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