Fix #8039 - library support and add back roopacker dependancy
[roobuilder] / src / Builder4 / ValaProjectSettingsPopover.vala
1 static ValaProjectSettingsPopover  _ValaProjectSettingsPopover;
2
3 public class ValaProjectSettingsPopover : Object
4 {
5         public Gtk.Window el;
6         private ValaProjectSettingsPopover  _this;
7
8         public static ValaProjectSettingsPopover singleton()
9         {
10                 if (_ValaProjectSettingsPopover == null) {
11                     _ValaProjectSettingsPopover= new ValaProjectSettingsPopover();
12                 }
13                 return _ValaProjectSettingsPopover;
14         }
15         public Xcls_notebook notebook;
16         public Xcls_label_global label_global;
17         public Xcls_label_targets label_targets;
18         public Xcls_compile_flags compile_flags;
19         public Xcls_version version;
20         public Xcls_licence licence;
21         public Xcls_vapi_scroll vapi_scroll;
22         public Xcls_vapimodel vapimodel;
23         public Xcls_vapi_filter vapi_filter;
24         public Xcls_vapi_search vapi_search;
25         public Xcls_set_vbox set_vbox;
26         public Xcls_treeview treeview;
27         public Xcls_treeselmodel treeselmodel;
28         public Xcls_treelistsort treelistsort;
29         public Xcls_treelistmodel treelistmodel;
30         public Xcls_treemodel treemodel;
31         public Xcls_name name;
32         public Xcls_target_sel target_sel;
33         public Xcls_target_model target_model;
34         public Xcls_set_vboxb set_vboxb;
35         public Xcls_build_name build_name;
36         public Xcls_build_execute_args build_execute_args;
37         public Xcls_build_as_library build_as_library;
38         public Xcls_save_btn save_btn;
39
40                 // my vars (def)
41         public Project.Callback doneObj;
42         public bool cg_loading;
43         public Xcls_MainWindow window;
44         public Project.GtkValaSettings? selected_target;
45         public bool done;
46         public Project.Gtk project;
47         public uint border_width;
48
49         // ctor
50         public ValaProjectSettingsPopover()
51         {
52                 _this = this;
53                 this.el = new Gtk.Window();
54
55                 // my vars (dec)
56                 this.doneObj = null;
57                 this.cg_loading = false;
58                 this.window = null;
59                 this.selected_target = null;
60                 this.done = false;
61                 this.project = null;
62                 this.border_width = 0;
63
64                 // set gobject values
65                 this.el.modal = true;
66                 var child_1 = new Xcls_HeaderBar1( _this );
67                 child_1.ref();
68                 this.el.titlebar = child_1.el;
69                 var child_2 = new Xcls_Box3( _this );
70                 child_2.ref();
71                 this.el.set_child ( child_2.el  );
72
73                 //listeners
74                 this.el.close_request.connect( ( ) => {
75                         if (!this.done) {
76                                 return true;
77                         }
78                         return false;
79                         
80                 });
81                 this.el.hide.connect( () => {
82                           if (!this.done) {
83                     _this.el.show();
84                   }
85                 });
86         }
87
88         // user defined functions
89         public void show (Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {
90              
91             //print("ValaProjectSettings show\n");
92             this.doneObj = doneObj;
93             this.project=  project;
94                  
95             this.compile_flags.el.buffer.set_text(
96                 project.compile_flags.data
97                 );
98            this.version.el.buffer.set_text(
99                 project.version.data
100                 );
101                   this.licence.el.buffer.set_text(
102                 project.licence.data
103                 ); 
104             project.loadVapiIntoStore(_this.vapimodel.el);
105              GLib.Timeout.add(500, () => {
106                          this.vapi_scroll.el.vadjustment.value  = 0;     
107                      return false;
108              });
109             
110            
111                 
112                 project.loadTargetsIntoStore(this.target_model.el);
113                 
114                 _this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;
115                 _this.target_sel.selectTarget(null);
116         //      Gtk.Allocation rect;
117                 //btn.get_allocation(out rect);
118          //   this.el.set_pointing_to(rect);
119          this.el.application = pwin.application; // ??? make it modal?
120                  this.el.set_transient_for(pwin);
121                  
122                 // window + header?
123                 // print("SHOWALL - POPIP\n");
124                 this.el.set_size_request(800,800);
125                 this.el.show();
126                 this.notebook.el.page = 0; // first page.
127                 
128                 //this.view.el.grab_focus();
129         
130         }
131         public void save ()  {
132             this.project.save(); 
133         }
134         public class Xcls_HeaderBar1 : Object
135         {
136                 public Gtk.HeaderBar el;
137                 private ValaProjectSettingsPopover  _this;
138
139
140                         // my vars (def)
141
142                 // ctor
143                 public Xcls_HeaderBar1(ValaProjectSettingsPopover _owner )
144                 {
145                         _this = _owner;
146                         this.el = new Gtk.HeaderBar();
147
148                         // my vars (dec)
149
150                         // set gobject values
151                         var child_1 = new Xcls_Label2( _this );
152                         child_1.ref();
153                         this.el.title_widget = child_1.el;
154                 }
155
156                 // user defined functions
157         }
158         public class Xcls_Label2 : Object
159         {
160                 public Gtk.Label el;
161                 private ValaProjectSettingsPopover  _this;
162
163
164                         // my vars (def)
165
166                 // ctor
167                 public Xcls_Label2(ValaProjectSettingsPopover _owner )
168                 {
169                         _this = _owner;
170                         this.el = new Gtk.Label( "Change Vala  Compile settings" );
171
172                         // my vars (dec)
173
174                         // set gobject values
175                 }
176
177                 // user defined functions
178         }
179
180
181         public class Xcls_Box3 : Object
182         {
183                 public Gtk.Box el;
184                 private ValaProjectSettingsPopover  _this;
185
186
187                         // my vars (def)
188
189                 // ctor
190                 public Xcls_Box3(ValaProjectSettingsPopover _owner )
191                 {
192                         _this = _owner;
193                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
194
195                         // my vars (dec)
196
197                         // set gobject values
198                         this.el.hexpand = true;
199                         this.el.vexpand = true;
200                         new Xcls_notebook( _this );
201                         this.el.append( _this.notebook.el );
202                         var child_2 = new Xcls_Box57( _this );
203                         child_2.ref();
204                         this.el.append( child_2.el );
205                 }
206
207                 // user defined functions
208         }
209         public class Xcls_notebook : Object
210         {
211                 public Gtk.Notebook el;
212                 private ValaProjectSettingsPopover  _this;
213
214
215                         // my vars (def)
216
217                 // ctor
218                 public Xcls_notebook(ValaProjectSettingsPopover _owner )
219                 {
220                         _this = _owner;
221                         _this.notebook = this;
222                         this.el = new Gtk.Notebook();
223
224                         // my vars (dec)
225
226                         // set gobject values
227                         this.el.vexpand = true;
228                         new Xcls_label_global( _this );
229                         new Xcls_label_targets( _this );
230                         var child_3 = new Xcls_Box7( _this );
231                         child_3.ref();
232                         this.el.append_page ( child_3.el , _this.label_global.el );
233                         var child_4 = new Xcls_Paned25( _this );
234                         child_4.ref();
235                         this.el.append_page ( child_4.el , _this.label_targets.el );
236                 }
237
238                 // user defined functions
239         }
240         public class Xcls_label_global : Object
241         {
242                 public Gtk.Label el;
243                 private ValaProjectSettingsPopover  _this;
244
245
246                         // my vars (def)
247
248                 // ctor
249                 public Xcls_label_global(ValaProjectSettingsPopover _owner )
250                 {
251                         _this = _owner;
252                         _this.label_global = this;
253                         this.el = new Gtk.Label( "Global" );
254
255                         // my vars (dec)
256
257                         // set gobject values
258                 }
259
260                 // user defined functions
261         }
262
263         public class Xcls_label_targets : Object
264         {
265                 public Gtk.Label el;
266                 private ValaProjectSettingsPopover  _this;
267
268
269                         // my vars (def)
270
271                 // ctor
272                 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
273                 {
274                         _this = _owner;
275                         _this.label_targets = this;
276                         this.el = new Gtk.Label( "Targets" );
277
278                         // my vars (dec)
279
280                         // set gobject values
281                 }
282
283                 // user defined functions
284         }
285
286         public class Xcls_Box7 : Object
287         {
288                 public Gtk.Box el;
289                 private ValaProjectSettingsPopover  _this;
290
291
292                         // my vars (def)
293
294                 // ctor
295                 public Xcls_Box7(ValaProjectSettingsPopover _owner )
296                 {
297                         _this = _owner;
298                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
299
300                         // my vars (dec)
301
302                         // set gobject values
303                         this.el.homogeneous = false;
304                         var child_1 = new Xcls_Box834( _this );
305                         child_1.ref();
306                         this.el.append( child_1.el );
307                         new Xcls_vapi_scroll( _this );
308                         this.el.append( _this.vapi_scroll.el );
309                         new Xcls_vapi_search( _this );
310                         this.el.append( _this.vapi_search.el );
311                 }
312
313                 // user defined functions
314         }
315         public class Xcls_Box834 : Object
316         {
317                 public Gtk.Box el;
318                 private ValaProjectSettingsPopover  _this;
319
320
321                         // my vars (def)
322
323                 // ctor
324                 public Xcls_Box834(ValaProjectSettingsPopover _owner )
325                 {
326                         _this = _owner;
327                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 10 );
328
329                         // my vars (dec)
330
331                         // set gobject values
332                         var child_1 = new Xcls_Label853( _this );
333                         child_1.ref();
334                         this.el.append( child_1.el );
335                         new Xcls_compile_flags( _this );
336                         this.el.append( _this.compile_flags.el );
337                         var child_3 = new Xcls_Label886( _this );
338                         child_3.ref();
339                         this.el.append( child_3.el );
340                         new Xcls_version( _this );
341                         this.el.append( _this.version.el );
342                         var child_5 = new Xcls_Label906( _this );
343                         child_5.ref();
344                         this.el.append( child_5.el );
345                         new Xcls_licence( _this );
346                         this.el.append( _this.licence.el );
347                 }
348
349                 // user defined functions
350         }
351         public class Xcls_Label853 : Object
352         {
353                 public Gtk.Label el;
354                 private ValaProjectSettingsPopover  _this;
355
356
357                         // my vars (def)
358
359                 // ctor
360                 public Xcls_Label853(ValaProjectSettingsPopover _owner )
361                 {
362                         _this = _owner;
363                         this.el = new Gtk.Label( "Compile flags:" );
364
365                         // my vars (dec)
366
367                         // set gobject values
368                         this.el.halign = Gtk.Align.START;
369                         this.el.hexpand = false;
370                 }
371
372                 // user defined functions
373         }
374
375         public class Xcls_compile_flags : Object
376         {
377                 public Gtk.Entry el;
378                 private ValaProjectSettingsPopover  _this;
379
380
381                         // my vars (def)
382
383                 // ctor
384                 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
385                 {
386                         _this = _owner;
387                         _this.compile_flags = this;
388                         this.el = new Gtk.Entry();
389
390                         // my vars (dec)
391
392                         // set gobject values
393                         this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
394
395                         //listeners
396                         this.el.changed.connect( () => {
397                             
398                            _this.project.compile_flags = this.el.buffer.text;
399                            _this.project.save();
400                         //    _this.project.save();
401                         
402                         });
403                 }
404
405                 // user defined functions
406         }
407
408         public class Xcls_Label886 : Object
409         {
410                 public Gtk.Label el;
411                 private ValaProjectSettingsPopover  _this;
412
413
414                         // my vars (def)
415
416                 // ctor
417                 public Xcls_Label886(ValaProjectSettingsPopover _owner )
418                 {
419                         _this = _owner;
420                         this.el = new Gtk.Label( "Version:" );
421
422                         // my vars (dec)
423
424                         // set gobject values
425                         this.el.halign = Gtk.Align.START;
426                         this.el.hexpand = false;
427                 }
428
429                 // user defined functions
430         }
431
432         public class Xcls_version : Object
433         {
434                 public Gtk.Entry el;
435                 private ValaProjectSettingsPopover  _this;
436
437
438                         // my vars (def)
439
440                 // ctor
441                 public Xcls_version(ValaProjectSettingsPopover _owner )
442                 {
443                         _this = _owner;
444                         _this.version = this;
445                         this.el = new Gtk.Entry();
446
447                         // my vars (dec)
448
449                         // set gobject values
450                         this.el.placeholder_text = "eg. 1.5";
451
452                         //listeners
453                         this.el.changed.connect( () => {
454                             
455                            _this.project.version = this.el.buffer.text;
456                            _this.project.save();
457                         //    _this.project.save();
458                         
459                         });
460                 }
461
462                 // user defined functions
463         }
464
465         public class Xcls_Label906 : Object
466         {
467                 public Gtk.Label el;
468                 private ValaProjectSettingsPopover  _this;
469
470
471                         // my vars (def)
472
473                 // ctor
474                 public Xcls_Label906(ValaProjectSettingsPopover _owner )
475                 {
476                         _this = _owner;
477                         this.el = new Gtk.Label( "Licence:" );
478
479                         // my vars (dec)
480
481                         // set gobject values
482                         this.el.halign = Gtk.Align.START;
483                         this.el.hexpand = false;
484                 }
485
486                 // user defined functions
487         }
488
489         public class Xcls_licence : Object
490         {
491                 public Gtk.Entry el;
492                 private ValaProjectSettingsPopover  _this;
493
494
495                         // my vars (def)
496
497                 // ctor
498                 public Xcls_licence(ValaProjectSettingsPopover _owner )
499                 {
500                         _this = _owner;
501                         _this.licence = this;
502                         this.el = new Gtk.Entry();
503
504                         // my vars (dec)
505
506                         // set gobject values
507                         this.el.placeholder_text = "eg. LGPL";
508
509                         //listeners
510                         this.el.changed.connect( () => {
511                             
512                            _this.project.licence = this.el.buffer.text;
513                            _this.project.save();
514                         //    _this.project.save();
515                         
516                         });
517                 }
518
519                 // user defined functions
520         }
521
522
523         public class Xcls_vapi_scroll : Object
524         {
525                 public Gtk.ScrolledWindow el;
526                 private ValaProjectSettingsPopover  _this;
527
528
529                         // my vars (def)
530
531                 // ctor
532                 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
533                 {
534                         _this = _owner;
535                         _this.vapi_scroll = this;
536                         this.el = new Gtk.ScrolledWindow();
537
538                         // my vars (dec)
539
540                         // set gobject values
541                         this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
542                         this.el.has_frame = true;
543                         this.el.hexpand = true;
544                         this.el.vexpand = true;
545                         this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
546                         var child_1 = new Xcls_ColumnView11( _this );
547                         child_1.ref();
548                         this.el.child = child_1.el;
549                 }
550
551                 // user defined functions
552         }
553         public class Xcls_ColumnView11 : Object
554         {
555                 public Gtk.ColumnView el;
556                 private ValaProjectSettingsPopover  _this;
557
558
559                         // my vars (def)
560
561                 // ctor
562                 public Xcls_ColumnView11(ValaProjectSettingsPopover _owner )
563                 {
564                         _this = _owner;
565                         var child_1 = new Xcls_NoSelection12( _this );
566                         child_1.ref();
567                         this.el = new Gtk.ColumnView( child_1.el );
568
569                         // my vars (dec)
570
571                         // set gobject values
572                         var child_2 = new Xcls_ColumnViewColumn20( _this );
573                         child_2.ref();
574                         this.el.append_column ( child_2.el  );
575                         var child_3 = new Xcls_ColumnViewColumn22( _this );
576                         child_3.ref();
577                         this.el.append_column ( child_3.el  );
578                 }
579
580                 // user defined functions
581         }
582         public class Xcls_NoSelection12 : Object
583         {
584                 public Gtk.NoSelection el;
585                 private ValaProjectSettingsPopover  _this;
586
587
588                         // my vars (def)
589
590                 // ctor
591                 public Xcls_NoSelection12(ValaProjectSettingsPopover _owner )
592                 {
593                         _this = _owner;
594                         var child_1 = new Xcls_FilterListModel13( _this );
595                         child_1.ref();
596                         this.el = new Gtk.NoSelection( child_1.el );
597
598                         // my vars (dec)
599
600                         // set gobject values
601                 }
602
603                 // user defined functions
604         }
605         public class Xcls_FilterListModel13 : Object
606         {
607                 public Gtk.FilterListModel el;
608                 private ValaProjectSettingsPopover  _this;
609
610
611                         // my vars (def)
612
613                 // ctor
614                 public Xcls_FilterListModel13(ValaProjectSettingsPopover _owner )
615                 {
616                         _this = _owner;
617                         var child_1 = new Xcls_SortListModel14( _this );
618                         child_1.ref();
619                         new Xcls_vapi_filter( _this );
620                         this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
621
622                         // my vars (dec)
623
624                         // set gobject values
625                 }
626
627                 // user defined functions
628         }
629         public class Xcls_SortListModel14 : Object
630         {
631                 public Gtk.SortListModel el;
632                 private ValaProjectSettingsPopover  _this;
633
634
635                         // my vars (def)
636
637                 // ctor
638                 public Xcls_SortListModel14(ValaProjectSettingsPopover _owner )
639                 {
640                         _this = _owner;
641                         new Xcls_vapimodel( _this );
642                         var child_2 = new Xcls_StringSorter16( _this );
643                         child_2.ref();
644                         this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
645
646                         // my vars (dec)
647
648                         // set gobject values
649                 }
650
651                 // user defined functions
652         }
653         public class Xcls_vapimodel : Object
654         {
655                 public GLib.ListStore el;
656                 private ValaProjectSettingsPopover  _this;
657
658
659                         // my vars (def)
660
661                 // ctor
662                 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
663                 {
664                         _this = _owner;
665                         _this.vapimodel = this;
666                         this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
667
668                         // my vars (dec)
669
670                         // set gobject values
671                 }
672
673                 // user defined functions
674         }
675
676         public class Xcls_StringSorter16 : Object
677         {
678                 public Gtk.StringSorter el;
679                 private ValaProjectSettingsPopover  _this;
680
681
682                         // my vars (def)
683
684                 // ctor
685                 public Xcls_StringSorter16(ValaProjectSettingsPopover _owner )
686                 {
687                         _this = _owner;
688                         var child_1 = new Xcls_PropertyExpression17( _this );
689                         child_1.ref();
690                         this.el = new Gtk.StringSorter( child_1.el );
691
692                         // my vars (dec)
693
694                         // set gobject values
695                 }
696
697                 // user defined functions
698         }
699         public class Xcls_PropertyExpression17 : Object
700         {
701                 public Gtk.PropertyExpression el;
702                 private ValaProjectSettingsPopover  _this;
703
704
705                         // my vars (def)
706
707                 // ctor
708                 public Xcls_PropertyExpression17(ValaProjectSettingsPopover _owner )
709                 {
710                         _this = _owner;
711                         this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
712
713                         // my vars (dec)
714
715                         // set gobject values
716                 }
717
718                 // user defined functions
719         }
720
721
722
723         public class Xcls_vapi_filter : Object
724         {
725                 public Gtk.StringFilter el;
726                 private ValaProjectSettingsPopover  _this;
727
728
729                         // my vars (def)
730
731                 // ctor
732                 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
733                 {
734                         _this = _owner;
735                         _this.vapi_filter = this;
736                         var child_1 = new Xcls_PropertyExpression19( _this );
737                         child_1.ref();
738                         this.el = new Gtk.StringFilter( child_1.el );
739
740                         // my vars (dec)
741
742                         // set gobject values
743                 }
744
745                 // user defined functions
746         }
747         public class Xcls_PropertyExpression19 : Object
748         {
749                 public Gtk.PropertyExpression el;
750                 private ValaProjectSettingsPopover  _this;
751
752
753                         // my vars (def)
754
755                 // ctor
756                 public Xcls_PropertyExpression19(ValaProjectSettingsPopover _owner )
757                 {
758                         _this = _owner;
759                         this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
760
761                         // my vars (dec)
762
763                         // set gobject values
764                 }
765
766                 // user defined functions
767         }
768
769
770
771
772         public class Xcls_ColumnViewColumn20 : Object
773         {
774                 public Gtk.ColumnViewColumn el;
775                 private ValaProjectSettingsPopover  _this;
776
777
778                         // my vars (def)
779
780                 // ctor
781                 public Xcls_ColumnViewColumn20(ValaProjectSettingsPopover _owner )
782                 {
783                         _this = _owner;
784                         var child_1 = new Xcls_SignalListItemFactory21( _this );
785                         child_1.ref();
786                         this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
787
788                         // my vars (dec)
789
790                         // set gobject values
791                         this.el.expand = true;
792                 }
793
794                 // user defined functions
795         }
796         public class Xcls_SignalListItemFactory21 : Object
797         {
798                 public Gtk.SignalListItemFactory el;
799                 private ValaProjectSettingsPopover  _this;
800
801
802                         // my vars (def)
803
804                 // ctor
805                 public Xcls_SignalListItemFactory21(ValaProjectSettingsPopover _owner )
806                 {
807                         _this = _owner;
808                         this.el = new Gtk.SignalListItemFactory();
809
810                         // my vars (dec)
811
812                         // set gobject values
813
814                         //listeners
815                         this.el.setup.connect( (item) => {
816                                 //var j = (JsRender.JsRender) item;
817                                 var gi = (Gtk.ListItem)item;
818                                  
819                                 var lbl = new Gtk.Label("");
820                                 lbl.halign = Gtk.Align.START;
821                                 gi.set_child(lbl);
822                         
823                         
824                         
825                         });
826                         this.el.bind.connect( (listitem) => {
827                          
828                                 var lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();
829                                    
830                                 var item = (Project.VapiSelection)  ((Gtk.ListItem)listitem).get_item();
831                         
832                                 item.bind_property("name",
833                                         lbl, "label",
834                                    GLib.BindingFlags.SYNC_CREATE);
835                         
836                                   
837                         });
838                 }
839
840                 // user defined functions
841         }
842
843
844         public class Xcls_ColumnViewColumn22 : Object
845         {
846                 public Gtk.ColumnViewColumn el;
847                 private ValaProjectSettingsPopover  _this;
848
849
850                         // my vars (def)
851
852                 // ctor
853                 public Xcls_ColumnViewColumn22(ValaProjectSettingsPopover _owner )
854                 {
855                         _this = _owner;
856                         var child_1 = new Xcls_SignalListItemFactory23( _this );
857                         child_1.ref();
858                         this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
859
860                         // my vars (dec)
861
862                         // set gobject values
863                 }
864
865                 // user defined functions
866         }
867         public class Xcls_SignalListItemFactory23 : Object
868         {
869                 public Gtk.SignalListItemFactory el;
870                 private ValaProjectSettingsPopover  _this;
871
872
873                         // my vars (def)
874
875                 // ctor
876                 public Xcls_SignalListItemFactory23(ValaProjectSettingsPopover _owner )
877                 {
878                         _this = _owner;
879                         this.el = new Gtk.SignalListItemFactory();
880
881                         // my vars (dec)
882
883                         // set gobject values
884
885                         //listeners
886                         this.el.setup.connect( (listitem) => {
887                         
888                                 var btn = new Gtk.CheckButton();
889                          
890                                 ((Gtk.ListItem)listitem).set_child(btn);
891                                 
892                                 btn.toggled.connect(() =>  {
893                                  
894                                         var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
895                                         jr.selected = btn.active;
896                                 });
897                         });
898                         this.el.bind.connect( (listitem) => {
899                                  //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
900                                 
901                                 
902                                 
903                                 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
904                                 var btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();
905                                   
906                          
907                                 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
908                         
909                                 //GLib.debug("change  %s to %s", lbl.label, np.name);
910                         
911                                 btn.active = vs.selected; 
912                                 
913                                 vs.btn = btn;
914                                 // bind image...
915                                 
916                         });
917                 }
918
919                 // user defined functions
920         }
921
922
923
924
925         public class Xcls_vapi_search : Object
926         {
927                 public Gtk.SearchEntry el;
928                 private ValaProjectSettingsPopover  _this;
929
930
931                         // my vars (def)
932
933                 // ctor
934                 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
935                 {
936                         _this = _owner;
937                         _this.vapi_search = this;
938                         this.el = new Gtk.SearchEntry();
939
940                         // my vars (dec)
941
942                         // set gobject values
943                         this.el.placeholder_text = "Search Libraries (Vapi)";
944                         this.el.search_delay = 500;
945
946                         //listeners
947                         this.el.search_changed.connect( ( ) => {
948                         
949                          _this.vapi_filter.el.set_search(this.el.get_text());
950                          
951                         });
952                 }
953
954                 // user defined functions
955         }
956
957
958         public class Xcls_Paned25 : Object
959         {
960                 public Gtk.Paned el;
961                 private ValaProjectSettingsPopover  _this;
962
963
964                         // my vars (def)
965
966                 // ctor
967                 public Xcls_Paned25(ValaProjectSettingsPopover _owner )
968                 {
969                         _this = _owner;
970                         this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
971
972                         // my vars (dec)
973
974                         // set gobject values
975                         this.el.vexpand = true;
976                         this.el.position = 300;
977                         new Xcls_set_vbox( _this );
978                         this.el.set_end_child ( _this.set_vbox.el  );
979                         var child_2 = new Xcls_Box42( _this );
980                         child_2.ref();
981                         this.el.start_child = child_2.el;
982                 }
983
984                 // user defined functions
985         }
986         public class Xcls_set_vbox : Object
987         {
988                 public Gtk.Box el;
989                 private ValaProjectSettingsPopover  _this;
990
991
992                         // my vars (def)
993
994                 // ctor
995                 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
996                 {
997                         _this = _owner;
998                         _this.set_vbox = this;
999                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1000
1001                         // my vars (dec)
1002
1003                         // set gobject values
1004                         this.el.homogeneous = false;
1005                         var child_1 = new Xcls_ScrolledWindow27( _this );
1006                         child_1.ref();
1007                         this.el.append( child_1.el );
1008                 }
1009
1010                 // user defined functions
1011         }
1012         public class Xcls_ScrolledWindow27 : Object
1013         {
1014                 public Gtk.ScrolledWindow el;
1015                 private ValaProjectSettingsPopover  _this;
1016
1017
1018                         // my vars (def)
1019
1020                 // ctor
1021                 public Xcls_ScrolledWindow27(ValaProjectSettingsPopover _owner )
1022                 {
1023                         _this = _owner;
1024                         this.el = new Gtk.ScrolledWindow();
1025
1026                         // my vars (dec)
1027
1028                         // set gobject values
1029                         this.el.vexpand = true;
1030                         new Xcls_treeview( _this );
1031                         this.el.child = _this.treeview.el;
1032                 }
1033
1034                 // user defined functions
1035         }
1036         public class Xcls_treeview : Object
1037         {
1038                 public Gtk.ColumnView el;
1039                 private ValaProjectSettingsPopover  _this;
1040
1041
1042                         // my vars (def)
1043
1044                 // ctor
1045                 public Xcls_treeview(ValaProjectSettingsPopover _owner )
1046                 {
1047                         _this = _owner;
1048                         _this.treeview = this;
1049                         new Xcls_treeselmodel( _this );
1050                         this.el = new Gtk.ColumnView( _this.treeselmodel.el );
1051
1052                         // my vars (dec)
1053
1054                         // set gobject values
1055                         new Xcls_name( _this );
1056                         this.el.append_column ( _this.name.el  );
1057                         var child_3 = new Xcls_ColumnViewColumn40( _this );
1058                         child_3.ref();
1059                         this.el.append_column ( child_3.el  );
1060                 }
1061
1062                 // user defined functions
1063         }
1064         public class Xcls_treeselmodel : Object
1065         {
1066                 public Gtk.SingleSelection el;
1067                 private ValaProjectSettingsPopover  _this;
1068
1069
1070                         // my vars (def)
1071
1072                 // ctor
1073                 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
1074                 {
1075                         _this = _owner;
1076                         _this.treeselmodel = this;
1077                         var child_1 = new Xcls_FilterListModel30( _this );
1078                         child_1.ref();
1079                         this.el = new Gtk.SingleSelection( child_1.el );
1080
1081                         // my vars (dec)
1082
1083                         // set gobject values
1084                 }
1085
1086                 // user defined functions
1087         }
1088         public class Xcls_FilterListModel30 : Object
1089         {
1090                 public Gtk.FilterListModel el;
1091                 private ValaProjectSettingsPopover  _this;
1092
1093
1094                         // my vars (def)
1095
1096                 // ctor
1097                 public Xcls_FilterListModel30(ValaProjectSettingsPopover _owner )
1098                 {
1099                         _this = _owner;
1100                         new Xcls_treelistsort( _this );
1101                         var child_2 = new Xcls_CustomFilter37( _this );
1102                         child_2.ref();
1103                         this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
1104
1105                         // my vars (dec)
1106
1107                         // set gobject values
1108                 }
1109
1110                 // user defined functions
1111         }
1112         public class Xcls_treelistsort : Object
1113         {
1114                 public Gtk.SortListModel el;
1115                 private ValaProjectSettingsPopover  _this;
1116
1117
1118                         // my vars (def)
1119
1120                 // ctor
1121                 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
1122                 {
1123                         _this = _owner;
1124                         _this.treelistsort = this;
1125                         new Xcls_treelistmodel( _this );
1126                         var child_2 = new Xcls_TreeListRowSorter34( _this );
1127                         child_2.ref();
1128                         this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
1129
1130                         // my vars (dec)
1131
1132                         // set gobject values
1133
1134                         // init method
1135
1136                         {
1137                                 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
1138                         }
1139                 }
1140
1141                 // user defined functions
1142         }
1143         public class Xcls_treelistmodel : Object
1144         {
1145                 public Gtk.TreeListModel el;
1146                 private ValaProjectSettingsPopover  _this;
1147
1148
1149                         // my vars (def)
1150
1151                 // ctor
1152                 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
1153                 {
1154                         _this = _owner;
1155                         _this.treelistmodel = this;
1156                         new Xcls_treemodel( _this );
1157                         this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
1158         //GLib.debug("liststore got %s", item.get_type().name());
1159         return ((JsRender.JsRender)item).childfiles;
1160 }  );
1161
1162                         // my vars (dec)
1163
1164                         // set gobject values
1165                 }
1166
1167                 // user defined functions
1168         }
1169         public class Xcls_treemodel : Object
1170         {
1171                 public GLib.ListStore el;
1172                 private ValaProjectSettingsPopover  _this;
1173
1174
1175                         // my vars (def)
1176
1177                 // ctor
1178                 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1179                 {
1180                         _this = _owner;
1181                         _this.treemodel = this;
1182                         this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1183
1184                         // my vars (dec)
1185
1186                         // set gobject values
1187                 }
1188
1189                 // user defined functions
1190         }
1191
1192
1193         public class Xcls_TreeListRowSorter34 : Object
1194         {
1195                 public Gtk.TreeListRowSorter el;
1196                 private ValaProjectSettingsPopover  _this;
1197
1198
1199                         // my vars (def)
1200
1201                 // ctor
1202                 public Xcls_TreeListRowSorter34(ValaProjectSettingsPopover _owner )
1203                 {
1204                         _this = _owner;
1205                         var child_1 = new Xcls_StringSorter35( _this );
1206                         child_1.ref();
1207                         this.el = new Gtk.TreeListRowSorter( child_1.el );
1208
1209                         // my vars (dec)
1210
1211                         // set gobject values
1212                 }
1213
1214                 // user defined functions
1215         }
1216         public class Xcls_StringSorter35 : Object
1217         {
1218                 public Gtk.StringSorter el;
1219                 private ValaProjectSettingsPopover  _this;
1220
1221
1222                         // my vars (def)
1223
1224                 // ctor
1225                 public Xcls_StringSorter35(ValaProjectSettingsPopover _owner )
1226                 {
1227                         _this = _owner;
1228                         var child_1 = new Xcls_PropertyExpression36( _this );
1229                         child_1.ref();
1230                         this.el = new Gtk.StringSorter( child_1.el );
1231
1232                         // my vars (dec)
1233
1234                         // set gobject values
1235                 }
1236
1237                 // user defined functions
1238         }
1239         public class Xcls_PropertyExpression36 : Object
1240         {
1241                 public Gtk.PropertyExpression el;
1242                 private ValaProjectSettingsPopover  _this;
1243
1244
1245                         // my vars (def)
1246
1247                 // ctor
1248                 public Xcls_PropertyExpression36(ValaProjectSettingsPopover _owner )
1249                 {
1250                         _this = _owner;
1251                         this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1252
1253                         // my vars (dec)
1254
1255                         // set gobject values
1256                 }
1257
1258                 // user defined functions
1259         }
1260
1261
1262
1263
1264         public class Xcls_CustomFilter37 : Object
1265         {
1266                 public Gtk.CustomFilter el;
1267                 private ValaProjectSettingsPopover  _this;
1268
1269
1270                         // my vars (def)
1271
1272                 // ctor
1273                 public Xcls_CustomFilter37(ValaProjectSettingsPopover _owner )
1274                 {
1275                         _this = _owner;
1276                         this.el = new Gtk.CustomFilter( (item) => { 
1277         
1278         var tr = ((Gtk.TreeListRow)item).get_item();
1279         //GLib.debug("filter %s", tr.get_type().name());
1280         var j =  (JsRender.JsRender) tr;
1281         if (j.xtype == "Gtk") {
1282                 return true;
1283         }
1284         if (j.xtype != "Dir") {
1285                 return j.path.has_suffix(".vala") ||  j.path.has_suffix(".c");
1286         }
1287         // dirs..
1288          
1289         for (var i =0 ; i < j.childfiles.n_items; i++) {
1290                 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1291                 if (f.xtype == "Gtk") {
1292                         return true;
1293                 }
1294                 if (f.path.has_suffix(".vala") ||  f.path.has_suffix(".c")) {
1295                         return true;
1296                 }
1297         }
1298         return false;
1299
1300 } );
1301
1302                         // my vars (dec)
1303
1304                         // set gobject values
1305                 }
1306
1307                 // user defined functions
1308         }
1309
1310
1311
1312         public class Xcls_name : Object
1313         {
1314                 public Gtk.ColumnViewColumn el;
1315                 private ValaProjectSettingsPopover  _this;
1316
1317
1318                         // my vars (def)
1319
1320                 // ctor
1321                 public Xcls_name(ValaProjectSettingsPopover _owner )
1322                 {
1323                         _this = _owner;
1324                         _this.name = this;
1325                         var child_1 = new Xcls_SignalListItemFactory39( _this );
1326                         child_1.ref();
1327                         this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1328
1329                         // my vars (dec)
1330
1331                         // set gobject values
1332                         this.el.id = "name";
1333                         this.el.expand = true;
1334                         this.el.resizable = true;
1335
1336                         // init method
1337
1338                         {
1339                                  this.el.set_sorter(  new Gtk.StringSorter(
1340                                         new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1341                                 ));
1342                                         ;
1343                                         
1344                         }
1345                 }
1346
1347                 // user defined functions
1348         }
1349         public class Xcls_SignalListItemFactory39 : Object
1350         {
1351                 public Gtk.SignalListItemFactory el;
1352                 private ValaProjectSettingsPopover  _this;
1353
1354
1355                         // my vars (def)
1356
1357                 // ctor
1358                 public Xcls_SignalListItemFactory39(ValaProjectSettingsPopover _owner )
1359                 {
1360                         _this = _owner;
1361                         this.el = new Gtk.SignalListItemFactory();
1362
1363                         // my vars (dec)
1364
1365                         // set gobject values
1366
1367                         //listeners
1368                         this.el.setup.connect( (listitem) => {
1369                                 
1370                                 var expand = new Gtk.TreeExpander();
1371                                  
1372                                 expand.set_indent_for_depth(true);
1373                                 expand.set_indent_for_icon(true);
1374                                  
1375                                 var lbl = new Gtk.Label("");
1376                                 lbl.use_markup = true;
1377                                 
1378                                 
1379                                 lbl.justify = Gtk.Justification.LEFT;
1380                                 lbl.xalign = 0;
1381                         
1382                          
1383                                 expand.set_child(lbl);
1384                                 ((Gtk.ListItem)listitem).set_child(expand);
1385                                 ((Gtk.ListItem)listitem).activatable = false;
1386                         });
1387                         this.el.bind.connect( (listitem) => {
1388                                  //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1389                                 
1390                                 
1391                                 
1392                                 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1393                                 var expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();
1394                                   
1395                          
1396                                 var lbl = (Gtk.Label) expand.child;
1397                                 
1398                                  if (lbl.label != "") { // do not update
1399                                         return;
1400                                 }
1401                                 
1402                         
1403                                 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1404                                 var jr = (JsRender.JsRender) lr.get_item();
1405                                 //GLib.debug("change  %s to %s", lbl.label, np.name);
1406                                 lbl.label = jr.name; // for dir's we could hsow the sub path..
1407                                 lbl.tooltip_markup = jr.path;
1408                                  
1409                             expand.set_hide_expander(  jr.childfiles.n_items < 1);
1410                                 expand.set_list_row(lr);
1411                          
1412                                 expand.set_hide_expander(  jr.xtype != "Dir" );
1413                                  expand.set_list_row(lr);
1414                          
1415                                 // bind image...
1416                                 
1417                         });
1418                 }
1419
1420                 // user defined functions
1421         }
1422
1423
1424         public class Xcls_ColumnViewColumn40 : Object
1425         {
1426                 public Gtk.ColumnViewColumn el;
1427                 private ValaProjectSettingsPopover  _this;
1428
1429
1430                         // my vars (def)
1431
1432                 // ctor
1433                 public Xcls_ColumnViewColumn40(ValaProjectSettingsPopover _owner )
1434                 {
1435                         _this = _owner;
1436                         var child_1 = new Xcls_SignalListItemFactory41( _this );
1437                         child_1.ref();
1438                         this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1439
1440                         // my vars (dec)
1441
1442                         // set gobject values
1443                 }
1444
1445                 // user defined functions
1446         }
1447         public class Xcls_SignalListItemFactory41 : Object
1448         {
1449                 public Gtk.SignalListItemFactory el;
1450                 private ValaProjectSettingsPopover  _this;
1451
1452
1453                         // my vars (def)
1454
1455                 // ctor
1456                 public Xcls_SignalListItemFactory41(ValaProjectSettingsPopover _owner )
1457                 {
1458                         _this = _owner;
1459                         this.el = new Gtk.SignalListItemFactory();
1460
1461                         // my vars (dec)
1462
1463                         // set gobject values
1464
1465                         //listeners
1466                         this.el.setup.connect( (listitem) => {
1467                         
1468                                 var btn = new Gtk.CheckButton();
1469                          
1470                                 ((Gtk.ListItem)listitem).set_child(btn);
1471                                 
1472                                 btn.toggled.connect(() =>  {
1473                                         if (_this.cg_loading) {
1474                                                 return;
1475                                         }
1476                                         var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1477                                         var jr = (JsRender.JsRender) lr.get_item();
1478                                         jr.compile_group_selected = btn.active;
1479                                         
1480                                         
1481                                 });
1482                         });
1483                         this.el.bind.connect( (listitem) => {
1484                                  //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1485                                 
1486                                 
1487                                 
1488                                 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1489                                 var btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();
1490                                   
1491                          
1492                                 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1493                                 var jr = (JsRender.JsRender) lr.get_item();
1494                                 //GLib.debug("change  %s to %s", lbl.label, np.name);
1495                         
1496                                 //btn.active = jr.compile_group_selected;
1497                                 btn.active = _this.selected_target.has_file(jr);
1498                                 
1499                                 //jr.bind_property("compile_group_selected",
1500                             //                btn, "active",
1501                             //               GLib.BindingFlags.BIDIRECTIONAL); 
1502                                 // bind image...
1503                                 
1504                         });
1505                 }
1506
1507                 // user defined functions
1508         }
1509
1510
1511
1512
1513
1514         public class Xcls_Box42 : Object
1515         {
1516                 public Gtk.Box el;
1517                 private ValaProjectSettingsPopover  _this;
1518
1519
1520                         // my vars (def)
1521
1522                 // ctor
1523                 public Xcls_Box42(ValaProjectSettingsPopover _owner )
1524                 {
1525                         _this = _owner;
1526                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1527
1528                         // my vars (dec)
1529
1530                         // set gobject values
1531                         var child_1 = new Xcls_Box43( _this );
1532                         child_1.ref();
1533                         this.el.append( child_1.el );
1534                         var child_2 = new Xcls_ScrolledWindow46( _this );
1535                         child_2.ref();
1536                         this.el.append( child_2.el );
1537                         new Xcls_set_vboxb( _this );
1538                         this.el.append( _this.set_vboxb.el );
1539                 }
1540
1541                 // user defined functions
1542         }
1543         public class Xcls_Box43 : Object
1544         {
1545                 public Gtk.Box el;
1546                 private ValaProjectSettingsPopover  _this;
1547
1548
1549                         // my vars (def)
1550
1551                 // ctor
1552                 public Xcls_Box43(ValaProjectSettingsPopover _owner )
1553                 {
1554                         _this = _owner;
1555                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1556
1557                         // my vars (dec)
1558
1559                         // set gobject values
1560                         this.el.hexpand = true;
1561                         var child_1 = new Xcls_Button44( _this );
1562                         child_1.ref();
1563                         this.el.append( child_1.el );
1564                         var child_2 = new Xcls_Button45( _this );
1565                         child_2.ref();
1566                         this.el.append( child_2.el );
1567                 }
1568
1569                 // user defined functions
1570         }
1571         public class Xcls_Button44 : Object
1572         {
1573                 public Gtk.Button el;
1574                 private ValaProjectSettingsPopover  _this;
1575
1576
1577                         // my vars (def)
1578
1579                 // ctor
1580                 public Xcls_Button44(ValaProjectSettingsPopover _owner )
1581                 {
1582                         _this = _owner;
1583                         this.el = new Gtk.Button();
1584
1585                         // my vars (dec)
1586
1587                         // set gobject values
1588                         this.el.hexpand = true;
1589                         this.el.label = "Add Compile Target";
1590
1591                         //listeners
1592                         this.el.clicked.connect( ()  => {
1593                             
1594                                if (_this.project.compilegroups.has_key("NEW GROUP")) {
1595                                 return;
1596                             }
1597                             var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1598                             _this.project.compilegroups.set(cg.name, cg);
1599                              _this.project.loadTargetsIntoStore(_this.target_model.el);
1600                              //  select it.. ?? should load it??
1601                              for(var i =0;i < _this.target_model.el.n_items; i++) {
1602                                 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1603                                 if (ncg.name == cg.name) {
1604                                         _this.target_sel.el.selected = i;
1605                                         _this.target_sel.selectTarget(cg);
1606                                         break;
1607                                         }
1608                                 } 
1609                                 
1610                                 
1611                                  
1612                         });
1613                 }
1614
1615                 // user defined functions
1616         }
1617
1618         public class Xcls_Button45 : Object
1619         {
1620                 public Gtk.Button el;
1621                 private ValaProjectSettingsPopover  _this;
1622
1623
1624                         // my vars (def)
1625
1626                 // ctor
1627                 public Xcls_Button45(ValaProjectSettingsPopover _owner )
1628                 {
1629                         _this = _owner;
1630                         this.el = new Gtk.Button();
1631
1632                         // my vars (dec)
1633
1634                         // set gobject values
1635                         this.el.hexpand = true;
1636                         this.el.label = "Remove Target";
1637
1638                         //listeners
1639                         this.el.clicked.connect( ()  => {
1640                             // load the new values.
1641                                 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1642                                         GLib.debug("nothing selected");
1643                                         return;
1644                                 }
1645                                 
1646                                  
1647                                 // add the directory..
1648                                 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1649                                  
1650                                  
1651                                 GLib.debug("remove: %s\n", cg.name);
1652                                 if (!_this.project.compilegroups.unset(cg.name)) {
1653                                         GLib.debug("remove failed");
1654                                 }
1655                                 _this.project.loadTargetsIntoStore(_this.target_model.el);
1656                         });
1657                 }
1658
1659                 // user defined functions
1660         }
1661
1662
1663         public class Xcls_ScrolledWindow46 : Object
1664         {
1665                 public Gtk.ScrolledWindow el;
1666                 private ValaProjectSettingsPopover  _this;
1667
1668
1669                         // my vars (def)
1670
1671                 // ctor
1672                 public Xcls_ScrolledWindow46(ValaProjectSettingsPopover _owner )
1673                 {
1674                         _this = _owner;
1675                         this.el = new Gtk.ScrolledWindow();
1676
1677                         // my vars (dec)
1678
1679                         // set gobject values
1680                         this.el.vexpand = true;
1681                         var child_1 = new Xcls_ColumnView47( _this );
1682                         child_1.ref();
1683                         this.el.child = child_1.el;
1684
1685                         // init method
1686
1687                         {  
1688                         this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1689                         
1690                         }
1691                 }
1692
1693                 // user defined functions
1694         }
1695         public class Xcls_ColumnView47 : Object
1696         {
1697                 public Gtk.ColumnView el;
1698                 private ValaProjectSettingsPopover  _this;
1699
1700
1701                         // my vars (def)
1702
1703                 // ctor
1704                 public Xcls_ColumnView47(ValaProjectSettingsPopover _owner )
1705                 {
1706                         _this = _owner;
1707                         new Xcls_target_sel( _this );
1708                         this.el = new Gtk.ColumnView( _this.target_sel.el );
1709
1710                         // my vars (dec)
1711
1712                         // set gobject values
1713                         var child_2 = new Xcls_ColumnViewColumn50( _this );
1714                         child_2.ref();
1715                         this.el.append_column ( child_2.el  );
1716                 }
1717
1718                 // user defined functions
1719         }
1720         public class Xcls_target_sel : Object
1721         {
1722                 public Gtk.SingleSelection el;
1723                 private ValaProjectSettingsPopover  _this;
1724
1725
1726                         // my vars (def)
1727
1728                 // ctor
1729                 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1730                 {
1731                         _this = _owner;
1732                         _this.target_sel = this;
1733                         new Xcls_target_model( _this );
1734                         this.el = new Gtk.SingleSelection( _this.target_model.el );
1735
1736                         // my vars (dec)
1737
1738                         // set gobject values
1739
1740                         //listeners
1741                         this.el.selection_changed.connect( (position, n_items) => {
1742                         
1743                                  
1744                                 // load the new values.
1745                                 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1746                                         this.selectTarget(null);
1747                                         return;
1748                                 }
1749                                 this.selectTarget(null);
1750                                 
1751                          
1752                         
1753                                 // add the directory..
1754                                 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1755                                 
1756                                 this.selectTarget(cg);
1757                            
1758                         });
1759                 }
1760
1761                 // user defined functions
1762                 public void selectTarget (Project.GtkValaSettings? cg) {
1763                 // load the new values
1764                          _this.selected_target = cg;  
1765                          _this.project.active_cg = cg;
1766                          
1767                 
1768                         if (cg == null) {
1769                                  
1770                                 _this.set_vbox.el.hide();       
1771                                 _this.set_vboxb.el.hide();      
1772                                 return;
1773                         }
1774                         
1775                         
1776                         _this.set_vbox.el.show();
1777                         _this.set_vboxb.el.show();
1778                         // add the directory..
1779                  
1780                          
1781                          GLib.debug("loading dirs into project list");
1782                          cg.loading_ui = true;
1783                          _this.cg_loading = true;
1784                 
1785                           _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1786                           _this.project.loadDirsIntoStore(_this.treemodel.el);
1787                           _this.treeview.el.set_model(_this.treeselmodel.el);
1788                           
1789                          cg.loading_ui = false;
1790                          
1791                          _this.cg_loading = false;
1792                          GLib.debug("Set name to %s", cg.name);
1793                          
1794                         _this.build_name.el.buffer.set_text(cg.name.data);
1795                         _this.build_as_library.el.active = cg.is_library;
1796                  
1797                         _this.build_execute_args.el.buffer.set_text(  cg.execute_args.data );
1798                  
1799                 }
1800         }
1801         public class Xcls_target_model : Object
1802         {
1803                 public GLib.ListStore el;
1804                 private ValaProjectSettingsPopover  _this;
1805
1806
1807                         // my vars (def)
1808
1809                 // ctor
1810                 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1811                 {
1812                         _this = _owner;
1813                         _this.target_model = this;
1814                         this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1815
1816                         // my vars (dec)
1817
1818                         // set gobject values
1819                 }
1820
1821                 // user defined functions
1822         }
1823
1824
1825         public class Xcls_ColumnViewColumn50 : Object
1826         {
1827                 public Gtk.ColumnViewColumn el;
1828                 private ValaProjectSettingsPopover  _this;
1829
1830
1831                         // my vars (def)
1832
1833                 // ctor
1834                 public Xcls_ColumnViewColumn50(ValaProjectSettingsPopover _owner )
1835                 {
1836                         _this = _owner;
1837                         var child_1 = new Xcls_SignalListItemFactory51( _this );
1838                         child_1.ref();
1839                         this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1840
1841                         // my vars (dec)
1842
1843                         // set gobject values
1844                         this.el.expand = true;
1845                 }
1846
1847                 // user defined functions
1848         }
1849         public class Xcls_SignalListItemFactory51 : Object
1850         {
1851                 public Gtk.SignalListItemFactory el;
1852                 private ValaProjectSettingsPopover  _this;
1853
1854
1855                         // my vars (def)
1856
1857                 // ctor
1858                 public Xcls_SignalListItemFactory51(ValaProjectSettingsPopover _owner )
1859                 {
1860                         _this = _owner;
1861                         this.el = new Gtk.SignalListItemFactory();
1862
1863                         // my vars (dec)
1864
1865                         // set gobject values
1866
1867                         //listeners
1868                         this.el.setup.connect( (item) => {
1869                                 //var j = (JsRender.JsRender) item;
1870                                 var gi = (Gtk.ListItem)item;
1871                                  
1872                                 var lbl = new Gtk.Label("");
1873                                 lbl.halign = Gtk.Align.START;
1874                                 gi.set_child(lbl);
1875                         
1876                         
1877                         
1878                         });
1879                         this.el.bind.connect( (listitem) => {
1880                          
1881                                 var lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();
1882                                    
1883                                 var item = (Project.GtkValaSettings)  ((Gtk.ListItem)listitem).get_item();
1884                         
1885                                 item.bind_property("name",
1886                                         lbl, "label",
1887                                    GLib.BindingFlags.SYNC_CREATE);
1888                         
1889                                   
1890                         });
1891                 }
1892
1893                 // user defined functions
1894         }
1895
1896
1897
1898
1899         public class Xcls_set_vboxb : Object
1900         {
1901                 public Gtk.Box el;
1902                 private ValaProjectSettingsPopover  _this;
1903
1904
1905                         // my vars (def)
1906
1907                 // ctor
1908                 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1909                 {
1910                         _this = _owner;
1911                         _this.set_vboxb = this;
1912                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1913
1914                         // my vars (dec)
1915
1916                         // set gobject values
1917                         var child_1 = new Xcls_Label53( _this );
1918                         child_1.ref();
1919                         this.el.append( child_1.el );
1920                         new Xcls_build_name( _this );
1921                         this.el.append( _this.build_name.el );
1922                         var child_3 = new Xcls_Label55( _this );
1923                         child_3.ref();
1924                         this.el.append( child_3.el );
1925                         new Xcls_build_execute_args( _this );
1926                         this.el.append( _this.build_execute_args.el );
1927                         new Xcls_build_as_library( _this );
1928                         this.el.append( _this.build_as_library.el );
1929                 }
1930
1931                 // user defined functions
1932         }
1933         public class Xcls_Label53 : Object
1934         {
1935                 public Gtk.Label el;
1936                 private ValaProjectSettingsPopover  _this;
1937
1938
1939                         // my vars (def)
1940
1941                 // ctor
1942                 public Xcls_Label53(ValaProjectSettingsPopover _owner )
1943                 {
1944                         _this = _owner;
1945                         this.el = new Gtk.Label( "Build Name (executable name)" );
1946
1947                         // my vars (dec)
1948
1949                         // set gobject values
1950                 }
1951
1952                 // user defined functions
1953         }
1954
1955         public class Xcls_build_name : Object
1956         {
1957                 public Gtk.Entry el;
1958                 private ValaProjectSettingsPopover  _this;
1959
1960
1961                         // my vars (def)
1962                 public bool in_insert;
1963
1964                 // ctor
1965                 public Xcls_build_name(ValaProjectSettingsPopover _owner )
1966                 {
1967                         _this = _owner;
1968                         _this.build_name = this;
1969                         this.el = new Gtk.Entry();
1970
1971                         // my vars (dec)
1972                         this.in_insert = false;
1973
1974                         // set gobject values
1975
1976                         // init method
1977
1978                         var ed = (this.el.get_delegate() as Gtk.Editable);
1979                         if (ed != null) {
1980                                 ed.insert_text.connect((text, length, ref position) => {
1981                                         if (this.in_insert) {
1982                                                 return;
1983                                         }
1984                                         GLib.debug("got insert text %s", text);
1985                                         
1986                                         var nt = "";
1987                                         for(var i = 0;i < text.length; i++){ 
1988                                                 if (Posix.isupper(text[i]) ||Posix.islower(text[i])  ) {
1989                                                         nt +=  text[i].to_string();
1990                                                 }       
1991                                         }
1992                                         if (nt.length < 1) {
1993                                                 GLib.Signal.stop_emission_by_name(ed, "insert_text");
1994                                                 return;
1995                                         }
1996                         
1997                                         this.in_insert = true;
1998                                  
1999                                         this.el.insert_text(nt,nt.length, ref position);
2000                                         this.in_insert = false;
2001                                         GLib.Signal.stop_emission_by_name(ed, "insert_text");
2002                                 });
2003                         
2004                         }
2005
2006                         //listeners
2007                         this.el.insert_text.connect( (text, length, ref position) => {
2008                                 if (this.in_insert) {
2009                                         return;
2010                                 }
2011                                 GLib.debug("got insert text %s", text);
2012                                 
2013                                 var nt = "";
2014                                 for(var i = 0;i < text.length; i++){ 
2015                                         if (Posix.isalpha(text[i])) {
2016                                                 nt +=  text[i].to_string();
2017                                         }       
2018                                 }
2019                                 if (nt.length < 1) {
2020                                         return;
2021                                 }
2022                         
2023                                 this.in_insert = true;
2024                          
2025                                 this.el.insert_text(text,length, ref position);
2026                                 this.in_insert = false;
2027                         });
2028                         this.el.changed.connect( ()  => {
2029                                 if (_this.selected_target == null) {
2030                                         return;
2031                                 }
2032                                 var name = this.el.text;
2033                                 // name ischanging.. probably always..
2034                                 if (_this.selected_target.name != name) {
2035                                         _this.project.compilegroups.unset(_this.selected_target.name);
2036                                         _this.project.compilegroups.set(name, _this.selected_target);
2037                                 }
2038                         
2039                                 _this.selected_target.name = this.el.buffer.text;
2040                         });
2041                 }
2042
2043                 // user defined functions
2044         }
2045
2046         public class Xcls_Label55 : Object
2047         {
2048                 public Gtk.Label el;
2049                 private ValaProjectSettingsPopover  _this;
2050
2051
2052                         // my vars (def)
2053
2054                 // ctor
2055                 public Xcls_Label55(ValaProjectSettingsPopover _owner )
2056                 {
2057                         _this = _owner;
2058                         this.el = new Gtk.Label( "test argments - when run after a build" );
2059
2060                         // my vars (dec)
2061
2062                         // set gobject values
2063                 }
2064
2065                 // user defined functions
2066         }
2067
2068         public class Xcls_build_execute_args : Object
2069         {
2070                 public Gtk.Entry el;
2071                 private ValaProjectSettingsPopover  _this;
2072
2073
2074                         // my vars (def)
2075
2076                 // ctor
2077                 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
2078                 {
2079                         _this = _owner;
2080                         _this.build_execute_args = this;
2081                         this.el = new Gtk.Entry();
2082
2083                         // my vars (dec)
2084
2085                         // set gobject values
2086                         this.el.placeholder_text = "eg.  -f somefile -g ";
2087
2088                         //listeners
2089                         this.el.changed.connect( () => {
2090                             if (_this.selected_target == null) {
2091                                 return;
2092                             }
2093                             _this.selected_target.execute_args = this.el.buffer.text;
2094                             
2095                         });
2096                 }
2097
2098                 // user defined functions
2099         }
2100
2101         public class Xcls_build_as_library : Object
2102         {
2103                 public Gtk.CheckButton el;
2104                 private ValaProjectSettingsPopover  _this;
2105
2106
2107                         // my vars (def)
2108
2109                 // ctor
2110                 public Xcls_build_as_library(ValaProjectSettingsPopover _owner )
2111                 {
2112                         _this = _owner;
2113                         _this.build_as_library = this;
2114                         this.el = new Gtk.CheckButton();
2115
2116                         // my vars (dec)
2117
2118                         // set gobject values
2119                         this.el.label = "build as library";
2120
2121                         //listeners
2122                         this.el.notify["active"].connect( () => {
2123                             if (_this.selected_target == null) {
2124                                 return;
2125                             }
2126                             _this.selected_target.is_library = this.el.active;
2127                             
2128                         });
2129                 }
2130
2131                 // user defined functions
2132         }
2133
2134
2135
2136
2137
2138         public class Xcls_Box57 : Object
2139         {
2140                 public Gtk.Box el;
2141                 private ValaProjectSettingsPopover  _this;
2142
2143
2144                         // my vars (def)
2145
2146                 // ctor
2147                 public Xcls_Box57(ValaProjectSettingsPopover _owner )
2148                 {
2149                         _this = _owner;
2150                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
2151
2152                         // my vars (dec)
2153
2154                         // set gobject values
2155                         this.el.margin_end = 4;
2156                         this.el.margin_start = 4;
2157                         this.el.hexpand = true;
2158                         this.el.margin_bottom = 4;
2159                         this.el.margin_top = 4;
2160                         var child_1 = new Xcls_Button58( _this );
2161                         child_1.ref();
2162                         this.el.append( child_1.el );
2163                         var child_2 = new Xcls_Label59( _this );
2164                         child_2.ref();
2165                         this.el.append( child_2.el );
2166                         new Xcls_save_btn( _this );
2167                         this.el.append( _this.save_btn.el );
2168                 }
2169
2170                 // user defined functions
2171         }
2172         public class Xcls_Button58 : Object
2173         {
2174                 public Gtk.Button el;
2175                 private ValaProjectSettingsPopover  _this;
2176
2177
2178                         // my vars (def)
2179
2180                 // ctor
2181                 public Xcls_Button58(ValaProjectSettingsPopover _owner )
2182                 {
2183                         _this = _owner;
2184                         this.el = new Gtk.Button();
2185
2186                         // my vars (dec)
2187
2188                         // set gobject values
2189                         this.el.label = "Cancel";
2190
2191                         //listeners
2192                         this.el.clicked.connect( () => { 
2193                         
2194                           _this.done = true;
2195                             _this.el.hide(); 
2196                         });
2197                 }
2198
2199                 // user defined functions
2200         }
2201
2202         public class Xcls_Label59 : Object
2203         {
2204                 public Gtk.Label el;
2205                 private ValaProjectSettingsPopover  _this;
2206
2207
2208                         // my vars (def)
2209
2210                 // ctor
2211                 public Xcls_Label59(ValaProjectSettingsPopover _owner )
2212                 {
2213                         _this = _owner;
2214                         this.el = new Gtk.Label( "" );
2215
2216                         // my vars (dec)
2217
2218                         // set gobject values
2219                         this.el.hexpand = true;
2220                 }
2221
2222                 // user defined functions
2223         }
2224
2225         public class Xcls_save_btn : Object
2226         {
2227                 public Gtk.Button el;
2228                 private ValaProjectSettingsPopover  _this;
2229
2230
2231                         // my vars (def)
2232
2233                 // ctor
2234                 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2235                 {
2236                         _this = _owner;
2237                         _this.save_btn = this;
2238                         this.el = new Gtk.Button();
2239
2240                         // my vars (dec)
2241
2242                         // set gobject values
2243                         this.el.css_classes = { "suggested-action" };
2244                         this.el.label = "Save";
2245
2246                         //listeners
2247                         this.el.clicked.connect( ( ) =>  { 
2248                         
2249                          
2250                         _this.project.save(); 
2251                          
2252                                 // what about .js ?
2253                         _this.done = true;
2254                         _this.el.hide();
2255                         if (_this.doneObj != null) {
2256                                 _this.doneObj.call(_this.project);
2257                         }
2258                          
2259                            
2260                         });
2261                 }
2262
2263                 // user defined functions
2264         }
2265
2266
2267
2268 }