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