e1e853338974e742ea6ca5cd4837fdf00fa25549
[roobuilder] / src / Builder4 / MainWindow.bjs
1 {
2  "build_module" : "builder",
3  "items" : [
4   {
5    "# Project.Project project" : "null",
6    "# WindowState windowstate" : "null",
7    "# int no_windows" : 1,
8    "# string title" : "\"Roo Application Builder\"",
9    "$ type" : "Gtk.WindowType.TOPLEVEL",
10    "$ xns" : "Gtk",
11    "* init" : [
12     " ",
13     "\t  ",
14     "    //this.el.show_all();",
15     "    //try {",
16     "         this.el.set_icon_name(\"roobuilder\");",
17     "\t//} catch (Exception e) {",
18     "\t//\tprint(\"no icon found\");",
19     "//\t}"
20    ],
21    "border_width" : 0,
22    "default_height" : 750,
23    "default_width" : 1200,
24    "id" : "MainWindow",
25    "items" : [
26     {
27      "$ xns" : "Gtk",
28      "* pack" : "set_titlebar",
29      "bool show_close_button" : true,
30      "id" : "headerbar",
31      "items" : [
32       {
33        "$ xns" : "Gtk",
34        "* pack" : "pack_start",
35        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
36        "items" : [
37         {
38          "$ tooltop_text" : [
39           "\"Open a new Window",
40           "\""
41          ],
42          "$ xns" : "Gtk",
43          "* pack" : "add",
44          "bool always_show_image" : true,
45          "id" : "windownew",
46          "items" : [
47           {
48            "$ xns" : "Gtk",
49            "* pack" : "set_image",
50            "utf8 icon_name" : "window-new",
51            "xtype" : "Image"
52           }
53          ],
54          "listeners" : {
55           "clicked" : [
56            "  ( ) => {",
57            "     _this.openNewWindow();",
58            "      ",
59            "",
60            "}"
61           ]
62          },
63          "string label" : "New Window",
64          "xtype" : "Button"
65         },
66         {
67          "$ tooltop_text" : "\"Open File\"",
68          "$ xns" : "Gtk",
69          "* pack" : "add",
70          "bool always_show_image" : true,
71          "id" : "open_projects_btn",
72          "items" : [
73           {
74            "$ xns" : "Gtk",
75            "* pack" : "set_image",
76            "utf8 icon_name" : "system-file-manager",
77            "xtype" : "Image"
78           }
79          ],
80          "listeners" : {
81           "clicked" : [
82            "  ( ) => {",
83            "  \t_this.windowstate.showPopoverFiles(this.el, _this.project);",
84            "",
85            "}"
86           ]
87          },
88          "string label" : "Files / Projects",
89          "xtype" : "Button"
90         }
91        ],
92        "xtype" : "Box"
93       }
94      ],
95      "string title" : "Application Builder",
96      "xtype" : "HeaderBar"
97     },
98     {
99      "$ homogeneous" : false,
100      "$ xns" : "Gtk",
101      "* pack" : "add",
102      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
103      "id" : "vbox",
104      "items" : [
105       {
106        "# int lastWidth" : 0,
107        "$ xns" : "Gtk",
108        "* pack" : "pack_start,true,true,0",
109        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
110        "id" : "mainpane",
111        "items" : [
112         {
113          "$ xns" : "Gtk",
114          "* pack" : "add1",
115          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
116          "id" : "leftpane",
117          "items" : [
118           {
119            "$ xns" : "Gtk",
120            "* pack" : "pack_start,true,true,0",
121            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
122            "id" : "editpane",
123            "items" : [
124             {
125              "$ xns" : "Gtk",
126              "* pack" : "add1",
127              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
128              "id" : "tree",
129              "xtype" : "Box"
130             },
131             {
132              "$ xns" : "Gtk",
133              "* pack" : "add2",
134              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
135              "id" : "props",
136              "xtype" : "Box"
137             }
138            ],
139            "xtype" : "Paned"
140           }
141          ],
142          "xtype" : "Box"
143         },
144         {
145          "$ xns" : "Gtk",
146          "* pack" : "add2",
147          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
148          "items" : [
149           {
150            "$ xns" : "GtkClutter",
151            "* init" : [
152             "    var stage = this.el.get_stage();",
153             "    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));",
154             "    ",
155             "    ",
156             ""
157            ],
158            "* pack" : "pack_start,true,true,0",
159            "id" : "clutterembed",
160            "items" : [
161             {
162              "$ xns" : "GtkClutter",
163              "* init" : [
164               "{",
165               "   ",
166               "   ",
167               "    this.el.add_constraint(",
168               "        new Clutter.AlignConstraint(",
169               "            _this.clutterembed.el.get_stage(), ",
170               "            Clutter.AlignAxis.X_AXIS,",
171               "            1.0f",
172               "        )",
173               "    );",
174               "        ",
175               "    //this.el.set_position(100,100);",
176               "    this.el.set_pivot_point(1.0f,1.0f);",
177               "    ",
178               "    this.el.set_size(_this.clutterembed.el.get_stage().width-50,",
179               "            _this.clutterembed.el.get_stage().height);",
180               "            ",
181               "}"
182              ],
183              "* pack" : "get_stage().add_child",
184              "id" : "rooview",
185              "xtype" : "Actor"
186             },
187             {
188              "$ xns" : "GtkClutter",
189              "* init" : [
190               "{",
191               "   ",
192               "   /*",
193               "    this.el.add_constraint(",
194               "        new Clutter.AlignConstraint(",
195               "            _this.clutterembed.el.get_stage(), ",
196               "            Clutter.AlignAxis.X_AXIS,",
197               "            0.0f",
198               "        )",
199               "    );",
200               "    */",
201               "    this.el.fixed_x = 50.0f;",
202               "    this.el.fixed_y = 0.0f;",
203               "    //this.el.set_position(100,100);",
204               "    this.el.set_pivot_point(0.0f,0.0f);",
205               "    this.el.set_scale(0.0f,1.0f);",
206               "    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
207               "            _this.clutterembed.el.get_stage().height);",
208               "            ",
209               "}"
210              ],
211              "* pack" : "get_stage().add_child",
212              "id" : "objectview",
213              "xtype" : "Actor"
214             },
215             {
216              "$ xns" : "GtkClutter",
217              "* init" : [
218               "{",
219               "   ",
220               "   /*",
221               "    this.el.add_constraint(",
222               "        new Clutter.AlignConstraint(",
223               "            _this.clutterembed.el.get_stage(), ",
224               "            Clutter.AlignAxis.X_AXIS,",
225               "            0.0f",
226               "        )",
227               "    );",
228               "    */",
229               "    this.el.fixed_x = 50.0f;",
230               "    this.el.fixed_y = 0.0f;",
231               "    //this.el.set_position(100,100);",
232               "    this.el.set_pivot_point(0.0f,0.0f);",
233               "    this.el.set_scale(0.0f,1.0f);",
234               "    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
235               "            _this.clutterembed.el.get_stage().height);",
236               "            ",
237               "}"
238              ],
239              "* pack" : "get_stage().add_child",
240              "id" : "codeeditview",
241              "xtype" : "Actor"
242             },
243             {
244              "$ xns" : "GtkClutter",
245              "* init" : [
246               "{",
247               "   ",
248               "   /*",
249               "    this.el.add_constraint(",
250               "        new Clutter.AlignConstraint(",
251               "            _this.clutterembed.el.get_stage(), ",
252               "            Clutter.AlignAxis.X_AXIS,",
253               "            0.0f",
254               "        )",
255               "    );",
256               "    */",
257               "    this.el.fixed_x = 50.0f;",
258               "    this.el.fixed_y = 0.0f;",
259               "    //this.el.set_position(100,100);",
260               "    this.el.set_pivot_point(0.0f,0.0f);",
261               "    this.el.set_scale(0.0f,1.0f);",
262               "    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
263               "            _this.clutterembed.el.get_stage().height);",
264               "            ",
265               "}"
266              ],
267              "* pack" : "get_stage().add_child",
268              "id" : "addpropsview",
269              "xtype" : "Actor"
270             },
271             {
272              "$ xns" : "Clutter",
273              "* init" : [
274               "{",
275               "    ",
276               "    this.el.add_constraint(",
277               "        new Clutter.AlignConstraint(",
278               "            _this.clutterembed.el.get_stage(), ",
279               "            Clutter.AlignAxis.X_AXIS,",
280               "            0.0f",
281               "        )",
282               "    );",
283               "     ",
284               "    ",
285               "    //this.el.set_position(100,100);",
286               "    this.el.set_pivot_point(0.5f,0.5f);",
287               "     this.el.set_size(50,",
288               "           _this.clutterembed.el.get_stage().height);",
289               "     ",
290               "}"
291              ],
292              "* pack" : "get_stage().add_child",
293              "id" : "buttonlayout",
294              "items" : [
295               {
296                "$ orientation" : "Clutter.Orientation.VERTICAL",
297                "$ xns" : "Clutter",
298                "* prop" : "layout_manager",
299                "xtype" : "BoxLayout"
300               },
301               {
302                "$ xns" : "Clutter",
303                "* init" : "this.el.set_size(50,50);",
304                "* pack" : "add_child",
305                "id" : "backbutton",
306                "items" : [
307                 {
308                  "$ xns" : "GtkClutter",
309                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
310                  "* pack" : "add_child",
311                  "items" : [
312                   {
313                    "$ xns" : "Gtk",
314                    "* pack" : false,
315                    "height_request" : 50,
316                    "items" : [
317                     {
318                      "$ xns" : "Gtk",
319                      "* pack" : "set_image",
320                      "utf8 icon_name" : "go-previous",
321                      "xtype" : "Image"
322                     }
323                    ],
324                    "listeners" : {
325                     "clicked" : [
326                      "  ( ) => {",
327                      " //  if (_this.windowstate.state == WindowState.State.FILEPROJECT) {",
328                      "    ",
329                      "//\t     _this.windowstate.switchState(WindowState.State.FILES);",
330                      "  //   } else { ",
331                      "\t    _this.windowstate.switchState(WindowState.State.PREVIEW);",
332                      "  //  }",
333                      "    ",
334                      "",
335                      "}"
336                     ]
337                    },
338                    "utf8 tooltip_text" : "Back",
339                    "width_request" : 50,
340                    "xtype" : "Button"
341                   }
342                  ],
343                  "xtype" : "Actor"
344                 }
345                ],
346                "xtype" : "Actor"
347               },
348               {
349                "$ xns" : "Clutter",
350                "* init" : "this.el.set_size(50,50);",
351                "* pack" : "add_child",
352                "id" : "objectshowbutton",
353                "items" : [
354                 {
355                  "$ xns" : "GtkClutter",
356                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
357                  "* pack" : "add_child",
358                  "items" : [
359                   {
360                    "$ tooltip_text" : "\"Add Child Element\"",
361                    "$ xns" : "Gtk",
362                    "* pack" : false,
363                    "height_request" : 50,
364                    "items" : [
365                     {
366                      "$ xns" : "Gtk",
367                      "* pack" : "set_image",
368                      "utf8 icon_name" : "list-add",
369                      "xtype" : "Image"
370                     }
371                    ],
372                    "listeners" : {
373                     "clicked" : [
374                      "  ( ) => {",
375                      "    ",
376                      "",
377                      "  \t_this.windowstate.showAddObject(this.el);",
378                      " ",
379                      "}"
380                     ]
381                    },
382                    "width_request" : 50,
383                    "xtype" : "Button"
384                   }
385                  ],
386                  "xtype" : "Actor"
387                 }
388                ],
389                "listeners" : {
390                 "enter_event" : [
391                  "(  event)  => {",
392                  "    this.el.background_color =   Clutter.Color.from_string(\"#333\");",
393                  "        return false;",
394                  "}"
395                 ],
396                 "leave_event" : [
397                  "(  event)  => {",
398                  "    this.el.background_color =   Clutter.Color.from_string(\"#000\");",
399                  "    return false;",
400                  "}"
401                 ]
402                },
403                "xtype" : "Actor"
404               },
405               {
406                "$ xns" : "Clutter",
407                "* init" : "this.el.set_size(50,50);",
408                "* pack" : "add_child",
409                "id" : "addpropbutton",
410                "items" : [
411                 {
412                  "$ xns" : "GtkClutter",
413                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
414                  "* pack" : "add_child",
415                  "items" : [
416                   {
417                    "$ tooltip_text" : "\"Add Property\"",
418                    "$ xns" : "Gtk",
419                    "* pack" : false,
420                    "height_request" : 50,
421                    "items" : [
422                     {
423                      "$ xns" : "Gtk",
424                      "* pack" : "set_image",
425                      "utf8 icon_name" : "format-justify-left",
426                      "xtype" : "Image"
427                     }
428                    ],
429                    "listeners" : {
430                     "clicked" : [
431                      "  ( ) => {",
432                      "    ",
433                      "     _this.windowstate.showProps(this.el, \"props\");",
434                      " ",
435                      "",
436                      "}"
437                     ]
438                    },
439                    "width_request" : 50,
440                    "xtype" : "Button"
441                   }
442                  ],
443                  "xtype" : "Actor"
444                 }
445                ],
446                "xtype" : "Actor"
447               },
448               {
449                "$ xns" : "Clutter",
450                "* init" : "this.el.set_size(50,50);",
451                "* pack" : "add_child",
452                "id" : "addlistenerbutton",
453                "items" : [
454                 {
455                  "$ xns" : "GtkClutter",
456                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
457                  "* pack" : "add_child",
458                  "items" : [
459                   {
460                    "$ tooltip_text" : "\"Add Event Code\"",
461                    "$ xns" : "Gtk",
462                    "* pack" : false,
463                    "height_request" : 50,
464                    "items" : [
465                     {
466                      "$ xns" : "Gtk",
467                      "* pack" : "set_image",
468                      "utf8 icon_name" : "appointment-new",
469                      "xtype" : "Image"
470                     }
471                    ],
472                    "listeners" : {
473                     "clicked" : [
474                      "  ( ) => {",
475                      "    ",
476                      " ",
477                      "   _this.windowstate.showProps(this.el, \"signals\");",
478                      "",
479                      "",
480                      "}"
481                     ]
482                    },
483                    "width_request" : 50,
484                    "xtype" : "Button"
485                   }
486                  ],
487                  "xtype" : "Actor"
488                 }
489                ],
490                "xtype" : "Actor"
491               }
492              ],
493              "xtype" : "Actor"
494             }
495            ],
496            "listeners" : {
497             "size_allocate" : [
498              "  (  alloc) => {",
499              "    if (_this.windowstate == null) {",
500              "        return;",
501              "    }",
502              "    _this.windowstate.resizeCanvas(); ",
503              "        ",
504              "}"
505             ]
506            },
507            "xtype" : "Embed"
508           }
509          ],
510          "xtype" : "Box"
511         }
512        ],
513        "position" : 400,
514        "xtype" : "Paned"
515       },
516       {
517        "$ xns" : "Gtk",
518        "* pack" : "pack_end,false,true,0",
519        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
520        "bool homogeneous" : false,
521        "items" : [
522         {
523          "$ tooltip_text" : "\"Project Details\"",
524          "$ xns" : "Gtk",
525          "* pack" : "add",
526          "bool always_show_image" : true,
527          "height_request" : 50,
528          "items" : [
529           {
530            "$ xns" : "Gtk",
531            "* pack" : "set_image",
532            "utf8 icon_name" : "emblem-system",
533            "xtype" : "Image"
534           }
535          ],
536          "listeners" : {
537           "clicked" : [
538            "  ( ) => {",
539            "     ",
540            "     _this.windowstate.projectPopoverShow(this.el, _this.project);",
541            "   ",
542            " ",
543            "}"
544           ]
545          },
546          "string label" : "Edit Project Settings",
547          "width_request" : 50,
548          "xtype" : "Button"
549         },
550         {
551          "$ tooltip_text" : "\"File Details\"",
552          "$ xns" : "Gtk",
553          "* pack" : "add",
554          "bool always_show_image" : true,
555          "height_request" : 50,
556          "items" : [
557           {
558            "$ xns" : "Gtk",
559            "* pack" : "set_image",
560            "utf8 icon_name" : "document-properties",
561            "xtype" : "Image"
562           }
563          ],
564          "listeners" : {
565           "clicked" : [
566            "  ( ) => {",
567            "  ",
568            "    // create a new file in project..",
569            "    if (_this.project == null || _this.windowstate.file == null) {",
570            "        return  ;",
571            "    }",
572            "     _this.windowstate.file_details.show(",
573            "        _this.windowstate.file, this.el",
574            "    );",
575            "     ",
576            "    return  ;    ",
577            "",
578            "",
579            "}"
580           ]
581          },
582          "string label" : "Edit File Properties",
583          "width_request" : 50,
584          "xtype" : "Button"
585         },
586         {
587          "$ xns" : "Gtk",
588          "* pack" : "add",
589          "bool always_show_image" : true,
590          "items" : [
591           {
592            "$ xns" : "Gtk",
593            "* init" : [
594             "{",
595             "    this.el.show_all();",
596             "}",
597             ""
598            ],
599            "* pack" : "set_popup",
600            "id" : "topbarmenu",
601            "items" : [
602             {
603              "$ xns" : "Gtk",
604              "* pack" : "append",
605              "listeners" : {
606               "activate" : [
607                " ( ) => {",
608                "         Resources.singleton().fetchStart();",
609                "}"
610               ]
611              },
612              "string label" : "Download updated Resources",
613              "xtype" : "MenuItem"
614             },
615             {
616              "$ xns" : "Gtk",
617              "* pack" : "append",
618              "listeners" : {
619               "activate" : [
620                "() => {",
621                "    About.singleton().el.show();",
622                "    }"
623               ]
624              },
625              "string label" : "About the Builder",
626              "xtype" : "MenuItem"
627             }
628            ],
629            "xtype" : "Menu"
630           },
631           {
632            "$ xns" : "Gtk",
633            "* pack" : "set_image",
634            "utf8 icon_name" : "dialog-information",
635            "xtype" : "Image"
636           }
637          ],
638          "string label" : "About",
639          "xtype" : "MenuButton"
640         },
641         {
642          "$ xns" : "Gtk",
643          "* pack" : "pack_start,true,true,0",
644          "string label" : "   ",
645          "xtype" : "Label"
646         },
647         {
648          "$ xns" : "Gtk",
649          "* init" : [
650           "{",
651           "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
652           "        if (pos < 1) {",
653           "            this.el.hide();",
654           "            _this.mainpane.el.set_sensitive(true);",
655           "            ",
656           "            return;",
657           "        }",
658           "         _this.mainpane.el.set_sensitive(false);",
659           "         this.el.show();",
660           "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
661           "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
662           "       ",
663           "     });",
664           "}",
665           ""
666          ],
667          "* pack" : "pack_start,true,true,0",
668          "bool show_text" : true,
669          "id" : "statusbar",
670          "ulong handler_id" : "-1",
671          "xtype" : "ProgressBar"
672         },
673         {
674          "$ xns" : "Gtk",
675          "* init" : [
676           "var description =   Pango.FontDescription.from_string(\"monospace\");",
677           "\tdescription.set_size(8000);",
678           "\t this.el.override_font(description);",
679           "",
680           ""
681          ],
682          "* pack" : "pack_start,false,true,0",
683          "id" : "search_entry",
684          "listeners" : {
685           "changed" : [
686            "() => {",
687            "\tif (this.el.text == \"\") {",
688            "\t\t_this.search_results.el.hide();",
689            "\t\treturn;",
690            "\t}",
691            "\tvar res = 0;",
692            "\tswitch(_this.windowstate.state) {",
693            "\t\tcase WindowState.State.CODEONLY:",
694            "\t\t///case WindowState.State.CODE:",
695            "\t\t\t// search the code being edited..",
696            "\t\t\tres = _this.windowstate.code_editor_tab.search(this.el.text);",
697            "\t\t\t",
698            "\t\t\tbreak;",
699            "\t\tcase WindowState.State.PREVIEW:",
700            "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
701            "\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);",
702            "\t\t\t} else { ",
703            "\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t",
704            "\t\t\t}",
705            "\t\t",
706            "\t\t",
707            "\t\t\tbreak;",
708            "\t}",
709            "\t_this.search_results.el.show();",
710            "\tif (res > 0) {",
711            "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
712            "\t} else {",
713            "\t\t_this.search_results.el.label = \"No Matches\";",
714            "\t}",
715            "\t\t",
716            "\t",
717            "\t",
718            "}",
719            ""
720           ],
721           "key_press_event" : [
722            "(event) => {",
723            "    ",
724            " \tif (event.keyval == Gdk.Key.Return) {",
725            "\t\tthis.forwardSearch(false);",
726            "\t    return true;",
727            "",
728            "\t}    ",
729            "   // print(event.key.keyval)",
730            "    ",
731            "    return false;",
732            "",
733            "} "
734           ]
735          },
736          "xtype" : "SearchEntry",
737          "| void forwardSearch" : [
738           "(bool change_focus) {",
739           "\tswitch(_this.windowstate.state) {",
740           "\t\tcase WindowState.State.CODEONLY:",
741           "\t\t//case WindowState.State.CODE:",
742           "\t\t\t// search the code being edited..",
743           "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
744           "\t\t\t ",
745           "\t\t\tbreak;",
746           "\t\tcase WindowState.State.PREVIEW:",
747           "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
748           "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
749           "\t\t\t} else { ",
750           "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
751           "\t\t\t}",
752           "\t\t",
753           "\t\t\tbreak;",
754           "\t}",
755           "\t",
756           "}",
757           ""
758          ]
759         },
760         {
761          "$ xns" : "Gtk",
762          "* pack" : "add",
763          "items" : [
764           {
765            "$ xns" : "Gtk",
766            "* pack" : "add",
767            "Xcls_ValaCompileErrors popup" : "",
768            "bool always_show_image" : true,
769            "id" : "search_results",
770            "items" : [
771             {
772              "$ xns" : "Gtk",
773              "* pack" : "set_image",
774              "bool sensitive" : false,
775              "utf8 icon_name" : "system-search",
776              "xtype" : "Image"
777             }
778            ],
779            "listeners" : {
780             "button_press_event" : [
781              "() => {",
782              "/*",
783              "    if (this.popup == null) {",
784              "        this.popup = new Xcls_ValaCompileErrors();",
785              "        this.popup.window = _this;",
786              "    }",
787              "   ",
788              "    ",
789              "    this.popup.show(this.notices, this.el);",
790              "    */",
791              "    return true;",
792              "}"
793             ]
794            },
795            "string label" : "Matches",
796            "xtype" : "ImageMenuItem"
797           },
798           {
799            "$ xns" : "Gtk",
800            "* pack" : "add",
801            "id" : "statusbar_compilestatus_label",
802            "string label" : "Compile Status:",
803            "xtype" : "MenuItem"
804           },
805           {
806            "# Json.Object notices" : "new Json.Object() ",
807            "$ xns" : "Gtk",
808            "* pack" : "add",
809            "Xcls_ValaCompileErrors popup" : "",
810            "bool always_show_image" : true,
811            "id" : "statusbar_errors",
812            "items" : [
813             {
814              "$ xns" : "Gtk",
815              "* pack" : "set_image",
816              "utf8 icon_name" : "dialog-error",
817              "xtype" : "Image"
818             }
819            ],
820            "listeners" : {
821             "button_press_event" : [
822              "() => {",
823              "    if (this.popup == null) {",
824              "        this.popup = new Xcls_ValaCompileErrors();",
825              "        this.popup.window = _this;",
826              "    }",
827              "   ",
828              "    ",
829              "    this.popup.show(this.notices, this.el);",
830              "    return true;",
831              "}"
832             ]
833            },
834            "string label" : "Errors",
835            "xtype" : "ImageMenuItem",
836            "| void setNotices" : [
837             "(Json.Object nots, int qty) {",
838             "    this.el.show();",
839             "    this.el.label = qty.to_string() + \" Errors\";",
840             "    this.notices = nots;",
841             "",
842             "}",
843             ""
844            ]
845           },
846           {
847            "# Json.Object notices" : "new Json.Object()",
848            "$ xns" : "Gtk",
849            "* pack" : "add",
850            "Xcls_ValaCompileErrors popup" : "",
851            "bool always_show_image" : true,
852            "id" : "statusbar_warnings",
853            "items" : [
854             {
855              "$ xns" : "Gtk",
856              "* pack" : "set_image",
857              "utf8 icon_name" : "dialog-warning",
858              "xtype" : "Image"
859             }
860            ],
861            "listeners" : {
862             "button_press_event" : [
863              "() => {",
864              "    if (this.popup == null) {",
865              "        this.popup = new Xcls_ValaCompileErrors();",
866              "        this.popup.window = _this;",
867              "    }",
868              "    ",
869              "    this.popup.show(this.notices, this.el);",
870              "    return true;",
871              "}"
872             ]
873            },
874            "string label" : "Warnings",
875            "xtype" : "ImageMenuItem",
876            "| void setNotices" : [
877             "(Json.Object nots, int qty) {",
878             "    this.el.show();",
879             "    this.el.label = qty.to_string() + \" Warnings\";",
880             "    this.notices = nots;",
881             "",
882             "}",
883             ""
884            ]
885           },
886           {
887            "# Json.Object notices" : "new Json.Object()",
888            "$ xns" : "Gtk",
889            "* pack" : "add",
890            "Xcls_ValaCompileErrors popup" : "",
891            "bool always_show_image" : true,
892            "id" : "statusbar_depricated",
893            "items" : [
894             {
895              "$ xns" : "Gtk",
896              "* pack" : "set_image",
897              "utf8 icon_name" : "dialog-information",
898              "xtype" : "Image"
899             }
900            ],
901            "listeners" : {
902             "button_press_event" : [
903              "() => {",
904              "    if (this.popup == null) {",
905              "        this.popup = new Xcls_ValaCompileErrors();",
906              "        this.popup.window = _this;",
907              "    }",
908              "    ",
909              "    ",
910              "    this.popup.show(this.notices, this.el);",
911              "    return true;",
912              "}"
913             ]
914            },
915            "string label" : "Depricated",
916            "xtype" : "ImageMenuItem",
917            "| void setNotices" : [
918             "(Json.Object nots, int qty) {",
919             "    this.el.show();",
920             "    this.el.label = qty.to_string() + \" Depricated\";",
921             "    this.notices = nots;",
922             "",
923             "}",
924             ""
925            ]
926           },
927           {
928            "$ xns" : "Gtk",
929            "* pack" : "add",
930            "Xcls_ValaCompileErrors popup" : "",
931            "bool always_show_image" : true,
932            "id" : "statusbar_run",
933            "items" : [
934             {
935              "$ xns" : "Gtk",
936              "* pack" : "set_image",
937              "utf8 icon_name" : "media-playback-start",
938              "xtype" : "Image"
939             }
940            ],
941            "listeners" : {
942             "button_press_event" : [
943              "() => {",
944              "\tif (_this.windowstate.file == null) {",
945              "\t\treturn true;",
946              "\t}",
947              "\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);",
948              "\t",
949              "\t_this.windowstate.compile_results.show(this.el,true);",
950              "\t",
951              "\treturn true;",
952              "}"
953             ]
954            },
955            "string label" : "Run",
956            "xtype" : "ImageMenuItem"
957           }
958          ],
959          "string tooltip_text" : "Update Resources / About Roobuilder",
960          "xtype" : "MenuBar"
961         },
962         {
963          "$ xns" : "Gtk",
964          "* pack" : "add",
965          "id" : "statusbar_compile_spinner",
966          "string tooltip_text" : "Compiling",
967          "xtype" : "Spinner",
968          "| void start" : [
969           "() {",
970           "  this.el.show();",
971           "  this.el.start();  ",
972           "}",
973           ""
974          ],
975          "| void stop" : [
976           "() {",
977           " this.el.stop();",
978           "  this.el.hide();",
979           "}",
980           ""
981          ]
982         }
983        ],
984        "xtype" : "Box"
985       }
986      ],
987      "xtype" : "Box"
988     }
989    ],
990    "listeners" : {
991     "delete_event" : [
992      "  (   event) => {",
993      "    return false;",
994      "} "
995     ],
996     "destroy" : [
997      "() =>  {",
998      " Xcls_MainWindow.singleton().no_windows--;",
999      " ",
1000      " Resources.singleton().disconnect(_this.statusbar.handler_id);",
1001      " ",
1002      " ",
1003      " if (Xcls_MainWindow.singleton().no_windows < 1) {",
1004      "",
1005      "     Gtk.main_quit();",
1006      " }",
1007      "}"
1008     ],
1009     "key_release_event" : [
1010      " (event) => {",
1011      "    ",
1012      "    if (this.search_entry.el.is_visible()) {",
1013      "\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1014      "\t\t    print(\"SAVE: ctrl-f  pressed\");",
1015      "\t\t\tthis.search_entry.el.grab_focus();",
1016      "\t\t    return false;",
1017      "\t\t}",
1018      "\t\t",
1019      "\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1020      "\t\t    print(\"SAVE: ctrl-g  pressed\");",
1021      "\t\t\tthis.search_entry.forwardSearch(true);",
1022      "\t\t    return false;",
1023      "\t\t}",
1024      "\t\t",
1025      "\t}    ",
1026      "\t",
1027      "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1028      "\t\tprint(\"SAVE: ctrl-n  pressed\");",
1029      "\t\tthis.openNewWindow();",
1030      "\t\treturn false;",
1031      "\t}",
1032      "\t",
1033      "   // print(event.key.keyval)",
1034      "    ",
1035      "    return false;",
1036      "",
1037      "} ",
1038      "",
1039      ""
1040     ],
1041     "show" : [
1042      "  ( ) => {",
1043      "    // hide the file editing..",
1044      "   ",
1045      "    //this.hideViewEditing();",
1046      "    _this.statusbar.el.hide();",
1047      "     _this.statusbar_errors.el.hide();",
1048      "    _this.statusbar_warnings.el.hide();",
1049      "    _this.statusbar_depricated.el.hide();",
1050      "    _this.statusbar_compile_spinner.el.hide();",
1051      "  ",
1052      "    Resources.singleton().checkResources();",
1053      "",
1054      "}"
1055     ]
1056    },
1057    "xtype" : "Window",
1058    "|             void setTitle" : [
1059     " (string str) {",
1060     "    this.headerbar.el.set_title(this.title + \" - \" + str);",
1061     "} ",
1062     ""
1063    ],
1064    "|             void show" : [
1065     "() {",
1066     "   ",
1067     "    this.el.show_all();",
1068     "",
1069     "}"
1070    ],
1071    "|        void initChildren" : [
1072     " () {",
1073     "    // this needs putting in a better place..",
1074     "    this.windowstate = new WindowState(this);",
1075     "     ",
1076     "",
1077     "    //w.el.show_all();",
1078     "    var tl = new Clutter.Timeline(6000);",
1079     "    tl.set_repeat_count(-1);",
1080     "    tl.start();",
1081     "    tl.ref();",
1082     "",
1083     "    ",
1084     "",
1085     "",
1086     "",
1087     "}",
1088     ""
1089    ],
1090    "| void openNewWindow" : [
1091     "() {",
1092     "\tXcls_MainWindow.singleton().no_windows++;",
1093     "        var w = new Xcls_MainWindow();",
1094     "        w.ref();",
1095     "",
1096     "        w.el.show_all();",
1097     "        w.initChildren();",
1098     "        w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project);",
1099     "        // should open the file dialog...",
1100     "        //w.windowstate.switchState(WindowState.State.FILES);",
1101     "}",
1102     ""
1103    ]
1104   }
1105  ],
1106  "modOrder" : "",
1107  "name" : "MainWindow",
1108  "parent" : "",
1109  "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",
1110  "permname" : "",
1111  "title" : ""
1112 }