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