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