src/Builder4/MainWindow.bjs
[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  "build_module" : "builder",
9  "items" : [
10   {
11    "listeners" : {
12     "delete_event" : "  (   event) => {\n    return false;\n} ",
13     "destroy" : "() =>  {\n Xcls_MainWindow.singleton().no_windows--;\n \n Resources.singleton().disconnect(_this.statusbar.handler_id);\n \n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n     Gtk.main_quit();\n }\n}",
14     "show" : "  ( ) => {\n    // hide the file editing..\n   \n    //this.hideViewEditing();\n    _this.statusbar.el.hide();\n     _this.statusbar_errors.el.hide();\n    _this.statusbar_warnings.el.hide();\n    _this.statusbar_depricated.el.hide();\n    \n  \n    Resources.singleton().checkResources();\n\n}",
15     "key_release_event" : " (event) => {\n    \n    if (this.search_entry.el.is_visible()) {\n\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-f  pressed\");\n\t\t\tthis.search_entry.el.grab_focus();\n\t\t    return false;\n\t\t}\n\t\t\n\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-g  pressed\");\n\t\t\tthis.search_entry.forwardSearch(true);\n\t\t    return false;\n\t\t}\n\t\t\n\t}    \n\t\n\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\tprint(\"SAVE: ctrl-n  pressed\");\n\t\tthis.openNewWindow();\n\t\treturn false;\n\t}\n\t\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
16    },
17    "id" : "MainWindow",
18    "default_width" : 800,
19    "* init" : " \n\t  \n    //this.el.show_all();\n    \n     ",
20    "| void openNewWindow" : "() {\n\tXcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}\n",
21    "# Project.Project project" : "null",
22    "# string title" : "\"Application Builder\"",
23    "xtype" : "Window",
24    "# int no_windows" : 1,
25    "default_height" : 500,
26    "|        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    \n\n\n\n}\n",
27    "$ xns" : "Gtk",
28    "|             void show" : "() {\n   \n    this.el.show_all();\n\n}",
29    "# WindowState windowstate" : "null",
30    "border_width" : 0,
31    "$ type" : "Gtk.WindowType.TOPLEVEL",
32    "|             void setTitle" : " (string str) {\n    this.headerbar.el.set_title(this.title + \" - \" + str);\n} \n",
33    "items" : [
34     {
35      "id" : "headerbar",
36      "xtype" : "HeaderBar",
37      "* pack" : "set_titlebar",
38      "bool show_close_button" : true,
39      "$ xns" : "Gtk",
40      "string title" : "Application Builder",
41      "items" : [
42       {
43        "* pack" : "pack_start",
44        "xtype" : "Box",
45        "$ xns" : "Gtk",
46        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
47        "items" : [
48         {
49          "bool use_popover" : false,
50          "xtype" : "MenuButton",
51          "* pack" : "add",
52          "$ xns" : "Gtk",
53          "items" : [
54           {
55            "id" : "topbarmenu",
56            "* init" : "{\n    this.el.show_all();\n}\n",
57            "xtype" : "Menu",
58            "* pack" : "set_popup",
59            "$ xns" : "Gtk",
60            "items" : [
61             {
62              "listeners" : {
63               "activate" : "( ) => {\n       _this.openNewWindow();\n}"
64              },
65              "string label" : "Open a new Window",
66              "* pack" : "append",
67              "xtype" : "MenuItem",
68              "$ xns" : "Gtk"
69             },
70             {
71              "* pack" : "append",
72              "xtype" : "SeparatorMenuItem",
73              "$ xns" : "Gtk"
74             },
75             {
76              "listeners" : {
77               "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
78              },
79              "xtype" : "MenuItem",
80              "string label" : "Download updated Resources",
81              "* pack" : "append",
82              "$ xns" : "Gtk"
83             },
84             {
85              "listeners" : {
86               "activate" : "() => {\n    About.singleton().el.show();\n    }"
87              },
88              "* pack" : "append",
89              "xtype" : "MenuItem",
90              "string label" : "About the Builder",
91              "$ xns" : "Gtk"
92             }
93            ]
94           },
95           {
96            "utf8 icon_name" : "help-about",
97            "* pack" : "set_image",
98            "xtype" : "Image",
99            "$ xns" : "Gtk"
100           }
101          ]
102         }
103        ]
104       },
105       {
106        "listeners" : {
107         "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
108        },
109        "* pack" : false,
110        "xtype" : "Button",
111        "width_request" : 50,
112        "$ xns" : "Gtk",
113        "height_request" : 50,
114        "$ tooltop_text" : "\"Open File\"",
115        "items" : [
116         {
117          "xtype" : "Image",
118          "utf8 icon_name" : "document-open",
119          "* pack" : "set_image",
120          "$ xns" : "Gtk"
121         }
122        ]
123       }
124      ]
125     },
126     {
127      "listeners" : {
128       "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
129      },
130      "utf8 tooltip_text" : "Back",
131      "xtype" : "Button",
132      "* pack" : false,
133      "width_request" : 50,
134      "$ xns" : "Gtk",
135      "height_request" : 50,
136      "items" : [
137       {
138        "* pack" : "set_image",
139        "xtype" : "Image",
140        "utf8 icon_name" : "go-previous",
141        "$ xns" : "Gtk"
142       }
143      ]
144     },
145     {
146      "id" : "vbox",
147      "* pack" : "add",
148      "xtype" : "Box",
149      "$ xns" : "Gtk",
150      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
151      "$ homogeneous" : false,
152      "items" : [
153       {
154        "id" : "mainpane",
155        "position" : 400,
156        "* pack" : "pack_start,true,true,0",
157        "# int lastWidth" : 0,
158        "xtype" : "Paned",
159        "$ xns" : "Gtk",
160        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
161        "items" : [
162         {
163          "id" : "leftpane",
164          "xtype" : "Box",
165          "* pack" : "add1",
166          "$ xns" : "Gtk",
167          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
168          "items" : [
169           {
170            "id" : "editpane",
171            "xtype" : "Paned",
172            "* pack" : "pack_start,true,true,0",
173            "$ xns" : "Gtk",
174            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
175            "items" : [
176             {
177              "id" : "tree",
178              "xtype" : "Box",
179              "* pack" : "add1",
180              "$ xns" : "Gtk",
181              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
182             },
183             {
184              "id" : "props",
185              "xtype" : "Box",
186              "* pack" : "add2",
187              "$ xns" : "Gtk",
188              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
189             }
190            ]
191           }
192          ]
193         },
194         {
195          "* pack" : "add2",
196          "xtype" : "Box",
197          "$ xns" : "Gtk",
198          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
199          "items" : [
200           {
201            "listeners" : {
202             "size_allocate" : "  (  alloc) => {\n    if (_this.windowstate == null) {\n        return;\n    }\n    _this.windowstate.resizeCanvas(); \n        \n}"
203            },
204            "id" : "clutterembed",
205            "* init" : "    var stage = this.el.get_stage();\n    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));\n    \n    \n",
206            "xtype" : "Embed",
207            "* pack" : "pack_start,true,true,0",
208            "$ xns" : "GtkClutter",
209            "items" : [
210             {
211              "id" : "rooview",
212              "* 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}",
213              "xtype" : "Actor",
214              "* pack" : "get_stage().add_child",
215              "$ xns" : "GtkClutter"
216             },
217             {
218              "id" : "objectview",
219              "* 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}",
220              "xtype" : "Actor",
221              "* pack" : "get_stage().add_child",
222              "$ xns" : "GtkClutter"
223             },
224             {
225              "id" : "codeeditview",
226              "* 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}",
227              "xtype" : "Actor",
228              "* pack" : "get_stage().add_child",
229              "$ xns" : "GtkClutter"
230             },
231             {
232              "id" : "addpropsview",
233              "* 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}",
234              "xtype" : "Actor",
235              "* pack" : "get_stage().add_child",
236              "$ xns" : "GtkClutter"
237             },
238             {
239              "id" : "projecteditview",
240              "* 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}",
241              "xtype" : "Actor",
242              "* pack" : "get_stage().add_child",
243              "$ xns" : "GtkClutter"
244             },
245             {
246              "id" : "buttonlayout",
247              "* 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}",
248              "xtype" : "Actor",
249              "* pack" : "get_stage().add_child",
250              "$ xns" : "Clutter",
251              "items" : [
252               {
253                "$ orientation" : "Clutter.Orientation.VERTICAL",
254                "xtype" : "BoxLayout",
255                "$ xns" : "Clutter",
256                "* prop" : "layout_manager"
257               },
258               {
259                "id" : "backbutton",
260                "* init" : "this.el.set_size(50,50);",
261                "xtype" : "Actor",
262                "* pack" : "add_child",
263                "$ xns" : "Clutter",
264                "items" : [
265                 {
266                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
267                  "xtype" : "Actor",
268                  "* pack" : "add_child",
269                  "$ xns" : "GtkClutter",
270                  "items" : [
271                   {
272                    "listeners" : {
273                     "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
274                    },
275                    "utf8 tooltip_text" : "Back",
276                    "* pack" : false,
277                    "xtype" : "Button",
278                    "width_request" : 50,
279                    "$ xns" : "Gtk",
280                    "height_request" : 50,
281                    "items" : [
282                     {
283                      "xtype" : "Image",
284                      "utf8 icon_name" : "go-previous",
285                      "* pack" : "set_image",
286                      "$ xns" : "Gtk"
287                     }
288                    ]
289                   }
290                  ]
291                 }
292                ]
293               },
294               {
295                "id" : "projectbutton",
296                "* init" : "this.el.set_size(50,50);",
297                "xtype" : "Actor",
298                "* pack" : "add_child",
299                "$ xns" : "Clutter",
300                "items" : [
301                 {
302                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
303                  "* pack" : "add_child",
304                  "xtype" : "Actor",
305                  "$ xns" : "GtkClutter",
306                  "items" : [
307                   {
308                    "listeners" : {
309                     "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
310                    },
311                    "* pack" : false,
312                    "xtype" : "Button",
313                    "width_request" : 50,
314                    "$ xns" : "Gtk",
315                    "height_request" : 50,
316                    "$ tooltop_text" : "\"Open File\"",
317                    "items" : [
318                     {
319                      "* pack" : "set_image",
320                      "xtype" : "Image",
321                      "utf8 icon_name" : "document-open",
322                      "$ xns" : "Gtk"
323                     }
324                    ]
325                   }
326                  ]
327                 }
328                ]
329               },
330               {
331                "id" : "editfilebutton",
332                "* init" : "this.el.set_size(50.0f,50.0f);",
333                "xtype" : "Actor",
334                "* pack" : "add_child",
335                "$ xns" : "Clutter",
336                "items" : [
337                 {
338                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
339                  "* pack" : "add_child",
340                  "xtype" : "Actor",
341                  "$ xns" : "GtkClutter",
342                  "items" : [
343                   {
344                    "listeners" : {
345                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    if (_this.project == null || _this.windowstate.file == null) {\n        return  ;\n    }\n     _this.windowstate.file_details.show(\n        _this.windowstate.file, this.el\n    );\n     \n    return  ;    \n\n\n}"
346                    },
347                    "* pack" : false,
348                    "xtype" : "Button",
349                    "width_request" : 50,
350                    "$ xns" : "Gtk",
351                    "$ tooltip_text" : "\"File Details\"",
352                    "height_request" : 50,
353                    "items" : [
354                     {
355                      "utf8 icon_name" : "document-properties",
356                      "* pack" : "set_image",
357                      "xtype" : "Image",
358                      "$ xns" : "Gtk"
359                     }
360                    ]
361                   }
362                  ]
363                 }
364                ]
365               },
366               {
367                "id" : "projecteditbutton",
368                "* init" : "this.el.set_size(50,50);",
369                "xtype" : "Actor",
370                "* pack" : "add_child",
371                "$ xns" : "Clutter",
372                "items" : [
373                 {
374                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
375                  "* pack" : "add_child",
376                  "xtype" : "Actor",
377                  "$ xns" : "GtkClutter",
378                  "items" : [
379                   {
380                    "listeners" : {
381                     "clicked" : "  ( ) => {\n     _this.windowstate.switchState(WindowState.State.PROJECT);\n   \n\n\n}"
382                    },
383                    "* pack" : false,
384                    "xtype" : "Button",
385                    "width_request" : 50,
386                    "$ xns" : "Gtk",
387                    "$ tooltip_text" : "\"Project Details\"",
388                    "height_request" : 50,
389                    "items" : [
390                     {
391                      "xtype" : "Image",
392                      "utf8 icon_name" : "emblem-system",
393                      "* pack" : "set_image",
394                      "$ xns" : "Gtk"
395                     }
396                    ]
397                   }
398                  ]
399                 }
400                ]
401               },
402               {
403                "listeners" : {
404                 "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
405                 "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
406                },
407                "id" : "objectshowbutton",
408                "* init" : "this.el.set_size(50,50);",
409                "xtype" : "Actor",
410                "* pack" : "add_child",
411                "$ xns" : "Clutter",
412                "items" : [
413                 {
414                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
415                  "* pack" : "add_child",
416                  "xtype" : "Actor",
417                  "$ xns" : "GtkClutter",
418                  "items" : [
419                   {
420                    "listeners" : {
421                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.OBJECT);\n  \n \n}"
422                    },
423                    "* pack" : false,
424                    "xtype" : "Button",
425                    "width_request" : 50,
426                    "$ xns" : "Gtk",
427                    "$ tooltip_text" : "\"Add Child Element\"",
428                    "height_request" : 50,
429                    "items" : [
430                     {
431                      "* pack" : "set_image",
432                      "xtype" : "Image",
433                      "utf8 icon_name" : "list-add",
434                      "$ xns" : "Gtk"
435                     }
436                    ]
437                   }
438                  ]
439                 }
440                ]
441               },
442               {
443                "id" : "addpropbutton",
444                "* init" : "this.el.set_size(50,50);",
445                "xtype" : "Actor",
446                "* pack" : "add_child",
447                "$ xns" : "Clutter",
448                "items" : [
449                 {
450                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
451                  "* pack" : "add_child",
452                  "xtype" : "Actor",
453                  "$ xns" : "GtkClutter",
454                  "items" : [
455                   {
456                    "listeners" : {
457                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
458                    },
459                    "* pack" : false,
460                    "xtype" : "Button",
461                    "width_request" : 50,
462                    "$ xns" : "Gtk",
463                    "$ tooltip_text" : "\"Add Property\"",
464                    "height_request" : 50,
465                    "items" : [
466                     {
467                      "utf8 icon_name" : "format-justify-left",
468                      "* pack" : "set_image",
469                      "xtype" : "Image",
470                      "$ xns" : "Gtk"
471                     }
472                    ]
473                   }
474                  ]
475                 }
476                ]
477               },
478               {
479                "id" : "addlistenerbutton",
480                "* init" : "this.el.set_size(50,50);",
481                "xtype" : "Actor",
482                "* pack" : "add_child",
483                "$ xns" : "Clutter",
484                "items" : [
485                 {
486                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
487                  "* pack" : "add_child",
488                  "xtype" : "Actor",
489                  "$ xns" : "GtkClutter",
490                  "items" : [
491                   {
492                    "listeners" : {
493                     "clicked" : "  ( ) => {\n    \n    _this.windowstate.switchState(WindowState.State.LISTENER);\n  \n\n\n}"
494                    },
495                    "* pack" : false,
496                    "xtype" : "Button",
497                    "width_request" : 50,
498                    "$ xns" : "Gtk",
499                    "$ tooltip_text" : "\"Add Event Code\"",
500                    "height_request" : 50,
501                    "items" : [
502                     {
503                      "xtype" : "Image",
504                      "utf8 icon_name" : "appointment-new",
505                      "* pack" : "set_image",
506                      "$ xns" : "Gtk"
507                     }
508                    ]
509                   }
510                  ]
511                 }
512                ]
513               },
514               {
515                "id" : "addprojectbutton",
516                "* init" : "this.el.set_size(50.0f,50.0f);",
517                "xtype" : "Actor",
518                "* pack" : "add_child",
519                "$ xns" : "Clutter",
520                "items" : [
521                 {
522                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
523                  "* pack" : "add_child",
524                  "xtype" : "Actor",
525                  "$ xns" : "GtkClutter",
526                  "items" : [
527                   {
528                    "listeners" : {
529                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =      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    \n    \n    _this.windowstate.left_projects.is_loaded = false;    \n    _this.windowstate.left_projects.load();\n    _this.windowstate.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
530                    },
531                    "* pack" : false,
532                    "xtype" : "Button",
533                    "width_request" : 50,
534                    "$ xns" : "Gtk",
535                    "$ tooltip_text" : "\"New\\nProj.\"",
536                    "height_request" : 50,
537                    "items" : [
538                     {
539                      "utf8 icon_name" : "folder-new",
540                      "* pack" : "set_image",
541                      "xtype" : "Image",
542                      "$ xns" : "Gtk"
543                     }
544                    ]
545                   }
546                  ]
547                 }
548                ]
549               },
550               {
551                "id" : "addfilebutton",
552                "* init" : "this.el.set_size(50.0f,50.0f);",
553                "xtype" : "Actor",
554                "* pack" : "add_child",
555                "$ xns" : "Clutter",
556                "items" : [
557                 {
558                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
559                  "* pack" : "add_child",
560                  "xtype" : "Actor",
561                  "$ xns" : "GtkClutter",
562                  "items" : [
563                   {
564                    "listeners" : {
565                     "clicked" : " () => {\n    // create a new file in project..\n    print(\"add file selected\\n\");\n    // what's the currently selected project...\n    var proj = _this.windowstate.left_projects.getSelectedProject();\n    \n    if (proj == null) {\n\t\tprint(\"no project selected?\\n\");\n        return  ;\n    }\n    \n    print(\"creating file?\");\n    \n    var f = JsRender.JsRender.factory(proj.xtype,  proj, \"\");\n    _this.project = proj;\n        print(\"showing popup?\");\n     _this.windowstate.file_details.show(\n       f, this.el\n    );\n    \n    \n    return  ;    \n}"
566                    },
567                    "* pack" : false,
568                    "xtype" : "Button",
569                    "width_request" : 50,
570                    "$ xns" : "Gtk",
571                    "$ tooltip_text" : "\"Add File\"",
572                    "height_request" : 50,
573                    "items" : [
574                     {
575                      "* pack" : "set_image",
576                      "xtype" : "Image",
577                      "utf8 icon_name" : "document-new",
578                      "$ xns" : "Gtk"
579                     }
580                    ]
581                   }
582                  ]
583                 }
584                ]
585               },
586               {
587                "id" : "delprojectbutton",
588                "* init" : "this.el.set_size(50,50);",
589                "xtype" : "Actor",
590                "* pack" : "add_child",
591                "$ xns" : "Clutter",
592                "items" : [
593                 {
594                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
595                  "* pack" : "add_child",
596                  "xtype" : "Actor",
597                  "$ xns" : "GtkClutter",
598                  "items" : [
599                   {
600                    "listeners" : {
601                     "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.windowstate.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.windowstate.left_projects.is_loaded =  false;\n    _this.windowstate.left_projects.load();\n    _this.windowstate.clutterfiles.clearFiles();\n\n}"
602                    },
603                    "* pack" : false,
604                    "xtype" : "Button",
605                    "width_request" : 50,
606                    "$ xns" : "Gtk",
607                    "$ tooltip_text" : "\"Delete Project\"",
608                    "height_request" : 50,
609                    "items" : [
610                     {
611                      "utf8 icon_name" : "user-trash",
612                      "* pack" : "set_image",
613                      "xtype" : "Image",
614                      "$ xns" : "Gtk"
615                     }
616                    ]
617                   }
618                  ]
619                 }
620                ]
621               }
622              ]
623             }
624            ]
625           }
626          ]
627         }
628        ]
629       },
630       {
631        "bool homogeneous" : false,
632        "xtype" : "Box",
633        "* pack" : "pack_end,false,true,0",
634        "$ xns" : "Gtk",
635        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
636        "items" : [
637         {
638          "* pack" : "pack_start,true,true,0",
639          "xtype" : "Label",
640          "string label" : "   ",
641          "$ xns" : "Gtk"
642         },
643         {
644          "bool show_text" : true,
645          "id" : "statusbar",
646          "ulong handler_id" : "-1",
647          "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));\n       \n     });\n}\n",
648          "xtype" : "ProgressBar",
649          "* pack" : "pack_start,true,true,0",
650          "$ xns" : "Gtk"
651         },
652         {
653          "listeners" : {
654           "key_press_event" : "(event) => {\n    \n \tif (event.keyval == Gdk.Key.Return) {\n\t\tthis.forwardSearch(false);\n\t    return true;\n\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} ",
655           "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\t_this.search_results.el.hide();\n\t\treturn;\n\t}\n\tvar res = 0;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t} else { \n\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tbreak;\n\t}\n\t_this.search_results.el.show();\n\tif (res > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
656          },
657          "id" : "search_entry",
658          "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
659          "* pack" : "pack_start,false,true,0",
660          "xtype" : "SearchEntry",
661          "$ xns" : "Gtk",
662          "| void forwardSearch" : "(bool change_focus) {\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\t_this.windowstate.code_editor.forwardSearch(change_focus);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);\n\t\t\t} else { \n\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\t\n}\n"
663         },
664         {
665          "* pack" : "pack_end,false,true,0",
666          "xtype" : "MenuBar",
667          "$ xns" : "Gtk",
668          "items" : [
669           {
670            "listeners" : {
671             "button_press_event" : "() => {\n/*\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    */\n    return true;\n}"
672            },
673            "bool always_show_image" : true,
674            "id" : "search_results",
675            "Xcls_ValaCompileErrors popup" : "",
676            "string label" : "Matches",
677            "* pack" : "add",
678            "xtype" : "ImageMenuItem",
679            "$ xns" : "Gtk",
680            "items" : [
681             {
682              "* pack" : "set_image",
683              "xtype" : "Image",
684              "utf8 icon_name" : "system-search",
685              "bool sensitive" : false,
686              "$ xns" : "Gtk"
687             }
688            ]
689           },
690           {
691            "id" : "statusbar_compilestatus_label",
692            "* pack" : "add",
693            "xtype" : "MenuItem",
694            "string label" : "Compile Status:",
695            "$ xns" : "Gtk"
696           },
697           {
698            "listeners" : {
699             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
700            },
701            "bool always_show_image" : true,
702            "id" : "statusbar_errors",
703            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Errors\";\n    this.notices = nots;\n\n}\n",
704            "Xcls_ValaCompileErrors popup" : "",
705            "string label" : "Errors",
706            "* pack" : "add",
707            "xtype" : "ImageMenuItem",
708            "# Json.Object notices" : "new Json.Object() ",
709            "$ xns" : "Gtk",
710            "items" : [
711             {
712              "xtype" : "Image",
713              "utf8 icon_name" : "dialog-error",
714              "* pack" : "set_image",
715              "$ xns" : "Gtk"
716             }
717            ]
718           },
719           {
720            "listeners" : {
721             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
722            },
723            "bool always_show_image" : true,
724            "id" : "statusbar_warnings",
725            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Warnings\";\n    this.notices = nots;\n\n}\n",
726            "Xcls_ValaCompileErrors popup" : "",
727            "* pack" : "add",
728            "string label" : "Warnings",
729            "xtype" : "ImageMenuItem",
730            "# Json.Object notices" : "new Json.Object()",
731            "$ xns" : "Gtk",
732            "items" : [
733             {
734              "* pack" : "set_image",
735              "xtype" : "Image",
736              "utf8 icon_name" : "dialog-warning",
737              "$ xns" : "Gtk"
738             }
739            ]
740           },
741           {
742            "listeners" : {
743             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
744            },
745            "bool always_show_image" : true,
746            "id" : "statusbar_depricated",
747            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Depricated\";\n    this.notices = nots;\n\n}\n",
748            "Xcls_ValaCompileErrors popup" : "",
749            "string label" : "Depricated",
750            "* pack" : "add",
751            "xtype" : "ImageMenuItem",
752            "# Json.Object notices" : "new Json.Object()",
753            "$ xns" : "Gtk",
754            "items" : [
755             {
756              "utf8 icon_name" : "dialog-information",
757              "* pack" : "set_image",
758              "xtype" : "Image",
759              "$ xns" : "Gtk"
760             }
761            ]
762           },
763           {
764            "listeners" : {
765             "button_press_event" : "() => {\n\tif (_this.windowstate.file == null) {\n\t\treturn true;\n\t}\n\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);\n\t\n\t_this.windowstate.compile_results.show(this.el,true);\n\t\n\treturn true;\n}"
766            },
767            "bool always_show_image" : true,
768            "id" : "statusbar_run",
769            "Xcls_ValaCompileErrors popup" : "",
770            "string label" : "Run",
771            "* pack" : "add",
772            "xtype" : "ImageMenuItem",
773            "$ xns" : "Gtk",
774            "items" : [
775             {
776              "* pack" : "set_image",
777              "xtype" : "Image",
778              "utf8 icon_name" : "media-playback-start",
779              "$ xns" : "Gtk"
780             }
781            ]
782           }
783          ]
784         }
785        ]
786       }
787      ]
788     }
789    ]
790   }
791  ]
792 }