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