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