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