src/Builder4/MainWindow.bjs
[app.Builder.js] / 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_vbox vbox;
16     public Xcls_mainpane mainpane;
17     public Xcls_leftpane leftpane;
18     public Xcls_editpane editpane;
19     public Xcls_tree tree;
20     public Xcls_props props;
21     public Xcls_clutterembed clutterembed;
22     public Xcls_rooview rooview;
23     public Xcls_objectview objectview;
24     public Xcls_codeeditview codeeditview;
25     public Xcls_addpropsview addpropsview;
26     public Xcls_projecteditview projecteditview;
27     public Xcls_buttonlayout buttonlayout;
28     public Xcls_backbutton backbutton;
29     public Xcls_projectbutton projectbutton;
30     public Xcls_editfilebutton editfilebutton;
31     public Xcls_projecteditbutton projecteditbutton;
32     public Xcls_objectshowbutton objectshowbutton;
33     public Xcls_addpropbutton addpropbutton;
34     public Xcls_addlistenerbutton addlistenerbutton;
35     public Xcls_addprojectbutton addprojectbutton;
36     public Xcls_addfilebutton addfilebutton;
37     public Xcls_delprojectbutton delprojectbutton;
38     public Xcls_new_window new_window;
39
40         // my vars (def)
41     public int no_windows;
42     public Project.Project project;
43     public bool children_loaded;
44     public Xcls_WindowLeftProjects left_projects;
45     public Xcls_WindowRooView window_rooview;
46     public Xcls_WindowLeftTree left_tree;
47     public Editor code_editor;
48     public Xcls_DialogNewComponent new_file_dialog;
49     public WindowState windowstate;
50     public Xcls_ProjectSettings projectsettings;
51     public Xcls_ClutterFiles clutterfiles;
52     public Xcls_LeftProps left_props;
53     public Xcls_RightPalete rightpalete;
54     public string title;
55     public ValaProjectSettings vala_projectsettings;
56     public Xcls_WindowAddProp add_props;
57     public Xcls_GtkView window_gladeview;
58
59     // ctor 
60     public Xcls_MainWindow()
61     {
62         _this = this;
63         this.el = new Gtk.Window( Gtk.WindowType.TOPLEVEL );
64
65         // my vars (dec)
66         this.no_windows = 1;
67         this.project = null;
68         this.children_loaded = false;
69         this.left_projects = null;
70         this.window_rooview = null;
71         this.left_tree = null;
72         this.code_editor = null;
73         this.new_file_dialog = null;
74         this.windowstate = null;
75         this.projectsettings = null;
76         this.clutterfiles = null;
77         this.left_props = null;
78         this.rightpalete = null;
79         this.title = "Application Builder";
80         this.vala_projectsettings = null;
81         this.add_props = null;
82         this.window_gladeview = null;
83
84         // set gobject values
85         this.el.border_width = 0;
86         this.el.default_height = 500;
87         this.el.default_width = 800;
88         var child_0 = new Xcls_vbox( _this );
89         child_0.ref();
90         this.el.add (  child_0.el  );
91
92         // init method 
93
94         this.state = "files";
95                   
96             //this.el.show_all();
97         // listeners 
98         this.el.delete_event.connect( (   event) => {
99             return false;
100         });
101         this.el.destroy.connect( () =>  {
102          Xcls_MainWindow.singleton().no_windows--;
103          
104          if (Xcls_MainWindow.singleton().no_windows < 1) {
105         
106              Gtk.main_quit();
107          }
108         });
109         this.el.show.connect( ( ) => {
110             // hide the file editing..
111            
112             //this.hideViewEditing();
113         });
114     }
115
116     // user defined functions 
117     public             void hideAddListener () {
118           _this.backbutton.el.hide();
119          _this.projectbutton.el.show(); 
120               _this.projecteditbutton.el.show();
121              _this.editfilebutton.el.show();   
122          _this.addpropsview.el.save_easing_state();
123         var el = _this.rooview.el;
124         el.save_easing_state();
125     
126         
127         el.set_scale(1.0f,1.0f);
128         _this.addpropsview.el.set_scale(0.0f,0.0f);
129         _this.state = "edit";
130     
131      
132         //_this.clutterfiles.loadProject(_this.project);
133     
134         el.restore_easing_state();
135          _this.addpropsview.el.restore_easing_state();  
136       }
137     public        void initChildren () {
138         // this needs putting in a better place..
139         this.windowstate = new WindowState(this);
140          
141     
142         //w.el.show_all();
143         var tl = new Clutter.Timeline(6000);
144         tl.set_repeat_count(-1);
145         tl.start();
146         tl.ref();
147     
148         this.children_loaded = true;
149     
150     
151     
152     
153     }
154     public             void hideCodeEdit () {
155         //this.code_editor.saveContents();
156          _this.backbutton.el.hide();
157     
158           _this.projectbutton.el.show(); 
159            _this.projecteditbutton.el.show();
160            _this.editfilebutton.el.show();   
161            
162            
163            
164          _this.codeeditview.el.save_easing_state();
165         var el = _this.rooview.el;
166         el.save_easing_state();
167     
168         
169         el.set_scale(1.0f,1.0f);
170         _this.codeeditview.el.set_scale(0.0f,0.0f);
171         _this.state = "edit";
172     
173      
174         //_this.clutterfiles.loadProject(_this.project);
175     
176         el.restore_easing_state();
177          _this.codeeditview.el.restore_easing_state();  
178      }
179     public             void showAddProp () {
180     
181          
182          var ae =      this.left_tree.getActiveElement();
183         if (ae == null) {
184             return;
185         }
186          _this.backbutton.el.show();
187            _this.projectbutton.el.hide();
188         _this.editfilebutton.el.hide();
189         _this.projecteditbutton.el.hide();    
190         
191          
192          
193         //this.rooview.el.hide();
194         this.add_props.el.show_all();
195         this.add_props.show(
196             Palete.factory(this.project.xtype), 
197             "props",
198             ae.fqn()
199         );
200     
201         _this.addpropsview.el.save_easing_state();
202             
203         var el = _this.rooview.el;
204         el.save_easing_state();
205         _this.clutterembed.setSizesAlloc("addprop");
206          
207          
208     
209         _this.addpropsview.el.set_scale(1.0f,1.0f);
210        
211        
212      
213         //_this.clutterfiles.loadProject(_this.project);
214     
215         el.restore_easing_state();
216         _this.addpropsview.el.restore_easing_state();
217         this.state = "addprop";
218     }
219     public             void showViewEditing ( )  {
220          this.editpane.el.show();
221       //   this.rooview.el.show();
222          this.left_projects.el.hide();
223         
224         _this.addprojectbutton.el.hide();   
225         _this.delprojectbutton.el.hide();
226         _this.addfilebutton.el.hide();       
227         _this.backbutton.el.hide();
228        _this.new_window.el.hide();      
229             
230             
231           _this.projectbutton.el.show();         
232         _this.editfilebutton.el.show();   
233        _this.projecteditbutton.el.show();
234       _this.objectshowbutton.el.show();
235       _this.addpropbutton.el.show();      
236       _this.addlistenerbutton.el.show();   
237     
238           
239         var el = _this.rooview.el;
240             el.save_easing_state();
241       
242         
243             el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
244             el.set_scale(1.0f,1.0f);
245             _this.state = "edit";
246            // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
247             _this.clutterfiles.el.hide();
248         
249         el.restore_easing_state();
250             
251         print("show view editing");
252     }
253     public             void hideProjectEdit () {
254         // return to editing state..
255            
256           _this.projectbutton.el.show();
257          _this.projecteditbutton.el.show();
258           _this.backbutton.el.hide();
259              _this.editfilebutton.el.show();   
260     
261          
262            if (this.project.xtype == "Roo") {
263             
264             //this.projectsettings.show(this.project);
265         } else {
266     
267             this.vala_projectsettings.project.writeConfig();
268         }
269         _this.projecteditview.el.save_easing_state();
270         var el = _this.rooview.el;
271         el.save_easing_state();
272     
273         
274         el.set_scale(1.0f,1.0f);
275            _this.projecteditview.el.set_scale(1.0f,0.0f);
276         _this.state = "edit";
277     
278      
279         //_this.clutterfiles.loadProject(_this.project);
280     
281         el.restore_easing_state();
282           _this.projecteditview.el.restore_easing_state();  
283       
284     }
285     public             void showProjectEdit () {
286         // make the browser smaller, and show the edit dialog
287         
288         
289          _this.projectbutton.el.hide();
290          _this.projecteditbutton.el.hide();
291          _this.editfilebutton.el.hide();
292          
293         _this.backbutton.el.show();
294          
295         //this.rooview.el.hide();
296         
297         
298         if (this.project.xtype == "Roo") {
299             this.projectsettings.el.show_all();
300             this.projectsettings.show(this.project);
301         } else {
302             this.vala_projectsettings.el.show_all();
303             this.vala_projectsettings.show((Project.Gtk)this.project);
304         }
305         _this.projecteditview.el.save_easing_state();
306             
307         var el = _this.rooview.el;
308         el.save_easing_state();
309        
310         
311         el.set_scale(0.5f,0.5f);
312     
313         _this.projecteditview.el.set_scale(1.0f,1.0f);
314        
315         _this.state = "projectedit";
316          
317      
318         //_this.clutterfiles.loadProject(_this.project);
319     
320         el.restore_easing_state();
321         _this.projecteditview.el.restore_easing_state();
322       //  print("show view browsing");
323         
324     }
325     public             void showAddListener () {
326     
327          
328          
329         var ae =      this.left_tree.getActiveElement();
330         if (ae == null) {
331             return;
332         }
333          
334        _this.backbutton.el.show();
335         _this.projectbutton.el.hide();
336         _this.editfilebutton.el.hide();
337         _this.projecteditbutton.el.hide();    
338         
339         
340         //this.rooview.el.hide();
341         this.add_props.el.show_all();
342         this.add_props.show(
343             Palete.factory(this.project.xtype), 
344             "signals",
345             ae.fqn()
346         );
347         //this.rightpalete.show(this.project);
348     
349         _this.addpropsview.el.save_easing_state();
350             
351         var el = _this.rooview.el;
352         el.save_easing_state();
353        
354           _this.clutterembed.setSizesAlloc("addlistener");
355     
356         
357       
358     
359         _this.addpropsview.el.set_scale(1.0f,1.0f);
360        
361        
362      
363         //_this.clutterfiles.loadProject(_this.project);
364     
365         el.restore_easing_state();
366         _this.addpropsview.el.restore_easing_state();
367         this.state = "addlistener";
368     }
369     public             void hideAddProp () {
370           _this.backbutton.el.hide();
371          _this.projectbutton.el.show(); 
372               _this.projecteditbutton.el.show();
373              _this.editfilebutton.el.show();   
374          _this.addpropsview.el.save_easing_state();
375          
376         var el = _this.rooview.el;
377         el.save_easing_state();
378     
379         
380         el.set_scale(1.0f,1.0f);
381         _this.addpropsview.el.set_scale(0.0f,0.0f);
382         _this.state = "edit";
383     
384      
385         //_this.clutterfiles.loadProject(_this.project);
386     
387         el.restore_easing_state();
388          _this.addpropsview.el.restore_easing_state();  
389      }
390     public             void showCodeEdit (JsRender.JsRender file, JsRender.Node node, string ptype, string key)
391     {
392         // this is a bit different,
393         // it's not called via a button - but triggered by the prop edit class signal.
394         // so it has to hide any other state..
395         
396         switch(this.state) {
397             case "object":
398                 this.hideObject();
399                 break;
400             case "addprop":
401                 this.hideAddProp();
402                 break;
403             case "addlistener":
404                 this.hideAddListener();
405                 break;
406         }
407      
408        _this.backbutton.el.show();
409        
410         _this.projectbutton.el.hide();
411         _this.editfilebutton.el.hide();
412         _this.projecteditbutton.el.hide();    
413        // more?? 
414          
415         //this.rooview.el.hide();
416         this.code_editor.el.show_all();
417         this.code_editor.show(
418             file,
419             node,
420             ptype,
421             key
422         );
423     
424         _this.codeeditview.el.save_easing_state();
425             
426         var el = _this.rooview.el;
427         el.save_easing_state();
428         _this.clutterembed.setSizesAlloc("codedit");
429        
430         _this.codeeditview.el.set_scale(1.0f,1.0f);
431        
432        
433      
434         //_this.clutterfiles.loadProject(_this.project);
435     
436         el.restore_easing_state();
437         _this.codeeditview.el.restore_easing_state();
438         this.state = "codeedit";
439     }
440     public             void setTitle (string str) {
441         this.el.set_title(this.title + " - " + str);
442     }
443     public             void show () {
444         this.left_tree =new Xcls_WindowLeftTree();
445         _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
446         this.el.show_all();
447     
448     }
449     public             void hideViewEditing ( )   {
450     
451     // show the file navigation...
452         this.windowstate.set(WindowState.State.FILES);
453     
454     }
455     public             void showObject () {
456     
457          
458         // what's the active node on the left hand side..
459         
460         var n = _this.left_tree.getActiveElement();
461     
462         if (_this.left_tree.model.file == null) {
463             return;
464         }
465         
466         if (n == null && _this.left_tree.model.file.tree != null) {
467             return;
468         }
469         
470          _this.backbutton.el.show();
471            _this.projectbutton.el.hide();
472         _this.editfilebutton.el.hide();
473         _this.projecteditbutton.el.hide();    
474         
475          
476         //this.rooview.el.hide();
477         this.rightpalete.el.show_all();
478         this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
479     
480         
481         //this.rightpalete.show(this.project);
482     
483         _this.objectview.el.save_easing_state();
484             
485         var el = _this.rooview.el;
486         el.save_easing_state();
487        
488          _this.clutterembed.setSizesAlloc("object");
489         
490     
491         _this.objectview.el.set_scale(1.0f,1.0f);
492        
493        
494      
495         //_this.clutterfiles.loadProject(_this.project);
496     
497         el.restore_easing_state();
498         _this.objectview.el.restore_easing_state();
499         this.state = "object";
500     }
501     public             void hideObject () {
502           // return to editing state..
503            
504               _this.projecteditbutton.el.show();
505           _this.backbutton.el.hide();
506          _this.projectbutton.el.show(); 
507              _this.editfilebutton.el.show();   
508          _this.objectview.el.save_easing_state();
509         var el = _this.rooview.el;
510         el.save_easing_state();
511     
512         
513         el.set_scale(1.0f,1.0f);
514         _this.objectview.el.set_scale(0.0f,0.0f);
515         _this.state = "edit";
516     
517      
518         //_this.clutterfiles.loadProject(_this.project);
519     
520         el.restore_easing_state();
521          _this.objectview.el.restore_easing_state();  
522      
523     
524     }
525     public class Xcls_vbox : Object 
526     {
527         public Gtk.VBox el;
528         private Xcls_MainWindow  _this;
529
530
531             // my vars (def)
532
533         // ctor 
534         public Xcls_vbox(Xcls_MainWindow _owner )
535         {
536             _this = _owner;
537             _this.vbox = this;
538             this.el = new Gtk.VBox( false, 0 );
539
540             // my vars (dec)
541
542             // set gobject values
543             var child_0 = new Xcls_mainpane( _this );
544             child_0.ref();
545             this.el.pack_end (  child_0.el , true,true,0 );
546         }
547
548         // user defined functions 
549     }
550     public class Xcls_mainpane : Object 
551     {
552         public Gtk.HPaned el;
553         private Xcls_MainWindow  _this;
554
555
556             // my vars (def)
557         public int lastWidth;
558
559         // ctor 
560         public Xcls_mainpane(Xcls_MainWindow _owner )
561         {
562             _this = _owner;
563             _this.mainpane = this;
564             this.el = new Gtk.HPaned();
565
566             // my vars (dec)
567             this.lastWidth = 0;
568
569             // set gobject values
570             this.el.position = 400;
571             var child_0 = new Xcls_leftpane( _this );
572             child_0.ref();
573             this.el.add1 (  child_0.el  );
574             var child_1 = new Xcls_VBox8( _this );
575             child_1.ref();
576             this.el.add2 (  child_1.el  );
577         }
578
579         // user defined functions 
580     }
581     public class Xcls_leftpane : Object 
582     {
583         public Gtk.VBox el;
584         private Xcls_MainWindow  _this;
585
586
587             // my vars (def)
588
589         // ctor 
590         public Xcls_leftpane(Xcls_MainWindow _owner )
591         {
592             _this = _owner;
593             _this.leftpane = this;
594             this.el = new Gtk.VBox( true, 0 );
595
596             // my vars (dec)
597
598             // set gobject values
599             var child_0 = new Xcls_editpane( _this );
600             child_0.ref();
601             this.el.pack_start (  child_0.el , false,true,0 );
602         }
603
604         // user defined functions 
605     }
606     public class Xcls_editpane : Object 
607     {
608         public Gtk.VPaned el;
609         private Xcls_MainWindow  _this;
610
611
612             // my vars (def)
613
614         // ctor 
615         public Xcls_editpane(Xcls_MainWindow _owner )
616         {
617             _this = _owner;
618             _this.editpane = this;
619             this.el = new Gtk.VPaned();
620
621             // my vars (dec)
622
623             // set gobject values
624             var child_0 = new Xcls_tree( _this );
625             child_0.ref();
626             this.el.add1 (  child_0.el  );
627             var child_1 = new Xcls_props( _this );
628             child_1.ref();
629             this.el.add2 (  child_1.el  );
630         }
631
632         // user defined functions 
633     }
634     public class Xcls_tree : Object 
635     {
636         public Gtk.VBox el;
637         private Xcls_MainWindow  _this;
638
639
640             // my vars (def)
641
642         // ctor 
643         public Xcls_tree(Xcls_MainWindow _owner )
644         {
645             _this = _owner;
646             _this.tree = this;
647             this.el = new Gtk.VBox( true, 0 );
648
649             // my vars (dec)
650
651             // set gobject values
652         }
653
654         // user defined functions 
655     }
656     public class Xcls_props : Object 
657     {
658         public Gtk.VBox el;
659         private Xcls_MainWindow  _this;
660
661
662             // my vars (def)
663
664         // ctor 
665         public Xcls_props(Xcls_MainWindow _owner )
666         {
667             _this = _owner;
668             _this.props = this;
669             this.el = new Gtk.VBox( true, 0 );
670
671             // my vars (dec)
672
673             // set gobject values
674         }
675
676         // user defined functions 
677     }
678     public class Xcls_VBox8 : Object 
679     {
680         public Gtk.VBox el;
681         private Xcls_MainWindow  _this;
682
683
684             // my vars (def)
685
686         // ctor 
687         public Xcls_VBox8(Xcls_MainWindow _owner )
688         {
689             _this = _owner;
690             this.el = new Gtk.VBox( true, 0 );
691
692             // my vars (dec)
693
694             // set gobject values
695             var child_0 = new Xcls_clutterembed( _this );
696             child_0.ref();
697             this.el.pack_start (  child_0.el , true,true,0 );
698         }
699
700         // user defined functions 
701     }
702     public class Xcls_clutterembed : Object 
703     {
704         public GtkClutter.Embed el;
705         private Xcls_MainWindow  _this;
706
707
708             // my vars (def)
709
710         // ctor 
711         public Xcls_clutterembed(Xcls_MainWindow _owner )
712         {
713             _this = _owner;
714             _this.clutterembed = this;
715             this.el = new GtkClutter.Embed();
716
717             // my vars (dec)
718
719             // set gobject values
720             var child_0 = new Xcls_rooview( _this );
721             child_0.ref();
722             this.el.get_stage().add_child (  child_0.el  );
723             var child_1 = new Xcls_objectview( _this );
724             child_1.ref();
725             this.el.get_stage().add_child (  child_1.el  );
726             var child_2 = new Xcls_codeeditview( _this );
727             child_2.ref();
728             this.el.get_stage().add_child (  child_2.el  );
729             var child_3 = new Xcls_addpropsview( _this );
730             child_3.ref();
731             this.el.get_stage().add_child (  child_3.el  );
732             var child_4 = new Xcls_projecteditview( _this );
733             child_4.ref();
734             this.el.get_stage().add_child (  child_4.el  );
735             var child_5 = new Xcls_buttonlayout( _this );
736             child_5.ref();
737             this.el.get_stage().add_child (  child_5.el  );
738
739             // init method 
740
741             var stage = this.el.get_stage();
742                 stage.set_background_color(  Clutter.Color.from_string("#000"));
743             // listeners 
744             this.el.size_allocate.connect( (  alloc) => {
745                 this.windowstate.resizeCanvasElements(alloc); 
746                     
747             });
748         }
749
750         // user defined functions 
751     }
752     public class Xcls_rooview : Object 
753     {
754         public GtkClutter.Actor el;
755         private Xcls_MainWindow  _this;
756
757
758             // my vars (def)
759
760         // ctor 
761         public Xcls_rooview(Xcls_MainWindow _owner )
762         {
763             _this = _owner;
764             _this.rooview = this;
765             this.el = new GtkClutter.Actor();
766
767             // my vars (dec)
768
769             // set gobject values
770
771             // init method 
772
773             {
774                
775                
776                 this.el.add_constraint(
777                     new Clutter.AlignConstraint(
778                         _this.clutterembed.el.get_stage(), 
779                         Clutter.AlignAxis.X_AXIS,
780                         1.0f
781                     )
782                 );
783                     
784                 //this.el.set_position(100,100);
785                 this.el.set_pivot_point(1.0f,1.0f);
786                 
787                 this.el.set_size(_this.clutterembed.el.get_stage().width-50,
788                         _this.clutterembed.el.get_stage().height);
789                         
790             }        }
791
792         // user defined functions 
793     }
794     public class Xcls_objectview : Object 
795     {
796         public GtkClutter.Actor el;
797         private Xcls_MainWindow  _this;
798
799
800             // my vars (def)
801
802         // ctor 
803         public Xcls_objectview(Xcls_MainWindow _owner )
804         {
805             _this = _owner;
806             _this.objectview = this;
807             this.el = new GtkClutter.Actor();
808
809             // my vars (dec)
810
811             // set gobject values
812
813             // init method 
814
815             {
816                
817                /*
818                 this.el.add_constraint(
819                     new Clutter.AlignConstraint(
820                         _this.clutterembed.el.get_stage(), 
821                         Clutter.AlignAxis.X_AXIS,
822                         0.0f
823                     )
824                 );
825                 */
826                 this.el.fixed_x = 50.0f;
827                 this.el.fixed_y = 0.0f;
828                 //this.el.set_position(100,100);
829                 this.el.set_pivot_point(0.0f,0.0f);
830                 this.el.set_scale(0.0f,1.0f);
831                 this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
832                         _this.clutterembed.el.get_stage().height);
833                         
834             }        }
835
836         // user defined functions 
837     }
838     public class Xcls_codeeditview : Object 
839     {
840         public GtkClutter.Actor el;
841         private Xcls_MainWindow  _this;
842
843
844             // my vars (def)
845
846         // ctor 
847         public Xcls_codeeditview(Xcls_MainWindow _owner )
848         {
849             _this = _owner;
850             _this.codeeditview = this;
851             this.el = new GtkClutter.Actor();
852
853             // my vars (dec)
854
855             // set gobject values
856
857             // init method 
858
859             {
860                
861                /*
862                 this.el.add_constraint(
863                     new Clutter.AlignConstraint(
864                         _this.clutterembed.el.get_stage(), 
865                         Clutter.AlignAxis.X_AXIS,
866                         0.0f
867                     )
868                 );
869                 */
870                 this.el.fixed_x = 50.0f;
871                 this.el.fixed_y = 0.0f;
872                 //this.el.set_position(100,100);
873                 this.el.set_pivot_point(0.0f,0.0f);
874                 this.el.set_scale(0.0f,1.0f);
875                 this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
876                         _this.clutterembed.el.get_stage().height);
877                         
878             }        }
879
880         // user defined functions 
881     }
882     public class Xcls_addpropsview : Object 
883     {
884         public GtkClutter.Actor el;
885         private Xcls_MainWindow  _this;
886
887
888             // my vars (def)
889
890         // ctor 
891         public Xcls_addpropsview(Xcls_MainWindow _owner )
892         {
893             _this = _owner;
894             _this.addpropsview = this;
895             this.el = new GtkClutter.Actor();
896
897             // my vars (dec)
898
899             // set gobject values
900
901             // init method 
902
903             {
904                
905                /*
906                 this.el.add_constraint(
907                     new Clutter.AlignConstraint(
908                         _this.clutterembed.el.get_stage(), 
909                         Clutter.AlignAxis.X_AXIS,
910                         0.0f
911                     )
912                 );
913                 */
914                 this.el.fixed_x = 50.0f;
915                 this.el.fixed_y = 0.0f;
916                 //this.el.set_position(100,100);
917                 this.el.set_pivot_point(0.0f,0.0f);
918                 this.el.set_scale(0.0f,1.0f);
919                 this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
920                         _this.clutterembed.el.get_stage().height);
921                         
922             }        }
923
924         // user defined functions 
925     }
926     public class Xcls_projecteditview : Object 
927     {
928         public GtkClutter.Actor el;
929         private Xcls_MainWindow  _this;
930
931
932             // my vars (def)
933
934         // ctor 
935         public Xcls_projecteditview(Xcls_MainWindow _owner )
936         {
937             _this = _owner;
938             _this.projecteditview = this;
939             this.el = new GtkClutter.Actor();
940
941             // my vars (dec)
942
943             // set gobject values
944
945             // init method 
946
947             {
948                
949                
950                 this.el.add_constraint(
951                     new Clutter.AlignConstraint(
952                         _this.clutterembed.el.get_stage(), 
953                         Clutter.AlignAxis.X_AXIS,
954                         1.0f
955                     )
956                 );
957                     
958                 //this.el.set_position(100,100);
959                 this.el.set_pivot_point(0.0f,0.0f);
960                 this.el.set_scale(1.0f,0.0f);
961                 this.el.set_size(_this.clutterembed.el.get_stage().width-50,
962                         _this.clutterembed.el.get_stage().height /2);
963                         
964             }        }
965
966         // user defined functions 
967     }
968     public class Xcls_buttonlayout : Object 
969     {
970         public Clutter.Actor el;
971         private Xcls_MainWindow  _this;
972
973
974             // my vars (def)
975
976         // ctor 
977         public Xcls_buttonlayout(Xcls_MainWindow _owner )
978         {
979             _this = _owner;
980             _this.buttonlayout = this;
981             this.el = new Clutter.Actor();
982
983             // my vars (dec)
984
985             // set gobject values
986             var child_0 = new Xcls_BoxLayout16( _this );
987             child_0.ref();
988             this.el.layout_manager = child_0.el;
989             var child_1 = new Xcls_backbutton( _this );
990             child_1.ref();
991             this.el.add_child (  child_1.el  );
992             var child_2 = new Xcls_projectbutton( _this );
993             child_2.ref();
994             this.el.add_child (  child_2.el  );
995             var child_3 = new Xcls_editfilebutton( _this );
996             child_3.ref();
997             this.el.add_child (  child_3.el  );
998             var child_4 = new Xcls_projecteditbutton( _this );
999             child_4.ref();
1000             this.el.add_child (  child_4.el  );
1001             var child_5 = new Xcls_objectshowbutton( _this );
1002             child_5.ref();
1003             this.el.add_child (  child_5.el  );
1004             var child_6 = new Xcls_addpropbutton( _this );
1005             child_6.ref();
1006             this.el.add_child (  child_6.el  );
1007             var child_7 = new Xcls_addlistenerbutton( _this );
1008             child_7.ref();
1009             this.el.add_child (  child_7.el  );
1010             var child_8 = new Xcls_addprojectbutton( _this );
1011             child_8.ref();
1012             this.el.add_child (  child_8.el  );
1013             var child_9 = new Xcls_addfilebutton( _this );
1014             child_9.ref();
1015             this.el.add_child (  child_9.el  );
1016             var child_10 = new Xcls_delprojectbutton( _this );
1017             child_10.ref();
1018             this.el.add_child (  child_10.el  );
1019             var child_11 = new Xcls_new_window( _this );
1020             child_11.ref();
1021             this.el.add_child (  child_11.el  );
1022
1023             // init method 
1024
1025             {
1026                 
1027                 this.el.add_constraint(
1028                     new Clutter.AlignConstraint(
1029                         _this.clutterembed.el.get_stage(), 
1030                         Clutter.AlignAxis.X_AXIS,
1031                         0.0f
1032                     )
1033                 );
1034                  
1035                 
1036                 //this.el.set_position(100,100);
1037                 this.el.set_pivot_point(0.5f,0.5f);
1038                  this.el.set_size(50,
1039                        _this.clutterembed.el.get_stage().height);
1040                  
1041             }        }
1042
1043         // user defined functions 
1044     }
1045     public class Xcls_BoxLayout16 : Object 
1046     {
1047         public Clutter.BoxLayout el;
1048         private Xcls_MainWindow  _this;
1049
1050
1051             // my vars (def)
1052
1053         // ctor 
1054         public Xcls_BoxLayout16(Xcls_MainWindow _owner )
1055         {
1056             _this = _owner;
1057             this.el = new Clutter.BoxLayout();
1058
1059             // my vars (dec)
1060
1061             // set gobject values
1062             this.el.orientation = Clutter.Orientation.VERTICAL;
1063         }
1064
1065         // user defined functions 
1066     }
1067     public class Xcls_backbutton : Object 
1068     {
1069         public Clutter.Actor el;
1070         private Xcls_MainWindow  _this;
1071
1072
1073             // my vars (def)
1074
1075         // ctor 
1076         public Xcls_backbutton(Xcls_MainWindow _owner )
1077         {
1078             _this = _owner;
1079             _this.backbutton = this;
1080             this.el = new Clutter.Actor();
1081
1082             // my vars (dec)
1083
1084             // set gobject values
1085             var child_0 = new Xcls_Actor18( _this );
1086             child_0.ref();
1087             this.el.add_child (  child_0.el  );
1088
1089             // init method 
1090
1091             this.el.set_size(50,50);        }
1092
1093         // user defined functions 
1094     }
1095     public class Xcls_Actor18 : Object 
1096     {
1097         public GtkClutter.Actor el;
1098         private Xcls_MainWindow  _this;
1099
1100
1101             // my vars (def)
1102
1103         // ctor 
1104         public Xcls_Actor18(Xcls_MainWindow _owner )
1105         {
1106             _this = _owner;
1107             this.el = new GtkClutter.Actor();
1108
1109             // my vars (dec)
1110
1111             // set gobject values
1112             var child_0 = new Xcls_Button19( _this );
1113             child_0.ref();
1114
1115             // init method 
1116
1117             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1118
1119         // user defined functions 
1120     }
1121     public class Xcls_Button19 : Object 
1122     {
1123         public Gtk.Button el;
1124         private Xcls_MainWindow  _this;
1125
1126
1127             // my vars (def)
1128
1129         // ctor 
1130         public Xcls_Button19(Xcls_MainWindow _owner )
1131         {
1132             _this = _owner;
1133             this.el = new Gtk.Button();
1134
1135             // my vars (dec)
1136
1137             // set gobject values
1138             this.el.width_request = 50;
1139             this.el.height_request = 50;
1140             this.el.tooltip_text = "Back";
1141             var child_0 = new Xcls_Image20( _this );
1142             child_0.ref();
1143             this.el.set_image (  child_0.el  );
1144
1145             // listeners 
1146             this.el.clicked.connect( ( ) => {
1147               
1148                 this.windowstate.switchState(WindowState.State.PREVIEW);
1149                 
1150             
1151             });
1152         }
1153
1154         // user defined functions 
1155     }
1156     public class Xcls_Image20 : Object 
1157     {
1158         public Gtk.Image el;
1159         private Xcls_MainWindow  _this;
1160
1161
1162             // my vars (def)
1163
1164         // ctor 
1165         public Xcls_Image20(Xcls_MainWindow _owner )
1166         {
1167             _this = _owner;
1168             this.el = new Gtk.Image();
1169
1170             // my vars (dec)
1171
1172             // set gobject values
1173             this.el.icon_name = "go-previous";
1174         }
1175
1176         // user defined functions 
1177     }
1178     public class Xcls_projectbutton : Object 
1179     {
1180         public Clutter.Actor el;
1181         private Xcls_MainWindow  _this;
1182
1183
1184             // my vars (def)
1185
1186         // ctor 
1187         public Xcls_projectbutton(Xcls_MainWindow _owner )
1188         {
1189             _this = _owner;
1190             _this.projectbutton = this;
1191             this.el = new Clutter.Actor();
1192
1193             // my vars (dec)
1194
1195             // set gobject values
1196             var child_0 = new Xcls_Actor22( _this );
1197             child_0.ref();
1198             this.el.add_child (  child_0.el  );
1199
1200             // init method 
1201
1202             this.el.set_size(50,50);        }
1203
1204         // user defined functions 
1205     }
1206     public class Xcls_Actor22 : Object 
1207     {
1208         public GtkClutter.Actor el;
1209         private Xcls_MainWindow  _this;
1210
1211
1212             // my vars (def)
1213
1214         // ctor 
1215         public Xcls_Actor22(Xcls_MainWindow _owner )
1216         {
1217             _this = _owner;
1218             this.el = new GtkClutter.Actor();
1219
1220             // my vars (dec)
1221
1222             // set gobject values
1223             var child_0 = new Xcls_Button23( _this );
1224             child_0.ref();
1225
1226             // init method 
1227
1228             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1229
1230         // user defined functions 
1231     }
1232     public class Xcls_Button23 : Object 
1233     {
1234         public Gtk.Button el;
1235         private Xcls_MainWindow  _this;
1236
1237
1238             // my vars (def)
1239
1240         // ctor 
1241         public Xcls_Button23(Xcls_MainWindow _owner )
1242         {
1243             _this = _owner;
1244             this.el = new Gtk.Button();
1245
1246             // my vars (dec)
1247
1248             // set gobject values
1249             this.el.width_request = 50;
1250             this.el.height_request = 50;
1251             var child_0 = new Xcls_Image24( _this );
1252             child_0.ref();
1253             this.el.set_image (  child_0.el  );
1254
1255             // listeners 
1256             this.el.clicked.connect( ( ) => {
1257                this.windowstate.switchState(WindowState.State.PROJECT);
1258                   
1259             
1260             });
1261         }
1262
1263         // user defined functions 
1264     }
1265     public class Xcls_Image24 : Object 
1266     {
1267         public Gtk.Image el;
1268         private Xcls_MainWindow  _this;
1269
1270
1271             // my vars (def)
1272
1273         // ctor 
1274         public Xcls_Image24(Xcls_MainWindow _owner )
1275         {
1276             _this = _owner;
1277             this.el = new Gtk.Image();
1278
1279             // my vars (dec)
1280
1281             // set gobject values
1282             this.el.icon_name = "document-open";
1283         }
1284
1285         // user defined functions 
1286     }
1287     public class Xcls_editfilebutton : Object 
1288     {
1289         public Clutter.Actor el;
1290         private Xcls_MainWindow  _this;
1291
1292
1293             // my vars (def)
1294
1295         // ctor 
1296         public Xcls_editfilebutton(Xcls_MainWindow _owner )
1297         {
1298             _this = _owner;
1299             _this.editfilebutton = this;
1300             this.el = new Clutter.Actor();
1301
1302             // my vars (dec)
1303
1304             // set gobject values
1305             var child_0 = new Xcls_Actor26( _this );
1306             child_0.ref();
1307             this.el.add_child (  child_0.el  );
1308
1309             // init method 
1310
1311             this.el.set_size(50.0f,50.0f);        }
1312
1313         // user defined functions 
1314     }
1315     public class Xcls_Actor26 : Object 
1316     {
1317         public GtkClutter.Actor el;
1318         private Xcls_MainWindow  _this;
1319
1320
1321             // my vars (def)
1322
1323         // ctor 
1324         public Xcls_Actor26(Xcls_MainWindow _owner )
1325         {
1326             _this = _owner;
1327             this.el = new GtkClutter.Actor();
1328
1329             // my vars (dec)
1330
1331             // set gobject values
1332             var child_0 = new Xcls_Button27( _this );
1333             child_0.ref();
1334
1335             // init method 
1336
1337             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1338
1339         // user defined functions 
1340     }
1341     public class Xcls_Button27 : Object 
1342     {
1343         public Gtk.Button el;
1344         private Xcls_MainWindow  _this;
1345
1346
1347             // my vars (def)
1348
1349         // ctor 
1350         public Xcls_Button27(Xcls_MainWindow _owner )
1351         {
1352             _this = _owner;
1353             this.el = new Gtk.Button();
1354
1355             // my vars (dec)
1356
1357             // set gobject values
1358             this.el.width_request = 50;
1359             this.el.height_request = 50;
1360             this.el.tooltip_text = "File Details";
1361             var child_0 = new Xcls_Image28( _this );
1362             child_0.ref();
1363             this.el.set_image (  child_0.el  );
1364
1365             // listeners 
1366             this.el.clicked.connect( ( ) => {
1367               
1368                 // create a new file in project..
1369                 if (_this.project == null || _this.left_tree.model.file == null) {
1370                     return  ;
1371                 }
1372                  this.windowstate.new_file_dialog.show(_this.left_tree.model.file);
1373                  
1374                 return  ;    
1375             
1376             
1377             });
1378         }
1379
1380         // user defined functions 
1381     }
1382     public class Xcls_Image28 : Object 
1383     {
1384         public Gtk.Image el;
1385         private Xcls_MainWindow  _this;
1386
1387
1388             // my vars (def)
1389
1390         // ctor 
1391         public Xcls_Image28(Xcls_MainWindow _owner )
1392         {
1393             _this = _owner;
1394             this.el = new Gtk.Image();
1395
1396             // my vars (dec)
1397
1398             // set gobject values
1399             this.el.icon_name = "document-properties";
1400         }
1401
1402         // user defined functions 
1403     }
1404     public class Xcls_projecteditbutton : Object 
1405     {
1406         public Clutter.Actor el;
1407         private Xcls_MainWindow  _this;
1408
1409
1410             // my vars (def)
1411
1412         // ctor 
1413         public Xcls_projecteditbutton(Xcls_MainWindow _owner )
1414         {
1415             _this = _owner;
1416             _this.projecteditbutton = this;
1417             this.el = new Clutter.Actor();
1418
1419             // my vars (dec)
1420
1421             // set gobject values
1422             var child_0 = new Xcls_Actor30( _this );
1423             child_0.ref();
1424             this.el.add_child (  child_0.el  );
1425
1426             // init method 
1427
1428             this.el.set_size(50,50);        }
1429
1430         // user defined functions 
1431     }
1432     public class Xcls_Actor30 : Object 
1433     {
1434         public GtkClutter.Actor el;
1435         private Xcls_MainWindow  _this;
1436
1437
1438             // my vars (def)
1439
1440         // ctor 
1441         public Xcls_Actor30(Xcls_MainWindow _owner )
1442         {
1443             _this = _owner;
1444             this.el = new GtkClutter.Actor();
1445
1446             // my vars (dec)
1447
1448             // set gobject values
1449             var child_0 = new Xcls_Button31( _this );
1450             child_0.ref();
1451
1452             // init method 
1453
1454             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1455
1456         // user defined functions 
1457     }
1458     public class Xcls_Button31 : Object 
1459     {
1460         public Gtk.Button el;
1461         private Xcls_MainWindow  _this;
1462
1463
1464             // my vars (def)
1465
1466         // ctor 
1467         public Xcls_Button31(Xcls_MainWindow _owner )
1468         {
1469             _this = _owner;
1470             this.el = new Gtk.Button();
1471
1472             // my vars (dec)
1473
1474             // set gobject values
1475             this.el.width_request = 50;
1476             this.el.height_request = 50;
1477             this.el.tooltip_text = "Project Details";
1478             var child_0 = new Xcls_Image32( _this );
1479             child_0.ref();
1480             this.el.set_image (  child_0.el  );
1481
1482             // listeners 
1483             this.el.clicked.connect( ( ) => {
1484                 switch (_this.state) {
1485                     case "edit":
1486                         _this.showProjectEdit();
1487                         break;  
1488                     case "files":
1489                         // _this.showViewEditing();
1490                         break; 
1491                     case "projectedit":
1492                         _this.hideProjectEdit();
1493                         break;
1494                         
1495                         
1496                           
1497                     case "addprop":
1498                         _this.hideAddProp();
1499                         _this.showProjectEdit();
1500                         break;
1501                     case "addlistener":
1502                         _this.hideAddListener();
1503                         _this.showProjectEdit();
1504                         break;
1505                          
1506                      case "object":
1507                         _this.hideObject();
1508                         _this.showProjectEdit();    
1509                         break;
1510                     default:
1511                         break;
1512                 }
1513                 return  ;    
1514             
1515             
1516             });
1517         }
1518
1519         // user defined functions 
1520     }
1521     public class Xcls_Image32 : Object 
1522     {
1523         public Gtk.Image el;
1524         private Xcls_MainWindow  _this;
1525
1526
1527             // my vars (def)
1528
1529         // ctor 
1530         public Xcls_Image32(Xcls_MainWindow _owner )
1531         {
1532             _this = _owner;
1533             this.el = new Gtk.Image();
1534
1535             // my vars (dec)
1536
1537             // set gobject values
1538             this.el.icon_name = "emblem-system";
1539         }
1540
1541         // user defined functions 
1542     }
1543     public class Xcls_objectshowbutton : Object 
1544     {
1545         public Clutter.Actor el;
1546         private Xcls_MainWindow  _this;
1547
1548
1549             // my vars (def)
1550
1551         // ctor 
1552         public Xcls_objectshowbutton(Xcls_MainWindow _owner )
1553         {
1554             _this = _owner;
1555             _this.objectshowbutton = this;
1556             this.el = new Clutter.Actor();
1557
1558             // my vars (dec)
1559
1560             // set gobject values
1561             var child_0 = new Xcls_Actor34( _this );
1562             child_0.ref();
1563             this.el.add_child (  child_0.el  );
1564
1565             // init method 
1566
1567             this.el.set_size(50,50);
1568             // listeners 
1569             this.el.button_press_event.connect( ( ) => {
1570                 
1571                 
1572                 
1573                 switch (_this.state) {
1574             
1575              
1576                     case "addprop":
1577                         _this.hideAddProp();
1578                         _this.showObject();
1579                         break;
1580                 case "addlistener":
1581                         _this.hideAddListener();
1582                         _this.showObject();
1583                         break;
1584             
1585             // show            
1586                     case "edit":
1587                         _this.showObject();
1588                         break;
1589                         
1590             // hide            
1591                     case "object":
1592                         _this.hideObject();
1593                         break;
1594                         break;
1595                                     
1596                     default:
1597                         print("unhandled add objects from %s\n",_this.state);
1598                         break;
1599                 }
1600                 return false;    
1601             
1602             
1603             });
1604             this.el.enter_event.connect( (  event)  => {
1605                 this.el.background_color = new Clutter.Color.from_string("#333");
1606                     return false;
1607             });
1608             this.el.leave_event.connect( (  event)  => {
1609                 this.el.background_color = new Clutter.Color.from_string("#000");
1610                 return false;
1611             });
1612         }
1613
1614         // user defined functions 
1615     }
1616     public class Xcls_Actor34 : Object 
1617     {
1618         public GtkClutter.Actor el;
1619         private Xcls_MainWindow  _this;
1620
1621
1622             // my vars (def)
1623
1624         // ctor 
1625         public Xcls_Actor34(Xcls_MainWindow _owner )
1626         {
1627             _this = _owner;
1628             this.el = new GtkClutter.Actor();
1629
1630             // my vars (dec)
1631
1632             // set gobject values
1633             var child_0 = new Xcls_Button35( _this );
1634             child_0.ref();
1635
1636             // init method 
1637
1638             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1639
1640         // user defined functions 
1641     }
1642     public class Xcls_Button35 : Object 
1643     {
1644         public Gtk.Button el;
1645         private Xcls_MainWindow  _this;
1646
1647
1648             // my vars (def)
1649
1650         // ctor 
1651         public Xcls_Button35(Xcls_MainWindow _owner )
1652         {
1653             _this = _owner;
1654             this.el = new Gtk.Button();
1655
1656             // my vars (dec)
1657
1658             // set gobject values
1659             this.el.width_request = 50;
1660             this.el.height_request = 50;
1661             this.el.tooltip_text = "Add Child Element";
1662             var child_0 = new Xcls_Image36( _this );
1663             child_0.ref();
1664             this.el.set_image (  child_0.el  );
1665
1666             // listeners 
1667             this.el.clicked.connect( ( ) => {
1668                 
1669                 
1670                 
1671                 switch (_this.state) {
1672             
1673              
1674                     case "addprop":
1675                         _this.hideAddProp();
1676                         _this.showObject();
1677                         break;
1678                 case "addlistener":
1679                         _this.hideAddListener();
1680                         _this.showObject();
1681                         break;
1682             
1683             // show            
1684                     case "edit":
1685                         _this.showObject();
1686                         break;
1687                         
1688             // hide            
1689                     case "object":
1690                         _this.hideObject();
1691                         break;
1692                         break;
1693                                     
1694                     default:
1695                         print("unhandled add objects from %s\n",_this.state);
1696                         break;
1697                 }
1698                 return  ;    
1699             
1700             
1701             });
1702         }
1703
1704         // user defined functions 
1705     }
1706     public class Xcls_Image36 : Object 
1707     {
1708         public Gtk.Image el;
1709         private Xcls_MainWindow  _this;
1710
1711
1712             // my vars (def)
1713
1714         // ctor 
1715         public Xcls_Image36(Xcls_MainWindow _owner )
1716         {
1717             _this = _owner;
1718             this.el = new Gtk.Image();
1719
1720             // my vars (dec)
1721
1722             // set gobject values
1723             this.el.icon_name = "list-add";
1724         }
1725
1726         // user defined functions 
1727     }
1728     public class Xcls_addpropbutton : Object 
1729     {
1730         public Clutter.Actor el;
1731         private Xcls_MainWindow  _this;
1732
1733
1734             // my vars (def)
1735
1736         // ctor 
1737         public Xcls_addpropbutton(Xcls_MainWindow _owner )
1738         {
1739             _this = _owner;
1740             _this.addpropbutton = this;
1741             this.el = new Clutter.Actor();
1742
1743             // my vars (dec)
1744
1745             // set gobject values
1746             var child_0 = new Xcls_Actor38( _this );
1747             child_0.ref();
1748             this.el.add_child (  child_0.el  );
1749
1750             // init method 
1751
1752             this.el.set_size(50,50);        }
1753
1754         // user defined functions 
1755     }
1756     public class Xcls_Actor38 : Object 
1757     {
1758         public GtkClutter.Actor el;
1759         private Xcls_MainWindow  _this;
1760
1761
1762             // my vars (def)
1763
1764         // ctor 
1765         public Xcls_Actor38(Xcls_MainWindow _owner )
1766         {
1767             _this = _owner;
1768             this.el = new GtkClutter.Actor();
1769
1770             // my vars (dec)
1771
1772             // set gobject values
1773             var child_0 = new Xcls_Button39( _this );
1774             child_0.ref();
1775
1776             // init method 
1777
1778             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1779
1780         // user defined functions 
1781     }
1782     public class Xcls_Button39 : Object 
1783     {
1784         public Gtk.Button el;
1785         private Xcls_MainWindow  _this;
1786
1787
1788             // my vars (def)
1789
1790         // ctor 
1791         public Xcls_Button39(Xcls_MainWindow _owner )
1792         {
1793             _this = _owner;
1794             this.el = new Gtk.Button();
1795
1796             // my vars (dec)
1797
1798             // set gobject values
1799             this.el.width_request = 50;
1800             this.el.height_request = 50;
1801             this.el.tooltip_text = "Add Property";
1802             var child_0 = new Xcls_Image40( _this );
1803             child_0.ref();
1804             this.el.set_image (  child_0.el  );
1805
1806             // listeners 
1807             this.el.clicked.connect( ( ) => {
1808                 
1809                 
1810                 
1811                 switch (_this.state) {
1812                     case "edit":
1813                         _this.showAddProp();
1814                         break;
1815                         
1816                     case "object":
1817                         _this.hideObject();
1818                         _this.showAddProp();
1819                         break;
1820                    
1821                     case "addlistener":
1822                         _this.hideAddListener();
1823                         _this.showAddProp();            
1824                         break;
1825                         
1826                         
1827                     case "addprop":
1828                         _this.hideAddProp();
1829                         break;
1830                         
1831                     default:
1832                         print("unhandled add property from %s\n",_this.state);
1833                         break;
1834                         
1835                 }
1836                 return  ;    
1837             
1838             
1839             });
1840         }
1841
1842         // user defined functions 
1843     }
1844     public class Xcls_Image40 : Object 
1845     {
1846         public Gtk.Image el;
1847         private Xcls_MainWindow  _this;
1848
1849
1850             // my vars (def)
1851
1852         // ctor 
1853         public Xcls_Image40(Xcls_MainWindow _owner )
1854         {
1855             _this = _owner;
1856             this.el = new Gtk.Image();
1857
1858             // my vars (dec)
1859
1860             // set gobject values
1861             this.el.icon_name = "format-justify-left";
1862         }
1863
1864         // user defined functions 
1865     }
1866     public class Xcls_addlistenerbutton : Object 
1867     {
1868         public Clutter.Actor el;
1869         private Xcls_MainWindow  _this;
1870
1871
1872             // my vars (def)
1873
1874         // ctor 
1875         public Xcls_addlistenerbutton(Xcls_MainWindow _owner )
1876         {
1877             _this = _owner;
1878             _this.addlistenerbutton = this;
1879             this.el = new Clutter.Actor();
1880
1881             // my vars (dec)
1882
1883             // set gobject values
1884             var child_0 = new Xcls_Actor42( _this );
1885             child_0.ref();
1886             this.el.add_child (  child_0.el  );
1887
1888             // init method 
1889
1890             this.el.set_size(50,50);        }
1891
1892         // user defined functions 
1893     }
1894     public class Xcls_Actor42 : Object 
1895     {
1896         public GtkClutter.Actor el;
1897         private Xcls_MainWindow  _this;
1898
1899
1900             // my vars (def)
1901
1902         // ctor 
1903         public Xcls_Actor42(Xcls_MainWindow _owner )
1904         {
1905             _this = _owner;
1906             this.el = new GtkClutter.Actor();
1907
1908             // my vars (dec)
1909
1910             // set gobject values
1911             var child_0 = new Xcls_Button43( _this );
1912             child_0.ref();
1913
1914             // init method 
1915
1916             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
1917
1918         // user defined functions 
1919     }
1920     public class Xcls_Button43 : Object 
1921     {
1922         public Gtk.Button el;
1923         private Xcls_MainWindow  _this;
1924
1925
1926             // my vars (def)
1927
1928         // ctor 
1929         public Xcls_Button43(Xcls_MainWindow _owner )
1930         {
1931             _this = _owner;
1932             this.el = new Gtk.Button();
1933
1934             // my vars (dec)
1935
1936             // set gobject values
1937             this.el.width_request = 50;
1938             this.el.height_request = 50;
1939             this.el.tooltip_text = "Add Event Code";
1940             var child_0 = new Xcls_Image44( _this );
1941             child_0.ref();
1942             this.el.set_image (  child_0.el  );
1943
1944             // listeners 
1945             this.el.clicked.connect( ( ) => {
1946                 
1947                 
1948                 
1949                 switch (_this.state) {
1950                     case "edit":
1951                         _this.showAddListener();
1952                         break;
1953                         
1954                    
1955                     case "addlistener":
1956                         _this.hideAddListener();
1957                         break;
1958             
1959                         
1960                     case "addprop":
1961                         _this.hideAddProp();
1962                         _this.showAddListener();
1963                         break;
1964                      case "object":
1965                         _this.hideObject();
1966                         _this.showAddListener();
1967                         break;
1968                 
1969                       default:
1970                         print("unhandled add listener from %s\n",_this.state);
1971             
1972                         break;
1973                         
1974                 }
1975                 return  ;    
1976             
1977             
1978             });
1979         }
1980
1981         // user defined functions 
1982     }
1983     public class Xcls_Image44 : Object 
1984     {
1985         public Gtk.Image el;
1986         private Xcls_MainWindow  _this;
1987
1988
1989             // my vars (def)
1990
1991         // ctor 
1992         public Xcls_Image44(Xcls_MainWindow _owner )
1993         {
1994             _this = _owner;
1995             this.el = new Gtk.Image();
1996
1997             // my vars (dec)
1998
1999             // set gobject values
2000             this.el.icon_name = "appointment-new";
2001         }
2002
2003         // user defined functions 
2004     }
2005     public class Xcls_addprojectbutton : Object 
2006     {
2007         public Clutter.Actor el;
2008         private Xcls_MainWindow  _this;
2009
2010
2011             // my vars (def)
2012
2013         // ctor 
2014         public Xcls_addprojectbutton(Xcls_MainWindow _owner )
2015         {
2016             _this = _owner;
2017             _this.addprojectbutton = this;
2018             this.el = new Clutter.Actor();
2019
2020             // my vars (dec)
2021
2022             // set gobject values
2023             var child_0 = new Xcls_Actor46( _this );
2024             child_0.ref();
2025             this.el.add_child (  child_0.el  );
2026
2027             // init method 
2028
2029             this.el.set_size(50.0f,50.0f);        }
2030
2031         // user defined functions 
2032     }
2033     public class Xcls_Actor46 : Object 
2034     {
2035         public GtkClutter.Actor el;
2036         private Xcls_MainWindow  _this;
2037
2038
2039             // my vars (def)
2040
2041         // ctor 
2042         public Xcls_Actor46(Xcls_MainWindow _owner )
2043         {
2044             _this = _owner;
2045             this.el = new GtkClutter.Actor();
2046
2047             // my vars (dec)
2048
2049             // set gobject values
2050             var child_0 = new Xcls_Button47( _this );
2051             child_0.ref();
2052
2053             // init method 
2054
2055             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
2056
2057         // user defined functions 
2058     }
2059     public class Xcls_Button47 : Object 
2060     {
2061         public Gtk.Button el;
2062         private Xcls_MainWindow  _this;
2063
2064
2065             // my vars (def)
2066
2067         // ctor 
2068         public Xcls_Button47(Xcls_MainWindow _owner )
2069         {
2070             _this = _owner;
2071             this.el = new Gtk.Button();
2072
2073             // my vars (dec)
2074
2075             // set gobject values
2076             this.el.width_request = 50;
2077             this.el.height_request = 50;
2078             this.el.tooltip_text = "New\nProj.";
2079             var child_0 = new Xcls_Image48( _this );
2080             child_0.ref();
2081             this.el.set_image (  child_0.el  );
2082
2083             // listeners 
2084             this.el.clicked.connect( ( ) => {
2085               
2086                 // create a new file in project..
2087                 //Xcls_DialogNewComponent.singleton().show(
2088                var  pe =     Xcls_EditProject.singleton();
2089                 pe.el.set_transient_for(_this.el);
2090                 pe.el.set_modal(true);   
2091                
2092                 var p  = pe.show();
2093             
2094                 if (p == null) {
2095                     return;
2096                 }
2097                 _this.left_projects.is_loaded = false;    
2098                 _this.left_projects.load();
2099                 _this.left_projects.selectProject(p);
2100                 return  ;    
2101             
2102             
2103             });
2104         }
2105
2106         // user defined functions 
2107     }
2108     public class Xcls_Image48 : Object 
2109     {
2110         public Gtk.Image el;
2111         private Xcls_MainWindow  _this;
2112
2113
2114             // my vars (def)
2115
2116         // ctor 
2117         public Xcls_Image48(Xcls_MainWindow _owner )
2118         {
2119             _this = _owner;
2120             this.el = new Gtk.Image();
2121
2122             // my vars (dec)
2123
2124             // set gobject values
2125             this.el.icon_name = "folder-new";
2126         }
2127
2128         // user defined functions 
2129     }
2130     public class Xcls_addfilebutton : Object 
2131     {
2132         public Clutter.Actor el;
2133         private Xcls_MainWindow  _this;
2134
2135
2136             // my vars (def)
2137
2138         // ctor 
2139         public Xcls_addfilebutton(Xcls_MainWindow _owner )
2140         {
2141             _this = _owner;
2142             _this.addfilebutton = this;
2143             this.el = new Clutter.Actor();
2144
2145             // my vars (dec)
2146
2147             // set gobject values
2148             var child_0 = new Xcls_Actor50( _this );
2149             child_0.ref();
2150             this.el.add_child (  child_0.el  );
2151
2152             // init method 
2153
2154             this.el.set_size(50.0f,50.0f);        }
2155
2156         // user defined functions 
2157     }
2158     public class Xcls_Actor50 : Object 
2159     {
2160         public GtkClutter.Actor el;
2161         private Xcls_MainWindow  _this;
2162
2163
2164             // my vars (def)
2165
2166         // ctor 
2167         public Xcls_Actor50(Xcls_MainWindow _owner )
2168         {
2169             _this = _owner;
2170             this.el = new GtkClutter.Actor();
2171
2172             // my vars (dec)
2173
2174             // set gobject values
2175             var child_0 = new Xcls_Button51( _this );
2176             child_0.ref();
2177
2178             // init method 
2179
2180             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
2181
2182         // user defined functions 
2183     }
2184     public class Xcls_Button51 : Object 
2185     {
2186         public Gtk.Button el;
2187         private Xcls_MainWindow  _this;
2188
2189
2190             // my vars (def)
2191
2192         // ctor 
2193         public Xcls_Button51(Xcls_MainWindow _owner )
2194         {
2195             _this = _owner;
2196             this.el = new Gtk.Button();
2197
2198             // my vars (dec)
2199
2200             // set gobject values
2201             this.el.width_request = 50;
2202             this.el.height_request = 50;
2203             this.el.tooltip_text = "Add File";
2204             var child_0 = new Xcls_Image52( _this );
2205             child_0.ref();
2206             this.el.set_image (  child_0.el  );
2207
2208             // listeners 
2209             this.el.clicked.connect( () => {
2210                 // create a new file in project..
2211                 
2212                 // what's the currently selected project...
2213                 var proj = _this.left_projects.getSelectedProject();
2214                 
2215                 if (proj == null) {
2216                     return  ;
2217                 }
2218                 
2219                 
2220                 
2221                 var f = JsRender.JsRender.factory(proj.xtype,  proj, "");
2222                 _this.project = proj;
2223                 _this.new_file_dialog.show(f);
2224                 
2225                 return  ;    
2226             });
2227         }
2228
2229         // user defined functions 
2230     }
2231     public class Xcls_Image52 : Object 
2232     {
2233         public Gtk.Image el;
2234         private Xcls_MainWindow  _this;
2235
2236
2237             // my vars (def)
2238
2239         // ctor 
2240         public Xcls_Image52(Xcls_MainWindow _owner )
2241         {
2242             _this = _owner;
2243             this.el = new Gtk.Image();
2244
2245             // my vars (dec)
2246
2247             // set gobject values
2248             this.el.icon_name = "document-new";
2249         }
2250
2251         // user defined functions 
2252     }
2253     public class Xcls_delprojectbutton : Object 
2254     {
2255         public Clutter.Actor el;
2256         private Xcls_MainWindow  _this;
2257
2258
2259             // my vars (def)
2260
2261         // ctor 
2262         public Xcls_delprojectbutton(Xcls_MainWindow _owner )
2263         {
2264             _this = _owner;
2265             _this.delprojectbutton = this;
2266             this.el = new Clutter.Actor();
2267
2268             // my vars (dec)
2269
2270             // set gobject values
2271             var child_0 = new Xcls_Actor54( _this );
2272             child_0.ref();
2273             this.el.add_child (  child_0.el  );
2274
2275             // init method 
2276
2277             this.el.set_size(50,50);        }
2278
2279         // user defined functions 
2280     }
2281     public class Xcls_Actor54 : Object 
2282     {
2283         public GtkClutter.Actor el;
2284         private Xcls_MainWindow  _this;
2285
2286
2287             // my vars (def)
2288
2289         // ctor 
2290         public Xcls_Actor54(Xcls_MainWindow _owner )
2291         {
2292             _this = _owner;
2293             this.el = new GtkClutter.Actor();
2294
2295             // my vars (dec)
2296
2297             // set gobject values
2298             var child_0 = new Xcls_Button55( _this );
2299             child_0.ref();
2300
2301             // init method 
2302
2303             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
2304
2305         // user defined functions 
2306     }
2307     public class Xcls_Button55 : Object 
2308     {
2309         public Gtk.Button el;
2310         private Xcls_MainWindow  _this;
2311
2312
2313             // my vars (def)
2314
2315         // ctor 
2316         public Xcls_Button55(Xcls_MainWindow _owner )
2317         {
2318             _this = _owner;
2319             this.el = new Gtk.Button();
2320
2321             // my vars (dec)
2322
2323             // set gobject values
2324             this.el.width_request = 50;
2325             this.el.height_request = 50;
2326             this.el.tooltip_text = "Delelte Project";
2327             var child_0 = new Xcls_Image56( _this );
2328             child_0.ref();
2329             this.el.set_image (  child_0.el  );
2330
2331             // listeners 
2332             this.el.clicked.connect( ( ) => {
2333                  
2334                  var cd = DialogConfirm.singleton();
2335                  cd.el.set_transient_for(_this.el);
2336                 cd.el.set_modal(true);
2337             
2338                  var project =   _this.left_projects.getSelectedProject();
2339                 if (project == null) {
2340                     print("SKIP - no project\n");
2341                     return;
2342                 }
2343                 
2344                     
2345                  if (Gtk.ResponseType.YES != cd.show("Confirm", 
2346                     "Are you sure you want to delete project %s".printf(project.name))) {
2347                     return;
2348                 }
2349                  
2350             
2351                 // confirm?
2352                 Project.Project.remove(project);
2353                 _this.project = null;
2354                 
2355                 _this.left_projects.is_loaded =  false;
2356                 _this.left_projects.load();
2357                 _this.clutterfiles.clearFiles();
2358             
2359             });
2360         }
2361
2362         // user defined functions 
2363     }
2364     public class Xcls_Image56 : Object 
2365     {
2366         public Gtk.Image el;
2367         private Xcls_MainWindow  _this;
2368
2369
2370             // my vars (def)
2371
2372         // ctor 
2373         public Xcls_Image56(Xcls_MainWindow _owner )
2374         {
2375             _this = _owner;
2376             this.el = new Gtk.Image();
2377
2378             // my vars (dec)
2379
2380             // set gobject values
2381             this.el.icon_name = "user-trash";
2382         }
2383
2384         // user defined functions 
2385     }
2386     public class Xcls_new_window : Object 
2387     {
2388         public Clutter.Actor el;
2389         private Xcls_MainWindow  _this;
2390
2391
2392             // my vars (def)
2393
2394         // ctor 
2395         public Xcls_new_window(Xcls_MainWindow _owner )
2396         {
2397             _this = _owner;
2398             _this.new_window = this;
2399             this.el = new Clutter.Actor();
2400
2401             // my vars (dec)
2402
2403             // set gobject values
2404             var child_0 = new Xcls_Actor58( _this );
2405             child_0.ref();
2406             this.el.add_child (  child_0.el  );
2407
2408             // init method 
2409
2410             this.el.set_size(50,50);        }
2411
2412         // user defined functions 
2413     }
2414     public class Xcls_Actor58 : Object 
2415     {
2416         public GtkClutter.Actor el;
2417         private Xcls_MainWindow  _this;
2418
2419
2420             // my vars (def)
2421
2422         // ctor 
2423         public Xcls_Actor58(Xcls_MainWindow _owner )
2424         {
2425             _this = _owner;
2426             this.el = new GtkClutter.Actor();
2427
2428             // my vars (dec)
2429
2430             // set gobject values
2431             var child_0 = new Xcls_Button59( _this );
2432             child_0.ref();
2433
2434             // init method 
2435
2436             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);        }
2437
2438         // user defined functions 
2439     }
2440     public class Xcls_Button59 : Object 
2441     {
2442         public Gtk.Button el;
2443         private Xcls_MainWindow  _this;
2444
2445
2446             // my vars (def)
2447
2448         // ctor 
2449         public Xcls_Button59(Xcls_MainWindow _owner )
2450         {
2451             _this = _owner;
2452             this.el = new Gtk.Button();
2453
2454             // my vars (dec)
2455
2456             // set gobject values
2457             this.el.width_request = 50;
2458             this.el.height_request = 50;
2459             this.el.tooltip_text = "Open New Window";
2460             var child_0 = new Xcls_Image60( _this );
2461             child_0.ref();
2462             this.el.set_image (  child_0.el  );
2463
2464             // listeners 
2465             this.el.clicked.connect( ( ) => {
2466                     Xcls_MainWindow.singleton().no_windows++;
2467                     var w = new Xcls_MainWindow();
2468                     w.ref();
2469             
2470                     w.el.show_all();
2471                     w.initChildren();
2472                     w.hideViewEditing();
2473             });
2474         }
2475
2476         // user defined functions 
2477     }
2478     public class Xcls_Image60 : Object 
2479     {
2480         public Gtk.Image el;
2481         private Xcls_MainWindow  _this;
2482
2483
2484             // my vars (def)
2485
2486         // ctor 
2487         public Xcls_Image60(Xcls_MainWindow _owner )
2488         {
2489             _this = _owner;
2490             this.el = new Gtk.Image();
2491
2492             // my vars (dec)
2493
2494             // set gobject values
2495             this.el.icon_name = "window-new";
2496         }
2497
2498         // user defined functions 
2499     }
2500 }