Fix #8028 - language server performance, fix warnings and critical errors
[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    "# bool winloading" : false,
9    "$ type" : "Gtk.WindowType.TOPLEVEL",
10    "$ xns" : "Gtk",
11    "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
12    "* init" : [
13     "",
14     "this.el.set_icon_name(\"roobuilder\");",
15     ""
16    ],
17    "border_width" : 0,
18    "default_height" : 850,
19    "default_width" : 1200,
20    "id" : "MainWindow",
21    "items" : [
22     {
23      "$ xns" : "Gtk",
24      "* pack" : "set_titlebar",
25      "bool show_close_button" : true,
26      "id" : "headerbar",
27      "items" : [
28       {
29        "$ xns" : "Gtk",
30        "* pack" : "pack_start",
31        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
32        "items" : [
33         {
34          "$ xns" : "Gtk",
35          "* pack" : "append",
36          "bool has_frame" : false,
37          "bool has_tooltip" : true,
38          "items" : [
39           {
40            "$ xns" : "Adw",
41            "* prop" : "child",
42            "string icon_name" : "preferences-system-windows",
43            "string label" : " Files",
44            "xtype" : "ButtonContent"
45           }
46          ],
47          "listeners" : {
48           "clicked" : [
49            "  ( ) => {",
50            "  \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;",
51            "  \tif (_this.splitview.el.show_sidebar) {",
52            "  \t\t_this.sidebar.show(); ",
53            " \t}",
54            "}"
55           ]
56          },
57          "string tooltip_text" : "Manage Windows (Ctrl-O)",
58          "xtype" : "Button"
59         },
60         {
61          "$ xns" : "Gtk",
62          "bool has_frame" : false,
63          "listeners" : {
64           "clicked" : [
65            "( ) => {",
66            "\t",
67            "\tGLib.debug(\"undo clicked\");",
68            "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
69            "\t\t_this.windowstate.code_editor_tab.buffer.el.undo();",
70            "\t}",
71            "\tif (!_this.windowstate.file.undoStep(-1)) {",
72            "\t\treturn;",
73            "\t}",
74            "\t",
75            "\t ",
76            "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
77            "\t// this triggers loadItems..",
78            "\t_this.windowstate.left_tree.model.loadFile(",
79            "\t\t_this.windowstate.file);",
80            "\t ",
81            "",
82            "\t",
83            " ",
84            "",
85            "\t// load it everywhere",
86            "}",
87            ""
88           ]
89          },
90          "string icon_name" : "edit-undo",
91          "xtype" : "Button"
92         },
93         {
94          "$ xns" : "Gtk",
95          "bool has_frame" : false,
96          "listeners" : {
97           "clicked" : [
98            "( ) => {",
99            "\t",
100            "\tGLib.debug(\"undo clicked\");",
101            "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
102            "\t\t_this.windowstate.code_editor_tab.buffer.el.redo();",
103            "\t}",
104            "\tif (!_this.windowstate.file.undoStep(1)) {",
105            "\t\treturn;",
106            "\t}",
107            "\t",
108            "\t ",
109            "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
110            "\t// this triggers loadItems..",
111            "\t_this.windowstate.left_tree.model.loadFile(",
112            "\t\t_this.windowstate.file);",
113            "\t ",
114            "",
115            "\t",
116            " ",
117            "",
118            "\t// load it everywhere",
119            "}",
120            ""
121           ]
122          },
123          "string icon_name" : "edit-redo",
124          "xtype" : "Button"
125         }
126        ],
127        "xtype" : "Box"
128       }
129      ],
130      "xtype" : "HeaderBar"
131     },
132     {
133      "$ xns" : "Adw",
134      "* prop" : "child",
135      "bool collapsed" : true,
136      "bool show_sidebar" : false,
137      "double sidebar_width_fraction" : 0.40000000000000002,
138      "id" : "splitview",
139      "items" : [
140       {
141        "$ xns" : "Gtk",
142        "* prop" : "content",
143        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
144        "bool hexpand" : true,
145        "bool homogeneous" : false,
146        "bool vexpand" : false,
147        "id" : "vbox",
148        "int spacing" : 0,
149        "items" : [
150         {
151          "# int lastWidth" : 0,
152          "$ xns" : "Gtk",
153          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
154          "bool hexpand" : true,
155          "bool vexpand" : true,
156          "id" : "mainpane",
157          "items" : [
158           {
159            "$ xns" : "Gtk",
160            "* prop" : "start_child",
161            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
162            "bool hexpand" : true,
163            "bool vexpand" : true,
164            "id" : "leftpane",
165            "items" : [
166             {
167              "$ xns" : "Gtk",
168              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
169              "id" : "editpane",
170              "items" : [
171               {
172                "$ xns" : "Gtk",
173                "* prop" : "start_child",
174                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
175                "bool hexpand" : true,
176                "bool vexpand" : true,
177                "id" : "tree",
178                "xtype" : "Box"
179               },
180               {
181                "$ xns" : "Gtk",
182                "* prop" : "end_child",
183                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
184                "bool hexpand" : true,
185                "bool vexpand" : true,
186                "id" : "props",
187                "xtype" : "Box"
188               }
189              ],
190              "listeners" : {
191               "accept_position" : [
192                "( ) => {",
193                "\t_this.windowstate.left_tree.onresize();",
194                "\treturn true;",
195                "}",
196                ""
197               ],
198               "move_handle" : [
199                "(scroll) => {",
200                "\tGLib.debug(\"Move handle\");",
201                "\treturn true;",
202                "}"
203               ]
204              },
205              "xtype" : "Paned"
206             }
207            ],
208            "xtype" : "Box"
209           },
210           {
211            "$ xns" : "Gtk",
212            "* prop" : "end_child",
213            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
214            "bool hexpand" : true,
215            "bool vexpand" : true,
216            "items" : [
217             {
218              "$ xns" : "Gtk",
219              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
220              "bool hexpand" : true,
221              "bool vexpand" : true,
222              "id" : "rooviewbox",
223              "xtype" : "Box"
224             },
225             {
226              "$ xns" : "Gtk",
227              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
228              "bool hexpand" : true,
229              "bool vexpand" : true,
230              "id" : "codeeditviewbox",
231              "xtype" : "Box"
232             }
233            ],
234            "xtype" : "Box"
235           }
236          ],
237          "listeners" : {
238           "accept_position" : [
239            "( ) => {",
240            "\t_this.windowstate.left_tree.onresize();",
241            "\treturn true;",
242            "}",
243            ""
244           ]
245          },
246          "position" : 400,
247          "xtype" : "Paned"
248         },
249         {
250          "$ xns" : "Gtk",
251          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
252          "bool homogeneous" : false,
253          "bool vexpand" : false,
254          "items" : [
255           {
256            "$ tooltip_text" : "\"Project Details\"",
257            "$ xns" : "Gtk",
258            "bool always_show_image" : true,
259            "listeners" : {
260             "clicked" : [
261              "  ( ) => {",
262              "     ",
263              "     _this.windowstate.projectPopoverShow(_this.el, null, null);",
264              "   ",
265              "  ",
266              "}"
267             ]
268            },
269            "string icon_name" : "emblem-system",
270            "string label" : "Edit Project Settings",
271            "xtype" : "Button"
272           },
273           {
274            "$ tooltip_text" : "\"File Details\"",
275            "$ xns" : "Gtk",
276            "bool always_show_image" : true,
277            "listeners" : {
278             "clicked" : [
279              "  ( ) => {",
280              "  ",
281              "    // create a new file in project..",
282              "    if (_this.project == null || _this.windowstate.file == null) {",
283              "        return  ;",
284              "    }",
285              "     _this.windowstate.file_details.show(",
286              "        _this.windowstate.file, _this.el, false",
287              "    );",
288              "     ",
289              "    return  ;    ",
290              "",
291              "",
292              "}"
293             ]
294            },
295            "string icon_name" : "document-properties",
296            "string label" : "Edit File Properties",
297            "xtype" : "Button"
298           },
299           {
300            "$ xns" : "Gtk",
301            "bool always_show_image" : true,
302            "items" : [
303             {
304              "$ xns" : "Gtk",
305              "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
306              "* init" : [
307               "{",
308               "   // this.el.show();",
309               "}",
310               ""
311              ],
312              "* prop" : "popover",
313              "id" : "topbarmenu",
314              "items" : [
315               {
316                "$ xns" : "Gtk",
317                "* pack" : "set_child",
318                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
319                "int spacing" : 0,
320                "items" : [
321                 {
322                  "$ xns" : "Gtk",
323                  "listeners" : {
324                   "activate" : [
325                    " ( ) => {",
326                    "         Resources.singleton().fetchStart();",
327                    "}"
328                   ]
329                  },
330                  "string label" : "Download updated Resources",
331                  "xtype" : "Button"
332                 },
333                 {
334                  "$ xns" : "Gtk",
335                  "listeners" : {
336                   "clicked" : [
337                    "() => {",
338                    "    About.singleton().el.show();",
339                    "    }"
340                   ]
341                  },
342                  "string label" : "About the Builder",
343                  "xtype" : "Button"
344                 }
345                ],
346                "xtype" : "Box"
347               }
348              ],
349              "xtype" : "PopoverMenu"
350             }
351            ],
352            "string icon_name" : "dialog-information",
353            "string label" : "About",
354            "xtype" : "MenuButton"
355           },
356           {
357            "$ xns" : "Gtk",
358            "bool hexpand" : true,
359            "string label" : "   ",
360            "xtype" : "Label"
361           },
362           {
363            "$ xns" : "Gtk",
364            "* init" : [
365             "{",
366             "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
367             "        if (pos < 1) {",
368             "            this.el.hide();",
369             "            _this.mainpane.el.set_sensitive(true);",
370             "            ",
371             "            return;",
372             "        }",
373             "         _this.mainpane.el.set_sensitive(false);",
374             "         this.el.show();",
375             "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
376             "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
377             "       ",
378             "     });",
379             "}",
380             ""
381            ],
382            "bool show_text" : true,
383            "id" : "statusbar",
384            "ulong handler_id" : "-1",
385            "xtype" : "ProgressBar"
386           },
387           {
388            "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
389            "$ xns" : "Gtk",
390            "items" : [
391             {
392              "$ xns" : "Gtk",
393              "id" : "statusbar_compilestatus_label",
394              "int margin_end" : 4,
395              "int margin_start" : 4,
396              "string label" : "Compile Status:",
397              "xtype" : "Label"
398             },
399             {
400              "$ xns" : "Gtk",
401              "Xcls_ValaCompileErrors popup" : "",
402              "id" : "statusbar_errors",
403              "listeners" : {
404               "clicked" : [
405                "() => {",
406                " ",
407                "\tif (this.popup == null) {",
408                "\t\treturn;",
409                "\t}",
410                "   ",
411                "    this.popup.show();",
412                "  ",
413                "}"
414               ]
415              },
416              "string icon_name" : "dialog-error",
417              "string label" : "0 Errors",
418              "xtype" : "Button",
419              "| void setNotices" : [
420               "(GLib.ListStore nots, int ferrors ) {",
421               "    BuilderApplication.showSpinner(\"\");",
422               "     if (nots.get_n_items() < 1 ) {",
423               "    \tthis.el.hide();",
424               "    \tif (this.popup != null) {",
425               "    \t\tthis.popup.el.hide();",
426               "\t\t}",
427               "    \treturn;",
428               "    }",
429               "    ",
430               "    this.el.show();",
431               "    this.el.label = \"%d/%d Errors\".printf(ferrors,(int)nots.get_n_items());",
432               "",
433               "    ",
434               " ",
435               "\tif (this.popup == null) {",
436               "        this.popup = new Xcls_ValaCompileErrors();",
437               "        this.popup.window = _this;",
438               "      //    this.popup.el.set_transient_for( _this.el );",
439               "        this.popup.el.set_parent(this.el);",
440               "    }",
441               " ",
442               "\tthis.popup.updateNotices(nots);",
443               "\t ",
444               "}",
445               ""
446              ]
447             },
448             {
449              "$ xns" : "Gtk",
450              "Xcls_ValaCompileErrors popup" : "",
451              "id" : "statusbar_warnings",
452              "listeners" : {
453               "clicked" : [
454                "() => {",
455                " ",
456                "\tif (this.popup == null) {",
457                "\t\treturn;",
458                "\t}",
459                "   ",
460                "    this.popup.show();",
461                "    return;",
462                "}"
463               ]
464              },
465              "string icon_name" : "dialog-warning",
466              "string label" : "0 Warnings",
467              "xtype" : "Button",
468              "| void setNotices" : [
469               "(GLib.ListStore nots, int ferrs ) {",
470               "    ",
471               "     if (nots.get_n_items() < 1 ) {",
472               "    \tthis.el.hide();",
473               "    \tif (this.popup != null) {",
474               "    \t\tthis.popup.el.hide();",
475               "\t\t}",
476               "    \treturn;",
477               "    }",
478               "    ",
479               "    this.el.show();",
480               "    this.el.label = \"%d/%d Warnings\".printf(ferrs,(int)nots.get_n_items());",
481               "",
482               "    ",
483               " ",
484               "\tif (this.popup == null) {",
485               "        this.popup = new Xcls_ValaCompileErrors();",
486               "        this.popup.window = _this;",
487               "      //    this.popup.el.set_transient_for( _this.el );",
488               "        this.popup.el.set_parent(this.el);",
489               "    }",
490               "\tthis.popup.updateNotices(nots);",
491               "\t ",
492               "}",
493               ""
494              ]
495             },
496             {
497              "# GLib.ListStore notices" : "null",
498              "$ xns" : "Gtk",
499              "Xcls_ValaCompileErrors popup" : "",
500              "id" : "statusbar_depricated",
501              "listeners" : {
502               "clicked" : [
503                "() => {",
504                " ",
505                "\tif (this.popup == null) {",
506                "\t\treturn;",
507                "\t}",
508                "   ",
509                "    this.popup.show();",
510                "  ",
511                "}"
512               ]
513              },
514              "string icon_name" : "dialog-information",
515              "string label" : "0 Depricated",
516              "xtype" : "Button",
517              "| void setNotices" : [
518               "",
519               "(GLib.ListStore nots, int ferrs ) {",
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 Depricated\".printf(ferrs,(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              "Palete.ValaCompileRequest? last_request" : "null",
549              "Xcls_ValaCompileErrors popup" : "",
550              "bool visible" : false,
551              "id" : "statusbar_run",
552              "listeners" : {
553               "clicked" : [
554                "() => {",
555                "   ",
556                "   if (_this.windowstate.file == null) {",
557                "\t\treturn;",
558                "\t}",
559                "   if (_this.statusbar_compile_spinner.el.spinning) {",
560                "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
561                "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
562                "    \treturn;",
563                "\t}",
564                "\t",
565                "\tif (this.last_request != null) {",
566                "\t\tthis.last_request.cancel();",
567                "\t\tif (this.last_request.terminal_pid > 0) {",
568                "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
569                "\t\t}",
570                "\t}",
571                "\tvar pr = _this.windowstate.project as Project.Gtk;",
572                "\tif (pr == null) {",
573                "\t\treturn;",
574                "\t}",
575                "\t",
576                "\t",
577                "\tthis.last_request= new Palete.ValaCompileRequest(",
578                "\t\tpr,",
579                "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
580                "\t);",
581                "\tthis.last_request.onOutput.connect( ( str) => {",
582                "\t\t_this.windowstate.compile_results.addLine(str);",
583                "\t});",
584                "\tthis.last_request.run.begin( ( a, r) => {",
585                "\t\tthis.last_request.run.end(r);",
586                "\t});",
587                "\t if (_this.windowstate.compile_results.el.parent == null) {",
588                "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
589                "\t}",
590                "\t_this.windowstate.compile_results.show(this.el,true);",
591                "\t         ",
592                "}"
593               ]
594              },
595              "string icon_name" : "media-playback-start",
596              "string label" : "Run",
597              "xtype" : "Button"
598             }
599            ],
600            "xtype" : "Box"
601           },
602           {
603            "$ xns" : "Gtk",
604            "id" : "statusbar_compile_spinner",
605            "int margin_end" : 4,
606            "int margin_start" : 4,
607            "string tooltip_text" : "Compiling",
608            "xtype" : "Spinner",
609            "| void start" : [
610             "(string icon, string tooltip) {",
611             "",
612             "\tif (icon == \"spinner\") {",
613             "\t  this.el.show();",
614             "\t  this.el.start();  ",
615             "\t  this.el.tooltip_text = tooltip;",
616             "\t  _this.statusbar_compile_icon.el.hide();",
617             "  } else {",
618             "\t  this.el.hide();",
619             "\t//  GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
620             "\t  _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
621             "\t  _this.statusbar_compile_icon.el.icon_name = icon;",
622             "\t  _this.statusbar_compile_icon.el.show();\t  ",
623             "  }",
624             "  ",
625             "\t ",
626             "}",
627             ""
628            ],
629            "| void stop" : [
630             "() {",
631             " this.el.stop();",
632             "  this.el.hide();",
633             " _this.statusbar_compile_icon.el.hide();  ",
634             "}",
635             ""
636            ]
637           },
638           {
639            "$ xns" : "Gtk",
640            "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
641            "id" : "statusbar_compile_icon",
642            "int margin_end" : 4,
643            "int margin_start" : 4,
644            "xtype" : "Image"
645           }
646          ],
647          "xtype" : "Box"
648         }
649        ],
650        "xtype" : "Box"
651       },
652       {
653        "$ xns" : "Gtk",
654        "* prop" : "sidebar",
655        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
656        "id" : "sidebar",
657        "int spacing" : 0,
658        "items" : [
659         {
660          "$ xns" : "Gtk",
661          "bool has_tooltip" : true,
662          "bool hexpand" : true,
663          "id" : "filesearch",
664          "items" : [
665           {
666            "$ xns" : "Gtk",
667            "listeners" : {
668             "key_released" : [
669              "(keyval, keycode, state) => {",
670              "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
671              "\t\treturn;",
672              "\t}",
673              "\t//GLib.debug(",
674              "\t//\t\"searcj key release %d, %d, %d  ?= %d\" , ",
675              "\t//\t\t(int) keyval, (int)  keycode, state,",
676              "\t//\t\t(int)Gdk.Key.Return",
677              "\t//\t);",
678              "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
679              "\t\treturn;",
680              "\t}",
681              "\t\t",
682              "\tvar dir = 0;",
683              "\t",
684              "\tif (keyval == Gdk.Key.Return) {",
685              "\t\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
686              "\t\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
687              "\t\tvar f = (JsRender.JsRender) tr.item;",
688              "\t\tGLib.debug(\"Click %s\", f.name);",
689              "\t\tif (f.xtype == \"Dir\") {",
690              "\t\t\treturn;",
691              "\t\t}",
692              "\t\t",
693              "\t\t",
694              "\t \t_this.windowstate.fileViewOpen(f,",
695              "\t \t\t_this.keystate.is_shift != 1 ",
696              "\t\t);",
697              "\t\t",
698              "\t\t_this.splitview.el.show_sidebar = false;",
699              "\t\treturn;",
700              "\t\t",
701              "\t",
702              "\t}",
703              "\tif (keyval == Gdk.Key.Up) {",
704              "\t\tdir = -1;",
705              "\t}if (keyval == Gdk.Key.Down) {",
706              "\t\tdir = 1;",
707              "\t}",
708              "\tif (dir == 0) {",
709              "\t\treturn;",
710              "\t}",
711              "\tvar ns = _this.treeselmodel.el.selected + dir;",
712              "\tif (ns < 0) {",
713              "\t\tns = 0;",
714              "\t}",
715              "\tif (ns >= _this.treeselmodel.el.get_n_items()) {",
716              "\t\tns  = _this.treeselmodel.el.get_n_items()-1;",
717              "\t}",
718              "\t_this.treeselmodel.el.selected = ns;",
719              "}",
720              ""
721             ]
722            },
723            "xtype" : "EventControllerKey"
724           }
725          ],
726          "listeners" : {
727           "search_changed" : [
728            "( ) => {",
729            "",
730            "\t_this.windowsearch.el.set_search(this.el.get_text());",
731            "\tif (this.el.text == \"\") {",
732            "\t\t_this.treescroll.el.visible = false;",
733            "\t\treturn;",
734            "\t}",
735            "\t_this.treescroll.el.visible = true;",
736            "\t_this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);",
737            "}",
738            ""
739           ]
740          },
741          "string placeholder_text" : "Search for file",
742          "string tooltip_text" : [
743           "up/down arrow to select file from lower file list",
744           "enter opens selected in new window",
745           "shift+enter opens it in this window "
746          ],
747          "xtype" : "SearchEntry"
748         },
749         {
750          "$ xns" : "Gtk",
751          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
752          "bool hexpand" : true,
753          "int spacing" : 0,
754          "items" : [
755           {
756            "$ xns" : "Gtk",
757            "bool hexpand" : true,
758            "id" : "open_projects_btn",
759            "items" : [
760             {
761              "$ xns" : "Gtk",
762              "* prop" : "child",
763              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
764              "int spacing" : 0,
765              "items" : [
766               {
767                "$ xns" : "Gtk",
768                "int margin_end" : 4,
769                "string icon_name" : "document-open",
770                "xtype" : "Image"
771               },
772               {
773                "$ xns" : "Gtk",
774                "string label" : "Open File",
775                "xtype" : "Label"
776               }
777              ],
778              "xtype" : "Box"
779             }
780            ],
781            "listeners" : {
782             "clicked" : [
783              "  ( ) => {",
784              "  \t_this.splitview.el.show_sidebar = false;",
785              "  \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
786              "}"
787             ]
788            },
789            "tooltop_text" : "\"Open File\"",
790            "xtype" : "Button"
791           },
792           {
793            "$ xns" : "Gtk",
794            "bool hexpand" : true,
795            "items" : [
796             {
797              "$ xns" : "Gtk",
798              "* prop" : "child",
799              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
800              "int spacing" : 0,
801              "items" : [
802               {
803                "$ xns" : "Gtk",
804                "int margin_end" : 4,
805                "string icon_name" : "window-new",
806                "xtype" : "Image"
807               },
808               {
809                "$ xns" : "Gtk",
810                "string label" : "New Window",
811                "xtype" : "Label"
812               }
813              ],
814              "xtype" : "Box"
815             }
816            ],
817            "listeners" : {
818             "clicked" : [
819              "( ) => {",
820              "\t_this.splitview.el.show_sidebar = false;",
821              "\t_this.windowstate.showPopoverFiles(_this.el, _this.project, true);",
822              "}"
823             ]
824            },
825            "xtype" : "Button"
826           }
827          ],
828          "xtype" : "Box"
829         },
830         {
831          "$ xns" : "Gtk",
832          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
833          "bool vexpand" : true,
834          "items" : [
835           {
836            "$ xns" : "Gtk",
837            "* prop" : "start_child",
838            "bool has_frame" : true,
839            "items" : [
840             {
841              "$ xns" : "Gtk",
842              "* prop" : "child",
843              "items" : [
844               {
845                "$ xns" : "Gtk",
846                "* prop" : "model",
847                "bool autoselect" : false,
848                "bool can_unselect" : false,
849                "bool selecting" : false,
850                "id" : "winsel",
851                "items" : [
852                 {
853                  "$ xns" : "Gtk",
854                  "* prop" : "model",
855                  "items" : [
856                   {
857                    "$ xns" : "Gtk",
858                    "* prop" : "model",
859                    "id" : "winfilter",
860                    "items" : [
861                     {
862                      "$ xns" : "Gtk",
863                      "* prop" : "filter",
864                      "id" : "windowsearch",
865                      "items" : [
866                       {
867                        "$ xns" : "Gtk",
868                        "* prop" : "expression",
869                        "GLib.Type this_type" : "typeof(WindowState)",
870                        "string property_name" : "file_name",
871                        "xtype" : "PropertyExpression"
872                       }
873                      ],
874                      "xtype" : "StringFilter"
875                     },
876                     {
877                      "$ xns" : "GLib",
878                      "* prop" : "model",
879                      "GLib.Type item_type" : "typeof(WindowState)",
880                      "id" : "winmodel",
881                      "xtype" : "ListStore"
882                     }
883                    ],
884                    "xtype" : "FilterListModel"
885                   },
886                   {
887                    "$ xns" : "Gtk",
888                    "* prop" : "sorter",
889                    "bool ignore_case" : true,
890                    "items" : [
891                     {
892                      "$ xns" : "Gtk",
893                      "* prop" : "expression",
894                      "GLib.Type this_type" : "typeof(WindowState)",
895                      "string property_name" : "file_name",
896                      "xtype" : "PropertyExpression"
897                     }
898                    ],
899                    "xtype" : "StringSorter"
900                   }
901                  ],
902                  "xtype" : "SortListModel"
903                 }
904                ],
905                "listeners" : {
906                 "notify[\"selected\"]" : [
907                  "() => {",
908                  "\tif (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {",
909                  "\t\treturn;",
910                  "\t}",
911                  "\tvar ws = this.el.selected_item as WindowState;",
912                  "\tif (ws == null) {",
913                  "\t\treturn;",
914                  "\t}",
915                  "\tif (ws.file.path != _this.windowstate.file.path) {",
916                  "\t\t_this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window,  -1);",
917                  "\t\t_this.splitview.el.show_sidebar = false;",
918                  "\t}",
919                  "\t",
920                  "\tthis.selectCurrent();",
921                  " }"
922                 ]
923                },
924                "xtype" : "SingleSelection",
925                "| void selectCurrent" : [
926                 "() {",
927                 "\tthis.selecting = true;",
928                 "\t ",
929                 "\tfor(var i = 0;i < this.el.get_n_items(); i++) {",
930                 "\t\tvar ws = this.el.get_item(i) as WindowState;",
931                 "\t\tif (ws.file.path == _this.windowstate.file.path) {",
932                 "\t\t  \tthis.el.selected = i;",
933                 "\t\t  \tbreak;",
934                 "\t  \t}",
935                 "\t}",
936                 "\tthis.selecting = false;",
937                 " ",
938                 "",
939                 "}"
940                ]
941               },
942               {
943                "$ xns" : "Gtk",
944                "bool expand" : true,
945                "bool resizable" : true,
946                "id" : "projcol",
947                "items" : [
948                 {
949                  "$ xns" : "Gtk",
950                  "* prop" : "factory",
951                  "listeners" : {
952                   "bind" : [
953                    "(listitem) => {",
954                    "\tvar li = (listitem as Gtk.ListItem);",
955                    "\tif (li == null) {",
956                    "\t\treturn;",
957                    "\t}",
958                    "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
959                    "\t if (lb == null) {",
960                    "\t \treturn;",
961                    " \t}",
962                    "\t var item =  li.get_item() as WindowState;",
963                    "\t if (item == null) {",
964                    "\t \treturn;",
965                    " \t}",
966                    "\t lb.label = item.project.name;",
967                    "",
968                    "",
969                    "  ",
970                    "",
971                    "}",
972                    ""
973                   ],
974                   "setup" : [
975                    "(listitem) => {",
976                    "",
977                    "\tvar li = (listitem as Gtk.ListItem);",
978                    "\tif (li == null) {",
979                    "\t\treturn;",
980                    "\t}",
981                    "",
982                    "\tvar lbl = new Gtk.Label(\"\");",
983                    " \tli.set_child(lbl);",
984                    " \tlbl.justify = Gtk.Justification.LEFT;",
985                    " \tlbl.xalign = 0;",
986                    " \tlbl.use_markup = true;",
987                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
988                    "  ",
989                    "\tli.activatable = true;",
990                    "}",
991                    ""
992                   ]
993                  },
994                  "xtype" : "SignalListItemFactory"
995                 }
996                ],
997                "title" : "Project",
998                "xtype" : "ColumnViewColumn"
999               },
1000               {
1001                "$ xns" : "Gtk",
1002                "* pack" : "append_column",
1003                "bool expand" : true,
1004                "bool resizable" : true,
1005                "id" : "filecol",
1006                "items" : [
1007                 {
1008                  "$ xns" : "Gtk",
1009                  "* prop" : "factory",
1010                  "listeners" : {
1011                   "bind" : [
1012                    "(listitem) => {",
1013                    "\tvar li = (listitem as Gtk.ListItem);",
1014                    "\tif (li == null) {",
1015                    "\t\treturn;",
1016                    "\t}",
1017                    "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
1018                    "\t if (lb == null) {",
1019                    "\t \treturn;",
1020                    " \t}",
1021                    "\t var item =  li.get_item() as WindowState;",
1022                    "\t if (item == null) {",
1023                    "\t \treturn;",
1024                    " \t}",
1025                    " \t",
1026                    " \t ",
1027                    "  ",
1028                    " \tlb.label = item.file.relpath;",
1029                    "",
1030                    "",
1031                    "  ",
1032                    "",
1033                    "}",
1034                    ""
1035                   ],
1036                   "setup" : [
1037                    "(listitem) => {",
1038                    "\tvar li = (listitem as Gtk.ListItem);",
1039                    "\tif (li == null) {",
1040                    "\t\treturn;",
1041                    "\t}",
1042                    "\tvar lbl = new Gtk.Label(\"\");",
1043                    " \tli.set_child(lbl);",
1044                    " \tlbl.justify = Gtk.Justification.LEFT;",
1045                    " \tlbl.xalign = 0;",
1046                    " \tlbl.use_markup = true;",
1047                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
1048                    "  ",
1049                    "\tli.activatable = true;",
1050                    "}",
1051                    ""
1052                   ]
1053                  },
1054                  "xtype" : "SignalListItemFactory"
1055                 }
1056                ],
1057                "title" : "File",
1058                "xtype" : "ColumnViewColumn"
1059               }
1060              ],
1061              "xtype" : "ColumnView"
1062             }
1063            ],
1064            "xtype" : "ScrolledWindow"
1065           },
1066           {
1067            "* prop" : "end_child",
1068            "bool has_frame" : true,
1069            "bool hexpand" : true,
1070            "bool vexpand" : true,
1071            "bool visible" : false,
1072            "id" : "treescroll",
1073            "items" : [
1074             {
1075              "$ xns" : "Gtk",
1076              "* prop" : "child",
1077              "bool hexpand" : true,
1078              "bool vexpand" : true,
1079              "id" : "treeview",
1080              "items" : [
1081               {
1082                "$ xns" : "Gtk",
1083                "listeners" : {
1084                 "pressed" : [
1085                  "(n_press, x, y) => {",
1086                  "\tif (n_press == 2) {",
1087                  "\t\tGLib.debug(\"double cliced\");",
1088                  "\t} else {",
1089                  "\t\treturn;",
1090                  "\t}",
1091                  "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
1092                  "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
1093                  "\tvar f = (JsRender.JsRender) tr.item;",
1094                  "\tGLib.debug(\"Click %s\", f.name);",
1095                  "\tif (f.xtype == \"Dir\") {",
1096                  "\t\treturn;",
1097                  "\t}",
1098                  "\t",
1099                  "\t",
1100                  " \t_this.windowstate.fileViewOpen(f,",
1101                  " \t\t_this.keystate.is_shift != 1 ",
1102                  "\t);",
1103                  "\t",
1104                  "\t_this.splitview.el.show_sidebar = false;",
1105                  "\t",
1106                  "\t",
1107                  "",
1108                  "}",
1109                  ""
1110                 ]
1111                },
1112                "xtype" : "GestureClick"
1113               },
1114               {
1115                "$ xns" : "Gtk",
1116                "* prop" : "model",
1117                "bool autoselect" : true,
1118                "bool can_unselect" : true,
1119                "id" : "treeselmodel",
1120                "items" : [
1121                 {
1122                  "$ xns" : "Gtk",
1123                  "* prop" : "model",
1124                  "items" : [
1125                   {
1126                    "$ xns" : "Gtk",
1127                    "* prop" : "model",
1128                    "bool incremental" : true,
1129                    "id" : "treelistsort",
1130                    "items" : [
1131                     {
1132                      "$ xns" : "Gtk",
1133                      "* prop" : "model",
1134                      "Gtk.TreeListModelCreateModelFunc create_func" : [
1135                       "(item) => {",
1136                       "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
1137                       "\treturn ((JsRender.JsRender)item).childfiles;",
1138                       "} "
1139                      ],
1140                      "bool autoexpand" : true,
1141                      "bool passthrough" : false,
1142                      "id" : "treelistmodel",
1143                      "items" : [
1144                       {
1145                        "$ xns" : "GLib",
1146                        "* prop" : "root",
1147                        "GLib.Type item_type" : "typeof(JsRender.JsRender)",
1148                        "id" : "treemodel",
1149                        "xtype" : "ListStore"
1150                       }
1151                      ],
1152                      "xtype" : "TreeListModel"
1153                     },
1154                     {
1155                      "$ xns" : "Gtk",
1156                      "* prop" : "sorter",
1157                      "items" : [
1158                       {
1159                        "$ xns" : "Gtk",
1160                        "* prop" : "sorter",
1161                        "bool ignore_case" : true,
1162                        "items" : [
1163                         {
1164                          "$ xns" : "Gtk",
1165                          "* prop" : "expression",
1166                          "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
1167                          "string property_name" : "name",
1168                          "xtype" : "PropertyExpression"
1169                         }
1170                        ],
1171                        "xtype" : "StringSorter"
1172                       }
1173                      ],
1174                      "xtype" : "TreeListRowSorter"
1175                     }
1176                    ],
1177                    "xtype" : "SortListModel"
1178                   },
1179                   {
1180                    "$ xns" : "Gtk",
1181                    "* prop" : "filter",
1182                    "Gtk.CustomFilterFunc match_func" : [
1183                     "(item) => { ",
1184                     "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
1185                     "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
1186                     "\tvar j =  (JsRender.JsRender) tr;",
1187                     "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
1188                     "\t\treturn false;",
1189                     "\t}",
1190                     "\tvar str = _this.filesearch.el.text.down();\t",
1191                     "\tif (j.xtype == \"Dir\") {",
1192                     "\t",
1193                     "\t\t",
1194                     "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
1195                     "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
1196                     "\t\t\t//if (f.xtype != \"PlainFile\") {",
1197                     "\t\t\t//\tcontinue;",
1198                     "\t\t\t//}",
1199                     "\t\t\tif (f.content_type.contains(\"image\")) {",
1200                     "\t\t\t\tcontinue;",
1201                     "\t\t\t}",
1202                     "\t\t\tif (str.length < 1) {",
1203                     "\t\t\t\treturn true;",
1204                     "\t\t\t}",
1205                     "\t\t\tif (f.name.down().contains(str)) {",
1206                     "\t\t\t\treturn true;",
1207                     "\t\t\t}",
1208                     "\t\t\t",
1209                     "\t\t}",
1210                     "\t\t ",
1211                     "\t\treturn false;",
1212                     "\t}",
1213                     "\t//if (j.xtype != \"PlainFile\") {",
1214                     "\t//\treturn false;",
1215                     "\t//}",
1216                     " \tif (j.content_type.contains(\"image\")) {",
1217                     "\t\treturn false;",
1218                     "\t}",
1219                     "\t\t\t ",
1220                     "\tif (str.length < 1) { // no search.",
1221                     "\t\treturn true;",
1222                     "\t}",
1223                     "\tif (j.name.down().contains(str)) {",
1224                     "\t\treturn true;",
1225                     "\t}",
1226                     "\treturn false; ",
1227                     "",
1228                     "}"
1229                    ],
1230                    "id" : "treefilter",
1231                    "xtype" : "CustomFilter"
1232                   }
1233                  ],
1234                  "xtype" : "FilterListModel"
1235                 }
1236                ],
1237                "xtype" : "SingleSelection"
1238               },
1239               {
1240                "$ xns" : "Gtk",
1241                "* init" : [
1242                 "{",
1243                 "\t// this.el.set_sorter(  new Gtk.StringSorter(",
1244                 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
1245                 " //\t));",
1246                 "\t\t",
1247                 "}",
1248                 ""
1249                ],
1250                "* pack" : "append_column",
1251                "bool expand" : true,
1252                "bool resizable" : true,
1253                "id" : "name",
1254                "items" : [
1255                 {
1256                  "$ xns" : "Gtk",
1257                  "* prop" : "factory",
1258                  "listeners" : {
1259                   "bind" : [
1260                    "(listitem) => {",
1261                    "\t",
1262                    "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1263                    "                \t",
1264                    "            \t",
1265                    "            \t",
1266                    "        \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1267                    "    \tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
1268                    "    \t  ",
1269                    "     \tvar hbox = (Gtk.Box) expand.child;",
1270                    " ",
1271                    "\t",
1272                    "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
1273                    "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1274                    "",
1275                    " ",
1276                    "    \t",
1277                    "    \t if (lbl == null || lbl.label != \"\") { // do not update",
1278                    "    \t \treturn;",
1279                    "     \t}",
1280                    "    \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1281                    "    \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
1282                    "    ",
1283                    "    \t",
1284                    "    \tvar jr =(JsRender.JsRender) lr.get_item();",
1285                    "    \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
1286                    "    \t",
1287                    "    \t if (jr == null) {",
1288                    "    \t\t GLib.debug(\"Problem getting item\"); ",
1289                    "    \t\t return;",
1290                    "    \t }",
1291                    "",
1292                    "\t\tjr.bind_property(\"icon\",",
1293                    "                img, \"gicon\",",
1294                    "               GLib.BindingFlags.SYNC_CREATE);",
1295                    "",
1296                    "    \t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
1297                    "    \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
1298                    "    \tlbl.tooltip_markup = jr.path;",
1299                    "    \t ",
1300                    "        expand.set_hide_expander(  jr.xtype != \"Dir\" );",
1301                    "     \t expand.set_list_row(lr);",
1302                    "     ",
1303                    "         \t ",
1304                    "                 \t// bind image...",
1305                    "}",
1306                    ""
1307                   ],
1308                   "setup" : [
1309                    "(listitem) => {",
1310                    "\t",
1311                    "\tvar expand = new Gtk.TreeExpander();",
1312                    "\t ",
1313                    "\texpand.set_indent_for_depth(true);",
1314                    "\texpand.set_indent_for_icon(true);",
1315                    "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1316                    "\tvar icon = new Gtk.Image();",
1317                    "\ticon.margin_end = 4;",
1318                    "\tvar lbl = new Gtk.Label(\"\");",
1319                    "\tlbl.use_markup = true;",
1320                    "\t",
1321                    "\t",
1322                    " \tlbl.justify = Gtk.Justification.LEFT;",
1323                    " \tlbl.xalign = 0;",
1324                    "",
1325                    " \thbox.append(icon);",
1326                    "\thbox.append(lbl);",
1327                    "\texpand.set_child(hbox);",
1328                    "\t((Gtk.ListItem)listitem).set_child(expand);",
1329                    "\t((Gtk.ListItem)listitem).activatable = false;",
1330                    "}",
1331                    ""
1332                   ]
1333                  },
1334                  "xtype" : "SignalListItemFactory"
1335                 }
1336                ],
1337                "string title" : "All Project Files",
1338                "xtype" : "ColumnViewColumn"
1339               }
1340              ],
1341              "xtype" : "ColumnView"
1342             }
1343            ],
1344            "string tooltip_text" : [
1345             "dbl-click - opens in NEW window                        ",
1346             "shift--dbl-click opens in this window"
1347            ],
1348            "string xns" : "Gtk",
1349            "string xtype" : "ScrolledWindow"
1350           }
1351          ],
1352          "xtype" : "Paned"
1353         }
1354        ],
1355        "xtype" : "Box",
1356        "| void show" : [
1357         "() {",
1358         "\t_this.splitview.el.show_sidebar = true;",
1359         "  \t ",
1360         "\t_this.filesearch.el.grab_focus();",
1361         "\t_this.winloading = true;",
1362         "\t_this.winmodel.el.remove_all();",
1363         "\t_this.filesearch.el.set_text(\"\");",
1364         "\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
1365         "\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
1366         "\t}",
1367         "\t_this.winsel.selectCurrent();",
1368         "\t_this.winloading = false;",
1369         "\t",
1370         "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1371         "\t",
1372         "\t_this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);",
1373         "\t",
1374         "\t_this.treeview.el.set_model(_this.treeselmodel.el);",
1375         "\t",
1376         " \t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1377         "\t",
1378         "}"
1379        ]
1380       },
1381       {
1382        "$ xns" : "Gtk",
1383        "id" : "keystate",
1384        "int is_shift" : 0,
1385        "listeners" : {
1386         "key_pressed" : [
1387          "(keyval, keycode, state) => {",
1388          "",
1389          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1390          " \t\tthis.is_shift = 1;",
1391          " \t\t",
1392          "\t}",
1393          "\t",
1394          "\t",
1395          "\treturn true;",
1396          "\t",
1397          "}",
1398          ""
1399         ],
1400         "key_released" : [
1401          "(keyval, keycode, state) => {",
1402          "\t//GLib.debug(",
1403          "\t//\t\"key release %d, %d, %d  ?= %d %d\" , ",
1404          "\t//\t\t(int) keyval, (int)  keycode, state,",
1405          "\t//\t\t(int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK",
1406          "\t//\t);",
1407          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1408          " \t\tthis.is_shift = 0;",
1409          "\t}",
1410          "\t//GLib.debug(\"set state %d , shift = %d\", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);",
1411          "\tif (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {",
1412          "\t\t// ctrl O pressed",
1413          "\t\tif (!_this.splitview.el.show_sidebar) {",
1414          "\t  \t\t_this.sidebar.show(); ",
1415          "\t \t}",
1416          "\t}",
1417          "\t",
1418          "",
1419          " ",
1420          "}"
1421         ]
1422        },
1423        "xtype" : "EventControllerKey"
1424       }
1425      ],
1426      "xtype" : "OverlaySplitView"
1427     }
1428    ],
1429    "listeners" : {
1430     "close_request" : [
1431      "( ) => {",
1432      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
1433      "\t ",
1434      "\t ",
1435      "\t this.windowstate.file.getLanguageServer().document_close(",
1436      "\t \tthis.windowstate.file",
1437      " \t);",
1438      "\t ",
1439      "\t BuilderApplication.removeWindow(this);",
1440      "\t ",
1441      "\t if (BuilderApplication.windows.size  < 1) {",
1442      "\t \ttry {",
1443      "\t\t\tthis.windowstate.file.getLanguageServer().exit();",
1444      "\t\t} catch(Error e) {}",
1445      "\t\t",
1446      "\t\tBuilderApplication.singleton(  null ).quit();",
1447      "\t }",
1448      "\treturn true;",
1449      "\t",
1450      "}",
1451      ""
1452     ],
1453     "hide" : [
1454      "() =>  {",
1455      " ",
1456      " ",
1457      "",
1458      "}"
1459     ],
1460     "show" : [
1461      "  ( ) => {",
1462      "    // hide the file editing..",
1463      "   ",
1464      "    //this.hideViewEditing();",
1465      "    // this is updated by windowstate - we try and fill it in..",
1466      "     _this.statusbar.el.hide();",
1467      "     //_this.statusbar_errors.el.hide();",
1468      "    //_this.statusbar_warnings.el.hide();",
1469      "    //_this.statusbar_depricated.el.hide();",
1470      "    _this.statusbar_compile_spinner.el.hide();",
1471      "  ",
1472      "    Resources.singleton().checkResources();",
1473      "    ",
1474      "  ",
1475      "",
1476      "}"
1477     ]
1478    },
1479    "string title" : "Roo Application Builder",
1480    "xtype" : "ApplicationWindow",
1481    "| void initChildren" : [
1482     " () {",
1483     "    // this needs putting in a better place..",
1484     "    if (this.windowstate == null) {",
1485     "    \tthis.windowstate = new WindowState(this);",
1486     "    ",
1487     "    }",
1488     "     ",
1489     "",
1490     " ",
1491     "",
1492     "    ",
1493     "",
1494     "",
1495     "",
1496     "}",
1497     ""
1498    ],
1499    "| void openNewWindow" : [
1500     "() {",
1501     " ",
1502     "    var w = new Xcls_MainWindow();",
1503     "    w.ref();",
1504     "\tBuilderApplication.addWindow(w);",
1505     "    w.el.show();",
1506     "    w.initChildren();",
1507     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
1508     "     ",
1509     "}",
1510     ""
1511    ],
1512    "| void setTitle" : [
1513     " () {",
1514     "    if (_this.windowstate.project == null || ",
1515     "\t    _this.windowstate.file == null",
1516     "    ) {",
1517     "    \tthis.el.set_title(\"Select File\");",
1518     "    \treturn;",
1519     "\t}",
1520     "    _this.el.set_title(",
1521     "    \t_this.windowstate.project.name + ",
1522     "    \t\" - \" +",
1523     "\t\t_this.windowstate.file.relpath);",
1524     "} "
1525    ],
1526    "| void show" : [
1527     "() {",
1528     "   ",
1529     "    this.el.show();",
1530     "    if (this.windowstate.file  == null) {",
1531     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
1532     "    }",
1533     "}"
1534    ],
1535    "| void updateErrors" : [
1536     "() {",
1537     "",
1538     "",
1539     " \tGLib.debug(\"updateErrors\");",
1540     "\t",
1541     "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
1542     "\t",
1543     "\tthis.statusbar_errors.setNotices(",
1544     "\t\tpr,",
1545     "\t\tthis.windowstate.file.getErrorsTotal(\"ERR\")",
1546     "\t);",
1547     "\t",
1548     "\tthis.statusbar_warnings.setNotices(",
1549     "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
1550     "\t\tthis.windowstate.file.getErrorsTotal(\"WARN\")",
1551     "\t);",
1552     "\tthis.statusbar_depricated.setNotices(",
1553     "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
1554     "\t\tthis.windowstate.file.getErrorsTotal(\"DEPR\")",
1555     "\t);",
1556     "",
1557     "\t_this.statusbar_run.el.hide();",
1558     "",
1559     "\tif (pr.get_n_items() < 1) {",
1560     "\t\t_this.statusbar_run.el.show();",
1561     "\t} ",
1562     "\t",
1563     "}"
1564    ]
1565   }
1566  ],
1567  "name" : "MainWindow"
1568 }