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