fix line numbering issues with vala generator - hopefully fixes completion in node...
[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             "    ",
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             "\tthis.popup.updateNotices(nots);",
541             "\t ",
542             "}",
543             ""
544            ]
545           },
546           {
547            "$ xns" : "Gtk",
548            "Xcls_ValaCompileErrors popup" : "",
549            "id" : "statusbar_warnings",
550            "listeners" : {
551             "clicked" : [
552              "() => {",
553              " ",
554              "\tif (this.popup == null) {",
555              "\t\treturn;",
556              "\t}",
557              "   ",
558              "    this.popup.show();",
559              "    return;",
560              "}"
561             ]
562            },
563            "string icon_name" : "dialog-warning",
564            "string label" : "0 Warnings",
565            "xtype" : "Button",
566            "| void setNotices" : [
567             "(GLib.ListStore nots, GLib.ListStore fe ) {",
568             "    ",
569             "     if (nots.get_n_items() < 1 ) {",
570             "    \tthis.el.hide();",
571             "    \tif (this.popup != null) {",
572             "    \t\tthis.popup.el.hide();",
573             "\t\t}",
574             "    \treturn;",
575             "    }",
576             "    ",
577             "    this.el.show();",
578             "    this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
579             "",
580             "    ",
581             " ",
582             "\tif (this.popup == null) {",
583             "        this.popup = new Xcls_ValaCompileErrors();",
584             "        this.popup.window = _this;",
585             "      //    this.popup.el.set_transient_for( _this.el );",
586             "        this.popup.el.set_parent(this.el);",
587             "    }",
588             "\tthis.popup.updateNotices(nots);",
589             "\t ",
590             "}",
591             ""
592            ]
593           },
594           {
595            "# GLib.ListStore notices" : "null",
596            "$ xns" : "Gtk",
597            "Xcls_ValaCompileErrors popup" : "",
598            "id" : "statusbar_depricated",
599            "listeners" : {
600             "clicked" : [
601              "() => {",
602              " ",
603              "\tif (this.popup == null) {",
604              "\t\treturn;",
605              "\t}",
606              "   ",
607              "    this.popup.show();",
608              "  ",
609              "}"
610             ]
611            },
612            "string icon_name" : "dialog-information",
613            "string label" : "0 Depricated",
614            "xtype" : "Button",
615            "| void setNotices" : [
616             "",
617             "(GLib.ListStore nots, GLib.ListStore fe ) {",
618             "    ",
619             "     if (nots.get_n_items() < 1 ) {",
620             "    \tthis.el.hide();",
621             "    \tif (this.popup != null) {",
622             "    \t\tthis.popup.el.hide();",
623             "\t\t}",
624             "    \treturn;",
625             "    }",
626             "    ",
627             "    this.el.show();",
628             "    this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
629             "",
630             "    ",
631             " ",
632             "\tif (this.popup == null) {",
633             "        this.popup = new Xcls_ValaCompileErrors();",
634             "        this.popup.window = _this;",
635             "      //    this.popup.el.set_transient_for( _this.el );",
636             "        this.popup.el.set_parent(this.el);",
637             "    }",
638             "\tthis.popup.updateNotices(nots);",
639             "\t ",
640             "}",
641             ""
642            ]
643           },
644           {
645            "$ xns" : "Gtk",
646            "Xcls_ValaCompileErrors popup" : "",
647            "id" : "statusbar_run",
648            "listeners" : {
649             "clicked" : [
650              "() => {",
651              "   ",
652              "   if (_this.windowstate.file == null) {",
653              "\t\treturn;",
654              "\t}",
655              "   if (_this.statusbar_compile_spinner.el.spinning) {",
656              "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
657              "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
658              "    \treturn;",
659              "\t}",
660              "\t",
661              "\tvar req = new Palete.ValaCompileRequest(",
662              "\t\tPalete.ValaCompileRequestType.RUN,",
663              "\t\t_this.windowstate.file,",
664              "\t\tnull,",
665              "\t\tnull,",
666              "\t\t\"\"",
667              "\t);",
668              "\treq.run();",
669              "\t ",
670              "\t_this.windowstate.compile_results.el.set_parent(this.el);",
671              "\t_this.windowstate.compile_results.show(this.el,true);",
672              "\t         ",
673              "}"
674             ]
675            },
676            "string icon_name" : "media-playback-start",
677            "string label" : "Run",
678            "xtype" : "Button"
679           }
680          ],
681          "xtype" : "Box"
682         },
683         {
684          "$ xns" : "Gtk",
685          "id" : "statusbar_compile_spinner",
686          "int margin_end" : 4,
687          "int margin_start" : 4,
688          "string tooltip_text" : "Compiling",
689          "xtype" : "Spinner",
690          "| void start" : [
691           "() {",
692           "  this.el.show();",
693           "  this.el.start();  ",
694           "  ",
695           "\t ",
696           "}",
697           ""
698          ],
699          "| void stop" : [
700           "() {",
701           " this.el.stop();",
702           "  this.el.hide();",
703           "   ",
704           "}",
705           ""
706          ]
707         }
708        ],
709        "xtype" : "Box"
710       }
711      ],
712      "xtype" : "Box"
713     }
714    ],
715    "listeners" : {
716     "close_request" : [
717      "( ) => {",
718      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
719      "\t ",
720      "\t ",
721      "\t this.windowstate.file.getLanguageServer().document_close(",
722      "\t \tthis.windowstate.file",
723      " \t);",
724      "\t ",
725      "\t BuilderApplication.removeWindow(this);",
726      "\t ",
727      "\t if (BuilderApplication.windows.size  < 1) {",
728      "\t\tthis.windowstate.file.getLanguageServer().exit();",
729      "\t\tBuilderApplication.singleton(  null ).quit();",
730      "\t }",
731      "\treturn true;",
732      "}",
733      ""
734     ],
735     "hide" : [
736      "() =>  {",
737      " ",
738      " ",
739      "",
740      "}"
741     ],
742     "show" : [
743      "  ( ) => {",
744      "    // hide the file editing..",
745      "   ",
746      "    //this.hideViewEditing();",
747      "    // this is updated by windowstate - we try and fill it in..",
748      "     _this.statusbar.el.hide();",
749      "     //_this.statusbar_errors.el.hide();",
750      "    //_this.statusbar_warnings.el.hide();",
751      "    //_this.statusbar_depricated.el.hide();",
752      "    _this.statusbar_compile_spinner.el.hide();",
753      "  ",
754      "    Resources.singleton().checkResources();",
755      "    ",
756      "  ",
757      "",
758      "}"
759     ]
760    },
761    "string title" : "Roo Application Builder",
762    "xtype" : "ApplicationWindow",
763    "| void initChildren" : [
764     " () {",
765     "    // this needs putting in a better place..",
766     "    this.windowstate = new WindowState(this);",
767     "     ",
768     "",
769     " ",
770     "",
771     "    ",
772     "",
773     "",
774     "",
775     "}",
776     ""
777    ],
778    "| void openNewWindow" : [
779     "() {",
780     " ",
781     "    var w = new Xcls_MainWindow();",
782     "    w.ref();",
783     "\tBuilderApplication.addWindow(w);",
784     "    w.el.show();",
785     "    w.initChildren();",
786     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
787     "     ",
788     "}",
789     ""
790    ],
791    "| void setTitle" : [
792     " () {",
793     "    if (_this.windowstate.project == null || ",
794     "\t    _this.windowstate.file == null",
795     "    ) {",
796     "    \tthis.el.set_title(\"Select File\");",
797     "    \treturn;",
798     "\t}",
799     "    _this.el.set_title(",
800     "    \t_this.windowstate.project.name + ",
801     "    \t\" - \" +",
802     "\t\t_this.windowstate.file.relpath);",
803     "} "
804    ],
805    "| void show" : [
806     "() {",
807     "   ",
808     "    this.el.show();",
809     "    if (this.windowstate.file  == null) {",
810     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
811     "    }",
812     "}"
813    ],
814    "| void updateErrors" : [
815     "() {",
816     "",
817     "",
818     " \tGLib.debug(\"updateErrors\");",
819     "\t",
820     "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
821     "\t",
822     "\tthis.statusbar_errors.setNotices(",
823     "\t\tpr,",
824     "\t\tthis.windowstate.file.getErrors(\"ERR\")",
825     "\t);",
826     "\t",
827     "\tthis.statusbar_warnings.setNotices(",
828     "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
829     "\t\tthis.windowstate.file.getErrors(\"WARN\")",
830     "\t);",
831     "\tthis.statusbar_depricated.setNotices(",
832     "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
833     "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
834     "\t);",
835     " ",
836     "\t_this.statusbar_run.el.hide();",
837     "",
838     "\tif (pr.get_n_items() < 1) {",
839     "\t\t_this.statusbar_run.el.show();",
840     "\t} ",
841     "\t",
842     "}"
843    ]
844   }
845  ],
846  "name" : "MainWindow"
847 }