fix line numbering issues with vala generator - hopefully fixes completion in node...
[roobuilder] / src / Builder4 / MainWindow.vala
1     static Xcls_MainWindow  _MainWindow;
2
3     public class Xcls_MainWindow : Object
4     {
5         public Gtk.ApplicationWindow el;
6         private Xcls_MainWindow  _this;
7
8         public static Xcls_MainWindow singleton()
9         {
10             if (_MainWindow == null) {
11                 _MainWindow= new Xcls_MainWindow();
12             }
13             return _MainWindow;
14         }
15         public Xcls_headerbar headerbar;
16         public Xcls_windowbtn windowbtn;
17         public Xcls_windowspopup windowspopup;
18         public Xcls_popover_menu popover_menu;
19         public Xcls_open_projects_btn open_projects_btn;
20         public Xcls_vbox vbox;
21         public Xcls_mainpane mainpane;
22         public Xcls_leftpane leftpane;
23         public Xcls_editpane editpane;
24         public Xcls_tree tree;
25         public Xcls_props props;
26         public Xcls_rooviewbox rooviewbox;
27         public Xcls_codeeditviewbox codeeditviewbox;
28         public Xcls_topbarmenu topbarmenu;
29         public Xcls_statusbar statusbar;
30         public Xcls_statusbar_compilestatus_label statusbar_compilestatus_label;
31         public Xcls_statusbar_errors statusbar_errors;
32         public Xcls_statusbar_warnings statusbar_warnings;
33         public Xcls_statusbar_depricated statusbar_depricated;
34         public Xcls_statusbar_run statusbar_run;
35         public Xcls_statusbar_compile_spinner statusbar_compile_spinner;
36
37             // my vars (def)
38         public WindowState windowstate;
39         public Project.Project project;
40
41         // ctor
42         public Xcls_MainWindow()
43         {
44             _this = this;
45             this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({}));
46
47             // my vars (dec)
48             this.project = null;
49
50             // set gobject values
51             this.el.title = "Roo Application Builder";
52             this.el.default_height = 850;
53             this.el.default_width = 1200;
54             new Xcls_headerbar( _this );
55             this.el.set_titlebar ( _this.headerbar.el  );
56             new Xcls_vbox( _this );
57             this.el.set_child ( _this.vbox.el  );
58
59             // init method
60
61             this.el.set_icon_name("roobuilder");
62
63             //listeners
64             this.el.close_request.connect( ( ) => {
65                  Resources.singleton().disconnect(_this.statusbar.handler_id);
66                  
67                  
68                  this.windowstate.file.getLanguageServer().document_close(
69                         this.windowstate.file
70                 );
71                  
72                  BuilderApplication.removeWindow(this);
73                  
74                  if (BuilderApplication.windows.size  < 1) {
75                         this.windowstate.file.getLanguageServer().exit();
76                         BuilderApplication.singleton(  null ).quit();
77                  }
78                 return true;
79             });
80             this.el.show.connect( ( ) => {
81                 // hide the file editing..
82                
83                 //this.hideViewEditing();
84                 // this is updated by windowstate - we try and fill it in..
85                  _this.statusbar.el.hide();
86                  //_this.statusbar_errors.el.hide();
87                 //_this.statusbar_warnings.el.hide();
88                 //_this.statusbar_depricated.el.hide();
89                 _this.statusbar_compile_spinner.el.hide();
90               
91                 Resources.singleton().checkResources();
92                 
93               
94             
95             });
96             this.el.hide.connect( () =>  {
97              
98              
99             
100             });
101         }
102
103         // user defined functions
104         public void updateErrors () {
105         
106         
107                 GLib.debug("updateErrors");
108                 
109                 var pr = this.windowstate.project.getErrors("ERR");
110                 
111                 this.statusbar_errors.setNotices(
112                         pr,
113                         this.windowstate.file.getErrors("ERR")
114                 );
115                 
116                 this.statusbar_warnings.setNotices(
117                         this.windowstate.project.getErrors("WARN"),
118                         this.windowstate.file.getErrors("WARN")
119                 );
120                 this.statusbar_depricated.setNotices(
121                         this.windowstate.project.getErrors("DEPR"),
122                         this.windowstate.file.getErrors("DEPR")
123                 );
124          
125                 _this.statusbar_run.el.hide();
126         
127                 if (pr.get_n_items() < 1) {
128                         _this.statusbar_run.el.show();
129                 } 
130                 
131         }
132         public void initChildren () {
133             // this needs putting in a better place..
134             this.windowstate = new WindowState(this);
135              
136         
137          
138         
139             
140         
141         
142         
143         }
144         public void show () {
145            
146             this.el.show();
147             if (this.windowstate.file  == null) {
148                 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
149             }
150         }
151         public void setTitle () {
152             if (_this.windowstate.project == null || 
153                     _this.windowstate.file == null
154             ) {
155                 this.el.set_title("Select File");
156                 return;
157                 }
158             _this.el.set_title(
159                 _this.windowstate.project.name + 
160                 " - " +
161                         _this.windowstate.file.relpath);
162         }
163         public void openNewWindow () {
164          
165             var w = new Xcls_MainWindow();
166             w.ref();
167                 BuilderApplication.addWindow(w);
168             w.el.show();
169             w.initChildren();
170             w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
171              
172         }
173         public class Xcls_headerbar : Object
174         {
175             public Gtk.HeaderBar el;
176             private Xcls_MainWindow  _this;
177
178
179                 // my vars (def)
180             public bool show_close_button;
181             public string title;
182
183             // ctor
184             public Xcls_headerbar(Xcls_MainWindow _owner )
185             {
186                 _this = _owner;
187                 _this.headerbar = this;
188                 this.el = new Gtk.HeaderBar();
189
190                 // my vars (dec)
191                 this.show_close_button = true;
192                 this.title = "Application Builder";
193
194                 // set gobject values
195                 var child_1 = new Xcls_Box3( _this );
196                 child_1.ref();
197                 this.el.pack_start ( child_1.el  );
198             }
199
200             // user defined functions
201         }
202         public class Xcls_Box3 : Object
203         {
204             public Gtk.Box el;
205             private Xcls_MainWindow  _this;
206
207
208                 // my vars (def)
209
210             // ctor
211             public Xcls_Box3(Xcls_MainWindow _owner )
212             {
213                 _this = _owner;
214                 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
215
216                 // my vars (dec)
217
218                 // set gobject values
219                 new Xcls_windowbtn( _this );
220                 this.el.append( _this.windowbtn.el );
221                 new Xcls_open_projects_btn( _this );
222                 this.el.append ( _this.open_projects_btn.el  );
223             }
224
225             // user defined functions
226         }
227         public class Xcls_windowbtn : Object
228         {
229             public Gtk.Button el;
230             private Xcls_MainWindow  _this;
231
232
233                 // my vars (def)
234             public Gee.ArrayList<Gtk.Widget> mitems;
235
236             // ctor
237             public Xcls_windowbtn(Xcls_MainWindow _owner )
238             {
239                 _this = _owner;
240                 _this.windowbtn = this;
241                 this.el = new Gtk.Button();
242
243                 // my vars (dec)
244
245                 // set gobject values
246                 this.el.margin_end = 4;
247                 this.el.halign = Gtk.Align.START;
248                 new Xcls_windowspopup( _this );
249                 var child_2 = new Xcls_Box10( _this );
250                 this.el.child = child_2.el;
251
252                 // init method
253
254                 {
255                         this.mitems = new Gee.ArrayList<Gtk.Button>();
256                 }
257
258                 //listeners
259                 this.el.clicked.connect( ( ) => {
260                         this.updateMenu();
261                 
262                          _this.windowspopup.el.set_parent(this.el);
263                 
264                          _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); 
265                          _this.windowspopup.el.popup(); 
266                 });
267             }
268
269             // user defined functions
270             public void updateMenu () {
271                  foreach(var m in  this.mitems) {
272                          _this.popover_menu.el.remove(m);
273                  }
274                  this.mitems.clear();
275                 
276                  BuilderApplication.windows.sort((a,b) => {
277                         if (a.windowstate == null ||
278                                  a.windowstate.file == null || 
279                                  b.windowstate == null ||
280                                  b.windowstate.file == null
281                                  ) { 
282                                 return 0;
283                         }
284             
285                         var ap = a.windowstate.file.project.name;
286                         var bp = b.windowstate.file.project.name;
287                         
288             
289                         
290                         if (ap != bp) {
291                                 return ap.collate(bp);
292                         }
293                         var af =  a.windowstate.file == null ? "" : a.windowstate.file.getTitle();
294                         var bf = b.windowstate.file == null ? "" : b.windowstate.file.getTitle();               
295                         return af.collate(bf);
296                  
297                  });
298                  
299                  var p = "";
300                  foreach(var w in BuilderApplication.windows) {
301                         var wid = BuilderApplication.windows.index_of(w);
302                         // fixme find a better way to display this.
303                         if (w.windowstate == null ||
304                                  w.windowstate.file == null || 
305                                  _this.windowstate == null ||
306                                  _this.windowstate.file == null
307                                  ) { 
308                                 continue;
309                         }
310                         // should not happen...
311                         if (w.windowstate.file.path == _this.windowstate.file.path) {
312                                 continue;
313                         }
314                         if (w.windowstate.file.project.name != p || p != "") {
315                                 var ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
316                                 _this.popover_menu.el.append(ms);
317                                 ms.show();
318                                 this.mitems.add(ms);
319                         }
320                         
321                         p = w.windowstate.file.project.name;
322                         
323             
324                         GLib.debug("add menuitem %s", w.windowstate.file.path);
325                         
326                         
327                         
328                         var m = new Gtk.Button.with_label(
329                                 w.windowstate.file.project.name + " : " + w.windowstate.file.relpath
330                         );
331                         m.halign = Gtk.Align.START;
332                         
333                         
334                         //w.windowstate.file.path);
335                         m.clicked.connect(() => {
336                                 _this.windowspopup.el.hide();
337                                  BuilderApplication.windows.get(wid).el.present();
338                         });
339                         _this.popover_menu.el.append(m);
340                         //m.show();
341                         this.mitems.add(m);
342                  }
343             }
344         }
345         public class Xcls_windowspopup : Object
346         {
347             public Gtk.Popover el;
348             private Xcls_MainWindow  _this;
349
350
351                 // my vars (def)
352
353             // ctor
354             public Xcls_windowspopup(Xcls_MainWindow _owner )
355             {
356                 _this = _owner;
357                 _this.windowspopup = this;
358                 this.el = new Gtk.Popover();
359
360                 // my vars (dec)
361
362                 // set gobject values
363                 new Xcls_popover_menu( _this );
364                 this.el.set_child ( _this.popover_menu.el  );
365             }
366
367             // user defined functions
368         }
369         public class Xcls_popover_menu : Object
370         {
371             public Gtk.Box el;
372             private Xcls_MainWindow  _this;
373
374
375                 // my vars (def)
376
377             // ctor
378             public Xcls_popover_menu(Xcls_MainWindow _owner )
379             {
380                 _this = _owner;
381                 _this.popover_menu = this;
382                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
383
384                 // my vars (dec)
385
386                 // set gobject values
387                 var child_1 = new Xcls_Button7( _this );
388                 child_1.ref();
389                 this.el.append ( child_1.el  );
390                 var child_2 = new Xcls_Separator9( _this );
391                 child_2.ref();
392                 this.el.append ( child_2.el  );
393             }
394
395             // user defined functions
396         }
397         public class Xcls_Button7 : Object
398         {
399             public Gtk.Button el;
400             private Xcls_MainWindow  _this;
401
402
403                 // my vars (def)
404
405             // ctor
406             public Xcls_Button7(Xcls_MainWindow _owner )
407             {
408                 _this = _owner;
409                 this.el = new Gtk.Button();
410
411                 // my vars (dec)
412
413                 // set gobject values
414                 this.el.label = "New Window";
415                 var child_1 = new Xcls_ShortcutController8( _this );
416                 child_1.ref();
417                 this.el.add_controller(  child_1.el );
418
419                 //listeners
420                 this.el.clicked.connect( ( ) => {
421                         _this.windowspopup.el.hide();
422                         _this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);
423                 });
424             }
425
426             // user defined functions
427         }
428         public class Xcls_ShortcutController8 : Object
429         {
430             public Gtk.ShortcutController el;
431             private Xcls_MainWindow  _this;
432
433
434                 // my vars (def)
435
436             // ctor
437             public Xcls_ShortcutController8(Xcls_MainWindow _owner )
438             {
439                 _this = _owner;
440                 this.el = new Gtk.ShortcutController();
441
442                 // my vars (dec)
443
444                 // set gobject values
445                 this.el.scope = Gtk.ShortcutScope.GLOBAL;
446
447                 // init method
448
449                 {
450                         this.el.add_shortcut(
451                                 new Gtk.Shortcut(
452                                         new Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),
453                                         new Gtk.SignalAction("clicked")
454                                 )
455                         );
456                 }
457             }
458
459             // user defined functions
460         }
461
462
463         public class Xcls_Separator9 : Object
464         {
465             public Gtk.Separator el;
466             private Xcls_MainWindow  _this;
467
468
469                 // my vars (def)
470
471             // ctor
472             public Xcls_Separator9(Xcls_MainWindow _owner )
473             {
474                 _this = _owner;
475                 this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL );
476
477                 // my vars (dec)
478
479                 // set gobject values
480             }
481
482             // user defined functions
483         }
484
485
486
487         public class Xcls_Box10 : Object
488         {
489             public Gtk.Box el;
490             private Xcls_MainWindow  _this;
491
492
493                 // my vars (def)
494
495             // ctor
496             public Xcls_Box10(Xcls_MainWindow _owner )
497             {
498                 _this = _owner;
499                 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
500
501                 // my vars (dec)
502
503                 // set gobject values
504                 var child_1 = new Xcls_Image11( _this );
505                 child_1.ref();
506                 this.el.append( child_1.el );
507                 var child_2 = new Xcls_Label12( _this );
508                 child_2.ref();
509                 this.el.append( child_2.el );
510             }
511
512             // user defined functions
513         }
514         public class Xcls_Image11 : Object
515         {
516             public Gtk.Image el;
517             private Xcls_MainWindow  _this;
518
519
520                 // my vars (def)
521
522             // ctor
523             public Xcls_Image11(Xcls_MainWindow _owner )
524             {
525                 _this = _owner;
526                 this.el = new Gtk.Image();
527
528                 // my vars (dec)
529
530                 // set gobject values
531                 this.el.icon_name = "window-new";
532                 this.el.margin_start = 4;
533             }
534
535             // user defined functions
536         }
537
538         public class Xcls_Label12 : Object
539         {
540             public Gtk.Label el;
541             private Xcls_MainWindow  _this;
542
543
544                 // my vars (def)
545
546             // ctor
547             public Xcls_Label12(Xcls_MainWindow _owner )
548             {
549                 _this = _owner;
550                 this.el = new Gtk.Label( "Windows (Add/List)" );
551
552                 // my vars (dec)
553
554                 // set gobject values
555             }
556
557             // user defined functions
558         }
559
560
561
562         public class Xcls_open_projects_btn : Object
563         {
564             public Gtk.Button el;
565             private Xcls_MainWindow  _this;
566
567
568                 // my vars (def)
569             public bool always_show_image;
570
571             // ctor
572             public Xcls_open_projects_btn(Xcls_MainWindow _owner )
573             {
574                 _this = _owner;
575                 _this.open_projects_btn = this;
576                 this.el = new Gtk.Button();
577
578                 // my vars (dec)
579                 this.always_show_image = true;
580
581                 // set gobject values
582                 this.el.icon_name = "system-file-manager";
583                 this.el.label = "Files / Projects";
584
585                 //listeners
586                 this.el.clicked.connect( ( ) => {
587                         _this.windowstate.showPopoverFiles(this.el, _this.project, false);
588                 });
589             }
590
591             // user defined functions
592         }
593
594
595
596         public class Xcls_vbox : Object
597         {
598             public Gtk.Box el;
599             private Xcls_MainWindow  _this;
600
601
602                 // my vars (def)
603
604             // ctor
605             public Xcls_vbox(Xcls_MainWindow _owner )
606             {
607                 _this = _owner;
608                 _this.vbox = this;
609                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
610
611                 // my vars (dec)
612
613                 // set gobject values
614                 this.el.homogeneous = false;
615                 this.el.vexpand = true;
616                 new Xcls_mainpane( _this );
617                 this.el.append( _this.mainpane.el );
618                 var child_2 = new Xcls_Box23( _this );
619                 child_2.ref();
620                 this.el.append( child_2.el );
621             }
622
623             // user defined functions
624         }
625         public class Xcls_mainpane : Object
626         {
627             public Gtk.Paned el;
628             private Xcls_MainWindow  _this;
629
630
631                 // my vars (def)
632             public int lastWidth;
633
634             // ctor
635             public Xcls_mainpane(Xcls_MainWindow _owner )
636             {
637                 _this = _owner;
638                 _this.mainpane = this;
639                 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
640
641                 // my vars (dec)
642                 this.lastWidth = 0;
643
644                 // set gobject values
645                 this.el.hexpand = true;
646                 this.el.vexpand = true;
647                 this.el.position = 400;
648                 new Xcls_leftpane( _this );
649                 this.el.start_child = _this.leftpane.el;
650                 var child_2 = new Xcls_Box20( _this );
651                 this.el.end_child = child_2.el;
652
653                 //listeners
654                 this.el.accept_position.connect( ( ) => {
655                         _this.windowstate.left_tree.onresize();
656                         return true;
657                 });
658             }
659
660             // user defined functions
661         }
662         public class Xcls_leftpane : Object
663         {
664             public Gtk.Box el;
665             private Xcls_MainWindow  _this;
666
667
668                 // my vars (def)
669
670             // ctor
671             public Xcls_leftpane(Xcls_MainWindow _owner )
672             {
673                 _this = _owner;
674                 _this.leftpane = this;
675                 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
676
677                 // my vars (dec)
678
679                 // set gobject values
680                 this.el.hexpand = true;
681                 this.el.vexpand = true;
682                 new Xcls_editpane( _this );
683                 this.el.append( _this.editpane.el );
684             }
685
686             // user defined functions
687         }
688         public class Xcls_editpane : Object
689         {
690             public Gtk.Paned el;
691             private Xcls_MainWindow  _this;
692
693
694                 // my vars (def)
695
696             // ctor
697             public Xcls_editpane(Xcls_MainWindow _owner )
698             {
699                 _this = _owner;
700                 _this.editpane = this;
701                 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
702
703                 // my vars (dec)
704
705                 // set gobject values
706                 new Xcls_tree( _this );
707                 this.el.start_child = _this.tree.el;
708                 new Xcls_props( _this );
709                 this.el.end_child = _this.props.el;
710
711                 //listeners
712                 this.el.accept_position.connect( ( ) => {
713                         _this.windowstate.left_tree.onresize();
714                         return true;
715                 });
716                 this.el.move_handle.connect( (scroll) => {
717                         GLib.debug("Move handle");
718                         return true;
719                 });
720             }
721
722             // user defined functions
723         }
724         public class Xcls_tree : Object
725         {
726             public Gtk.Box el;
727             private Xcls_MainWindow  _this;
728
729
730                 // my vars (def)
731
732             // ctor
733             public Xcls_tree(Xcls_MainWindow _owner )
734             {
735                 _this = _owner;
736                 _this.tree = this;
737                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
738
739                 // my vars (dec)
740
741                 // set gobject values
742                 this.el.hexpand = true;
743                 this.el.vexpand = true;
744             }
745
746             // user defined functions
747         }
748
749         public class Xcls_props : Object
750         {
751             public Gtk.Box el;
752             private Xcls_MainWindow  _this;
753
754
755                 // my vars (def)
756
757             // ctor
758             public Xcls_props(Xcls_MainWindow _owner )
759             {
760                 _this = _owner;
761                 _this.props = this;
762                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
763
764                 // my vars (dec)
765
766                 // set gobject values
767                 this.el.hexpand = true;
768                 this.el.vexpand = true;
769             }
770
771             // user defined functions
772         }
773
774
775
776         public class Xcls_Box20 : Object
777         {
778             public Gtk.Box el;
779             private Xcls_MainWindow  _this;
780
781
782                 // my vars (def)
783
784             // ctor
785             public Xcls_Box20(Xcls_MainWindow _owner )
786             {
787                 _this = _owner;
788                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
789
790                 // my vars (dec)
791
792                 // set gobject values
793                 this.el.hexpand = true;
794                 this.el.vexpand = true;
795                 new Xcls_rooviewbox( _this );
796                 this.el.append( _this.rooviewbox.el );
797                 new Xcls_codeeditviewbox( _this );
798                 this.el.append( _this.codeeditviewbox.el );
799             }
800
801             // user defined functions
802         }
803         public class Xcls_rooviewbox : Object
804         {
805             public Gtk.Box el;
806             private Xcls_MainWindow  _this;
807
808
809                 // my vars (def)
810
811             // ctor
812             public Xcls_rooviewbox(Xcls_MainWindow _owner )
813             {
814                 _this = _owner;
815                 _this.rooviewbox = this;
816                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
817
818                 // my vars (dec)
819
820                 // set gobject values
821                 this.el.hexpand = true;
822                 this.el.vexpand = true;
823             }
824
825             // user defined functions
826         }
827
828         public class Xcls_codeeditviewbox : Object
829         {
830             public Gtk.Box el;
831             private Xcls_MainWindow  _this;
832
833
834                 // my vars (def)
835
836             // ctor
837             public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
838             {
839                 _this = _owner;
840                 _this.codeeditviewbox = this;
841                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
842
843                 // my vars (dec)
844
845                 // set gobject values
846                 this.el.hexpand = true;
847                 this.el.vexpand = true;
848             }
849
850             // user defined functions
851         }
852
853
854
855         public class Xcls_Box23 : Object
856         {
857             public Gtk.Box el;
858             private Xcls_MainWindow  _this;
859
860
861                 // my vars (def)
862
863             // ctor
864             public Xcls_Box23(Xcls_MainWindow _owner )
865             {
866                 _this = _owner;
867                 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
868
869                 // my vars (dec)
870
871                 // set gobject values
872                 this.el.homogeneous = false;
873                 this.el.vexpand = false;
874                 var child_1 = new Xcls_Button24( _this );
875                 child_1.ref();
876                 this.el.append( child_1.el );
877                 var child_2 = new Xcls_Button25( _this );
878                 child_2.ref();
879                 this.el.append( child_2.el );
880                 var child_3 = new Xcls_MenuButton26( _this );
881                 child_3.ref();
882                 this.el.append( child_3.el );
883                 var child_4 = new Xcls_Label31( _this );
884                 child_4.ref();
885                 this.el.append( child_4.el );
886                 new Xcls_statusbar( _this );
887                 this.el.append( _this.statusbar.el );
888                 var child_6 = new Xcls_Box33( _this );
889                 child_6.ref();
890                 this.el.append( child_6.el );
891                 new Xcls_statusbar_compile_spinner( _this );
892                 this.el.append( _this.statusbar_compile_spinner.el );
893             }
894
895             // user defined functions
896         }
897         public class Xcls_Button24 : Object
898         {
899             public Gtk.Button el;
900             private Xcls_MainWindow  _this;
901
902
903                 // my vars (def)
904             public bool always_show_image;
905
906             // ctor
907             public Xcls_Button24(Xcls_MainWindow _owner )
908             {
909                 _this = _owner;
910                 this.el = new Gtk.Button();
911
912                 // my vars (dec)
913                 this.always_show_image = true;
914
915                 // set gobject values
916                 this.el.icon_name = "emblem-system";
917                 this.el.tooltip_text = "Project Details";
918                 this.el.label = "Edit Project Settings";
919
920                 //listeners
921                 this.el.clicked.connect( ( ) => {
922                      
923                      _this.windowstate.projectPopoverShow(_this.el, null, null);
924                    
925                   
926                 });
927             }
928
929             // user defined functions
930         }
931
932         public class Xcls_Button25 : Object
933         {
934             public Gtk.Button el;
935             private Xcls_MainWindow  _this;
936
937
938                 // my vars (def)
939             public bool always_show_image;
940
941             // ctor
942             public Xcls_Button25(Xcls_MainWindow _owner )
943             {
944                 _this = _owner;
945                 this.el = new Gtk.Button();
946
947                 // my vars (dec)
948                 this.always_show_image = true;
949
950                 // set gobject values
951                 this.el.icon_name = "document-properties";
952                 this.el.tooltip_text = "File Details";
953                 this.el.label = "Edit File Properties";
954
955                 //listeners
956                 this.el.clicked.connect( ( ) => {
957                   
958                     // create a new file in project..
959                     if (_this.project == null || _this.windowstate.file == null) {
960                         return  ;
961                     }
962                      _this.windowstate.file_details.show(
963                         _this.windowstate.file, _this.el, false
964                     );
965                      
966                     return  ;    
967                 
968                 
969                 });
970             }
971
972             // user defined functions
973         }
974
975         public class Xcls_MenuButton26 : Object
976         {
977             public Gtk.MenuButton el;
978             private Xcls_MainWindow  _this;
979
980
981                 // my vars (def)
982             public bool always_show_image;
983
984             // ctor
985             public Xcls_MenuButton26(Xcls_MainWindow _owner )
986             {
987                 _this = _owner;
988                 this.el = new Gtk.MenuButton();
989
990                 // my vars (dec)
991                 this.always_show_image = true;
992
993                 // set gobject values
994                 this.el.icon_name = "dialog-information";
995                 this.el.label = "About";
996                 new Xcls_topbarmenu( _this );
997                 this.el.popover = _this.topbarmenu.el;
998             }
999
1000             // user defined functions
1001         }
1002         public class Xcls_topbarmenu : Object
1003         {
1004             public Gtk.PopoverMenu el;
1005             private Xcls_MainWindow  _this;
1006
1007
1008                 // my vars (def)
1009
1010             // ctor
1011             public Xcls_topbarmenu(Xcls_MainWindow _owner )
1012             {
1013                 _this = _owner;
1014                 _this.topbarmenu = this;
1015                 this.el = new Gtk.PopoverMenu.from_model(null);
1016
1017                 // my vars (dec)
1018
1019                 // set gobject values
1020                 var child_1 = new Xcls_Box28( _this );
1021                 child_1.ref();
1022                 this.el.set_child ( child_1.el  );
1023
1024                 // init method
1025
1026                 {
1027                    // this.el.show();
1028                 }
1029             }
1030
1031             // user defined functions
1032         }
1033         public class Xcls_Box28 : Object
1034         {
1035             public Gtk.Box el;
1036             private Xcls_MainWindow  _this;
1037
1038
1039                 // my vars (def)
1040
1041             // ctor
1042             public Xcls_Box28(Xcls_MainWindow _owner )
1043             {
1044                 _this = _owner;
1045                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1046
1047                 // my vars (dec)
1048
1049                 // set gobject values
1050                 var child_1 = new Xcls_Button29( _this );
1051                 child_1.ref();
1052                 this.el.append( child_1.el );
1053                 var child_2 = new Xcls_Button30( _this );
1054                 child_2.ref();
1055                 this.el.append( child_2.el );
1056             }
1057
1058             // user defined functions
1059         }
1060         public class Xcls_Button29 : Object
1061         {
1062             public Gtk.Button el;
1063             private Xcls_MainWindow  _this;
1064
1065
1066                 // my vars (def)
1067
1068             // ctor
1069             public Xcls_Button29(Xcls_MainWindow _owner )
1070             {
1071                 _this = _owner;
1072                 this.el = new Gtk.Button();
1073
1074                 // my vars (dec)
1075
1076                 // set gobject values
1077                 this.el.label = "Download updated Resources";
1078
1079                 //listeners
1080                 this.el.activate.connect( ( ) => {
1081                          Resources.singleton().fetchStart();
1082                 });
1083             }
1084
1085             // user defined functions
1086         }
1087
1088         public class Xcls_Button30 : Object
1089         {
1090             public Gtk.Button el;
1091             private Xcls_MainWindow  _this;
1092
1093
1094                 // my vars (def)
1095
1096             // ctor
1097             public Xcls_Button30(Xcls_MainWindow _owner )
1098             {
1099                 _this = _owner;
1100                 this.el = new Gtk.Button();
1101
1102                 // my vars (dec)
1103
1104                 // set gobject values
1105                 this.el.label = "About the Builder";
1106
1107                 //listeners
1108                 this.el.clicked.connect( () => {
1109                     About.singleton().el.show();
1110                     });
1111             }
1112
1113             // user defined functions
1114         }
1115
1116
1117
1118
1119         public class Xcls_Label31 : Object
1120         {
1121             public Gtk.Label el;
1122             private Xcls_MainWindow  _this;
1123
1124
1125                 // my vars (def)
1126
1127             // ctor
1128             public Xcls_Label31(Xcls_MainWindow _owner )
1129             {
1130                 _this = _owner;
1131                 this.el = new Gtk.Label( "   " );
1132
1133                 // my vars (dec)
1134
1135                 // set gobject values
1136                 this.el.hexpand = true;
1137             }
1138
1139             // user defined functions
1140         }
1141
1142         public class Xcls_statusbar : Object
1143         {
1144             public Gtk.ProgressBar el;
1145             private Xcls_MainWindow  _this;
1146
1147
1148                 // my vars (def)
1149             public ulong handler_id;
1150
1151             // ctor
1152             public Xcls_statusbar(Xcls_MainWindow _owner )
1153             {
1154                 _this = _owner;
1155                 _this.statusbar = this;
1156                 this.el = new Gtk.ProgressBar();
1157
1158                 // my vars (dec)
1159                 this.handler_id = -1;
1160
1161                 // set gobject values
1162                 this.el.show_text = true;
1163
1164                 // init method
1165
1166                 {
1167                      this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1168                         if (pos < 1) {
1169                             this.el.hide();
1170                             _this.mainpane.el.set_sensitive(true);
1171                             
1172                             return;
1173                         }
1174                          _this.mainpane.el.set_sensitive(false);
1175                          this.el.show();
1176                          this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1177                          this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1178                        
1179                      });
1180                 }
1181             }
1182
1183             // user defined functions
1184         }
1185
1186         public class Xcls_Box33 : Object
1187         {
1188             public Gtk.Box el;
1189             private Xcls_MainWindow  _this;
1190
1191
1192                 // my vars (def)
1193
1194             // ctor
1195             public Xcls_Box33(Xcls_MainWindow _owner )
1196             {
1197                 _this = _owner;
1198                 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1199
1200                 // my vars (dec)
1201
1202                 // set gobject values
1203                 new Xcls_statusbar_compilestatus_label( _this );
1204                 this.el.append( _this.statusbar_compilestatus_label.el );
1205                 new Xcls_statusbar_errors( _this );
1206                 this.el.append( _this.statusbar_errors.el );
1207                 new Xcls_statusbar_warnings( _this );
1208                 this.el.append( _this.statusbar_warnings.el );
1209                 new Xcls_statusbar_depricated( _this );
1210                 this.el.append( _this.statusbar_depricated.el );
1211                 new Xcls_statusbar_run( _this );
1212                 this.el.append( _this.statusbar_run.el );
1213             }
1214
1215             // user defined functions
1216         }
1217         public class Xcls_statusbar_compilestatus_label : Object
1218         {
1219             public Gtk.Label el;
1220             private Xcls_MainWindow  _this;
1221
1222
1223                 // my vars (def)
1224
1225             // ctor
1226             public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1227             {
1228                 _this = _owner;
1229                 _this.statusbar_compilestatus_label = this;
1230                 this.el = new Gtk.Label( "Compile Status:" );
1231
1232                 // my vars (dec)
1233
1234                 // set gobject values
1235                 this.el.margin_end = 4;
1236                 this.el.margin_start = 4;
1237             }
1238
1239             // user defined functions
1240         }
1241
1242         public class Xcls_statusbar_errors : Object
1243         {
1244             public Gtk.Button el;
1245             private Xcls_MainWindow  _this;
1246
1247
1248                 // my vars (def)
1249             public Xcls_ValaCompileErrors popup;
1250
1251             // ctor
1252             public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1253             {
1254                 _this = _owner;
1255                 _this.statusbar_errors = this;
1256                 this.el = new Gtk.Button();
1257
1258                 // my vars (dec)
1259
1260                 // set gobject values
1261                 this.el.icon_name = "dialog-error";
1262                 this.el.label = "0 Errors";
1263
1264                 //listeners
1265                 this.el.clicked.connect( () => {
1266                  
1267                         if (this.popup == null) {
1268                                 return;
1269                         }
1270                    
1271                     this.popup.show();
1272                   
1273                 });
1274             }
1275
1276             // user defined functions
1277             public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1278                 
1279                  if (nots.get_n_items() < 1 ) {
1280                         this.el.hide();
1281                         if (this.popup != null) {
1282                                 this.popup.el.hide();
1283                         }
1284                         return;
1285                 }
1286                 
1287                 this.el.show();
1288                 this.el.label = "%d/%d Errors".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1289             
1290                 
1291              
1292                 if (this.popup == null) {
1293                     this.popup = new Xcls_ValaCompileErrors();
1294                     this.popup.window = _this;
1295                   //    this.popup.el.set_transient_for( _this.el );
1296                     this.popup.el.set_parent(this.el);
1297                 }
1298                 this.popup.updateNotices(nots);
1299                  
1300             }
1301         }
1302
1303         public class Xcls_statusbar_warnings : Object
1304         {
1305             public Gtk.Button el;
1306             private Xcls_MainWindow  _this;
1307
1308
1309                 // my vars (def)
1310             public Xcls_ValaCompileErrors popup;
1311
1312             // ctor
1313             public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1314             {
1315                 _this = _owner;
1316                 _this.statusbar_warnings = this;
1317                 this.el = new Gtk.Button();
1318
1319                 // my vars (dec)
1320
1321                 // set gobject values
1322                 this.el.icon_name = "dialog-warning";
1323                 this.el.label = "0 Warnings";
1324
1325                 //listeners
1326                 this.el.clicked.connect( () => {
1327                  
1328                         if (this.popup == null) {
1329                                 return;
1330                         }
1331                    
1332                     this.popup.show();
1333                     return;
1334                 });
1335             }
1336
1337             // user defined functions
1338             public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1339                 
1340                  if (nots.get_n_items() < 1 ) {
1341                         this.el.hide();
1342                         if (this.popup != null) {
1343                                 this.popup.el.hide();
1344                         }
1345                         return;
1346                 }
1347                 
1348                 this.el.show();
1349                 this.el.label = "%d/%d Warnings".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1350             
1351                 
1352              
1353                 if (this.popup == null) {
1354                     this.popup = new Xcls_ValaCompileErrors();
1355                     this.popup.window = _this;
1356                   //    this.popup.el.set_transient_for( _this.el );
1357                     this.popup.el.set_parent(this.el);
1358                 }
1359                 this.popup.updateNotices(nots);
1360                  
1361             }
1362         }
1363
1364         public class Xcls_statusbar_depricated : Object
1365         {
1366             public Gtk.Button el;
1367             private Xcls_MainWindow  _this;
1368
1369
1370                 // my vars (def)
1371             public Xcls_ValaCompileErrors popup;
1372             public GLib.ListStore notices;
1373
1374             // ctor
1375             public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1376             {
1377                 _this = _owner;
1378                 _this.statusbar_depricated = this;
1379                 this.el = new Gtk.Button();
1380
1381                 // my vars (dec)
1382                 this.notices = null;
1383
1384                 // set gobject values
1385                 this.el.icon_name = "dialog-information";
1386                 this.el.label = "0 Depricated";
1387
1388                 //listeners
1389                 this.el.clicked.connect( () => {
1390                  
1391                         if (this.popup == null) {
1392                                 return;
1393                         }
1394                    
1395                     this.popup.show();
1396                   
1397                 });
1398             }
1399
1400             // user defined functions
1401             public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1402                 
1403                  if (nots.get_n_items() < 1 ) {
1404                         this.el.hide();
1405                         if (this.popup != null) {
1406                                 this.popup.el.hide();
1407                         }
1408                         return;
1409                 }
1410                 
1411                 this.el.show();
1412                 this.el.label = "%d/%d Depricated".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1413             
1414                 
1415              
1416                 if (this.popup == null) {
1417                     this.popup = new Xcls_ValaCompileErrors();
1418                     this.popup.window = _this;
1419                   //    this.popup.el.set_transient_for( _this.el );
1420                     this.popup.el.set_parent(this.el);
1421                 }
1422                 this.popup.updateNotices(nots);
1423                  
1424             }
1425         }
1426
1427         public class Xcls_statusbar_run : Object
1428         {
1429             public Gtk.Button el;
1430             private Xcls_MainWindow  _this;
1431
1432
1433                 // my vars (def)
1434             public Xcls_ValaCompileErrors popup;
1435
1436             // ctor
1437             public Xcls_statusbar_run(Xcls_MainWindow _owner )
1438             {
1439                 _this = _owner;
1440                 _this.statusbar_run = this;
1441                 this.el = new Gtk.Button();
1442
1443                 // my vars (dec)
1444
1445                 // set gobject values
1446                 this.el.icon_name = "media-playback-start";
1447                 this.el.label = "Run";
1448
1449                 //listeners
1450                 this.el.clicked.connect( () => {
1451                    
1452                    if (_this.windowstate.file == null) {
1453                                 return;
1454                         }
1455                    if (_this.statusbar_compile_spinner.el.spinning) {
1456                         _this.windowstate.compile_results.el.set_parent(this.el);
1457                             _this.windowstate.compile_results.el.show(); // show currently running.
1458                         return;
1459                         }
1460                         
1461                         var req = new Palete.ValaCompileRequest(
1462                                 Palete.ValaCompileRequestType.RUN,
1463                                 _this.windowstate.file,
1464                                 null,
1465                                 null,
1466                                 ""
1467                         );
1468                         req.run();
1469                          
1470                         _this.windowstate.compile_results.el.set_parent(this.el);
1471                         _this.windowstate.compile_results.show(this.el,true);
1472                                  
1473                 });
1474             }
1475
1476             // user defined functions
1477         }
1478
1479
1480         public class Xcls_statusbar_compile_spinner : Object
1481         {
1482             public Gtk.Spinner el;
1483             private Xcls_MainWindow  _this;
1484
1485
1486                 // my vars (def)
1487
1488             // ctor
1489             public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1490             {
1491                 _this = _owner;
1492                 _this.statusbar_compile_spinner = this;
1493                 this.el = new Gtk.Spinner();
1494
1495                 // my vars (dec)
1496
1497                 // set gobject values
1498                 this.el.margin_end = 4;
1499                 this.el.margin_start = 4;
1500                 this.el.tooltip_text = "Compiling";
1501             }
1502
1503             // user defined functions
1504             public void start () {
1505               this.el.show();
1506               this.el.start();  
1507               
1508                  
1509             }
1510             public void stop () {
1511              this.el.stop();
1512               this.el.hide();
1513                
1514             }
1515         }
1516
1517
1518
1519     }