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