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