Builder4/MainWindow.bjs
[app.Builder.js] / Builder4 / MainWindow.vala
1 /* -- to compile
2 valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0  --pkg  libwnck-3.0 \
3     /tmp/MainWindow.vala  -o /tmp/MainWindow
4 */
5
6
7 /* -- to test class
8 static int main (string[] args) {
9     Gtk.init (ref args);
10     new Xcls_MainWindow();
11     MainWindow.show_all();
12      Gtk.main ();
13     return 0;
14 }
15 */
16
17
18 public static Xcls_MainWindow  MainWindow;
19
20 public class Xcls_MainWindow : Object 
21 {
22     public Gtk.Window el;
23     private Xcls_MainWindow  _this;
24
25     public static Xcls_MainWindow singleton()
26     {
27         if (MainWindow == null) {
28             MainWindow= new Xcls_MainWindow();
29         }
30         return MainWindow;
31     }
32     public Xcls_vbox vbox;
33     public Xcls_topbar topbar;
34     public Xcls_mainpane mainpane;
35     public Xcls_leftpane leftpane;
36     public Xcls_editpane editpane;
37     public Xcls_tree tree;
38     public Xcls_props props;
39     public Xcls_clutterembed clutterembed;
40     public Xcls_rooview rooview;
41     public Xcls_objectview objectview;
42     public Xcls_codeeditview codeeditview;
43     public Xcls_addpropsview addpropsview;
44     public Xcls_projecteditview projecteditview;
45     public Xcls_buttonlayout buttonlayout;
46     public Xcls_projectbutton projectbutton;
47     public Xcls_projecteditbutton projecteditbutton;
48     public Xcls_objectshowbutton objectshowbutton;
49     public Xcls_addpropbutton addpropbutton;
50     public Xcls_addlistenerbutton addlistenerbutton;
51
52         // my vars
53     public Project.Project project;
54     public Xcls_ClutterFiles clutterfiles;
55     public Xcls_Editor code_editor;
56     public Xcls_GladeView window_gladeview;
57     public Xcls_LeftProps left_props;
58     public Xcls_ProjectSettings projectsettings;
59     public Xcls_RightPalete rightpalete;
60     public Xcls_WindowAddProp add_props;
61     public Xcls_WindowLeftProjects left_projects;
62     public Xcls_WindowLeftTree left_tree;
63     public Xcls_WindowRooView window_rooview;
64     public bool children_loaded;
65     public string state;
66     public string title;
67
68         // ctor 
69     public Xcls_MainWindow()
70     {
71         _this = this;
72         this.el = new Gtk.Window( Gtk.WindowType.TOPLEVEL );
73
74         // my vars
75         this.project = null;
76         this.clutterfiles = null;
77         this.code_editor = null;
78         this.window_gladeview = null;
79         this.left_props = null;
80         this.projectsettings = null;
81         this.rightpalete = null;
82         this.add_props = null;
83         this.left_projects = null;
84         this.left_tree = null;
85         this.window_rooview = null;
86         this.children_loaded = false;
87         this.title = "Application Builder";
88
89         // set gobject values
90         this.el.border_width = 0;
91         this.el.default_height = 500;
92         this.el.default_width = 800;
93         var child_0 = new Xcls_vbox( _this );
94         child_0.ref();
95         this.el.add (  child_0.el  );
96
97         // init method 
98          this.state = "files";
99                   
100             //this.el.show_all();
101             
102             
103
104         // listeners 
105         this.el.show.connect(   ( ) => {
106             // hide the file editing..
107            
108             //this.hideViewEditing();
109         } );
110         this.el.delete_event.connect(   (   event) => {
111             return false;
112         } );
113         this.el.destroy.connect( => ()
114         {
115          Gtk.main_quit();
116         } );
117     }
118
119     // userdefined functions 
120     public void hideAddListener() {
121              _this.addpropsview.el.save_easing_state();
122             var el = _this.rooview.el;
123             el.save_easing_state();
124         
125             
126             el.set_scale(1.0f,1.0f);
127             _this.addpropsview.el.set_scale(0.0f,0.0f);
128             _this.state = "edit";
129         
130          
131             //_this.clutterfiles.loadProject(_this.project);
132         
133             el.restore_easing_state();
134              _this.addpropsview.el.restore_easing_state();  
135           }
136     public void hideAddProp() {
137              _this.addpropsview.el.save_easing_state();
138             var el = _this.rooview.el;
139             el.save_easing_state();
140         
141             
142             el.set_scale(1.0f,1.0f);
143             _this.addpropsview.el.set_scale(0.0f,0.0f);
144             _this.state = "edit";
145         
146          
147             //_this.clutterfiles.loadProject(_this.project);
148         
149             el.restore_easing_state();
150              _this.addpropsview.el.restore_easing_state();  
151          }
152     public void hideCodeEdit() {
153             //this.code_editor.saveContents();
154            
155              _this.codeeditview.el.save_easing_state();
156             var el = _this.rooview.el;
157             el.save_easing_state();
158         
159             
160             el.set_scale(1.0f,1.0f);
161             _this.codeeditview.el.set_scale(0.0f,0.0f);
162             _this.state = "edit";
163         
164          
165             //_this.clutterfiles.loadProject(_this.project);
166         
167             el.restore_easing_state();
168              _this.codeeditview.el.restore_easing_state();  
169          }
170     public void hideObject() {
171               // return to editing state..
172                
173              
174         
175         
176              
177              _this.objectview.el.save_easing_state();
178             var el = _this.rooview.el;
179             el.save_easing_state();
180         
181             
182             el.set_scale(1.0f,1.0f);
183             _this.objectview.el.set_scale(0.0f,0.0f);
184             _this.state = "edit";
185         
186          
187             //_this.clutterfiles.loadProject(_this.project);
188         
189             el.restore_easing_state();
190              _this.objectview.el.restore_easing_state();  
191          
192         
193         }
194     public void hideProjectEdit () {
195             // return to editing state..
196                
197               _this.projectbutton.el.show();
198              _this.projecteditbutton.el.show();
199              
200              
201             //this.rooview.el.hide();
202              //this.edit_project.el.show();
203                 _this.projecteditview.el.save_easing_state();
204             var el = _this.rooview.el;
205             el.save_easing_state();
206         
207             
208             el.set_scale(1.0f,1.0f);
209                _this.projecteditview.el.set_scale(1.0f,0.0f);
210             _this.state = "edit";
211         
212          
213             //_this.clutterfiles.loadProject(_this.project);
214         
215             el.restore_easing_state();
216               _this.projecteditview.el.restore_easing_state();  
217           
218         }
219     public void hideViewEditing  ( )   {
220           
221             if (this.left_tree.getActiveFile() != null) {
222                  if (this.left_tree.getActiveFile().xtype == "Roo" ) {
223                      this.window_rooview.createThumb();
224                  } else {
225                       this.window_gladeview.createThumb();
226                   }
227               }
228               _this.projecteditbutton.el.hide();
229              this.editpane.el.hide();
230             //this.rooview.el.hide();
231              this.left_projects.el.show();
232             
233             var el = _this.rooview.el;
234             el.save_easing_state();
235               el.set_easing_duration(1000);
236             // show project / file view..
237             //_this.mainpane.lastWidth = _this.leftpane.el.get_position();
238             //_this.mainpane.el.set_position(0);
239             // rotate y 180..
240             el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 360.0f);
241             el.set_scale(0.0f,0.0f);
242            
243                 _this.state = "files";
244         
245             _this.left_projects.selectProject(_this.project);
246             //_this.clutterfiles.loadProject(_this.project);
247         
248             el.restore_easing_state();
249                 
250             print("show view browsing");
251         }
252     public void initChildren () {
253             // this needs putting in a better place..
254             
255             print("init children");
256             this.left_tree = new Xcls_WindowLeftTree();
257             this.left_tree.ref();
258             this.tree.el.pack_start(this.left_tree.el,true, true,0);
259             this.left_tree.el.show_all();
260            
261             this.left_tree.before_node_change.connect(() => {
262                 if (this.state != "codeedit") {
263                     this.left_props.finish_editing();
264                     return true;
265                 }
266                 if (!this.code_editor.saveContents()) {
267                     return false;
268                 }
269                 return false;
270             
271             });
272             
273             this.left_tree.node_selected.connect((sel) => {
274                 
275                 print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
276                 
277                 if (sel == null) {
278                     this.left_props.el.hide();
279                 } 
280                 this.left_props.el.show();
281                 this.left_props.load(this.left_tree.getActiveFile(), sel);
282                 switch (this.state) {
283                     case "object": 
284                           
285                          if (sel == null) {
286                             this.rightpalete.clear();
287                             break;
288                         }
289                         this.rightpalete.load(_this.left_tree.getActiveFile().palete(), sel.fqn());
290                         break;
291                          
292                         
293                    case "addprop":
294                         if (sel == null) {
295                             this.add_props.clear();
296                             break;
297                         }
298                         this.add_props.show(_this.left_tree.getActiveFile().palete(), "props", sel.fqn());
299                         break;
300                         
301                    case "addlistener":
302                         if (sel == null) {
303                             this.add_props.clear();
304                             break;
305                         }
306                         this.add_props.show(_this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
307                         break;
308         
309                    case "codeedit":
310                        
311                         this.hideCodeEdit();
312                         break;
313                        
314                                         
315                 }
316                 return  ;
317                   
318             });
319             
320              this.left_tree.changed.connect(() => {
321                this.window_rooview.requestRedraw();
322             });
323              
324             
325         
326             // left properties
327         
328             this.left_props =new Xcls_LeftProps();
329             this.left_props.ref();
330             this.props.el.pack_start(this.left_props.el,true, true,0);
331             this.left_props.el.show_all();
332             
333             this.left_props.show_editor.connect( (file, node, type,  key) => {
334                 this.showCodeEdit(node, type,  key);
335             });
336             this.left_props.stop_editor.connect( () => {
337                 if (this.state != "codeedit") {
338                     return true;
339                 }
340             
341                 var ret =  this.code_editor.saveContents();
342                 if (!ret) {
343                     return false;
344                 }
345                 this.hideCodeEdit();
346                 return ret;
347             });
348              this.left_props.changed.connect(() => {
349                   if (this.left_tree.getActiveFile().xtype == "Roo" ) {
350                        this.window_rooview.requestRedraw();
351                    } else {
352                       this.window_gladeview.loadFile(this.left_tree.getActiveFile());
353                   }
354             });
355             
356         
357         
358         
359             // left projects..
360              this.left_projects = new Xcls_WindowLeftProjects();
361              this.left_projects.ref();
362              this.leftpane.el.pack_start(this.left_projects.el,true, true,0);
363              this.left_projects.el.show_all();
364              this.left_projects.project_selected.connect((proj) => {
365                 proj.scanDirs();
366                 _this.clutterfiles.loadProject(proj);
367             
368              });
369             
370            
371             // project edit..
372             this.projectsettings  =new Xcls_ProjectSettings();
373             this.projectsettings.ref();  /// really?
374             ((Gtk.Container)(this.projecteditview.el.get_widget())).add(this.projectsettings.el);
375             //this.projectsettings.el.show_all();
376         
377             var stage = _this.projecteditview.el.get_stage();
378             stage.set_background_color(  Clutter.Color.from_string("#000"));
379             
380              this.projectsettings.buttonPressed.connect((btn) => {
381                  if (this.left_tree.getActiveFile().xtype == "Roo" ) {
382                  
383                     if (btn == "save") {
384                          _this.window_rooview.view.renderJS(true);
385                     }
386                     if (btn == "apply") {
387                         _this.window_rooview.view.renderJS(true);
388                         return;
389                     }
390                 } else {
391                     // do nothing for gtk..
392                 }
393                 this.hideProjectEdit();
394                  
395              });
396             
397             
398             // objects (palate..)
399             this.rightpalete  = new Xcls_RightPalete();
400             this.rightpalete.ref();  /// really?
401             ((Gtk.Container)(this.objectview.el.get_widget())).add(this.rightpalete.el);
402             //this.projectsettings.el.show_all();
403         
404             stage = _this.objectview.el.get_stage();
405             stage.set_background_color(  Clutter.Color.from_string("#000"));
406             
407             /*this.projectsettings.buttonPressed.connect((btn) => {
408                 if (btn == "save") {
409                      _this.window_rooview.view.renderJS(true);
410                 }
411                 if (btn == "apply") {
412                     _this.window_rooview.view.renderJS(true);
413                     return;
414                 }
415                 this.hideProjectEdit();
416                  
417              });
418             */
419             
420             
421               
422             // Add properties
423             this.add_props  = new Xcls_WindowAddProp();
424             this.add_props.ref();  /// really?
425             ((Gtk.Container)(this.addpropsview.el.get_widget())).add(this.add_props.el);
426             //this.projectsettings.el.show_all();
427         
428             stage = _this.addpropsview.el.get_stage();
429             stage.set_background_color(  Clutter.Color.from_string("#000"));
430             
431             
432             _this.add_props.select.connect( (key,type,skel, etype) => {
433                 this.left_props.addProp(etype, key, skel, type);
434             });
435             
436             // editor
437             
438             
439             this.code_editor  = new Xcls_Editor();
440             this.code_editor.ref();  /// really?
441             ((Gtk.Container)(this.codeeditview.el.get_widget())).add(this.code_editor.el);
442             //this.projectsettings.el.show_all();
443         
444             stage = _this.codeeditview.el.get_stage();
445             stage.set_background_color(  Clutter.Color.from_string("#000"));
446             // editor.save...
447         
448             
449             
450              
451             
452             
453             //  roo view
454             
455              this.window_rooview  =new Xcls_WindowRooView();
456             this.window_rooview.ref();
457             ((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_rooview.el);
458             this.window_rooview.el.show_all();
459         
460             stage = _this.rooview.el.get_stage();
461             stage.set_background_color(  Clutter.Color.from_string("#000"));
462             
463               
464             //  glade view
465             
466             this.window_gladeview  =new Xcls_GladeView();
467             this.window_gladeview.ref();
468         
469             //((Gtk.Container)(this.rooview.el.get_widget())).add(this.window_gladeview.el);
470             ///this.window_gladeview.el.hide();
471         
472            
473             
474             // clutter files
475             
476             
477             this.clutterfiles = new Xcls_ClutterFiles();
478             this.clutterfiles.ref();
479             stage.add_child(this.clutterfiles.el);
480             this.clutterfiles.el.show_all();
481         
482         
483             this.clutterfiles.open.connect((file) => { 
484                 _this.project = file.project;
485                 _this.showViewEditing();
486                 this.left_tree.model.loadFile(file);
487                 var ctr= ((Gtk.Container)(this.rooview.el.get_widget()));
488                 if (file.xtype == "Roo" ) { 
489                     ctr.foreach( (w) => { ctr.remove(w); });
490                     ctr.add(this.window_rooview.el);
491                     this.window_rooview.loadFile(file);
492                     
493                     this.window_rooview.el.show_all();
494                 } else {
495                     ctr.foreach( (w) => { ctr.remove(w); });
496                     ctr.add(this.window_gladeview.el);
497                     this.window_gladeview.loadFile(file);
498                     this.window_gladeview.el.show_all();
499                 }
500                 print("OPEN : " + file.name);
501         
502             });
503         
504         
505         
506         
507         
508         
509             //w.el.show_all();
510             var tl = new Clutter.Timeline(6000);
511             tl.set_repeat_count(-1);
512             tl.start();
513             tl.ref();
514         
515             this.children_loaded = true;
516         
517         
518         
519         
520         }
521     public void setTitle (string str) {
522             this.el.set_title(this.title + " - " + str);
523         }
524     public void show() {
525             this.left_tree =new Xcls_WindowLeftTree();
526             _this.vbox.el.pack_start(this.left_tree.el,true, true,0);
527             this.el.show_all();
528         
529         }
530     public void showAddListener() {
531         
532              
533              
534             var ae =      this.left_tree.getActiveElement();
535             if (ae == null) {
536                 return;
537             }
538              
539             //this.rooview.el.hide();
540             this.add_props.el.show_all();
541             this.add_props.show(
542                 Palete.factory(this.project.xtype), 
543                 "signals",
544                 ae.fqn()
545             );
546             //this.rightpalete.show(this.project);
547         
548             _this.addpropsview.el.save_easing_state();
549                 
550             var el = _this.rooview.el;
551             el.save_easing_state();
552            
553             
554             el.set_scale(0.5f,0.5f);
555         
556             _this.addpropsview.el.set_scale(1.0f,1.0f);
557            
558            
559          
560             //_this.clutterfiles.loadProject(_this.project);
561         
562             el.restore_easing_state();
563             _this.addpropsview.el.restore_easing_state();
564             this.state = "addlistener";
565         }
566     public void showAddProp() {
567         
568              
569              var ae =      this.left_tree.getActiveElement();
570             if (ae == null) {
571                 return;
572             }
573              
574              
575              
576              
577             //this.rooview.el.hide();
578             this.add_props.el.show_all();
579             this.add_props.show(
580                 Palete.factory(this.project.xtype), 
581                 "props",
582                 ae.fqn()
583             );
584         
585             _this.addpropsview.el.save_easing_state();
586                 
587             var el = _this.rooview.el;
588             el.save_easing_state();
589            
590             
591             el.set_scale(0.5f,0.5f);
592         
593             _this.addpropsview.el.set_scale(1.0f,1.0f);
594            
595            
596          
597             //_this.clutterfiles.loadProject(_this.project);
598         
599             el.restore_easing_state();
600             _this.addpropsview.el.restore_easing_state();
601             this.state = "addprop";
602         }
603     public void showCodeEdit(JsRender.Node node, string ptype, string key)
604         {
605             // this is a bit different,
606             // it's not called via a button - but triggered by the prop edit class signal.
607             // so it has to hide any other state..
608             
609             switch(this.state) {
610                 case "object":
611                     this.hideObject();
612                     break;
613                 case "addprop":
614                     this.hideAddProp();
615                     break;
616                 case "addlistener":
617                     this.hideAddListener();
618                     break;
619             }
620          
621          
622              
623              
624             //this.rooview.el.hide();
625             this.code_editor.el.show_all();
626             this.code_editor.show(
627                 node,
628                 ptype,
629                 key
630             );
631         
632             _this.codeeditview.el.save_easing_state();
633                 
634             var el = _this.rooview.el;
635             el.save_easing_state();
636            
637             
638             el.set_scale(0.5f,0.5f);
639         
640             _this.codeeditview.el.set_scale(1.0f,1.0f);
641            
642            
643          
644             //_this.clutterfiles.loadProject(_this.project);
645         
646             el.restore_easing_state();
647             _this.codeeditview.el.restore_easing_state();
648             this.state = "codeedit";
649         }
650     public void showObject() {
651         
652              
653             // what's the active node on the left hand side..
654             
655             var n = _this.left_tree.getActiveElement();
656             if (n == null) {
657                 return;
658             }
659             
660              
661              
662              
663             //this.rooview.el.hide();
664             this.rightpalete.el.show_all();
665             this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n.fqn());
666         
667             
668             //this.rightpalete.show(this.project);
669         
670             _this.objectview.el.save_easing_state();
671                 
672             var el = _this.rooview.el;
673             el.save_easing_state();
674            
675             
676             el.set_scale(0.5f,0.5f);
677         
678             _this.objectview.el.set_scale(1.0f,1.0f);
679            
680            
681          
682             //_this.clutterfiles.loadProject(_this.project);
683         
684             el.restore_easing_state();
685             _this.objectview.el.restore_easing_state();
686             this.state = "object";
687         }
688     public void showProjectEdit () {
689             // make the browser smaller, and show the edit dialog
690             
691             
692              _this.projectbutton.el.hide();
693              _this.projecteditbutton.el.hide();
694              
695              
696             //this.rooview.el.hide();
697             this.projectsettings.el.show_all();
698             this.projectsettings.show(this.project);
699             _this.projecteditview.el.save_easing_state();
700                 
701             var el = _this.rooview.el;
702             el.save_easing_state();
703            
704             
705             el.set_scale(0.5f,0.5f);
706         
707             _this.projecteditview.el.set_scale(1.0f,1.0f);
708            
709             _this.state = "projectedit";
710              
711          
712             //_this.clutterfiles.loadProject(_this.project);
713         
714             el.restore_easing_state();
715             _this.projecteditview.el.restore_easing_state();
716           //  print("show view browsing");
717             
718         }
719     public void showViewEditing  ( )  {
720              this.editpane.el.show();
721           //   this.rooview.el.show();
722              this.left_projects.el.hide();
723             
724                _this.projecteditbutton.el.show();
725             
726             var el = _this.rooview.el;
727                 el.save_easing_state();
728           
729             
730                 el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
731                 el.set_scale(1.0f,1.0f);
732                 _this.state = "edit";
733                // _this.mainpane.el.set_position(_this.leftpane.lastWidth);
734                 _this.clutterfiles.el.hide();
735             
736             el.restore_easing_state();
737                 
738             print("show view editing");
739         }
740
741     // skip |xns - no return type
742     public class Xcls_vbox : Object 
743     {
744         public Gtk.VBox el;
745         private Xcls_MainWindow  _this;
746
747
748             // my vars
749
750             // ctor 
751         public Xcls_vbox(Xcls_MainWindow _owner )
752         {
753             _this = _owner;
754             _this.vbox = this;
755             this.el = new Gtk.VBox( false, 0 );
756
757             // my vars
758
759             // set gobject values
760             var child_0 = new Xcls_topbar( _this );
761             child_0.ref();
762             this.el.pack_start (  child_0.el , false,true,0 );
763             var child_1 = new Xcls_mainpane( _this );
764             child_1.ref();
765             this.el.pack_end (  child_1.el , true,true,0 );
766         }
767
768         // userdefined functions 
769
770         // skip |xns - no return type
771     }
772     public class Xcls_topbar : Object 
773     {
774         public Gtk.HBox el;
775         private Xcls_MainWindow  _this;
776
777
778             // my vars
779
780             // ctor 
781         public Xcls_topbar(Xcls_MainWindow _owner )
782         {
783             _this = _owner;
784             _this.topbar = this;
785             this.el = new Gtk.HBox( true, 0 );
786
787             // my vars
788
789             // set gobject values
790             this.el.height_request = 20;
791             this.el.vexpand = false  ;
792         }
793
794         // userdefined functions 
795
796         // skip |xns - no return type
797     }
798     public class Xcls_mainpane : Object 
799     {
800         public Gtk.HPaned el;
801         private Xcls_MainWindow  _this;
802
803
804             // my vars
805         public int lastWidth;
806
807             // ctor 
808         public Xcls_mainpane(Xcls_MainWindow _owner )
809         {
810             _this = _owner;
811             _this.mainpane = this;
812             this.el = new Gtk.HPaned();
813
814             // my vars
815             this.lastWidth = 0;
816
817             // set gobject values
818             this.el.position = 400;
819             var child_0 = new Xcls_leftpane( _this );
820             child_0.ref();
821             this.el.add1 (  child_0.el  );
822             var child_1 = new Xcls_VBox9( _this );
823             child_1.ref();
824             this.el.add2 (  child_1.el  );
825         }
826
827         // userdefined functions 
828
829         // skip |xns - no return type
830     }
831     public class Xcls_leftpane : Object 
832     {
833         public Gtk.VBox el;
834         private Xcls_MainWindow  _this;
835
836
837             // my vars
838
839             // ctor 
840         public Xcls_leftpane(Xcls_MainWindow _owner )
841         {
842             _this = _owner;
843             _this.leftpane = this;
844             this.el = new Gtk.VBox( true, 0 );
845
846             // my vars
847
848             // set gobject values
849             var child_0 = new Xcls_editpane( _this );
850             child_0.ref();
851             this.el.pack_start (  child_0.el , false,true,0 );
852         }
853
854         // userdefined functions 
855
856         // skip |xns - no return type
857     }
858     public class Xcls_editpane : Object 
859     {
860         public Gtk.VPaned el;
861         private Xcls_MainWindow  _this;
862
863
864             // my vars
865
866             // ctor 
867         public Xcls_editpane(Xcls_MainWindow _owner )
868         {
869             _this = _owner;
870             _this.editpane = this;
871             this.el = new Gtk.VPaned();
872
873             // my vars
874
875             // set gobject values
876             var child_0 = new Xcls_tree( _this );
877             child_0.ref();
878             this.el.add1 (  child_0.el  );
879             var child_1 = new Xcls_props( _this );
880             child_1.ref();
881             this.el.add2 (  child_1.el  );
882         }
883
884         // userdefined functions 
885
886         // skip |xns - no return type
887     }
888     public class Xcls_tree : Object 
889     {
890         public Gtk.VBox el;
891         private Xcls_MainWindow  _this;
892
893
894             // my vars
895
896             // ctor 
897         public Xcls_tree(Xcls_MainWindow _owner )
898         {
899             _this = _owner;
900             _this.tree = this;
901             this.el = new Gtk.VBox( true, 0 );
902
903             // my vars
904
905             // set gobject values
906         }
907
908         // userdefined functions 
909
910         // skip |xns - no return type
911     }
912     public class Xcls_props : Object 
913     {
914         public Gtk.VBox el;
915         private Xcls_MainWindow  _this;
916
917
918             // my vars
919
920             // ctor 
921         public Xcls_props(Xcls_MainWindow _owner )
922         {
923             _this = _owner;
924             _this.props = this;
925             this.el = new Gtk.VBox( true, 0 );
926
927             // my vars
928
929             // set gobject values
930         }
931
932         // userdefined functions 
933
934         // skip |xns - no return type
935     }
936     public class Xcls_VBox9 : Object 
937     {
938         public Gtk.VBox el;
939         private Xcls_MainWindow  _this;
940
941
942             // my vars
943
944             // ctor 
945         public Xcls_VBox9(Xcls_MainWindow _owner )
946         {
947             _this = _owner;
948             this.el = new Gtk.VBox( true, 0 );
949
950             // my vars
951
952             // set gobject values
953             var child_0 = new Xcls_clutterembed( _this );
954             child_0.ref();
955             this.el.pack_start (  child_0.el , true,true,0 );
956         }
957
958         // userdefined functions 
959
960         // skip |xns - no return type
961     }
962     public class Xcls_clutterembed : Object 
963     {
964         public GtkClutter.Embed el;
965         private Xcls_MainWindow  _this;
966
967
968             // my vars
969
970             // ctor 
971         public Xcls_clutterembed(Xcls_MainWindow _owner )
972         {
973             _this = _owner;
974             _this.clutterembed = this;
975             this.el = new GtkClutter.Embed();
976
977             // my vars
978
979             // set gobject values
980             var child_0 = new Xcls_rooview( _this );
981             child_0.ref();
982             this.el.get_stage().add_child (  child_0.el  );
983             var child_1 = new Xcls_objectview( _this );
984             child_1.ref();
985             this.el.get_stage().add_child (  child_1.el  );
986             var child_2 = new Xcls_codeeditview( _this );
987             child_2.ref();
988             this.el.get_stage().add_child (  child_2.el  );
989             var child_3 = new Xcls_addpropsview( _this );
990             child_3.ref();
991             this.el.get_stage().add_child (  child_3.el  );
992             var child_4 = new Xcls_projecteditview( _this );
993             child_4.ref();
994             this.el.get_stage().add_child (  child_4.el  );
995             var child_5 = new Xcls_buttonlayout( _this );
996             child_5.ref();
997             this.el.get_stage().add_child (  child_5.el  );
998
999             // init method 
1000                 var stage = this.el.get_stage();
1001                 stage.set_background_color(  Clutter.Color.from_string("#000"));
1002                 
1003                 
1004
1005             // listeners 
1006             this.el.size_allocate.connect(   (  alloc) => {
1007                 if (!_this.children_loaded) {  return; }
1008                 //print("size_allocation %d,%d\n".printf(alloc.width, alloc.height));
1009             
1010             /*    _this.rooview.el.set_size(this.el.get_stage().width-50,
1011                         this.el.get_stage().height);
1012                 _this.clutterfiles.set_size(this.el.get_stage().width-50,
1013                        this.el.get_stage().height);
1014             */
1015                // this.el.set_size_request(alloc.width,alloc.height);
1016                // this.el.get_stage().set_size(alloc.width,alloc.height);
1017                 _this.rooview.el.set_size(alloc.width-50,
1018                         alloc.height);
1019                         
1020                          
1021                         
1022                 _this.clutterfiles.set_size(alloc.width-50,
1023                        alloc.height);
1024                 _this.projecteditview.el.set_size(alloc.width-50,
1025                        alloc.height / 2.0f);
1026                        
1027                 _this.objectview.el.set_size((alloc.width -50)/2.0f,
1028                        alloc.height);
1029                        
1030                 _this.addpropsview.el.set_size((alloc.width -50)/2.0f,
1031                        alloc.height);
1032                 
1033                 _this.codeeditview.el.set_size((alloc.width -50)/2.0f,
1034                        alloc.height);
1035             } );
1036         }
1037
1038         // userdefined functions 
1039
1040         // skip |xns - no return type
1041     }
1042     public class Xcls_rooview : Object 
1043     {
1044         public GtkClutter.Actor el;
1045         private Xcls_MainWindow  _this;
1046
1047
1048             // my vars
1049
1050             // ctor 
1051         public Xcls_rooview(Xcls_MainWindow _owner )
1052         {
1053             _this = _owner;
1054             _this.rooview = this;
1055             this.el = new GtkClutter.Actor();
1056
1057             // my vars
1058
1059             // set gobject values
1060
1061             // init method 
1062             {
1063                
1064                
1065                 this.el.add_constraint(
1066                     new Clutter.AlignConstraint(
1067                         _this.clutterembed.el.get_stage(), 
1068                         Clutter.AlignAxis.X_AXIS,
1069                         1.0f
1070                     )
1071                 );
1072                     
1073                 //this.el.set_position(100,100);
1074                 this.el.set_pivot_point(1.0f,1.0f);
1075                 
1076                 this.el.set_size(_this.clutterembed.el.get_stage().width-50,
1077                         _this.clutterembed.el.get_stage().height);
1078                         
1079             }
1080         }
1081
1082         // userdefined functions 
1083
1084         // skip |xns - no return type
1085     }
1086     public class Xcls_objectview : Object 
1087     {
1088         public GtkClutter.Actor el;
1089         private Xcls_MainWindow  _this;
1090
1091
1092             // my vars
1093
1094             // ctor 
1095         public Xcls_objectview(Xcls_MainWindow _owner )
1096         {
1097             _this = _owner;
1098             _this.objectview = this;
1099             this.el = new GtkClutter.Actor();
1100
1101             // my vars
1102
1103             // set gobject values
1104
1105             // init method 
1106             {
1107                
1108                /*
1109                 this.el.add_constraint(
1110                     new Clutter.AlignConstraint(
1111                         _this.clutterembed.el.get_stage(), 
1112                         Clutter.AlignAxis.X_AXIS,
1113                         0.0f
1114                     )
1115                 );
1116                 */
1117                 this.el.fixed_x = 50.0f;
1118                 this.el.fixed_y = 0.0f;
1119                 //this.el.set_position(100,100);
1120                 this.el.set_pivot_point(0.0f,0.0f);
1121                 this.el.set_scale(0.0f,1.0f);
1122                 this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
1123                         _this.clutterembed.el.get_stage().height);
1124                         
1125             }
1126         }
1127
1128         // userdefined functions 
1129
1130         // skip |xns - no return type
1131     }
1132     public class Xcls_codeeditview : Object 
1133     {
1134         public GtkClutter.Actor el;
1135         private Xcls_MainWindow  _this;
1136
1137
1138             // my vars
1139
1140             // ctor 
1141         public Xcls_codeeditview(Xcls_MainWindow _owner )
1142         {
1143             _this = _owner;
1144             _this.codeeditview = this;
1145             this.el = new GtkClutter.Actor();
1146
1147             // my vars
1148
1149             // set gobject values
1150
1151             // init method 
1152             {
1153                
1154                /*
1155                 this.el.add_constraint(
1156                     new Clutter.AlignConstraint(
1157                         _this.clutterembed.el.get_stage(), 
1158                         Clutter.AlignAxis.X_AXIS,
1159                         0.0f
1160                     )
1161                 );
1162                 */
1163                 this.el.fixed_x = 50.0f;
1164                 this.el.fixed_y = 0.0f;
1165                 //this.el.set_position(100,100);
1166                 this.el.set_pivot_point(0.0f,0.0f);
1167                 this.el.set_scale(0.0f,1.0f);
1168                 this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,
1169                         _this.clutterembed.el.get_stage().height);
1170                         
1171             }
1172         }
1173
1174         // userdefined functions 
1175
1176         // skip |xns - no return type
1177     }
1178     public class Xcls_addpropsview : Object 
1179     {
1180         public GtkClutter.Actor el;
1181         private Xcls_MainWindow  _this;
1182
1183
1184             // my vars
1185
1186             // ctor 
1187         public Xcls_addpropsview(Xcls_MainWindow _owner )
1188         {
1189             _this = _owner;
1190             _this.addpropsview = this;
1191             this.el = new GtkClutter.Actor();
1192
1193             // my vars
1194
1195             // set gobject values
1196
1197             // init method 
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
1220         // userdefined functions 
1221
1222         // skip |xns - no return type
1223     }
1224     public class Xcls_projecteditview : Object 
1225     {
1226         public GtkClutter.Actor el;
1227         private Xcls_MainWindow  _this;
1228
1229
1230             // my vars
1231
1232             // ctor 
1233         public Xcls_projecteditview(Xcls_MainWindow _owner )
1234         {
1235             _this = _owner;
1236             _this.projecteditview = this;
1237             this.el = new GtkClutter.Actor();
1238
1239             // my vars
1240
1241             // set gobject values
1242
1243             // init method 
1244             {
1245                
1246                
1247                 this.el.add_constraint(
1248                     new Clutter.AlignConstraint(
1249                         _this.clutterembed.el.get_stage(), 
1250                         Clutter.AlignAxis.X_AXIS,
1251                         1.0f
1252                     )
1253                 );
1254                     
1255                 //this.el.set_position(100,100);
1256                 this.el.set_pivot_point(0.0f,0.0f);
1257                 this.el.set_scale(1.0f,0.0f);
1258                 this.el.set_size(_this.clutterembed.el.get_stage().width-50,
1259                         _this.clutterembed.el.get_stage().height /2);
1260                         
1261             }
1262         }
1263
1264         // userdefined functions 
1265
1266         // skip |xns - no return type
1267     }
1268     public class Xcls_buttonlayout : Object 
1269     {
1270         public Clutter.Actor el;
1271         private Xcls_MainWindow  _this;
1272
1273
1274             // my vars
1275
1276             // ctor 
1277         public Xcls_buttonlayout(Xcls_MainWindow _owner )
1278         {
1279             _this = _owner;
1280             _this.buttonlayout = this;
1281             this.el = new Clutter.Actor();
1282
1283             // my vars
1284
1285             // set gobject values
1286             var child_0 = new Xcls_BoxLayout17( _this );
1287             child_0.ref();
1288             this.el.layout_manager = child_0.el;
1289             var child_1 = new Xcls_projectbutton( _this );
1290             child_1.ref();
1291             this.el.add_child (  child_1.el  );
1292             var child_2 = new Xcls_projecteditbutton( _this );
1293             child_2.ref();
1294             this.el.add_child (  child_2.el  );
1295             var child_3 = new Xcls_objectshowbutton( _this );
1296             child_3.ref();
1297             this.el.add_child (  child_3.el  );
1298             var child_4 = new Xcls_addpropbutton( _this );
1299             child_4.ref();
1300             this.el.add_child (  child_4.el  );
1301             var child_5 = new Xcls_addlistenerbutton( _this );
1302             child_5.ref();
1303             this.el.add_child (  child_5.el  );
1304
1305             // init method 
1306             {
1307                 
1308                 this.el.add_constraint(
1309                     new Clutter.AlignConstraint(
1310                         _this.clutterembed.el.get_stage(), 
1311                         Clutter.AlignAxis.X_AXIS,
1312                         0.0f
1313                     )
1314                 );
1315                  
1316                 
1317                 //this.el.set_position(100,100);
1318                 this.el.set_pivot_point(0.5f,0.5f);
1319                  this.el.set_size(50,
1320                        _this.clutterembed.el.get_stage().height);
1321                  
1322             }
1323         }
1324
1325         // userdefined functions 
1326
1327         // skip |xns - no return type
1328     }
1329     public class Xcls_BoxLayout17 : Object 
1330     {
1331         public Clutter.BoxLayout el;
1332         private Xcls_MainWindow  _this;
1333
1334
1335             // my vars
1336
1337             // ctor 
1338         public Xcls_BoxLayout17(Xcls_MainWindow _owner )
1339         {
1340             _this = _owner;
1341             this.el = new Clutter.BoxLayout();
1342
1343             // my vars
1344
1345             // set gobject values
1346             this.el.orientation = Clutter.Orientation.VERTICAL;
1347         }
1348
1349         // userdefined functions 
1350
1351         // skip |xns - no return type
1352     }
1353     public class Xcls_projectbutton : Object 
1354     {
1355         public Clutter.Actor el;
1356         private Xcls_MainWindow  _this;
1357
1358
1359             // my vars
1360
1361             // ctor 
1362         public Xcls_projectbutton(Xcls_MainWindow _owner )
1363         {
1364             _this = _owner;
1365             _this.projectbutton = this;
1366             this.el = new Clutter.Actor();
1367
1368             // my vars
1369
1370             // set gobject values
1371             this.el.reactive = true;
1372             var child_0 = new Xcls_Text19( _this );
1373             child_0.ref();
1374             this.el.add_child (  child_0.el  );
1375
1376             // init method 
1377             this.el.set_size(50,50);
1378
1379             // listeners 
1380             this.el.enter_event.connect( (  event)  => {
1381                 this.el.background_color = new Clutter.Color.from_string("#333");
1382                     return false;
1383             } );
1384             this.el.leave_event.connect( (  event)  => {
1385                 this.el.background_color = new Clutter.Color.from_string("#000");
1386                 return false;
1387             } );
1388             this.el.button_press_event.connect(   ( ) => {
1389                 switch (_this.state) {
1390                     case "edit":
1391                     
1392                         _this.hideViewEditing();
1393                         break;  
1394                     case "files":
1395                         _this.showViewEditing();
1396                         break; 
1397                         
1398                       case "addprop":
1399                         _this.hideAddProp();
1400                         _this.hideViewEditing();
1401                         break;
1402                     case "addlistener":
1403                         _this.hideAddListener();
1404                         _this.hideViewEditing();
1405                         break;
1406                          
1407                      case "object":
1408                         _this.hideObject();
1409                         _this.hideViewEditing();
1410                         break;    
1411                         
1412                     default:
1413                         break;
1414                 }
1415                 return false;    
1416             
1417             } );
1418         }
1419
1420         // userdefined functions 
1421
1422         // skip |xns - no return type
1423     }
1424     public class Xcls_Text19 : Object 
1425     {
1426         public Clutter.Text el;
1427         private Xcls_MainWindow  _this;
1428
1429
1430             // my vars
1431
1432             // ctor 
1433         public Xcls_Text19(Xcls_MainWindow _owner )
1434         {
1435             _this = _owner;
1436             this.el = new Clutter.Text.full("Sans 10px","Open\nFiles",new Clutter.Color.from_string("#fff"));
1437
1438             // my vars
1439
1440             // set gobject values
1441             this.el.line_alignment = Pango.Alignment.CENTER;
1442             this.el.x_align = Clutter.ActorAlign.CENTER;
1443             this.el.x_expand = false;
1444             this.el.y_align = Clutter.ActorAlign.CENTER;
1445             this.el.y_expand = false;
1446         }
1447
1448         // userdefined functions 
1449
1450         // skip |xns - no return type
1451     }
1452     public class Xcls_projecteditbutton : Object 
1453     {
1454         public Clutter.Actor el;
1455         private Xcls_MainWindow  _this;
1456
1457
1458             // my vars
1459
1460             // ctor 
1461         public Xcls_projecteditbutton(Xcls_MainWindow _owner )
1462         {
1463             _this = _owner;
1464             _this.projecteditbutton = this;
1465             this.el = new Clutter.Actor();
1466
1467             // my vars
1468
1469             // set gobject values
1470             this.el.reactive = true;
1471             var child_0 = new Xcls_Text21( _this );
1472             child_0.ref();
1473             this.el.add_child (  child_0.el  );
1474
1475             // init method 
1476             this.el.set_size(50,50);
1477
1478             // listeners 
1479             this.el.enter_event.connect( (  event)  => {
1480                 this.el.background_color = new Clutter.Color.from_string("#333");
1481                     return false;
1482             } );
1483             this.el.leave_event.connect( (  event)  => {
1484                 this.el.background_color = new Clutter.Color.from_string("#000");
1485                 return false;
1486             } );
1487             this.el.button_press_event.connect(   ( ) => {
1488                 switch (_this.state) {
1489                     case "edit":
1490                         _this.showProjectEdit();
1491                         break;  
1492                     case "files":
1493                         // _this.showViewEditing();
1494                         break; 
1495                     case "projectedit":
1496                         _this.hideProjectEdit();
1497                         break;
1498                         
1499                         
1500                           
1501                     case "addprop":
1502                         _this.hideAddProp();
1503                         _this.showProjectEdit();
1504                         break;
1505                     case "addlistener":
1506                         _this.hideAddListener();
1507                         _this.showProjectEdit();
1508                         break;
1509                          
1510                      case "object":
1511                         _this.hideObject();
1512                         _this.showProjectEdit();    
1513                         break;
1514                     default:
1515                         break;
1516                 }
1517                 return false;    
1518             
1519             
1520             } );
1521         }
1522
1523         // userdefined functions 
1524
1525         // skip |xns - no return type
1526     }
1527     public class Xcls_Text21 : Object 
1528     {
1529         public Clutter.Text el;
1530         private Xcls_MainWindow  _this;
1531
1532
1533             // my vars
1534
1535             // ctor 
1536         public Xcls_Text21(Xcls_MainWindow _owner )
1537         {
1538             _this = _owner;
1539             this.el = new Clutter.Text.full("Sans 10px","Edit\nProject\nDetails",new Clutter.Color.from_string("#fff"));
1540
1541             // my vars
1542
1543             // set gobject values
1544             this.el.line_alignment = Pango.Alignment.CENTER;
1545             this.el.x_align = Clutter.ActorAlign.CENTER;
1546             this.el.x_expand = false;
1547             this.el.y_align = Clutter.ActorAlign.CENTER;
1548             this.el.y_expand = false;
1549         }
1550
1551         // userdefined functions 
1552
1553         // skip |xns - no return type
1554     }
1555     public class Xcls_objectshowbutton : Object 
1556     {
1557         public Clutter.Actor el;
1558         private Xcls_MainWindow  _this;
1559
1560
1561             // my vars
1562
1563             // ctor 
1564         public Xcls_objectshowbutton(Xcls_MainWindow _owner )
1565         {
1566             _this = _owner;
1567             _this.objectshowbutton = this;
1568             this.el = new Clutter.Actor();
1569
1570             // my vars
1571
1572             // set gobject values
1573             this.el.reactive = true;
1574             var child_0 = new Xcls_Text23( _this );
1575             child_0.ref();
1576             this.el.add_child (  child_0.el  );
1577
1578             // init method 
1579             this.el.set_size(50,50);
1580
1581             // listeners 
1582             this.el.enter_event.connect( (  event)  => {
1583                 this.el.background_color = new Clutter.Color.from_string("#333");
1584                     return false;
1585             } );
1586             this.el.leave_event.connect( (  event)  => {
1587                 this.el.background_color = new Clutter.Color.from_string("#000");
1588                 return false;
1589             } );
1590             this.el.button_press_event.connect(   ( ) => {
1591                 
1592                 
1593                 
1594                 switch (_this.state) {
1595             
1596              
1597                     case "addprop":
1598                         _this.hideAddProp();
1599                         _this.showObject();
1600                         break;
1601                 case "addlistener":
1602                         _this.hideAddListener();
1603                         _this.showObject();
1604                         break;
1605             
1606             // show            
1607                     case "edit":
1608                         _this.showObject();
1609                         break;
1610                         
1611             // hide            
1612                     case "object":
1613                         _this.hideObject();
1614                         break;
1615                         break;
1616                                     
1617                     default:
1618                         print("unhandled add objects from %s\n",_this.state);
1619                         break;
1620                 }
1621                 return false;    
1622             
1623             
1624             } );
1625         }
1626
1627         // userdefined functions 
1628
1629         // skip |xns - no return type
1630     }
1631     public class Xcls_Text23 : Object 
1632     {
1633         public Clutter.Text el;
1634         private Xcls_MainWindow  _this;
1635
1636
1637             // my vars
1638
1639             // ctor 
1640         public Xcls_Text23(Xcls_MainWindow _owner )
1641         {
1642             _this = _owner;
1643             this.el = new Clutter.Text.full("Sans 10px","Show\nPalate",new Clutter.Color.from_string("#fff"));
1644
1645             // my vars
1646
1647             // set gobject values
1648             this.el.line_alignment = Pango.Alignment.CENTER;
1649             this.el.x_align = Clutter.ActorAlign.CENTER;
1650             this.el.x_expand = false;
1651             this.el.y_align = Clutter.ActorAlign.CENTER;
1652             this.el.y_expand = false;
1653         }
1654
1655         // userdefined functions 
1656
1657         // skip |xns - no return type
1658     }
1659     public class Xcls_addpropbutton : Object 
1660     {
1661         public Clutter.Actor el;
1662         private Xcls_MainWindow  _this;
1663
1664
1665             // my vars
1666
1667             // ctor 
1668         public Xcls_addpropbutton(Xcls_MainWindow _owner )
1669         {
1670             _this = _owner;
1671             _this.addpropbutton = this;
1672             this.el = new Clutter.Actor();
1673
1674             // my vars
1675
1676             // set gobject values
1677             this.el.reactive = true;
1678             var child_0 = new Xcls_Text25( _this );
1679             child_0.ref();
1680             this.el.add_child (  child_0.el  );
1681
1682             // init method 
1683             this.el.set_size(50,50);
1684
1685             // listeners 
1686             this.el.enter_event.connect( (  event)  => {
1687                 this.el.background_color = new Clutter.Color.from_string("#333");
1688                     return false;
1689             } );
1690             this.el.leave_event.connect( (  event)  => {
1691                 this.el.background_color = new Clutter.Color.from_string("#000");
1692                 return false;
1693             } );
1694             this.el.button_press_event.connect(   ( ) => {
1695                 
1696                 
1697                 
1698                 switch (_this.state) {
1699                     case "edit":
1700                         _this.showAddProp();
1701                         break;
1702                         
1703                     case "object":
1704                         _this.hideObject();
1705                         _this.showAddProp();
1706                         break;
1707                    
1708                     case "addlistener":
1709                         _this.hideAddListener();
1710                         _this.showAddProp();            
1711                         break;
1712                         
1713                         
1714                     case "addprop":
1715                         _this.hideAddProp();
1716                         break;
1717                         
1718                     default:
1719                         print("unhandled add property from %s\n",_this.state);
1720                         break;
1721                         
1722                 }
1723                 return false;    
1724             
1725             
1726             } );
1727         }
1728
1729         // userdefined functions 
1730
1731         // skip |xns - no return type
1732     }
1733     public class Xcls_Text25 : Object 
1734     {
1735         public Clutter.Text el;
1736         private Xcls_MainWindow  _this;
1737
1738
1739             // my vars
1740
1741             // ctor 
1742         public Xcls_Text25(Xcls_MainWindow _owner )
1743         {
1744             _this = _owner;
1745             this.el = new Clutter.Text.full("Sans 10px","Add\nProperty",new Clutter.Color.from_string("#fff"));
1746
1747             // my vars
1748
1749             // set gobject values
1750             this.el.line_alignment = Pango.Alignment.CENTER;
1751             this.el.x_align = Clutter.ActorAlign.CENTER;
1752             this.el.x_expand = false;
1753             this.el.y_align = Clutter.ActorAlign.CENTER;
1754             this.el.y_expand = false;
1755         }
1756
1757         // userdefined functions 
1758
1759         // skip |xns - no return type
1760     }
1761     public class Xcls_addlistenerbutton : Object 
1762     {
1763         public Clutter.Actor el;
1764         private Xcls_MainWindow  _this;
1765
1766
1767             // my vars
1768
1769             // ctor 
1770         public Xcls_addlistenerbutton(Xcls_MainWindow _owner )
1771         {
1772             _this = _owner;
1773             _this.addlistenerbutton = this;
1774             this.el = new Clutter.Actor();
1775
1776             // my vars
1777
1778             // set gobject values
1779             this.el.reactive = true;
1780             var child_0 = new Xcls_Text27( _this );
1781             child_0.ref();
1782             this.el.add_child (  child_0.el  );
1783
1784             // init method 
1785             this.el.set_size(50,50);
1786
1787             // listeners 
1788             this.el.enter_event.connect( (  event)  => {
1789                 this.el.background_color = new Clutter.Color.from_string("#333");
1790                     return false;
1791             } );
1792             this.el.leave_event.connect( (  event)  => {
1793                 this.el.background_color = new Clutter.Color.from_string("#000");
1794                 return false;
1795             } );
1796             this.el.button_press_event.connect(   ( ) => {
1797                 
1798                 
1799                 
1800                 switch (_this.state) {
1801                     case "edit":
1802                         _this.showAddListener();
1803                         break;
1804                         
1805                    
1806                     case "addlistener":
1807                         _this.hideAddListener();
1808                         break;
1809             
1810                         
1811                     case "addprop":
1812                         _this.hideAddProp();
1813                         _this.showAddListener();
1814                         break;
1815                      case "object":
1816                         _this.hideObject();
1817                         _this.showAddListener();
1818                         break;
1819                 
1820                       default:
1821                         print("unhandled add listener from %s\n",_this.state);
1822             
1823                         break;
1824                         
1825                 }
1826                 return false;    
1827             
1828             
1829             } );
1830         }
1831
1832         // userdefined functions 
1833
1834         // skip |xns - no return type
1835     }
1836     public class Xcls_Text27 : Object 
1837     {
1838         public Clutter.Text el;
1839         private Xcls_MainWindow  _this;
1840
1841
1842             // my vars
1843
1844             // ctor 
1845         public Xcls_Text27(Xcls_MainWindow _owner )
1846         {
1847             _this = _owner;
1848             this.el = new Clutter.Text.full("Sans 10px","Add\nListener",new Clutter.Color.from_string("#fff"));
1849
1850             // my vars
1851
1852             // set gobject values
1853             this.el.line_alignment = Pango.Alignment.CENTER;
1854             this.el.x_align = Clutter.ActorAlign.CENTER;
1855             this.el.x_expand = false;
1856             this.el.y_align = Clutter.ActorAlign.CENTER;
1857             this.el.y_expand = false;
1858         }
1859
1860         // userdefined functions 
1861
1862         // skip |xns - no return type
1863     }
1864 }