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