35593e1c4bab82f748b03d1b8274812d538b929e
[app.Builder.js] / Builder4 / ValaProjectSettings.vala
1 static ValaProjectSettings  _ValaProjectSettings;
2
3 public class ValaProjectSettings : Object 
4 {
5     public Gtk.VBox el;
6     private ValaProjectSettings  _this;
7
8     public static ValaProjectSettings singleton()
9     {
10         if (_ValaProjectSettings == null) {
11             _ValaProjectSettings= new ValaProjectSettings();
12         }
13         return _ValaProjectSettings;
14     }
15     public Xcls_label_global label_global;
16     public Xcls_label_targets label_targets;
17     public Xcls_compile_flags compile_flags;
18     public Xcls_default_packages_tree_store default_packages_tree_store;
19     public Xcls_packages_render packages_render;
20     public Xcls_packages_render_use packages_render_use;
21     public Xcls_default_directory_tree default_directory_tree;
22     public Xcls_default_directory_tree_store default_directory_tree_store;
23     public Xcls_directory_render directory_render;
24     public Xcls_default_directory_menu default_directory_menu;
25     public Xcls_targets_tree_menu targets_tree_menu;
26     public Xcls_targets_tree targets_tree;
27     public Xcls_targets_tree_store targets_tree_store;
28     public Xcls_targets_render targets_render;
29     public Xcls_files_render files_render;
30
31         // my vars (def)
32     public Project.Gtk project;
33     public Xcls_MainWindow window;
34
35     // ctor 
36     public ValaProjectSettings()
37     {
38         _this = this;
39         this.el = new Gtk.VBox( true, 0 );
40
41         // my vars (dec)
42         this.project = null;
43         this.window = null;
44
45         // set gobject values
46         var child_0 = new Xcls_Notebook2( _this );
47         child_0.ref();
48         this.el.pack_start (  child_0.el , true,true,0 );
49     }
50
51     // user defined functions 
52     public void show (Project.Gtk project) {
53         
54         
55         print("ValaProjectSettings show\n");
56         
57         this.project=  project;
58     
59         this.compile_flags.el.text = "";
60         
61         this.default_directory_tree_store.load();    
62         this.default_packages_tree_store.load();            
63         this.targets_tree_store.load();
64     
65     
66     }
67     public class Xcls_Notebook2 : Object 
68     {
69         public Gtk.Notebook el;
70         private ValaProjectSettings  _this;
71
72
73             // my vars (def)
74
75         // ctor 
76         public Xcls_Notebook2(ValaProjectSettings _owner )
77         {
78             _this = _owner;
79             this.el = new Gtk.Notebook();
80
81             // my vars (dec)
82
83             // set gobject values
84             var child_0 = new Xcls_label_global( _this );
85             child_0.ref();
86             var child_1 = new Xcls_label_targets( _this );
87             child_1.ref();
88             var child_2 = new Xcls_VBox5( _this );
89             child_2.ref();
90             this.el.append_page (  child_2.el , _this.label_global.el );
91             var child_3 = new Xcls_HPaned27( _this );
92             child_3.ref();
93             this.el.append_page (  child_3.el , _this.label_targets.el );
94         }
95
96         // user defined functions 
97     }
98     public class Xcls_label_global : Object 
99     {
100         public Gtk.Label el;
101         private ValaProjectSettings  _this;
102
103
104             // my vars (def)
105
106         // ctor 
107         public Xcls_label_global(ValaProjectSettings _owner )
108         {
109             _this = _owner;
110             _this.label_global = this;
111             this.el = new Gtk.Label( "Global" );
112
113             // my vars (dec)
114
115             // set gobject values
116         }
117
118         // user defined functions 
119     }
120     public class Xcls_label_targets : Object 
121     {
122         public Gtk.Label el;
123         private ValaProjectSettings  _this;
124
125
126             // my vars (def)
127
128         // ctor 
129         public Xcls_label_targets(ValaProjectSettings _owner )
130         {
131             _this = _owner;
132             _this.label_targets = this;
133             this.el = new Gtk.Label( "Targets" );
134
135             // my vars (dec)
136
137             // set gobject values
138         }
139
140         // user defined functions 
141     }
142     public class Xcls_VBox5 : Object 
143     {
144         public Gtk.VBox el;
145         private ValaProjectSettings  _this;
146
147
148             // my vars (def)
149
150         // ctor 
151         public Xcls_VBox5(ValaProjectSettings _owner )
152         {
153             _this = _owner;
154             this.el = new Gtk.VBox( false, 0 );
155
156             // my vars (dec)
157
158             // set gobject values
159             var child_0 = new Xcls_Label6( _this );
160             child_0.ref();
161             this.el.pack_start (  child_0.el , false,false,0 );
162             var child_1 = new Xcls_compile_flags( _this );
163             child_1.ref();
164             this.el.pack_start (  child_1.el , false,false,0 );
165             var child_2 = new Xcls_Label8( _this );
166             child_2.ref();
167             this.el.pack_start (  child_2.el , false,false,0 );
168             var child_3 = new Xcls_ScrolledWindow9( _this );
169             child_3.ref();
170             this.el.pack_start (  child_3.el , true,true,0 );
171             var child_4 = new Xcls_Label16( _this );
172             child_4.ref();
173             this.el.pack_start (  child_4.el , false,false,0 );
174             var child_5 = new Xcls_ScrolledWindow17( _this );
175             child_5.ref();
176             this.el.pack_start (  child_5.el , true,true,0 );
177         }
178
179         // user defined functions 
180     }
181     public class Xcls_Label6 : Object 
182     {
183         public Gtk.Label el;
184         private ValaProjectSettings  _this;
185
186
187             // my vars (def)
188
189         // ctor 
190         public Xcls_Label6(ValaProjectSettings _owner )
191         {
192             _this = _owner;
193             this.el = new Gtk.Label( "compile flags" );
194
195             // my vars (dec)
196
197             // set gobject values
198         }
199
200         // user defined functions 
201     }
202     public class Xcls_compile_flags : Object 
203     {
204         public Gtk.Entry el;
205         private ValaProjectSettings  _this;
206
207
208             // my vars (def)
209
210         // ctor 
211         public Xcls_compile_flags(ValaProjectSettings _owner )
212         {
213             _this = _owner;
214             _this.compile_flags = this;
215             this.el = new Gtk.Entry();
216
217             // my vars (dec)
218
219             // set gobject values
220         }
221
222         // user defined functions 
223     }
224     public class Xcls_Label8 : Object 
225     {
226         public Gtk.Label el;
227         private ValaProjectSettings  _this;
228
229
230             // my vars (def)
231
232         // ctor 
233         public Xcls_Label8(ValaProjectSettings _owner )
234         {
235             _this = _owner;
236             this.el = new Gtk.Label( "packages" );
237
238             // my vars (dec)
239
240             // set gobject values
241         }
242
243         // user defined functions 
244     }
245     public class Xcls_ScrolledWindow9 : Object 
246     {
247         public Gtk.ScrolledWindow el;
248         private ValaProjectSettings  _this;
249
250
251             // my vars (def)
252
253         // ctor 
254         public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
255         {
256             _this = _owner;
257             this.el = new Gtk.ScrolledWindow( null, null );
258
259             // my vars (dec)
260
261             // set gobject values
262             var child_0 = new Xcls_default_packages_tree( _this );
263             child_0.ref();
264             this.el.add (  child_0.el  );
265         }
266
267         // user defined functions 
268     }
269     public class Xcls_default_packages_tree : Object 
270     {
271         public Gtk.TreeView el;
272         private ValaProjectSettings  _this;
273
274
275             // my vars (def)
276
277         // ctor 
278         public Xcls_default_packages_tree(ValaProjectSettings _owner )
279         {
280             _this = _owner;
281             this.el = new Gtk.TreeView();
282
283             // my vars (dec)
284
285             // set gobject values
286             this.el.headers_visible = false;
287             var child_0 = new Xcls_default_packages_tree_store( _this );
288             child_0.ref();
289             this.el.set_model (  child_0.el  );
290             var child_1 = new Xcls_TreeViewColumn12( _this );
291             child_1.ref();
292             this.el.append_column (  child_1.el  );
293             var child_2 = new Xcls_TreeViewColumn14( _this );
294             child_2.ref();
295             this.el.append_column (  child_2.el  );
296         }
297
298         // user defined functions 
299     }
300     public class Xcls_default_packages_tree_store : Object 
301     {
302         public Gtk.ListStore el;
303         private ValaProjectSettings  _this;
304
305
306             // my vars (def)
307
308         // ctor 
309         public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
310         {
311             _this = _owner;
312             _this.default_packages_tree_store = this;
313             this.el = new Gtk.ListStore( 2,     typeof(string),  // 0 key type
314       typeof(bool) );
315
316             // my vars (dec)
317
318             // set gobject values
319         }
320
321         // user defined functions 
322         public void load () {
323          
324             var def = _this.project.compilegroups.get("_default_");
325              var items  = def.packages;
326             
327             this.el.clear();
328             var pal = (Palete.Gtk) Palete.factory("Gtk");
329             var pkgs = pal.packages();
330             print("ValaProjectSettings:packages load %d\n", pkgs.size);
331         
332             Gtk.TreeIter citer;
333         
334             for(var i =0 ; i < pkgs.size; i++) {
335                  this.el.append(out citer);   
336                  
337                 this.el.set_value(citer, 0,   pkgs.get(i) ); // title 
338                 this.el.set_value(citer, 1,   items.contains(pkgs.get(i)) );
339             }
340             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
341             
342         }
343     }
344     public class Xcls_TreeViewColumn12 : Object 
345     {
346         public Gtk.TreeViewColumn el;
347         private ValaProjectSettings  _this;
348
349
350             // my vars (def)
351
352         // ctor 
353         public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
354         {
355             _this = _owner;
356             this.el = new Gtk.TreeViewColumn();
357
358             // my vars (dec)
359
360             // set gobject values
361             this.el.title = "name";
362             this.el.expand = true;
363             this.el.resizable = true;
364             var child_0 = new Xcls_packages_render( _this );
365             child_0.ref();
366             this.el.pack_start (  child_0.el , false );
367
368             // init method 
369
370             this.el.add_attribute(_this.packages_render.el , "text", 0 );        }
371
372         // user defined functions 
373     }
374     public class Xcls_packages_render : Object 
375     {
376         public Gtk.CellRendererText el;
377         private ValaProjectSettings  _this;
378
379
380             // my vars (def)
381
382         // ctor 
383         public Xcls_packages_render(ValaProjectSettings _owner )
384         {
385             _this = _owner;
386             _this.packages_render = this;
387             this.el = new Gtk.CellRendererText();
388
389             // my vars (dec)
390
391             // set gobject values
392         }
393
394         // user defined functions 
395     }
396     public class Xcls_TreeViewColumn14 : Object 
397     {
398         public Gtk.TreeViewColumn el;
399         private ValaProjectSettings  _this;
400
401
402             // my vars (def)
403
404         // ctor 
405         public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
406         {
407             _this = _owner;
408             this.el = new Gtk.TreeViewColumn();
409
410             // my vars (dec)
411
412             // set gobject values
413             this.el.title = "use";
414             this.el.resizable = false;
415             this.el.fixed_width = 50;
416             var child_0 = new Xcls_packages_render_use( _this );
417             child_0.ref();
418             this.el.pack_start (  child_0.el , false );
419
420             // init method 
421
422             {
423              this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
424              }        }
425
426         // user defined functions 
427     }
428     public class Xcls_packages_render_use : Object 
429     {
430         public Gtk.CellRendererToggle el;
431         private ValaProjectSettings  _this;
432
433
434             // my vars (def)
435
436         // ctor 
437         public Xcls_packages_render_use(ValaProjectSettings _owner )
438         {
439             _this = _owner;
440             _this.packages_render_use = this;
441             this.el = new Gtk.CellRendererToggle();
442
443             // my vars (dec)
444
445             // set gobject values
446             this.el.activatable = true;
447
448             // listeners 
449             this.el.toggled.connect( (  path_string) =>  { 
450                 var m = _this.default_packages_tree_store.el;
451                Gtk.TreeIter iter;
452                Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
453                m.get_iter (out iter, path);
454                GLib.Value val;
455                m.get_value(iter, 1, out val);
456                m.set_value(iter, 1,  ((bool) val) ? false :true); 
457                  GLib.Value fval;  
458                m.get_value(iter, 0, out fval);
459                var fn = (string)fval;
460                 
461                 var def = _this.project.compilegroups.get("_default_");
462                 var items  = def.packages;
463                 if ((bool)val) {
464                     // renive
465                     items.remove(fn);
466                 } else {
467                     items.add(fn);
468                 }
469                 
470             });
471         }
472
473         // user defined functions 
474     }
475     public class Xcls_Label16 : Object 
476     {
477         public Gtk.Label el;
478         private ValaProjectSettings  _this;
479
480
481             // my vars (def)
482
483         // ctor 
484         public Xcls_Label16(ValaProjectSettings _owner )
485         {
486             _this = _owner;
487             this.el = new Gtk.Label( "Available Directories" );
488
489             // my vars (dec)
490
491             // set gobject values
492         }
493
494         // user defined functions 
495     }
496     public class Xcls_ScrolledWindow17 : Object 
497     {
498         public Gtk.ScrolledWindow el;
499         private ValaProjectSettings  _this;
500
501
502             // my vars (def)
503
504         // ctor 
505         public Xcls_ScrolledWindow17(ValaProjectSettings _owner )
506         {
507             _this = _owner;
508             this.el = new Gtk.ScrolledWindow( null, null );
509
510             // my vars (dec)
511
512             // set gobject values
513             var child_0 = new Xcls_default_directory_tree( _this );
514             child_0.ref();
515             this.el.add (  child_0.el  );
516             var child_1 = new Xcls_default_directory_menu( _this );
517             child_1.ref();
518         }
519
520         // user defined functions 
521     }
522     public class Xcls_default_directory_tree : Object 
523     {
524         public Gtk.TreeView el;
525         private ValaProjectSettings  _this;
526
527
528             // my vars (def)
529
530         // ctor 
531         public Xcls_default_directory_tree(ValaProjectSettings _owner )
532         {
533             _this = _owner;
534             _this.default_directory_tree = this;
535             this.el = new Gtk.TreeView();
536
537             // my vars (dec)
538
539             // set gobject values
540             this.el.headers_visible = false;
541             var child_0 = new Xcls_default_directory_tree_store( _this );
542             child_0.ref();
543             this.el.set_model (  child_0.el  );
544             var child_1 = new Xcls_TreeViewColumn20( _this );
545             child_1.ref();
546             this.el.append_column (  child_1.el  );
547
548             // listeners 
549             this.el.button_press_event.connect( ( ev) => {
550                 //console.log("button press?");
551                
552                 
553                 if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {
554                     //print("click" + ev.type);
555                     return false;
556                 }
557                 //Gtk.TreePath res;
558                 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
559                 //    return true;
560                 //}
561                  
562               //  this.el.get_selection().select_path(res);
563                  
564                   //if (!this.get('/LeftTreeMenu').el)  { 
565                   //      this.get('/LeftTreeMenu').init(); 
566                   //  }
567                     
568                  _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
569                  _this.default_directory_menu.el.show_all();
570                   _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);
571                  //   print("click:" + res.path.to_string());
572                   return true;
573             });
574         }
575
576         // user defined functions 
577     }
578     public class Xcls_default_directory_tree_store : Object 
579     {
580         public Gtk.ListStore el;
581         private ValaProjectSettings  _this;
582
583
584             // my vars (def)
585
586         // ctor 
587         public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
588         {
589             _this = _owner;
590             _this.default_directory_tree_store = this;
591             this.el = new Gtk.ListStore( 1,     typeof(string)
592       );
593
594             // my vars (dec)
595
596             // set gobject values
597         }
598
599         // user defined functions 
600         public void load () {
601          
602           this.el.clear();
603           
604             
605              var def = _this.project.compilegroups.get("_default_");
606              var items  = def.sources;
607              
608          
609             Gtk.TreeIter citer;
610         
611             for(var i =0 ; i < items.size; i++) {
612                  this.el.append(out citer);   
613                  
614                 this.el.set_value(citer, 0,   items.get(i) ); // title 
615                 //this.el.set_value(citer, 1,   items.get(i) );
616             }
617             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
618             
619         }
620     }
621     public class Xcls_TreeViewColumn20 : Object 
622     {
623         public Gtk.TreeViewColumn el;
624         private ValaProjectSettings  _this;
625
626
627             // my vars (def)
628
629         // ctor 
630         public Xcls_TreeViewColumn20(ValaProjectSettings _owner )
631         {
632             _this = _owner;
633             this.el = new Gtk.TreeViewColumn();
634
635             // my vars (dec)
636
637             // set gobject values
638             this.el.title = "name";
639             this.el.resizable = true;
640             var child_0 = new Xcls_directory_render( _this );
641             child_0.ref();
642             this.el.pack_start (  child_0.el , false );
643
644             // init method 
645
646             this.el.add_attribute(_this.directory_render.el , "text", 0 );        }
647
648         // user defined functions 
649     }
650     public class Xcls_directory_render : Object 
651     {
652         public Gtk.CellRendererText el;
653         private ValaProjectSettings  _this;
654
655
656             // my vars (def)
657
658         // ctor 
659         public Xcls_directory_render(ValaProjectSettings _owner )
660         {
661             _this = _owner;
662             _this.directory_render = this;
663             this.el = new Gtk.CellRendererText();
664
665             // my vars (dec)
666
667             // set gobject values
668         }
669
670         // user defined functions 
671     }
672     public class Xcls_default_directory_menu : Object 
673     {
674         public Gtk.Menu el;
675         private ValaProjectSettings  _this;
676
677
678             // my vars (def)
679
680         // ctor 
681         public Xcls_default_directory_menu(ValaProjectSettings _owner )
682         {
683             _this = _owner;
684             _this.default_directory_menu = this;
685             this.el = new Gtk.Menu();
686
687             // my vars (dec)
688
689             // set gobject values
690             var child_0 = new Xcls_MenuItem23( _this );
691             child_0.ref();
692             this.el.add (  child_0.el  );
693             var child_1 = new Xcls_MenuItem24( _this );
694             child_1.ref();
695             this.el.add (  child_1.el  );
696             var child_2 = new Xcls_SeparatorMenuItem25( _this );
697             child_2.ref();
698             this.el.add (  child_2.el  );
699             var child_3 = new Xcls_MenuItem26( _this );
700             child_3.ref();
701             this.el.add (  child_3.el  );
702         }
703
704         // user defined functions 
705     }
706     public class Xcls_MenuItem23 : Object 
707     {
708         public Gtk.MenuItem el;
709         private ValaProjectSettings  _this;
710
711
712             // my vars (def)
713
714         // ctor 
715         public Xcls_MenuItem23(ValaProjectSettings _owner )
716         {
717             _this = _owner;
718             this.el = new Gtk.MenuItem();
719
720             // my vars (dec)
721
722             // set gobject values
723             this.el.label = "Add Directory";
724
725             // listeners 
726             this.el.activate.connect( ()  => {
727                 
728                 var  chooser = new Gtk.FileChooserDialog (
729                 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
730                 "_Cancel",
731                 Gtk.ResponseType.CANCEL,
732                 "_Add",
733                 Gtk.ResponseType.ACCEPT);
734                 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
735                     chooser.close ();
736                        return;
737                    }
738                    chooser.close ();
739                    // add the directory..
740                    var fn = _this.project.relPath(chooser.get_filename());
741                    _this.project.compilegroups.get("_default_").sources.add(fn);
742                    _this.default_directory_tree_store.load();
743             });
744         }
745
746         // user defined functions 
747     }
748     public class Xcls_MenuItem24 : Object 
749     {
750         public Gtk.MenuItem el;
751         private ValaProjectSettings  _this;
752
753
754             // my vars (def)
755
756         // ctor 
757         public Xcls_MenuItem24(ValaProjectSettings _owner )
758         {
759             _this = _owner;
760             this.el = new Gtk.MenuItem();
761
762             // my vars (dec)
763
764             // set gobject values
765             this.el.label = "Add File";
766
767             // listeners 
768             this.el.activate.connect( ()  => {
769                 
770                 var  chooser = new Gtk.FileChooserDialog (
771                 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
772                 "_Cancel",
773                 Gtk.ResponseType.CANCEL,
774                 "_Add",
775                 Gtk.ResponseType.ACCEPT);
776                 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
777                     chooser.close ();
778                        return;
779                    }
780                    chooser.close ();
781                    // add the directory..
782                    var fn = _this.project.relPath(chooser.get_filename());
783                    _this.project.compilegroups.get("_default_").sources.add(fn);
784                    _this.default_directory_tree_store.load();
785             });
786         }
787
788         // user defined functions 
789     }
790     public class Xcls_SeparatorMenuItem25 : Object 
791     {
792         public Gtk.SeparatorMenuItem el;
793         private ValaProjectSettings  _this;
794
795
796             // my vars (def)
797
798         // ctor 
799         public Xcls_SeparatorMenuItem25(ValaProjectSettings _owner )
800         {
801             _this = _owner;
802             this.el = new Gtk.SeparatorMenuItem();
803
804             // my vars (dec)
805
806             // set gobject values
807         }
808
809         // user defined functions 
810     }
811     public class Xcls_MenuItem26 : Object 
812     {
813         public Gtk.MenuItem el;
814         private ValaProjectSettings  _this;
815
816
817             // my vars (def)
818
819         // ctor 
820         public Xcls_MenuItem26(ValaProjectSettings _owner )
821         {
822             _this = _owner;
823             this.el = new Gtk.MenuItem();
824
825             // my vars (dec)
826
827             // set gobject values
828             this.el.label = "Remove File/Directory";
829
830             // listeners 
831             this.el.activate.connect( ()  => {
832                 
833                  //
834                     Gtk.TreeModel mod;
835                     Gtk.TreeIter iter;
836                     if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
837                            print("nothing selected\n");
838                         return;
839                     }
840             
841                         
842                    // add the directory..
843                    
844                    
845                    GLib.Value val;
846                     mod.get_value(iter,0, out val);
847                    var fn =  (string) val;
848                    
849                    print("remove: %s\n", fn);
850                    if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
851                               print("remove failed");
852                           }
853                    _this.default_directory_tree_store.load();
854             });
855         }
856
857         // user defined functions 
858     }
859     public class Xcls_HPaned27 : Object 
860     {
861         public Gtk.HPaned el;
862         private ValaProjectSettings  _this;
863
864
865             // my vars (def)
866
867         // ctor 
868         public Xcls_HPaned27(ValaProjectSettings _owner )
869         {
870             _this = _owner;
871             this.el = new Gtk.HPaned();
872
873             // my vars (dec)
874
875             // set gobject values
876             this.el.position = 300;
877             var child_0 = new Xcls_ScrolledWindow28( _this );
878             child_0.ref();
879             this.el.add1 (  child_0.el  );
880             var child_1 = new Xcls_set_vbox( _this );
881             child_1.ref();
882             this.el.add2 (  child_1.el  );
883         }
884
885         // user defined functions 
886     }
887     public class Xcls_ScrolledWindow28 : Object 
888     {
889         public Gtk.ScrolledWindow el;
890         private ValaProjectSettings  _this;
891
892
893             // my vars (def)
894
895         // ctor 
896         public Xcls_ScrolledWindow28(ValaProjectSettings _owner )
897         {
898             _this = _owner;
899             this.el = new Gtk.ScrolledWindow( null, null );
900
901             // my vars (dec)
902
903             // set gobject values
904             var child_0 = new Xcls_targets_tree_menu( _this );
905             child_0.ref();
906             this.el.add (  child_0.el  );
907             var child_1 = new Xcls_targets_tree( _this );
908             child_1.ref();
909             this.el.add (  child_1.el  );
910
911             // init method 
912
913             {  
914             this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
915             
916             }        }
917
918         // user defined functions 
919     }
920     public class Xcls_targets_tree_menu : Object 
921     {
922         public Gtk.Menu el;
923         private ValaProjectSettings  _this;
924
925
926             // my vars (def)
927
928         // ctor 
929         public Xcls_targets_tree_menu(ValaProjectSettings _owner )
930         {
931             _this = _owner;
932             _this.targets_tree_menu = this;
933             this.el = new Gtk.Menu();
934
935             // my vars (dec)
936
937             // set gobject values
938             var child_0 = new Xcls_MenuItem30( _this );
939             child_0.ref();
940             this.el.add (  child_0.el  );
941             var child_1 = new Xcls_SeparatorMenuItem31( _this );
942             child_1.ref();
943             this.el.add (  child_1.el  );
944             var child_2 = new Xcls_MenuItem32( _this );
945             child_2.ref();
946             this.el.add (  child_2.el  );
947         }
948
949         // user defined functions 
950     }
951     public class Xcls_MenuItem30 : Object 
952     {
953         public Gtk.MenuItem el;
954         private ValaProjectSettings  _this;
955
956
957             // my vars (def)
958
959         // ctor 
960         public Xcls_MenuItem30(ValaProjectSettings _owner )
961         {
962             _this = _owner;
963             this.el = new Gtk.MenuItem();
964
965             // my vars (dec)
966
967             // set gobject values
968             this.el.label = "Add Compile Target";
969
970             // listeners 
971             this.el.activate.connect( ()  => {
972                 
973                    if (_this.project.compilegroups.has_key("NEW GROUP")) {
974                     return;
975                 }
976                   
977                    // add the directory..
978                    
979                    _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
980                    _this.targets_tree_store.load();
981             });
982         }
983
984         // user defined functions 
985     }
986     public class Xcls_SeparatorMenuItem31 : Object 
987     {
988         public Gtk.SeparatorMenuItem el;
989         private ValaProjectSettings  _this;
990
991
992             // my vars (def)
993
994         // ctor 
995         public Xcls_SeparatorMenuItem31(ValaProjectSettings _owner )
996         {
997             _this = _owner;
998             this.el = new Gtk.SeparatorMenuItem();
999
1000             // my vars (dec)
1001
1002             // set gobject values
1003         }
1004
1005         // user defined functions 
1006     }
1007     public class Xcls_MenuItem32 : Object 
1008     {
1009         public Gtk.MenuItem el;
1010         private ValaProjectSettings  _this;
1011
1012
1013             // my vars (def)
1014
1015         // ctor 
1016         public Xcls_MenuItem32(ValaProjectSettings _owner )
1017         {
1018             _this = _owner;
1019             this.el = new Gtk.MenuItem();
1020
1021             // my vars (dec)
1022
1023             // set gobject values
1024             this.el.label = "Remove Target";
1025
1026             // listeners 
1027             this.el.activate.connect( ()  => {
1028                 
1029                  //
1030                     Gtk.TreeModel mod;
1031                     Gtk.TreeIter iter;
1032                     if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1033                            print("nothing selected\n");
1034                         return;
1035                     }
1036             
1037                         
1038                    // add the directory..
1039                    
1040                    
1041                    GLib.Value val;
1042                     mod.get_value(iter,0, out val);
1043                    var fn =  (string) val;
1044                    
1045                    print("remove: %s\n", fn);
1046                    if (!_this.project.compilegroups.unset(fn)) {
1047                               print("remove failed");
1048                   }
1049                    _this.targets_tree_store.load();
1050             });
1051         }
1052
1053         // user defined functions 
1054     }
1055     public class Xcls_targets_tree : Object 
1056     {
1057         public Gtk.TreeView el;
1058         private ValaProjectSettings  _this;
1059
1060
1061             // my vars (def)
1062
1063         // ctor 
1064         public Xcls_targets_tree(ValaProjectSettings _owner )
1065         {
1066             _this = _owner;
1067             _this.targets_tree = this;
1068             this.el = new Gtk.TreeView();
1069
1070             // my vars (dec)
1071
1072             // set gobject values
1073             var child_0 = new Xcls_targets_tree_store( _this );
1074             child_0.ref();
1075             this.el.set_model (  child_0.el  );
1076             var child_1 = new Xcls_TreeViewColumn35( _this );
1077             child_1.ref();
1078             this.el.append_column (  child_1.el  );
1079
1080             // listeners 
1081             this.el.button_press_event.connect( ( ev) => {
1082                 //console.log("button press?");
1083                
1084                 
1085                 if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {
1086                     //print("click" + ev.type);
1087                     return false;
1088                 }
1089                 //Gtk.TreePath res;
1090                 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1091                 //    return true;
1092                 //}
1093                  
1094               //  this.el.get_selection().select_path(res);
1095                  
1096                   //if (!this.get('/LeftTreeMenu').el)  { 
1097                   //      this.get('/LeftTreeMenu').init(); 
1098                   //  }
1099                     
1100                  _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1101                  _this.targets_tree_menu.el.show_all();
1102                   _this.targets_tree_menu.el.popup(null, null, null,  3, ev.time);
1103                  //   print("click:" + res.path.to_string());
1104                   return true;
1105             });
1106         }
1107
1108         // user defined functions 
1109     }
1110     public class Xcls_targets_tree_store : Object 
1111     {
1112         public Gtk.ListStore el;
1113         private ValaProjectSettings  _this;
1114
1115
1116             // my vars (def)
1117
1118         // ctor 
1119         public Xcls_targets_tree_store(ValaProjectSettings _owner )
1120         {
1121             _this = _owner;
1122             _this.targets_tree_store = this;
1123             this.el = new Gtk.ListStore( 2,     typeof(string),  // 0 key type
1124      typeof(string) // ??
1125       );
1126
1127             // my vars (dec)
1128
1129             // set gobject values
1130         }
1131
1132         // user defined functions 
1133         public void load () {
1134          
1135           this.el.clear();
1136           
1137             
1138              var cg = _this.project.compilegroups;
1139              
1140          
1141             Gtk.TreeIter citer;
1142             var iter = cg.map_iterator();
1143            while(iter.next()) {
1144                 var key = iter.get_key();
1145                 if (key == "_default_") {
1146                     continue;
1147                 }
1148             
1149                  this.el.append(out citer);   
1150                  
1151                 this.el.set_value(citer, 0,   key ); // title 
1152                 //this.el.set_value(citer, 1,   items.get(i) );
1153             };
1154             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1155             
1156         }
1157     }
1158     public class Xcls_TreeViewColumn35 : Object 
1159     {
1160         public Gtk.TreeViewColumn el;
1161         private ValaProjectSettings  _this;
1162
1163
1164             // my vars (def)
1165
1166         // ctor 
1167         public Xcls_TreeViewColumn35(ValaProjectSettings _owner )
1168         {
1169             _this = _owner;
1170             this.el = new Gtk.TreeViewColumn();
1171
1172             // my vars (dec)
1173
1174             // set gobject values
1175             this.el.title = "name";
1176             this.el.resizable = true;
1177             var child_0 = new Xcls_targets_render( _this );
1178             child_0.ref();
1179             this.el.pack_start (  child_0.el , false );
1180
1181             // init method 
1182
1183             {
1184                  this.el.add_attribute(_this.targets_render.el , "text", 0 );
1185              }        }
1186
1187         // user defined functions 
1188     }
1189     public class Xcls_targets_render : Object 
1190     {
1191         public Gtk.CellRendererText el;
1192         private ValaProjectSettings  _this;
1193
1194
1195             // my vars (def)
1196
1197         // ctor 
1198         public Xcls_targets_render(ValaProjectSettings _owner )
1199         {
1200             _this = _owner;
1201             _this.targets_render = this;
1202             this.el = new Gtk.CellRendererText();
1203
1204             // my vars (dec)
1205
1206             // set gobject values
1207             this.el.editable = true;
1208         }
1209
1210         // user defined functions 
1211     }
1212     public class Xcls_set_vbox : Object 
1213     {
1214         public Gtk.VBox el;
1215         private ValaProjectSettings  _this;
1216
1217
1218             // my vars (def)
1219
1220         // ctor 
1221         public Xcls_set_vbox(ValaProjectSettings _owner )
1222         {
1223             _this = _owner;
1224             this.el = new Gtk.VBox( false, 0 );
1225
1226             // my vars (dec)
1227
1228             // set gobject values
1229             var child_0 = new Xcls_Label38( _this );
1230             child_0.ref();
1231             this.el.pack_start (  child_0.el , false,false,0 );
1232             var child_1 = new Xcls_build_pack_target( _this );
1233             child_1.ref();
1234             this.el.pack_start (  child_1.el , false,false,0 );
1235             var child_2 = new Xcls_Label40( _this );
1236             child_2.ref();
1237             this.el.pack_start (  child_2.el , false,false,0 );
1238             var child_3 = new Xcls_build_compile_flags( _this );
1239             child_3.ref();
1240             this.el.pack_start (  child_3.el , false,false,0 );
1241             var child_4 = new Xcls_Label42( _this );
1242             child_4.ref();
1243             this.el.pack_start (  child_4.el , false,false,0 );
1244             var child_5 = new Xcls_ScrolledWindow43( _this );
1245             child_5.ref();
1246             this.el.pack_start (  child_5.el , true,true,0 );
1247         }
1248
1249         // user defined functions 
1250     }
1251     public class Xcls_Label38 : Object 
1252     {
1253         public Gtk.Label el;
1254         private ValaProjectSettings  _this;
1255
1256
1257             // my vars (def)
1258
1259         // ctor 
1260         public Xcls_Label38(ValaProjectSettings _owner )
1261         {
1262             _this = _owner;
1263             this.el = new Gtk.Label( "target filename" );
1264
1265             // my vars (dec)
1266
1267             // set gobject values
1268         }
1269
1270         // user defined functions 
1271     }
1272     public class Xcls_build_pack_target : Object 
1273     {
1274         public Gtk.Entry el;
1275         private ValaProjectSettings  _this;
1276
1277
1278             // my vars (def)
1279
1280         // ctor 
1281         public Xcls_build_pack_target(ValaProjectSettings _owner )
1282         {
1283             _this = _owner;
1284             this.el = new Gtk.Entry();
1285
1286             // my vars (dec)
1287
1288             // set gobject values
1289         }
1290
1291         // user defined functions 
1292     }
1293     public class Xcls_Label40 : Object 
1294     {
1295         public Gtk.Label el;
1296         private ValaProjectSettings  _this;
1297
1298
1299             // my vars (def)
1300
1301         // ctor 
1302         public Xcls_Label40(ValaProjectSettings _owner )
1303         {
1304             _this = _owner;
1305             this.el = new Gtk.Label( "compile flags" );
1306
1307             // my vars (dec)
1308
1309             // set gobject values
1310         }
1311
1312         // user defined functions 
1313     }
1314     public class Xcls_build_compile_flags : Object 
1315     {
1316         public Gtk.Entry el;
1317         private ValaProjectSettings  _this;
1318
1319
1320             // my vars (def)
1321
1322         // ctor 
1323         public Xcls_build_compile_flags(ValaProjectSettings _owner )
1324         {
1325             _this = _owner;
1326             this.el = new Gtk.Entry();
1327
1328             // my vars (dec)
1329
1330             // set gobject values
1331         }
1332
1333         // user defined functions 
1334     }
1335     public class Xcls_Label42 : Object 
1336     {
1337         public Gtk.Label el;
1338         private ValaProjectSettings  _this;
1339
1340
1341             // my vars (def)
1342
1343         // ctor 
1344         public Xcls_Label42(ValaProjectSettings _owner )
1345         {
1346             _this = _owner;
1347             this.el = new Gtk.Label( "Files to compile" );
1348
1349             // my vars (dec)
1350
1351             // set gobject values
1352         }
1353
1354         // user defined functions 
1355     }
1356     public class Xcls_ScrolledWindow43 : Object 
1357     {
1358         public Gtk.ScrolledWindow el;
1359         private ValaProjectSettings  _this;
1360
1361
1362             // my vars (def)
1363
1364         // ctor 
1365         public Xcls_ScrolledWindow43(ValaProjectSettings _owner )
1366         {
1367             _this = _owner;
1368             this.el = new Gtk.ScrolledWindow( null, null );
1369
1370             // my vars (dec)
1371
1372             // set gobject values
1373             var child_0 = new Xcls_files_tree( _this );
1374             child_0.ref();
1375         }
1376
1377         // user defined functions 
1378     }
1379     public class Xcls_files_tree : Object 
1380     {
1381         public Gtk.TreeView el;
1382         private ValaProjectSettings  _this;
1383
1384
1385             // my vars (def)
1386
1387         // ctor 
1388         public Xcls_files_tree(ValaProjectSettings _owner )
1389         {
1390             _this = _owner;
1391             this.el = new Gtk.TreeView();
1392
1393             // my vars (dec)
1394
1395             // set gobject values
1396             var child_0 = new Xcls_ListStore45( _this );
1397             child_0.ref();
1398             this.el.set_model (  child_0.el  );
1399             var child_1 = new Xcls_TreeViewColumn46( _this );
1400             child_1.ref();
1401             this.el.append_column (  child_1.el  );
1402         }
1403
1404         // user defined functions 
1405     }
1406     public class Xcls_ListStore45 : Object 
1407     {
1408         public Gtk.ListStore el;
1409         private ValaProjectSettings  _this;
1410
1411
1412             // my vars (def)
1413
1414         // ctor 
1415         public Xcls_ListStore45(ValaProjectSettings _owner )
1416         {
1417             _this = _owner;
1418             this.el = new Gtk.ListStore( 2,     typeof(string),  // 0 key type
1419      typeof(string) // ??
1420       );
1421
1422             // my vars (dec)
1423
1424             // set gobject values
1425         }
1426
1427         // user defined functions 
1428     }
1429     public class Xcls_TreeViewColumn46 : Object 
1430     {
1431         public Gtk.TreeViewColumn el;
1432         private ValaProjectSettings  _this;
1433
1434
1435             // my vars (def)
1436
1437         // ctor 
1438         public Xcls_TreeViewColumn46(ValaProjectSettings _owner )
1439         {
1440             _this = _owner;
1441             this.el = new Gtk.TreeViewColumn();
1442
1443             // my vars (dec)
1444
1445             // set gobject values
1446             this.el.title = "name";
1447             this.el.resizable = true;
1448             var child_0 = new Xcls_files_render( _this );
1449             child_0.ref();
1450             this.el.pack_start (  child_0.el , false );
1451
1452             // init method 
1453
1454             this.el.add_attribute(_this.files_render.el , "markup", 2 );
1455              this.el.add_attribute(_this.files_render.el , "text", 1 );        }
1456
1457         // user defined functions 
1458     }
1459     public class Xcls_files_render : Object 
1460     {
1461         public Gtk.CellRendererText el;
1462         private ValaProjectSettings  _this;
1463
1464
1465             // my vars (def)
1466
1467         // ctor 
1468         public Xcls_files_render(ValaProjectSettings _owner )
1469         {
1470             _this = _owner;
1471             _this.files_render = this;
1472             this.el = new Gtk.CellRendererText();
1473
1474             // my vars (dec)
1475
1476             // set gobject values
1477         }
1478
1479         // user defined functions 
1480     }
1481 }