src/Builder4/About.vala.c
[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          "listeners" : {
105           "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
106          },
107          "id" : "openbtn",
108          "* pack" : false,
109          "xtype" : "Button",
110          "width_request" : 50,
111          "$ xns" : "Gtk",
112          "height_request" : 50,
113          "$ tooltop_text" : "\"Open File\"",
114          "items" : [
115           {
116            "xtype" : "Image",
117            "utf8 icon_name" : "document-open",
118            "* pack" : "set_image",
119            "$ xns" : "Gtk"
120           }
121          ]
122         },
123         {
124          "listeners" : {
125           "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
126          },
127          "id" : "openbackbtn",
128          "utf8 tooltip_text" : "Back",
129          "xtype" : "Button",
130          "* pack" : false,
131          "width_request" : 50,
132          "$ xns" : "Gtk",
133          "height_request" : 50,
134          "bool visible" : false,
135          "items" : [
136           {
137            "* pack" : "set_image",
138            "xtype" : "Image",
139            "utf8 icon_name" : "go-previous",
140            "$ xns" : "Gtk"
141           }
142          ]
143         }
144        ]
145       }
146      ]
147     },
148     {
149      "id" : "vbox",
150      "* pack" : "add",
151      "xtype" : "Box",
152      "$ xns" : "Gtk",
153      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
154      "$ homogeneous" : false,
155      "items" : [
156       {
157        "id" : "mainpane",
158        "position" : 400,
159        "* pack" : "pack_start,true,true,0",
160        "# int lastWidth" : 0,
161        "xtype" : "Paned",
162        "$ xns" : "Gtk",
163        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
164        "items" : [
165         {
166          "id" : "leftpane",
167          "xtype" : "Box",
168          "* pack" : "add1",
169          "$ xns" : "Gtk",
170          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
171          "items" : [
172           {
173            "id" : "editpane",
174            "xtype" : "Paned",
175            "* pack" : "pack_start,true,true,0",
176            "$ xns" : "Gtk",
177            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
178            "items" : [
179             {
180              "id" : "tree",
181              "xtype" : "Box",
182              "* pack" : "add1",
183              "$ xns" : "Gtk",
184              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
185             },
186             {
187              "id" : "props",
188              "xtype" : "Box",
189              "* pack" : "add2",
190              "$ xns" : "Gtk",
191              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
192             }
193            ]
194           }
195          ]
196         },
197         {
198          "* pack" : "add2",
199          "xtype" : "Box",
200          "$ xns" : "Gtk",
201          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
202          "items" : [
203           {
204            "listeners" : {
205             "size_allocate" : "  (  alloc) => {\n    if (_this.windowstate == null) {\n        return;\n    }\n    _this.windowstate.resizeCanvas(); \n        \n}"
206            },
207            "id" : "clutterembed",
208            "* init" : "    var stage = this.el.get_stage();\n    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));\n    \n    \n",
209            "xtype" : "Embed",
210            "* pack" : "pack_start,true,true,0",
211            "$ xns" : "GtkClutter",
212            "items" : [
213             {
214              "id" : "rooview",
215              "* 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}",
216              "xtype" : "Actor",
217              "* pack" : "get_stage().add_child",
218              "$ xns" : "GtkClutter"
219             },
220             {
221              "id" : "objectview",
222              "* 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}",
223              "xtype" : "Actor",
224              "* pack" : "get_stage().add_child",
225              "$ xns" : "GtkClutter"
226             },
227             {
228              "id" : "codeeditview",
229              "* 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}",
230              "xtype" : "Actor",
231              "* pack" : "get_stage().add_child",
232              "$ xns" : "GtkClutter"
233             },
234             {
235              "id" : "addpropsview",
236              "* 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}",
237              "xtype" : "Actor",
238              "* pack" : "get_stage().add_child",
239              "$ xns" : "GtkClutter"
240             },
241             {
242              "id" : "projecteditview",
243              "* 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}",
244              "xtype" : "Actor",
245              "* pack" : "get_stage().add_child",
246              "$ xns" : "GtkClutter"
247             },
248             {
249              "id" : "buttonlayout",
250              "* 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}",
251              "xtype" : "Actor",
252              "* pack" : "get_stage().add_child",
253              "$ xns" : "Clutter",
254              "items" : [
255               {
256                "$ orientation" : "Clutter.Orientation.VERTICAL",
257                "xtype" : "BoxLayout",
258                "$ xns" : "Clutter",
259                "* prop" : "layout_manager"
260               },
261               {
262                "id" : "backbutton",
263                "* init" : "this.el.set_size(50,50);",
264                "xtype" : "Actor",
265                "* pack" : "add_child",
266                "$ xns" : "Clutter",
267                "items" : [
268                 {
269                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
270                  "xtype" : "Actor",
271                  "* pack" : "add_child",
272                  "$ xns" : "GtkClutter",
273                  "items" : [
274                   {
275                    "listeners" : {
276                     "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
277                    },
278                    "utf8 tooltip_text" : "Back",
279                    "* pack" : false,
280                    "xtype" : "Button",
281                    "width_request" : 50,
282                    "$ xns" : "Gtk",
283                    "height_request" : 50,
284                    "items" : [
285                     {
286                      "xtype" : "Image",
287                      "utf8 icon_name" : "go-previous",
288                      "* pack" : "set_image",
289                      "$ xns" : "Gtk"
290                     }
291                    ]
292                   }
293                  ]
294                 }
295                ]
296               },
297               {
298                "id" : "projectbutton",
299                "* init" : "this.el.set_size(50,50);",
300                "xtype" : "Actor",
301                "* pack" : "add_child",
302                "$ xns" : "Clutter",
303                "items" : [
304                 {
305                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
306                  "* pack" : "add_child",
307                  "xtype" : "Actor",
308                  "$ xns" : "GtkClutter",
309                  "items" : [
310                   {
311                    "listeners" : {
312                     "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
313                    },
314                    "* pack" : false,
315                    "xtype" : "Button",
316                    "width_request" : 50,
317                    "$ xns" : "Gtk",
318                    "height_request" : 50,
319                    "$ tooltop_text" : "\"Open File\"",
320                    "items" : [
321                     {
322                      "* pack" : "set_image",
323                      "xtype" : "Image",
324                      "utf8 icon_name" : "document-open",
325                      "$ xns" : "Gtk"
326                     }
327                    ]
328                   }
329                  ]
330                 }
331                ]
332               },
333               {
334                "id" : "editfilebutton",
335                "* init" : "this.el.set_size(50.0f,50.0f);",
336                "xtype" : "Actor",
337                "* pack" : "add_child",
338                "$ xns" : "Clutter",
339                "items" : [
340                 {
341                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
342                  "* pack" : "add_child",
343                  "xtype" : "Actor",
344                  "$ xns" : "GtkClutter",
345                  "items" : [
346                   {
347                    "listeners" : {
348                     "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}"
349                    },
350                    "* pack" : false,
351                    "xtype" : "Button",
352                    "width_request" : 50,
353                    "$ xns" : "Gtk",
354                    "$ tooltip_text" : "\"File Details\"",
355                    "height_request" : 50,
356                    "items" : [
357                     {
358                      "utf8 icon_name" : "document-properties",
359                      "* pack" : "set_image",
360                      "xtype" : "Image",
361                      "$ xns" : "Gtk"
362                     }
363                    ]
364                   }
365                  ]
366                 }
367                ]
368               },
369               {
370                "id" : "projecteditbutton",
371                "* init" : "this.el.set_size(50,50);",
372                "xtype" : "Actor",
373                "* pack" : "add_child",
374                "$ xns" : "Clutter",
375                "items" : [
376                 {
377                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
378                  "* pack" : "add_child",
379                  "xtype" : "Actor",
380                  "$ xns" : "GtkClutter",
381                  "items" : [
382                   {
383                    "listeners" : {
384                     "clicked" : "  ( ) => {\n     _this.windowstate.switchState(WindowState.State.PROJECT);\n   \n\n\n}"
385                    },
386                    "* pack" : false,
387                    "xtype" : "Button",
388                    "width_request" : 50,
389                    "$ xns" : "Gtk",
390                    "$ tooltip_text" : "\"Project Details\"",
391                    "height_request" : 50,
392                    "items" : [
393                     {
394                      "xtype" : "Image",
395                      "utf8 icon_name" : "emblem-system",
396                      "* pack" : "set_image",
397                      "$ xns" : "Gtk"
398                     }
399                    ]
400                   }
401                  ]
402                 }
403                ]
404               },
405               {
406                "listeners" : {
407                 "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
408                 "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
409                },
410                "id" : "objectshowbutton",
411                "* init" : "this.el.set_size(50,50);",
412                "xtype" : "Actor",
413                "* pack" : "add_child",
414                "$ xns" : "Clutter",
415                "items" : [
416                 {
417                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
418                  "* pack" : "add_child",
419                  "xtype" : "Actor",
420                  "$ xns" : "GtkClutter",
421                  "items" : [
422                   {
423                    "listeners" : {
424                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.OBJECT);\n  \n \n}"
425                    },
426                    "* pack" : false,
427                    "xtype" : "Button",
428                    "width_request" : 50,
429                    "$ xns" : "Gtk",
430                    "$ tooltip_text" : "\"Add Child Element\"",
431                    "height_request" : 50,
432                    "items" : [
433                     {
434                      "* pack" : "set_image",
435                      "xtype" : "Image",
436                      "utf8 icon_name" : "list-add",
437                      "$ xns" : "Gtk"
438                     }
439                    ]
440                   }
441                  ]
442                 }
443                ]
444               },
445               {
446                "id" : "addpropbutton",
447                "* init" : "this.el.set_size(50,50);",
448                "xtype" : "Actor",
449                "* pack" : "add_child",
450                "$ xns" : "Clutter",
451                "items" : [
452                 {
453                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
454                  "* pack" : "add_child",
455                  "xtype" : "Actor",
456                  "$ xns" : "GtkClutter",
457                  "items" : [
458                   {
459                    "listeners" : {
460                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
461                    },
462                    "* pack" : false,
463                    "xtype" : "Button",
464                    "width_request" : 50,
465                    "$ xns" : "Gtk",
466                    "$ tooltip_text" : "\"Add Property\"",
467                    "height_request" : 50,
468                    "items" : [
469                     {
470                      "utf8 icon_name" : "format-justify-left",
471                      "* pack" : "set_image",
472                      "xtype" : "Image",
473                      "$ xns" : "Gtk"
474                     }
475                    ]
476                   }
477                  ]
478                 }
479                ]
480               },
481               {
482                "id" : "addlistenerbutton",
483                "* init" : "this.el.set_size(50,50);",
484                "xtype" : "Actor",
485                "* pack" : "add_child",
486                "$ xns" : "Clutter",
487                "items" : [
488                 {
489                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
490                  "* pack" : "add_child",
491                  "xtype" : "Actor",
492                  "$ xns" : "GtkClutter",
493                  "items" : [
494                   {
495                    "listeners" : {
496                     "clicked" : "  ( ) => {\n    \n    _this.windowstate.switchState(WindowState.State.LISTENER);\n  \n\n\n}"
497                    },
498                    "* pack" : false,
499                    "xtype" : "Button",
500                    "width_request" : 50,
501                    "$ xns" : "Gtk",
502                    "$ tooltip_text" : "\"Add Event Code\"",
503                    "height_request" : 50,
504                    "items" : [
505                     {
506                      "xtype" : "Image",
507                      "utf8 icon_name" : "appointment-new",
508                      "* pack" : "set_image",
509                      "$ xns" : "Gtk"
510                     }
511                    ]
512                   }
513                  ]
514                 }
515                ]
516               },
517               {
518                "id" : "addprojectbutton",
519                "* init" : "this.el.set_size(50.0f,50.0f);",
520                "xtype" : "Actor",
521                "* pack" : "add_child",
522                "$ xns" : "Clutter",
523                "items" : [
524                 {
525                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
526                  "* pack" : "add_child",
527                  "xtype" : "Actor",
528                  "$ xns" : "GtkClutter",
529                  "items" : [
530                   {
531                    "listeners" : {
532                     "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}"
533                    },
534                    "* pack" : false,
535                    "xtype" : "Button",
536                    "width_request" : 50,
537                    "$ xns" : "Gtk",
538                    "$ tooltip_text" : "\"New\\nProj.\"",
539                    "height_request" : 50,
540                    "items" : [
541                     {
542                      "utf8 icon_name" : "folder-new",
543                      "* pack" : "set_image",
544                      "xtype" : "Image",
545                      "$ xns" : "Gtk"
546                     }
547                    ]
548                   }
549                  ]
550                 }
551                ]
552               },
553               {
554                "id" : "addfilebutton",
555                "* init" : "this.el.set_size(50.0f,50.0f);",
556                "xtype" : "Actor",
557                "* pack" : "add_child",
558                "$ xns" : "Clutter",
559                "items" : [
560                 {
561                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
562                  "* pack" : "add_child",
563                  "xtype" : "Actor",
564                  "$ xns" : "GtkClutter",
565                  "items" : [
566                   {
567                    "listeners" : {
568                     "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}"
569                    },
570                    "* pack" : false,
571                    "xtype" : "Button",
572                    "width_request" : 50,
573                    "$ xns" : "Gtk",
574                    "$ tooltip_text" : "\"Add File\"",
575                    "height_request" : 50,
576                    "items" : [
577                     {
578                      "* pack" : "set_image",
579                      "xtype" : "Image",
580                      "utf8 icon_name" : "document-new",
581                      "$ xns" : "Gtk"
582                     }
583                    ]
584                   }
585                  ]
586                 }
587                ]
588               },
589               {
590                "id" : "delprojectbutton",
591                "* init" : "this.el.set_size(50,50);",
592                "xtype" : "Actor",
593                "* pack" : "add_child",
594                "$ xns" : "Clutter",
595                "items" : [
596                 {
597                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
598                  "* pack" : "add_child",
599                  "xtype" : "Actor",
600                  "$ xns" : "GtkClutter",
601                  "items" : [
602                   {
603                    "listeners" : {
604                     "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}"
605                    },
606                    "* pack" : false,
607                    "xtype" : "Button",
608                    "width_request" : 50,
609                    "$ xns" : "Gtk",
610                    "$ tooltip_text" : "\"Delete Project\"",
611                    "height_request" : 50,
612                    "items" : [
613                     {
614                      "utf8 icon_name" : "user-trash",
615                      "* pack" : "set_image",
616                      "xtype" : "Image",
617                      "$ xns" : "Gtk"
618                     }
619                    ]
620                   }
621                  ]
622                 }
623                ]
624               }
625              ]
626             }
627            ]
628           }
629          ]
630         }
631        ]
632       },
633       {
634        "bool homogeneous" : false,
635        "xtype" : "Box",
636        "* pack" : "pack_end,false,true,0",
637        "$ xns" : "Gtk",
638        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
639        "items" : [
640         {
641          "* pack" : "pack_start,true,true,0",
642          "xtype" : "Label",
643          "string label" : "   ",
644          "$ xns" : "Gtk"
645         },
646         {
647          "bool show_text" : true,
648          "id" : "statusbar",
649          "ulong handler_id" : "-1",
650          "* 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",
651          "xtype" : "ProgressBar",
652          "* pack" : "pack_start,true,true,0",
653          "$ xns" : "Gtk"
654         },
655         {
656          "listeners" : {
657           "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} ",
658           "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"
659          },
660          "id" : "search_entry",
661          "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
662          "* pack" : "pack_start,false,true,0",
663          "xtype" : "SearchEntry",
664          "$ xns" : "Gtk",
665          "| 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"
666         },
667         {
668          "* pack" : "pack_end,false,true,0",
669          "xtype" : "MenuBar",
670          "$ xns" : "Gtk",
671          "items" : [
672           {
673            "listeners" : {
674             "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}"
675            },
676            "bool always_show_image" : true,
677            "id" : "search_results",
678            "Xcls_ValaCompileErrors popup" : "",
679            "string label" : "Matches",
680            "* pack" : "add",
681            "xtype" : "ImageMenuItem",
682            "$ xns" : "Gtk",
683            "items" : [
684             {
685              "* pack" : "set_image",
686              "xtype" : "Image",
687              "utf8 icon_name" : "system-search",
688              "bool sensitive" : false,
689              "$ xns" : "Gtk"
690             }
691            ]
692           },
693           {
694            "id" : "statusbar_compilestatus_label",
695            "* pack" : "add",
696            "xtype" : "MenuItem",
697            "string label" : "Compile Status:",
698            "$ xns" : "Gtk"
699           },
700           {
701            "listeners" : {
702             "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}"
703            },
704            "bool always_show_image" : true,
705            "id" : "statusbar_errors",
706            "| 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",
707            "Xcls_ValaCompileErrors popup" : "",
708            "string label" : "Errors",
709            "* pack" : "add",
710            "xtype" : "ImageMenuItem",
711            "# Json.Object notices" : "new Json.Object() ",
712            "$ xns" : "Gtk",
713            "items" : [
714             {
715              "xtype" : "Image",
716              "utf8 icon_name" : "dialog-error",
717              "* pack" : "set_image",
718              "$ xns" : "Gtk"
719             }
720            ]
721           },
722           {
723            "listeners" : {
724             "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}"
725            },
726            "bool always_show_image" : true,
727            "id" : "statusbar_warnings",
728            "| 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",
729            "Xcls_ValaCompileErrors popup" : "",
730            "* pack" : "add",
731            "string label" : "Warnings",
732            "xtype" : "ImageMenuItem",
733            "# Json.Object notices" : "new Json.Object()",
734            "$ xns" : "Gtk",
735            "items" : [
736             {
737              "* pack" : "set_image",
738              "xtype" : "Image",
739              "utf8 icon_name" : "dialog-warning",
740              "$ xns" : "Gtk"
741             }
742            ]
743           },
744           {
745            "listeners" : {
746             "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}"
747            },
748            "bool always_show_image" : true,
749            "id" : "statusbar_depricated",
750            "| 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",
751            "Xcls_ValaCompileErrors popup" : "",
752            "string label" : "Depricated",
753            "* pack" : "add",
754            "xtype" : "ImageMenuItem",
755            "# Json.Object notices" : "new Json.Object()",
756            "$ xns" : "Gtk",
757            "items" : [
758             {
759              "utf8 icon_name" : "dialog-information",
760              "* pack" : "set_image",
761              "xtype" : "Image",
762              "$ xns" : "Gtk"
763             }
764            ]
765           },
766           {
767            "listeners" : {
768             "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}"
769            },
770            "bool always_show_image" : true,
771            "id" : "statusbar_run",
772            "Xcls_ValaCompileErrors popup" : "",
773            "string label" : "Run",
774            "* pack" : "add",
775            "xtype" : "ImageMenuItem",
776            "$ xns" : "Gtk",
777            "items" : [
778             {
779              "* pack" : "set_image",
780              "xtype" : "Image",
781              "utf8 icon_name" : "media-playback-start",
782              "$ xns" : "Gtk"
783             }
784            ]
785           }
786          ]
787         }
788        ]
789       }
790      ]
791     }
792    ]
793   }
794  ]
795 }