meson.build.o7QLX02
[roobuilder] / src / Builder4 / MainWindow.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "# Project.Project project" : "null",
7    "# WindowState windowstate" : "",
8    "$ type" : "Gtk.WindowType.TOPLEVEL",
9    "$ xns" : "Gtk",
10    "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
11    "* init" : [
12     " ",
13     " ",
14     "     this.el.set_icon_name(\"roobuilder\");",
15     "     ",
16     "   ",
17     "     ",
18     " "
19    ],
20    "border_width" : 0,
21    "default_height" : 850,
22    "default_width" : 1200,
23    "id" : "MainWindow",
24    "items" : [
25     {
26      "$ string title" : "\"Application Builder\"",
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          "# Gee.ArrayList<Gtk.Widget> mitems" : "",
39          "$ Gtk.Align halign" : "Gtk.Align.START",
40          "$ xns" : "Gtk",
41          "* init" : [
42           "{",
43           "\tthis.mitems = new Gee.ArrayList<Gtk.Button>();",
44           "}",
45           ""
46          ],
47          "id" : "windowbtn",
48          "int margin_end" : 4,
49          "items" : [
50           {
51            "$ xns" : "Gtk",
52            "* pack" : false,
53            "id" : "windowspopup",
54            "items" : [
55             {
56              "$ xns" : "Gtk",
57              "* pack" : "set_child",
58              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59              "id" : "popover_menu",
60              "int spacing" : 0,
61              "items" : [
62               {
63                "$ xns" : "Gtk",
64                "* pack" : "append",
65                "items" : [
66                 {
67                  "$ Gtk.ShortcutScope scope" : "Gtk.ShortcutScope.GLOBAL",
68                  "$ xns" : "Gtk",
69                  "* init" : [
70                   "{",
71                   "\tthis.el.add_shortcut(",
72                   "\t\tnew Gtk.Shortcut(",
73                   "\t\t\tnew Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),",
74                   "\t\t\tnew Gtk.SignalAction(\"clicked\")",
75                   "\t\t)",
76                   "\t);",
77                   "}",
78                   ""
79                  ],
80                  "xtype" : "ShortcutController"
81                 }
82                ],
83                "listeners" : {
84                 "clicked" : [
85                  "( ) => {",
86                  "\t_this.windowspopup.el.hide();",
87                  "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
88                  "}",
89                  ""
90                 ]
91                },
92                "string label" : "New Window",
93                "xtype" : "Button"
94               },
95               {
96                "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
97                "$ xns" : "Gtk",
98                "* pack" : "append",
99                "xtype" : "Separator"
100               }
101              ],
102              "xtype" : "Box"
103             }
104            ],
105            "xtype" : "Popover"
106           },
107           {
108            "$ xns" : "Gtk",
109            "* prop" : "child",
110            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
111            "items" : [
112             {
113              "$ xns" : "Gtk",
114              "int margin_start" : 4,
115              "string icon_name" : "window-new",
116              "xtype" : "Image"
117             },
118             {
119              "$ xns" : "Gtk",
120              "string label" : "Windows (Add/List)",
121              "xtype" : "Label"
122             }
123            ],
124            "xtype" : "Box"
125           }
126          ],
127          "listeners" : {
128           "clicked" : [
129            "( ) => {",
130            "\tthis.updateMenu();",
131            "",
132            "\t _this.windowspopup.el.set_parent(this.el);",
133            "",
134            "\t _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); ",
135            "\t _this.windowspopup.el.popup(); ",
136            "}",
137            ""
138           ]
139          },
140          "xtype" : "Button",
141          "| void updateMenu" : [
142           "() {",
143           "\t foreach(var m in  this.mitems) {",
144           "\t \t _this.popover_menu.el.remove(m);",
145           "\t }",
146           "\t this.mitems.clear();",
147           "\t",
148           "\t BuilderApplication.windows.sort((a,b) => {",
149           "\t \tif (a.windowstate == null ||",
150           " \t\t\t a.windowstate.file == null || ",
151           " \t\t\t b.windowstate == null ||",
152           " \t\t\t b.windowstate.file == null",
153           " \t\t\t ) { ",
154           " \t\t\treturn 0;",
155           "\t\t}",
156           "",
157           "\t \tvar ap = a.windowstate.file.project.name;",
158           "\t \tvar bp = b.windowstate.file.project.name;",
159           "\t \t",
160           "",
161           "\t \t",
162           "\t \tif (ap != bp) {",
163           "\t \t\treturn ap.collate(bp);",
164           "\t \t}",
165           "\t \tvar af =  a.windowstate.file == null ? \"\" : a.windowstate.file.getTitle();",
166           "\t \tvar bf = b.windowstate.file == null ? \"\" : b.windowstate.file.getTitle();\t \t",
167           "\t\treturn af.collate(bf);",
168           "\t ",
169           "\t });",
170           "\t ",
171           "\t var p = \"\";",
172           "\t foreach(var w in BuilderApplication.windows) {",
173           "\t \tvar wid = BuilderApplication.windows.index_of(w);",
174           "\t \t// fixme find a better way to display this.",
175           " \t\tif (w.windowstate == null ||",
176           " \t\t\t w.windowstate.file == null || ",
177           " \t\t\t _this.windowstate == null ||",
178           " \t\t\t _this.windowstate.file == null",
179           " \t\t\t ) { ",
180           " \t\t\tcontinue;",
181           "\t\t}",
182           "\t \t// should not happen...",
183           "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
184           "\t \t\tcontinue;",
185           " \t\t}",
186           " \t\tif (w.windowstate.file.project.name != p || p != \"\") {",
187           " \t\t\tvar ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);",
188           " \t\t\t_this.popover_menu.el.append(ms);",
189           "\t\t \tms.show();",
190           "\t\t \tthis.mitems.add(ms);",
191           " \t\t}",
192           " \t\t",
193           " \t\tp = w.windowstate.file.project.name;",
194           " \t\t",
195           "",
196           " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
197           " \t\t",
198           " \t\t",
199           " \t\t",
200           "\t \tvar m = new Gtk.Button.with_label(",
201           "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.relpath",
202           "\t \t);",
203           "\t \tm.halign = Gtk.Align.START;",
204           "\t \t",
205           "\t \t",
206           "\t \t//w.windowstate.file.path);",
207           "\t \tm.clicked.connect(() => {",
208           "\t\t \t_this.windowspopup.el.hide();",
209           "\t \t\t BuilderApplication.windows.get(wid).el.present();",
210           "\t \t});",
211           "\t \t_this.popover_menu.el.append(m);",
212           "\t \t//m.show();",
213           "\t \tthis.mitems.add(m);",
214           "\t }",
215           "}"
216          ]
217         },
218         {
219          "$ xns" : "Gtk",
220          "* pack" : "append",
221          "bool always_show_image" : true,
222          "id" : "open_projects_btn",
223          "listeners" : {
224           "clicked" : [
225            "  ( ) => {",
226            "  \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
227            "}"
228           ]
229          },
230          "string icon_name" : "system-file-manager",
231          "string label" : "Files / Projects",
232          "tooltop_text" : "\"Open File\"",
233          "xtype" : "Button"
234         }
235        ],
236        "xtype" : "Box"
237       }
238      ],
239      "xtype" : "HeaderBar"
240     },
241     {
242      "$ xns" : "Gtk",
243      "* pack" : "set_child",
244      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
245      "bool homogeneous" : false,
246      "bool vexpand" : true,
247      "id" : "vbox",
248      "items" : [
249       {
250        "# int lastWidth" : 0,
251        "$ xns" : "Gtk",
252        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
253        "bool hexpand" : true,
254        "bool vexpand" : true,
255        "id" : "mainpane",
256        "items" : [
257         {
258          "$ xns" : "Gtk",
259          "* prop" : "start_child",
260          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
261          "bool hexpand" : true,
262          "bool vexpand" : true,
263          "id" : "leftpane",
264          "items" : [
265           {
266            "$ xns" : "Gtk",
267            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
268            "id" : "editpane",
269            "items" : [
270             {
271              "$ xns" : "Gtk",
272              "* prop" : "start_child",
273              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
274              "bool hexpand" : true,
275              "bool vexpand" : true,
276              "id" : "tree",
277              "xtype" : "Box"
278             },
279             {
280              "$ xns" : "Gtk",
281              "* prop" : "end_child",
282              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
283              "bool hexpand" : true,
284              "bool vexpand" : true,
285              "id" : "props",
286              "xtype" : "Box"
287             }
288            ],
289            "listeners" : {
290             "accept_position" : [
291              "( ) => {",
292              "\t_this.windowstate.left_tree.onresize();",
293              "\treturn true;",
294              "}",
295              ""
296             ],
297             "move_handle" : [
298              "(scroll) => {",
299              "\tGLib.debug(\"Move handle\");",
300              "\treturn true;",
301              "}"
302             ]
303            },
304            "xtype" : "Paned"
305           }
306          ],
307          "xtype" : "Box"
308         },
309         {
310          "$ xns" : "Gtk",
311          "* prop" : "end_child",
312          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
313          "bool hexpand" : true,
314          "bool vexpand" : true,
315          "items" : [
316           {
317            "$ xns" : "Gtk",
318            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
319            "bool hexpand" : true,
320            "bool vexpand" : true,
321            "id" : "rooviewbox",
322            "xtype" : "Box"
323           },
324           {
325            "$ xns" : "Gtk",
326            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
327            "bool hexpand" : true,
328            "bool vexpand" : true,
329            "id" : "codeeditviewbox",
330            "xtype" : "Box"
331           }
332          ],
333          "xtype" : "Box"
334         }
335        ],
336        "listeners" : {
337         "accept_position" : [
338          "( ) => {",
339          "\t_this.windowstate.left_tree.onresize();",
340          "\treturn true;",
341          "}",
342          ""
343         ]
344        },
345        "position" : 400,
346        "xtype" : "Paned"
347       },
348       {
349        "$ xns" : "Gtk",
350        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
351        "bool homogeneous" : false,
352        "bool vexpand" : false,
353        "items" : [
354         {
355          "$ tooltip_text" : "\"Project Details\"",
356          "$ xns" : "Gtk",
357          "bool always_show_image" : true,
358          "listeners" : {
359           "clicked" : [
360            "  ( ) => {",
361            "     ",
362            "     _this.windowstate.projectPopoverShow(_this.el, null, null);",
363            "   ",
364            "  ",
365            "}"
366           ]
367          },
368          "string icon_name" : "emblem-system",
369          "string label" : "Edit Project Settings",
370          "xtype" : "Button"
371         },
372         {
373          "$ tooltip_text" : "\"File Details\"",
374          "$ xns" : "Gtk",
375          "bool always_show_image" : true,
376          "listeners" : {
377           "clicked" : [
378            "  ( ) => {",
379            "  ",
380            "    // create a new file in project..",
381            "    if (_this.project == null || _this.windowstate.file == null) {",
382            "        return  ;",
383            "    }",
384            "     _this.windowstate.file_details.show(",
385            "        _this.windowstate.file, _this.el, false",
386            "    );",
387            "     ",
388            "    return  ;    ",
389            "",
390            "",
391            "}"
392           ]
393          },
394          "string icon_name" : "document-properties",
395          "string label" : "Edit File Properties",
396          "xtype" : "Button"
397         },
398         {
399          "$ xns" : "Gtk",
400          "bool always_show_image" : true,
401          "items" : [
402           {
403            "$ xns" : "Gtk",
404            "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
405            "* init" : [
406             "{",
407             "   // this.el.show();",
408             "}",
409             ""
410            ],
411            "* prop" : "popover",
412            "id" : "topbarmenu",
413            "items" : [
414             {
415              "$ xns" : "Gtk",
416              "* pack" : "set_child",
417              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
418              "int spacing" : 0,
419              "items" : [
420               {
421                "$ xns" : "Gtk",
422                "listeners" : {
423                 "activate" : [
424                  " ( ) => {",
425                  "         Resources.singleton().fetchStart();",
426                  "}"
427                 ]
428                },
429                "string label" : "Download updated Resources",
430                "xtype" : "Button"
431               },
432               {
433                "$ xns" : "Gtk",
434                "listeners" : {
435                 "clicked" : [
436                  "() => {",
437                  "    About.singleton().el.show();",
438                  "    }"
439                 ]
440                },
441                "string label" : "About the Builder",
442                "xtype" : "Button"
443               }
444              ],
445              "xtype" : "Box"
446             }
447            ],
448            "xtype" : "PopoverMenu"
449           }
450          ],
451          "string icon_name" : "dialog-information",
452          "string label" : "About",
453          "xtype" : "MenuButton"
454         },
455         {
456          "$ xns" : "Gtk",
457          "bool hexpand" : true,
458          "string label" : "   ",
459          "xtype" : "Label"
460         },
461         {
462          "$ xns" : "Gtk",
463          "* init" : [
464           "{",
465           "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
466           "        if (pos < 1) {",
467           "            this.el.hide();",
468           "            _this.mainpane.el.set_sensitive(true);",
469           "            ",
470           "            return;",
471           "        }",
472           "         _this.mainpane.el.set_sensitive(false);",
473           "         this.el.show();",
474           "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
475           "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
476           "       ",
477           "     });",
478           "}",
479           ""
480          ],
481          "bool show_text" : true,
482          "id" : "statusbar",
483          "ulong handler_id" : "-1",
484          "xtype" : "ProgressBar"
485         },
486         {
487          "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
488          "$ xns" : "Gtk",
489          "items" : [
490           {
491            "$ xns" : "Gtk",
492            "id" : "statusbar_compilestatus_label",
493            "int margin_end" : 4,
494            "int margin_start" : 4,
495            "string label" : "Compile Status:",
496            "xtype" : "Label"
497           },
498           {
499            "$ xns" : "Gtk",
500            "Xcls_ValaCompileErrors popup" : "",
501            "id" : "statusbar_errors",
502            "listeners" : {
503             "clicked" : [
504              "() => {",
505              " ",
506              "\tif (this.popup == null) {",
507              "\t\treturn;",
508              "\t}",
509              "   ",
510              "    this.popup.show();",
511              "  ",
512              "}"
513             ]
514            },
515            "string icon_name" : "dialog-error",
516            "string label" : "0 Errors",
517            "xtype" : "Button",
518            "| void setNotices" : [
519             "(GLib.ListStore nots, GLib.ListStore fe ) {",
520             "    BuilderApplication.showSpinner(\"\");",
521             "     if (nots.get_n_items() < 1 ) {",
522             "    \tthis.el.hide();",
523             "    \tif (this.popup != null) {",
524             "    \t\tthis.popup.el.hide();",
525             "\t\t}",
526             "    \treturn;",
527             "    }",
528             "    ",
529             "    this.el.show();",
530             "    this.el.label = \"%d/%d Errors\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
531             "",
532             "    ",
533             " ",
534             "\tif (this.popup == null) {",
535             "        this.popup = new Xcls_ValaCompileErrors();",
536             "        this.popup.window = _this;",
537             "      //    this.popup.el.set_transient_for( _this.el );",
538             "        this.popup.el.set_parent(this.el);",
539             "    }",
540             " ",
541             "\tthis.popup.updateNotices(nots);",
542             "\t ",
543             "}",
544             ""
545            ]
546           },
547           {
548            "$ xns" : "Gtk",
549            "Xcls_ValaCompileErrors popup" : "",
550            "id" : "statusbar_warnings",
551            "listeners" : {
552             "clicked" : [
553              "() => {",
554              " ",
555              "\tif (this.popup == null) {",
556              "\t\treturn;",
557              "\t}",
558              "   ",
559              "    this.popup.show();",
560              "    return;",
561              "}"
562             ]
563            },
564            "string icon_name" : "dialog-warning",
565            "string label" : "0 Warnings",
566            "xtype" : "Button",
567            "| void setNotices" : [
568             "(GLib.ListStore nots, GLib.ListStore fe ) {",
569             "    ",
570             "     if (nots.get_n_items() < 1 ) {",
571             "    \tthis.el.hide();",
572             "    \tif (this.popup != null) {",
573             "    \t\tthis.popup.el.hide();",
574             "\t\t}",
575             "    \treturn;",
576             "    }",
577             "    ",
578             "    this.el.show();",
579             "    this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
580             "",
581             "    ",
582             " ",
583             "\tif (this.popup == null) {",
584             "        this.popup = new Xcls_ValaCompileErrors();",
585             "        this.popup.window = _this;",
586             "      //    this.popup.el.set_transient_for( _this.el );",
587             "        this.popup.el.set_parent(this.el);",
588             "    }",
589             "\tthis.popup.updateNotices(nots);",
590             "\t ",
591             "}",
592             ""
593            ]
594           },
595           {
596            "# GLib.ListStore notices" : "null",
597            "$ xns" : "Gtk",
598            "Xcls_ValaCompileErrors popup" : "",
599            "id" : "statusbar_depricated",
600            "listeners" : {
601             "clicked" : [
602              "() => {",
603              " ",
604              "\tif (this.popup == null) {",
605              "\t\treturn;",
606              "\t}",
607              "   ",
608              "    this.popup.show();",
609              "  ",
610              "}"
611             ]
612            },
613            "string icon_name" : "dialog-information",
614            "string label" : "0 Depricated",
615            "xtype" : "Button",
616            "| void setNotices" : [
617             "",
618             "(GLib.ListStore nots, GLib.ListStore fe ) {",
619             "    ",
620             "     if (nots.get_n_items() < 1 ) {",
621             "    \tthis.el.hide();",
622             "    \tif (this.popup != null) {",
623             "    \t\tthis.popup.el.hide();",
624             "\t\t}",
625             "    \treturn;",
626             "    }",
627             "    ",
628             "    this.el.show();",
629             "    this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
630             "",
631             "    ",
632             " ",
633             "\tif (this.popup == null) {",
634             "        this.popup = new Xcls_ValaCompileErrors();",
635             "        this.popup.window = _this;",
636             "      //    this.popup.el.set_transient_for( _this.el );",
637             "        this.popup.el.set_parent(this.el);",
638             "    }",
639             "\tthis.popup.updateNotices(nots);",
640             "\t ",
641             "}",
642             ""
643            ]
644           },
645           {
646            "$ xns" : "Gtk",
647            "Palete.ValaCompileRequest? last_request" : "null",
648            "Xcls_ValaCompileErrors popup" : "",
649            "bool visible" : false,
650            "id" : "statusbar_run",
651            "listeners" : {
652             "clicked" : [
653              "() => {",
654              "   ",
655              "   if (_this.windowstate.file == null) {",
656              "\t\treturn;",
657              "\t}",
658              "   if (_this.statusbar_compile_spinner.el.spinning) {",
659              "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
660              "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
661              "    \treturn;",
662              "\t}",
663              "\t",
664              "\tif (this.last_request != null) {",
665              "\t\tthis.last_request.cancel();",
666              "\t\tif (this.last_request.terminal_pid > 0) {",
667              "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
668              "\t\t}",
669              "\t}",
670              "\t",
671              "\tthis.last_request= new Palete.ValaCompileRequest(",
672              "\t\tPalete.ValaCompileRequestType.RUN,",
673              "\t\t_this.windowstate.file,",
674              "\t\tnull,",
675              "\t\tnull,",
676              "\t\t\"\"",
677              "\t);",
678              "\tthis.last_request.run();",
679              "\t ",
680              "\t_this.windowstate.compile_results.el.set_parent(this.el);",
681              "\t_this.windowstate.compile_results.show(this.el,true);",
682              "\t         ",
683              "}"
684             ]
685            },
686            "string icon_name" : "media-playback-start",
687            "string label" : "Run",
688            "xtype" : "Button"
689           }
690          ],
691          "xtype" : "Box"
692         },
693         {
694          "$ xns" : "Gtk",
695          "id" : "statusbar_compile_spinner",
696          "int margin_end" : 4,
697          "int margin_start" : 4,
698          "string tooltip_text" : "Compiling",
699          "xtype" : "Spinner",
700          "| void start" : [
701           "(string icon, string tooltip) {",
702           "",
703           "\tif (icon == \"spinner\") {",
704           "\t  this.el.show();",
705           "\t  this.el.start();  ",
706           "\t  this.el.tooltip_text = tooltip;",
707           "\t  _this.statusbar_compile_icon.el.hide();",
708           "  } else {",
709           "\t  this.el.hide();",
710           "\t//  GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
711           "\t  _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
712           "\t  _this.statusbar_compile_icon.el.icon_name = icon;",
713           "\t  _this.statusbar_compile_icon.el.show();\t  ",
714           "  }",
715           "  ",
716           "\t ",
717           "}",
718           ""
719          ],
720          "| void stop" : [
721           "() {",
722           " this.el.stop();",
723           "  this.el.hide();",
724           " _this.statusbar_compile_icon.el.hide();  ",
725           "}",
726           ""
727          ]
728         },
729         {
730          "$ xns" : "Gtk",
731          "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
732          "id" : "statusbar_compile_icon",
733          "int margin_end" : 4,
734          "int margin_start" : 4,
735          "xtype" : "Image"
736         }
737        ],
738        "xtype" : "Box"
739       }
740      ],
741      "xtype" : "Box"
742     }
743    ],
744    "listeners" : {
745     "close_request" : [
746      "( ) => {",
747      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
748      "\t ",
749      "\t ",
750      "\t this.windowstate.file.getLanguageServer().document_close(",
751      "\t \tthis.windowstate.file",
752      " \t);",
753      "\t ",
754      "\t BuilderApplication.removeWindow(this);",
755      "\t ",
756      "\t if (BuilderApplication.windows.size  < 1) {",
757      "\t\tthis.windowstate.file.getLanguageServer().exit();",
758      "\t\tBuilderApplication.singleton(  null ).quit();",
759      "\t }",
760      "\treturn true;",
761      "}",
762      ""
763     ],
764     "hide" : [
765      "() =>  {",
766      " ",
767      " ",
768      "",
769      "}"
770     ],
771     "show" : [
772      "  ( ) => {",
773      "    // hide the file editing..",
774      "   ",
775      "    //this.hideViewEditing();",
776      "    // this is updated by windowstate - we try and fill it in..",
777      "     _this.statusbar.el.hide();",
778      "     //_this.statusbar_errors.el.hide();",
779      "    //_this.statusbar_warnings.el.hide();",
780      "    //_this.statusbar_depricated.el.hide();",
781      "    _this.statusbar_compile_spinner.el.hide();",
782      "  ",
783      "    Resources.singleton().checkResources();",
784      "    ",
785      "  ",
786      "",
787      "}"
788     ]
789    },
790    "string title" : "Roo Application Builder",
791    "xtype" : "ApplicationWindow",
792    "| void initChildren" : [
793     " () {",
794     "    // this needs putting in a better place..",
795     "    this.windowstate = new WindowState(this);",
796     "     ",
797     "",
798     " ",
799     "",
800     "    ",
801     "",
802     "",
803     "",
804     "}",
805     ""
806    ],
807    "| void openNewWindow" : [
808     "() {",
809     " ",
810     "    var w = new Xcls_MainWindow();",
811     "    w.ref();",
812     "\tBuilderApplication.addWindow(w);",
813     "    w.el.show();",
814     "    w.initChildren();",
815     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
816     "     ",
817     "}",
818     ""
819    ],
820    "| void setTitle" : [
821     " () {",
822     "    if (_this.windowstate.project == null || ",
823     "\t    _this.windowstate.file == null",
824     "    ) {",
825     "    \tthis.el.set_title(\"Select File\");",
826     "    \treturn;",
827     "\t}",
828     "    _this.el.set_title(",
829     "    \t_this.windowstate.project.name + ",
830     "    \t\" - \" +",
831     "\t\t_this.windowstate.file.relpath);",
832     "} "
833    ],
834    "| void show" : [
835     "() {",
836     "   ",
837     "    this.el.show();",
838     "    if (this.windowstate.file  == null) {",
839     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
840     "    }",
841     "}"
842    ],
843    "| void updateErrors" : [
844     "() {",
845     "",
846     "",
847     " \tGLib.debug(\"updateErrors\");",
848     "\t",
849     "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
850     "\t",
851     "\tthis.statusbar_errors.setNotices(",
852     "\t\tpr,",
853     "\t\tthis.windowstate.file.getErrors(\"ERR\")",
854     "\t);",
855     "\t",
856     "\tthis.statusbar_warnings.setNotices(",
857     "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
858     "\t\tthis.windowstate.file.getErrors(\"WARN\")",
859     "\t);",
860     "\tthis.statusbar_depricated.setNotices(",
861     "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
862     "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
863     "\t);",
864     " ",
865     "\t_this.statusbar_run.el.hide();",
866     "",
867     "\tif (pr.get_n_items() < 1) {",
868     "\t\t_this.statusbar_run.el.show();",
869     "\t} ",
870     "\t",
871     "}"
872    ]
873   }
874  ],
875  "name" : "MainWindow"
876 }