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