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