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