855cb3056e3b8aa7ef119a342d3ad8246aa7af69
[app.Builder.js] / src / Builder4 / MainWindow.bjs
1 {
2  "name" : "MainWindow",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/MainWindow.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "items" : [
9   {
10    "listeners" : {
11     "delete_event" : "  (   event) => {\n    return false;\n}",
12     "destroy" : "() =>  {\n Xcls_MainWindow.singleton().no_windows--;\n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n     Gtk.main_quit();\n }\n}",
13     "show" : "  ( ) => {\n    // hide the file editing..\n   \n    //this.hideViewEditing();\n}"
14    },
15    "|             void hideAddListener" : "() {\n      _this.backbutton.el.hide();\n     _this.projectbutton.el.show(); \n          _this.projecteditbutton.el.show();\n         _this.editfilebutton.el.show();   \n     _this.addpropsview.el.save_easing_state();\n    var el = _this.rooview.el;\n    el.save_easing_state();\n\n    \n    el.set_scale(1.0f,1.0f);\n    _this.addpropsview.el.set_scale(0.0f,0.0f);\n    _this.state = \"edit\";\n\n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n     _this.addpropsview.el.restore_easing_state();  \n  }",
16    "|        void initChildren" : " () {\n    // this needs putting in a better place..\n    this.windowstate = new WindowState(this);\n     \n\n    //w.el.show_all();\n    var tl = new Clutter.Timeline(6000);\n    tl.set_repeat_count(-1);\n    tl.start();\n    tl.ref();\n\n    this.children_loaded = true;\n\n\n\n\n}\n",
17    "# int no_windows" : 1,
18    "# Project.Project project" : "null",
19    "# bool children_loaded" : false,
20    "|             void hideCodeEdit" : "() {\n    //this.code_editor.saveContents();\n     _this.backbutton.el.hide();\n\n      _this.projectbutton.el.show(); \n       _this.projecteditbutton.el.show();\n       _this.editfilebutton.el.show();   \n       \n       \n       \n     _this.codeeditview.el.save_easing_state();\n    var el = _this.rooview.el;\n    el.save_easing_state();\n\n    \n    el.set_scale(1.0f,1.0f);\n    _this.codeeditview.el.set_scale(0.0f,0.0f);\n    _this.state = \"edit\";\n\n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n     _this.codeeditview.el.restore_easing_state();  \n }",
21    "|             void showAddProp" : "() {\n\n     \n     var ae =      this.left_tree.getActiveElement();\n    if (ae == null) {\n        return;\n    }\n     _this.backbutton.el.show();\n       _this.projectbutton.el.hide();\n    _this.editfilebutton.el.hide();\n    _this.projecteditbutton.el.hide();    \n    \n     \n     \n    //this.rooview.el.hide();\n    this.add_props.el.show_all();\n    this.add_props.show(\n        Palete.factory(this.project.xtype), \n        \"props\",\n        ae.fqn()\n    );\n\n    _this.addpropsview.el.save_easing_state();\n        \n    var el = _this.rooview.el;\n    el.save_easing_state();\n    _this.clutterembed.setSizesAlloc(\"addprop\");\n     \n     \n\n    _this.addpropsview.el.set_scale(1.0f,1.0f);\n   \n   \n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n    _this.addpropsview.el.restore_easing_state();\n    this.state = \"addprop\";\n}",
22    "|             void showViewEditing" : "  ( )  {\n     this.editpane.el.show();\n  //   this.rooview.el.show();\n     this.left_projects.el.hide();\n    \n    _this.addprojectbutton.el.hide();   \n    _this.delprojectbutton.el.hide();\n    _this.addfilebutton.el.hide();       \n    _this.backbutton.el.hide();\n   _this.new_window.el.hide();      \n        \n        \n      _this.projectbutton.el.show();         \n    _this.editfilebutton.el.show();   \n   _this.projecteditbutton.el.show();\n  _this.objectshowbutton.el.show();\n  _this.addpropbutton.el.show();      \n  _this.addlistenerbutton.el.show();   \n\n      \n    var el = _this.rooview.el;\n        el.save_easing_state();\n  \n    \n        el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);\n        el.set_scale(1.0f,1.0f);\n        _this.state = \"edit\";\n       // _this.mainpane.el.set_position(_this.leftpane.lastWidth);\n        _this.clutterfiles.el.hide();\n    \n    el.restore_easing_state();\n        \n    print(\"show view editing\");\n}",
23    "border_width" : 0,
24    "|             void hideProjectEdit" : " () {\n    // return to editing state..\n       \n      _this.projectbutton.el.show();\n     _this.projecteditbutton.el.show();\n      _this.backbutton.el.hide();\n         _this.editfilebutton.el.show();   \n\n     \n       if (this.project.xtype == \"Roo\") {\n        \n        //this.projectsettings.show(this.project);\n    } else {\n\n        this.vala_projectsettings.project.writeConfig();\n    }\n    _this.projecteditview.el.save_easing_state();\n    var el = _this.rooview.el;\n    el.save_easing_state();\n\n    \n    el.set_scale(1.0f,1.0f);\n       _this.projecteditview.el.set_scale(1.0f,0.0f);\n    _this.state = \"edit\";\n\n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n      _this.projecteditview.el.restore_easing_state();  \n  \n}\n",
25    "default_height" : 500,
26    "# Xcls_WindowLeftProjects left_projects" : "null",
27    "id" : "MainWindow",
28    "|             void showProjectEdit" : " () {\n    // make the browser smaller, and show the edit dialog\n    \n    \n     _this.projectbutton.el.hide();\n     _this.projecteditbutton.el.hide();\n     _this.editfilebutton.el.hide();\n     \n    _this.backbutton.el.show();\n     \n    //this.rooview.el.hide();\n    \n    \n    if (this.project.xtype == \"Roo\") {\n        this.projectsettings.el.show_all();\n        this.projectsettings.show(this.project);\n    } else {\n        this.vala_projectsettings.el.show_all();\n        this.vala_projectsettings.show((Project.Gtk)this.project);\n    }\n    _this.projecteditview.el.save_easing_state();\n        \n    var el = _this.rooview.el;\n    el.save_easing_state();\n   \n    \n    el.set_scale(0.5f,0.5f);\n\n    _this.projecteditview.el.set_scale(1.0f,1.0f);\n   \n    _this.state = \"projectedit\";\n     \n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n    _this.projecteditview.el.restore_easing_state();\n  //  print(\"show view browsing\");\n    \n}\n",
29    "# Xcls_WindowRooView window_rooview" : "null",
30    "|             void showAddListener" : "() {\n\n     \n     \n    var ae =      this.left_tree.getActiveElement();\n    if (ae == null) {\n        return;\n    }\n     \n   _this.backbutton.el.show();\n    _this.projectbutton.el.hide();\n    _this.editfilebutton.el.hide();\n    _this.projecteditbutton.el.hide();    \n    \n    \n    //this.rooview.el.hide();\n    this.add_props.el.show_all();\n    this.add_props.show(\n        Palete.factory(this.project.xtype), \n        \"signals\",\n        ae.fqn()\n    );\n    //this.rightpalete.show(this.project);\n\n    _this.addpropsview.el.save_easing_state();\n        \n    var el = _this.rooview.el;\n    el.save_easing_state();\n   \n      _this.clutterembed.setSizesAlloc(\"addlistener\");\n\n    \n  \n\n    _this.addpropsview.el.set_scale(1.0f,1.0f);\n   \n   \n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n    _this.addpropsview.el.restore_easing_state();\n    this.state = \"addlistener\";\n}",
31    "default_width" : 800,
32    "xtype" : "Window",
33    "$ type" : "Gtk.WindowType.TOPLEVEL",
34    "|             void hideAddProp" : "() {\n      _this.backbutton.el.hide();\n     _this.projectbutton.el.show(); \n          _this.projecteditbutton.el.show();\n         _this.editfilebutton.el.show();   \n     _this.addpropsview.el.save_easing_state();\n     \n    var el = _this.rooview.el;\n    el.save_easing_state();\n\n    \n    el.set_scale(1.0f,1.0f);\n    _this.addpropsview.el.set_scale(0.0f,0.0f);\n    _this.state = \"edit\";\n\n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n     _this.addpropsview.el.restore_easing_state();  \n }",
35    "# Xcls_WindowLeftTree left_tree" : "null",
36    "# Editor code_editor" : "null",
37    "|             void showCodeEdit" : "(JsRender.JsRender file, JsRender.Node node, string ptype, string key)\n{\n    // this is a bit different,\n    // it's not called via a button - but triggered by the prop edit class signal.\n    // so it has to hide any other state..\n    \n    switch(this.state) {\n        case \"object\":\n            this.hideObject();\n            break;\n        case \"addprop\":\n            this.hideAddProp();\n            break;\n        case \"addlistener\":\n            this.hideAddListener();\n            break;\n    }\n \n   _this.backbutton.el.show();\n   \n    _this.projectbutton.el.hide();\n    _this.editfilebutton.el.hide();\n    _this.projecteditbutton.el.hide();    \n   // more?? \n     \n    //this.rooview.el.hide();\n    this.code_editor.el.show_all();\n    this.code_editor.show(\n        file,\n        node,\n        ptype,\n        key\n    );\n\n    _this.codeeditview.el.save_easing_state();\n        \n    var el = _this.rooview.el;\n    el.save_easing_state();\n    _this.clutterembed.setSizesAlloc(\"codedit\");\n   \n    _this.codeeditview.el.set_scale(1.0f,1.0f);\n   \n   \n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n    _this.codeeditview.el.restore_easing_state();\n    this.state = \"codeedit\";\n}\n",
38    "# Xcls_DialogNewComponent new_file_dialog" : "null",
39    "WindowState windowstate" : "null",
40    "# Xcls_ProjectSettings projectsettings" : "null",
41    "|             void setTitle" : " (string str) {\n    this.el.set_title(this.title + \" - \" + str);\n}\n",
42    "|             void show" : "() {\n    this.left_tree =new Xcls_WindowLeftTree();\n    _this.vbox.el.pack_start(this.left_tree.el,true, true,0);\n    this.el.show_all();\n\n}",
43    "$ xns" : "Gtk",
44    "# Xcls_ClutterFiles clutterfiles" : "null",
45    "# Xcls_LeftProps left_props" : "null",
46    "|             void hideViewEditing" : "  ( )   {\n\n// show the file navigation...\n    this.windowstate.set(WindowState.State.FILES);\n\n}",
47    "# Xcls_RightPalete rightpalete" : "null",
48    "# string title" : "\"Application Builder\"",
49    "# ValaProjectSettings vala_projectsettings" : "null",
50    "# Xcls_WindowAddProp add_props" : "null",
51    "|             void showObject" : "() {\n\n     \n    // what's the active node on the left hand side..\n    \n    var n = _this.left_tree.getActiveElement();\n\n    if (_this.left_tree.model.file == null) {\n        return;\n    }\n    \n    if (n == null && _this.left_tree.model.file.tree != null) {\n        return;\n    }\n    \n     _this.backbutton.el.show();\n       _this.projectbutton.el.hide();\n    _this.editfilebutton.el.hide();\n    _this.projecteditbutton.el.hide();    \n    \n     \n    //this.rooview.el.hide();\n    this.rightpalete.el.show_all();\n    this.rightpalete.load(_this.left_tree.getActiveFile().palete(), n == null ? \"*top\" : n.fqn());\n\n    \n    //this.rightpalete.show(this.project);\n\n    _this.objectview.el.save_easing_state();\n        \n    var el = _this.rooview.el;\n    el.save_easing_state();\n   \n     _this.clutterembed.setSizesAlloc(\"object\");\n    \n\n    _this.objectview.el.set_scale(1.0f,1.0f);\n   \n   \n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n    _this.objectview.el.restore_easing_state();\n    this.state = \"object\";\n}",
52    "* init" : " this.state = \"files\";\n\t  \n    //this.el.show_all();\n    \n    ",
53    "|             void hideObject" : "() {\n      // return to editing state..\n       \n          _this.projecteditbutton.el.show();\n      _this.backbutton.el.hide();\n     _this.projectbutton.el.show(); \n         _this.editfilebutton.el.show();   \n     _this.objectview.el.save_easing_state();\n    var el = _this.rooview.el;\n    el.save_easing_state();\n\n    \n    el.set_scale(1.0f,1.0f);\n    _this.objectview.el.set_scale(0.0f,0.0f);\n    _this.state = \"edit\";\n\n \n    //_this.clutterfiles.loadProject(_this.project);\n\n    el.restore_easing_state();\n     _this.objectview.el.restore_easing_state();  \n \n\n}",
54    "# Xcls_GtkView window_gladeview" : "null",
55    "items" : [
56     {
57      "id" : "vbox",
58      "* pack" : "add",
59      "xtype" : "VBox",
60      "$ xns" : "Gtk",
61      "$ homogeneous" : false,
62      "items" : [
63       {
64        "id" : "mainpane",
65        "position" : 400,
66        "* pack" : "pack_end,true,true,0",
67        "# int lastWidth" : 0,
68        "xtype" : "HPaned",
69        "$ xns" : "Gtk",
70        "items" : [
71         {
72          "id" : "leftpane",
73          "xtype" : "VBox",
74          "* pack" : "add1",
75          "$ xns" : "Gtk",
76          "items" : [
77           {
78            "id" : "editpane",
79            "xtype" : "VPaned",
80            "* pack" : "pack_start,false,true,0",
81            "$ xns" : "Gtk",
82            "items" : [
83             {
84              "id" : "tree",
85              "xtype" : "VBox",
86              "* pack" : "add1",
87              "$ xns" : "Gtk"
88             },
89             {
90              "id" : "props",
91              "xtype" : "VBox",
92              "* pack" : "add2",
93              "$ xns" : "Gtk"
94             }
95            ]
96           }
97          ]
98         },
99         {
100          "* pack" : "add2",
101          "xtype" : "VBox",
102          "$ xns" : "Gtk",
103          "items" : [
104           {
105            "listeners" : {
106             "size_allocate" : "  (  alloc) => {\n    this.windowstate.resizeCanvasElements(alloc); \n        \n}"
107            },
108            "id" : "clutterembed",
109            "* init" : "    var stage = this.el.get_stage();\n    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));\n    \n    \n",
110            "xtype" : "Embed",
111            "* pack" : "pack_start,true,true,0",
112            "$ xns" : "GtkClutter",
113            "items" : [
114             {
115              "id" : "rooview",
116              "* init" : "{\n   \n   \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            1.0f\n        )\n    );\n        \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(1.0f,1.0f);\n    \n    this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
117              "xtype" : "Actor",
118              "* pack" : "get_stage().add_child",
119              "$ xns" : "GtkClutter"
120             },
121             {
122              "id" : "objectview",
123              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
124              "xtype" : "Actor",
125              "* pack" : "get_stage().add_child",
126              "$ xns" : "GtkClutter"
127             },
128             {
129              "id" : "codeeditview",
130              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
131              "xtype" : "Actor",
132              "* pack" : "get_stage().add_child",
133              "$ xns" : "GtkClutter"
134             },
135             {
136              "id" : "addpropsview",
137              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
138              "xtype" : "Actor",
139              "* pack" : "get_stage().add_child",
140              "$ xns" : "GtkClutter"
141             },
142             {
143              "id" : "projecteditview",
144              "* init" : "{\n   \n   \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            1.0f\n        )\n    );\n        \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(1.0f,0.0f);\n    this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n            _this.clutterembed.el.get_stage().height /2);\n            \n}",
145              "xtype" : "Actor",
146              "* pack" : "get_stage().add_child",
147              "$ xns" : "GtkClutter"
148             },
149             {
150              "id" : "buttonlayout",
151              "* init" : "{\n    \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n     \n    \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.5f,0.5f);\n     this.el.set_size(50,\n           _this.clutterembed.el.get_stage().height);\n     \n}",
152              "xtype" : "Actor",
153              "* pack" : "get_stage().add_child",
154              "$ xns" : "Clutter",
155              "items" : [
156               {
157                "$ orientation" : "Clutter.Orientation.VERTICAL",
158                "xtype" : "BoxLayout",
159                "$ xns" : "Clutter",
160                "* prop" : "layout_manager"
161               },
162               {
163                "id" : "backbutton",
164                "* init" : "this.el.set_size(50,50);",
165                "xtype" : "Actor",
166                "* pack" : "add_child",
167                "$ xns" : "Clutter",
168                "items" : [
169                 {
170                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
171                  "xtype" : "Actor",
172                  "* pack" : "add_child",
173                  "$ xns" : "GtkClutter",
174                  "items" : [
175                   {
176                    "listeners" : {
177                     "clicked" : "  ( ) => {\n  \n    this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
178                    },
179                    "utf8 tooltip_text" : "Back",
180                    "* pack" : false,
181                    "xtype" : "Button",
182                    "width_request" : 50,
183                    "$ xns" : "Gtk",
184                    "height_request" : 50,
185                    "items" : [
186                     {
187                      "* pack" : "set_image",
188                      "xtype" : "Image",
189                      "utf8 icon_name" : "go-previous",
190                      "$ xns" : "Gtk"
191                     }
192                    ]
193                   }
194                  ]
195                 }
196                ]
197               },
198               {
199                "id" : "projectbutton",
200                "* init" : "this.el.set_size(50,50);",
201                "xtype" : "Actor",
202                "* pack" : "add_child",
203                "$ xns" : "Clutter",
204                "items" : [
205                 {
206                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
207                  "* pack" : "add_child",
208                  "xtype" : "Actor",
209                  "$ xns" : "GtkClutter",
210                  "items" : [
211                   {
212                    "listeners" : {
213                     "clicked" : "  ( ) => {\n   this.windowstate.switchState(WindowState.State.PROJECT);\n      \n\n}"
214                    },
215                    "* pack" : false,
216                    "xtype" : "Button",
217                    "width_request" : 50,
218                    "$ xns" : "Gtk",
219                    "height_request" : 50,
220                    "$ tooltop_text" : "\"Open File\"",
221                    "items" : [
222                     {
223                      "utf8 icon_name" : "document-open",
224                      "* pack" : "set_image",
225                      "xtype" : "Image",
226                      "$ xns" : "Gtk"
227                     }
228                    ]
229                   }
230                  ]
231                 }
232                ]
233               },
234               {
235                "id" : "editfilebutton",
236                "* init" : "this.el.set_size(50.0f,50.0f);",
237                "xtype" : "Actor",
238                "* pack" : "add_child",
239                "$ xns" : "Clutter",
240                "items" : [
241                 {
242                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
243                  "* pack" : "add_child",
244                  "xtype" : "Actor",
245                  "$ xns" : "GtkClutter",
246                  "items" : [
247                   {
248                    "listeners" : {
249                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    if (_this.project == null || _this.left_tree.model.file == null) {\n        return  ;\n    }\n     this.windowstate.new_file_dialog.show(_this.left_tree.model.file);\n     \n    return  ;    \n\n\n}"
250                    },
251                    "* pack" : false,
252                    "xtype" : "Button",
253                    "width_request" : 50,
254                    "$ xns" : "Gtk",
255                    "$ tooltip_text" : "\"File Details\"",
256                    "height_request" : 50,
257                    "items" : [
258                     {
259                      "xtype" : "Image",
260                      "utf8 icon_name" : "document-properties",
261                      "* pack" : "set_image",
262                      "$ xns" : "Gtk"
263                     }
264                    ]
265                   }
266                  ]
267                 }
268                ]
269               },
270               {
271                "id" : "projecteditbutton",
272                "* init" : "this.el.set_size(50,50);",
273                "xtype" : "Actor",
274                "* pack" : "add_child",
275                "$ xns" : "Clutter",
276                "items" : [
277                 {
278                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
279                  "* pack" : "add_child",
280                  "xtype" : "Actor",
281                  "$ xns" : "GtkClutter",
282                  "items" : [
283                   {
284                    "listeners" : {
285                     "clicked" : "  ( ) => {\n     this.windowstate.switchState(WindowState.State.PROJECT);\n   \n\n\n}"
286                    },
287                    "* pack" : false,
288                    "xtype" : "Button",
289                    "width_request" : 50,
290                    "$ xns" : "Gtk",
291                    "$ tooltip_text" : "\"Project Details\"",
292                    "height_request" : 50,
293                    "items" : [
294                     {
295                      "* pack" : "set_image",
296                      "xtype" : "Image",
297                      "utf8 icon_name" : "emblem-system",
298                      "$ xns" : "Gtk"
299                     }
300                    ]
301                   }
302                  ]
303                 }
304                ]
305               },
306               {
307                "listeners" : {
308                 "button_press_event" : "  ( ) => {\n    \n    \n    \n    switch (_this.state) {\n\n \n        case \"addprop\":\n            _this.hideAddProp();\n            _this.showObject();\n            break;\n    case \"addlistener\":\n            _this.hideAddListener();\n            _this.showObject();\n            break;\n\n// show            \n        case \"edit\":\n            _this.showObject();\n            break;\n            \n// hide            \n        case \"object\":\n            _this.hideObject();\n            break;\n            break;\n                        \n        default:\n            print(\"unhandled add objects from %s\\n\",_this.state);\n            break;\n    }\n    return false;    \n\n\n}",
309                 "enter_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#333\");\n        return false;\n}",
310                 "leave_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#000\");\n    return false;\n}"
311                },
312                "id" : "objectshowbutton",
313                "* init" : "this.el.set_size(50,50);",
314                "xtype" : "Actor",
315                "* pack" : "add_child",
316                "$ xns" : "Clutter",
317                "items" : [
318                 {
319                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
320                  "* pack" : "add_child",
321                  "xtype" : "Actor",
322                  "$ xns" : "GtkClutter",
323                  "items" : [
324                   {
325                    "listeners" : {
326                     "clicked" : "  ( ) => {\n    \n     this.windowstate.switchState(WindowState.State.OBJECT);\n  \n\n\n}"
327                    },
328                    "* pack" : false,
329                    "xtype" : "Button",
330                    "width_request" : 50,
331                    "$ xns" : "Gtk",
332                    "$ tooltip_text" : "\"Add Child Element\"",
333                    "height_request" : 50,
334                    "items" : [
335                     {
336                      "utf8 icon_name" : "list-add",
337                      "* pack" : "set_image",
338                      "xtype" : "Image",
339                      "$ xns" : "Gtk"
340                     }
341                    ]
342                   }
343                  ]
344                 }
345                ]
346               },
347               {
348                "id" : "addpropbutton",
349                "* init" : "this.el.set_size(50,50);",
350                "xtype" : "Actor",
351                "* pack" : "add_child",
352                "$ xns" : "Clutter",
353                "items" : [
354                 {
355                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
356                  "* pack" : "add_child",
357                  "xtype" : "Actor",
358                  "$ xns" : "GtkClutter",
359                  "items" : [
360                   {
361                    "listeners" : {
362                     "clicked" : "  ( ) => {\n    \n     this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
363                    },
364                    "* pack" : false,
365                    "xtype" : "Button",
366                    "width_request" : 50,
367                    "$ xns" : "Gtk",
368                    "$ tooltip_text" : "\"Add Property\"",
369                    "height_request" : 50,
370                    "items" : [
371                     {
372                      "xtype" : "Image",
373                      "utf8 icon_name" : "format-justify-left",
374                      "* pack" : "set_image",
375                      "$ xns" : "Gtk"
376                     }
377                    ]
378                   }
379                  ]
380                 }
381                ]
382               },
383               {
384                "id" : "addlistenerbutton",
385                "* init" : "this.el.set_size(50,50);",
386                "xtype" : "Actor",
387                "* pack" : "add_child",
388                "$ xns" : "Clutter",
389                "items" : [
390                 {
391                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
392                  "* pack" : "add_child",
393                  "xtype" : "Actor",
394                  "$ xns" : "GtkClutter",
395                  "items" : [
396                   {
397                    "listeners" : {
398                     "clicked" : "  ( ) => {\n    \n    \n    \n    switch (_this.state) {\n        case \"edit\":\n            _this.showAddListener();\n            break;\n            \n       \n        case \"addlistener\":\n            _this.hideAddListener();\n            break;\n\n            \n        case \"addprop\":\n            _this.hideAddProp();\n            _this.showAddListener();\n            break;\n         case \"object\":\n            _this.hideObject();\n            _this.showAddListener();\n            break;\n    \n          default:\n            print(\"unhandled add listener from %s\\n\",_this.state);\n\n            break;\n            \n    }\n    return  ;    \n\n\n}"
399                    },
400                    "* pack" : false,
401                    "xtype" : "Button",
402                    "width_request" : 50,
403                    "$ xns" : "Gtk",
404                    "$ tooltip_text" : "\"Add Event Code\"",
405                    "height_request" : 50,
406                    "items" : [
407                     {
408                      "* pack" : "set_image",
409                      "xtype" : "Image",
410                      "utf8 icon_name" : "appointment-new",
411                      "$ xns" : "Gtk"
412                     }
413                    ]
414                   }
415                  ]
416                 }
417                ]
418               },
419               {
420                "id" : "addprojectbutton",
421                "* init" : "this.el.set_size(50.0f,50.0f);",
422                "xtype" : "Actor",
423                "* pack" : "add_child",
424                "$ xns" : "Clutter",
425                "items" : [
426                 {
427                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
428                  "* pack" : "add_child",
429                  "xtype" : "Actor",
430                  "$ xns" : "GtkClutter",
431                  "items" : [
432                   {
433                    "listeners" : {
434                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =     Xcls_EditProject.singleton();\n    pe.el.set_transient_for(_this.el);\n    pe.el.set_modal(true);   \n   \n    var p  = pe.show();\n\n    if (p == null) {\n        return;\n    }\n    _this.left_projects.is_loaded = false;    \n    _this.left_projects.load();\n    _this.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
435                    },
436                    "* pack" : false,
437                    "xtype" : "Button",
438                    "width_request" : 50,
439                    "$ xns" : "Gtk",
440                    "$ tooltip_text" : "\"New\\nProj.\"",
441                    "height_request" : 50,
442                    "items" : [
443                     {
444                      "xtype" : "Image",
445                      "utf8 icon_name" : "folder-new",
446                      "* pack" : "set_image",
447                      "$ xns" : "Gtk"
448                     }
449                    ]
450                   }
451                  ]
452                 }
453                ]
454               },
455               {
456                "id" : "addfilebutton",
457                "* init" : "this.el.set_size(50.0f,50.0f);",
458                "xtype" : "Actor",
459                "* pack" : "add_child",
460                "$ xns" : "Clutter",
461                "items" : [
462                 {
463                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
464                  "* pack" : "add_child",
465                  "xtype" : "Actor",
466                  "$ xns" : "GtkClutter",
467                  "items" : [
468                   {
469                    "listeners" : {
470                     "clicked" : " () => {\n    // create a new file in project..\n    \n    // what's the currently selected project...\n    var proj = _this.left_projects.getSelectedProject();\n    \n    if (proj == null) {\n        return  ;\n    }\n    \n    \n    \n    var f = JsRender.JsRender.factory(proj.xtype,  proj, \"\");\n    _this.project = proj;\n    _this.new_file_dialog.show(f);\n    \n    return  ;    \n}"
471                    },
472                    "* pack" : false,
473                    "xtype" : "Button",
474                    "width_request" : 50,
475                    "$ xns" : "Gtk",
476                    "$ tooltip_text" : "\"Add File\"",
477                    "height_request" : 50,
478                    "items" : [
479                     {
480                      "utf8 icon_name" : "document-new",
481                      "* pack" : "set_image",
482                      "xtype" : "Image",
483                      "$ xns" : "Gtk"
484                     }
485                    ]
486                   }
487                  ]
488                 }
489                ]
490               },
491               {
492                "id" : "delprojectbutton",
493                "* init" : "this.el.set_size(50,50);",
494                "xtype" : "Actor",
495                "* pack" : "add_child",
496                "$ xns" : "Clutter",
497                "items" : [
498                 {
499                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
500                  "* pack" : "add_child",
501                  "xtype" : "Actor",
502                  "$ xns" : "GtkClutter",
503                  "items" : [
504                   {
505                    "listeners" : {
506                     "clicked" : "  ( ) => {\n     \n     var cd = DialogConfirm.singleton();\n     cd.el.set_transient_for(_this.el);\n    cd.el.set_modal(true);\n\n     var project =   _this.left_projects.getSelectedProject();\n    if (project == null) {\n        print(\"SKIP - no project\\n\");\n        return;\n    }\n    \n        \n     if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n        \"Are you sure you want to delete project %s\".printf(project.name))) {\n        return;\n    }\n     \n\n    // confirm?\n    Project.Project.remove(project);\n    _this.project = null;\n    \n    _this.left_projects.is_loaded =  false;\n    _this.left_projects.load();\n    _this.clutterfiles.clearFiles();\n\n}"
507                    },
508                    "* pack" : false,
509                    "xtype" : "Button",
510                    "width_request" : 50,
511                    "$ xns" : "Gtk",
512                    "$ tooltip_text" : "\"Delelte Project\"",
513                    "height_request" : 50,
514                    "items" : [
515                     {
516                      "xtype" : "Image",
517                      "utf8 icon_name" : "user-trash",
518                      "* pack" : "set_image",
519                      "$ xns" : "Gtk"
520                     }
521                    ]
522                   }
523                  ]
524                 }
525                ]
526               },
527               {
528                "id" : "new_window",
529                "* init" : "this.el.set_size(50,50);",
530                "xtype" : "Actor",
531                "* pack" : "add_child",
532                "$ xns" : "Clutter",
533                "items" : [
534                 {
535                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
536                  "* pack" : "add_child",
537                  "xtype" : "Actor",
538                  "$ xns" : "GtkClutter",
539                  "items" : [
540                   {
541                    "listeners" : {
542                     "clicked" : "  ( ) => {\n        Xcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.hideViewEditing();\n}"
543                    },
544                    "utf8 tooltip_text" : "Open New Window",
545                    "* pack" : false,
546                    "xtype" : "Button",
547                    "width_request" : 50,
548                    "$ xns" : "Gtk",
549                    "height_request" : 50,
550                    "items" : [
551                     {
552                      "xtype" : "Image",
553                      "utf8 icon_name" : "window-new",
554                      "* pack" : "set_image",
555                      "$ xns" : "Gtk"
556                     }
557                    ]
558                   }
559                  ]
560                 }
561                ]
562               }
563              ]
564             }
565            ]
566           }
567          ]
568         }
569        ]
570       }
571      ]
572     }
573    ]
574   }
575  ]
576 }