2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Project.Project project" : "null",
7 "# WindowState windowstate" : "",
8 "$ type" : "Gtk.WindowType.TOPLEVEL",
10 "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
14 " this.el.set_icon_name(\"roobuilder\");",
21 "default_height" : 850,
22 "default_width" : 1200,
26 "$ string title" : "\"Application Builder\"",
28 "* pack" : "set_titlebar",
29 "bool show_close_button" : true,
34 "* pack" : "pack_start",
35 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
38 "# Gee.ArrayList<Gtk.Widget> mitems" : "",
39 "$ Gtk.Align halign" : "Gtk.Align.START",
43 "\tthis.mitems = new Gee.ArrayList<Gtk.Button>();",
53 "id" : "windowspopup",
57 "* pack" : "set_child",
58 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59 "id" : "popover_menu",
67 "$ Gtk.ShortcutScope scope" : "Gtk.ShortcutScope.GLOBAL",
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\")",
80 "xtype" : "ShortcutController"
86 "\t_this.windowspopup.el.hide();",
87 "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
92 "string label" : "New Window",
96 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
110 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
114 "int margin_start" : 4,
115 "string icon_name" : "window-new",
120 "string label" : "Windows (Add/List)",
130 "\tthis.updateMenu();",
132 "\t _this.windowspopup.el.set_parent(this.el);",
134 "\t _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); ",
135 "\t _this.windowspopup.el.popup(); ",
141 "| void updateMenu" : [
143 "\t foreach(var m in this.mitems) {",
144 "\t \t _this.popover_menu.el.remove(m);",
146 "\t this.mitems.clear();",
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",
157 "\t \tvar ap = a.windowstate.file.project.name;",
158 "\t \tvar bp = b.windowstate.file.project.name;",
162 "\t \tif (ap != bp) {",
163 "\t \t\treturn ap.collate(bp);",
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);",
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",
182 "\t \t// should not happen...",
183 "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
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);",
190 "\t\t \tthis.mitems.add(ms);",
193 " \t\tp = w.windowstate.file.project.name;",
196 " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
200 "\t \tvar m = new Gtk.Button.with_label(",
201 "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.relpath",
203 "\t \tm.halign = Gtk.Align.START;",
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();",
211 "\t \t_this.popover_menu.el.append(m);",
213 "\t \tthis.mitems.add(m);",
221 "bool always_show_image" : true,
222 "id" : "open_projects_btn",
226 " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
230 "string icon_name" : "system-file-manager",
231 "string label" : "Files / Projects",
232 "tooltop_text" : "\"Open File\"",
239 "xtype" : "HeaderBar"
243 "* pack" : "set_child",
244 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
245 "bool homogeneous" : false,
246 "bool vexpand" : true,
250 "# int lastWidth" : 0,
252 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
253 "bool hexpand" : true,
254 "bool vexpand" : true,
259 "* prop" : "start_child",
260 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
261 "bool hexpand" : true,
262 "bool vexpand" : true,
267 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
272 "* prop" : "start_child",
273 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
274 "bool hexpand" : true,
275 "bool vexpand" : true,
281 "* prop" : "end_child",
282 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
283 "bool hexpand" : true,
284 "bool vexpand" : true,
290 "accept_position" : [
292 "\t_this.windowstate.left_tree.onresize();",
299 "\tGLib.debug(\"Move handle\");",
311 "* prop" : "end_child",
312 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
313 "bool hexpand" : true,
314 "bool vexpand" : true,
318 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
319 "bool hexpand" : true,
320 "bool vexpand" : true,
326 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
327 "bool hexpand" : true,
328 "bool vexpand" : true,
329 "id" : "codeeditviewbox",
337 "accept_position" : [
339 "\t_this.windowstate.left_tree.onresize();",
350 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
351 "bool homogeneous" : false,
352 "bool vexpand" : false,
355 "$ tooltip_text" : "\"Project Details\"",
357 "bool always_show_image" : true,
362 " _this.windowstate.projectPopoverShow(_this.el, null, null);",
368 "string icon_name" : "emblem-system",
369 "string label" : "Edit Project Settings",
373 "$ tooltip_text" : "\"File Details\"",
375 "bool always_show_image" : true,
380 " // create a new file in project..",
381 " if (_this.project == null || _this.windowstate.file == null) {",
384 " _this.windowstate.file_details.show(",
385 " _this.windowstate.file, _this.el, false",
394 "string icon_name" : "document-properties",
395 "string label" : "Edit File Properties",
400 "bool always_show_image" : true,
404 "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
407 " // this.el.show();",
411 "* prop" : "popover",
416 "* pack" : "set_child",
417 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
425 " Resources.singleton().fetchStart();",
429 "string label" : "Download updated Resources",
437 " About.singleton().el.show();",
441 "string label" : "About the Builder",
448 "xtype" : "PopoverMenu"
451 "string icon_name" : "dialog-information",
452 "string label" : "About",
453 "xtype" : "MenuButton"
457 "bool hexpand" : true,
458 "string label" : " ",
465 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
468 " _this.mainpane.el.set_sensitive(true);",
472 " _this.mainpane.el.set_sensitive(false);",
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()));",
481 "bool show_text" : true,
483 "ulong handler_id" : "-1",
484 "xtype" : "ProgressBar"
487 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
492 "id" : "statusbar_compilestatus_label",
493 "int margin_end" : 4,
494 "int margin_start" : 4,
495 "string label" : "Compile Status:",
500 "Xcls_ValaCompileErrors popup" : "",
501 "id" : "statusbar_errors",
506 "\tif (this.popup == null) {",
510 " this.popup.show();",
515 "string icon_name" : "dialog-error",
516 "string label" : "0 Errors",
518 "| void setNotices" : [
519 "(GLib.ListStore nots, GLib.ListStore fe ) {",
521 " if (nots.get_n_items() < 1 ) {",
522 " \tthis.el.hide();",
523 " \tif (this.popup != null) {",
524 " \t\tthis.popup.el.hide();",
530 " this.el.label = \"%d/%d Errors\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
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);",
540 "\tthis.popup.updateNotices(nots);",
548 "Xcls_ValaCompileErrors popup" : "",
549 "id" : "statusbar_warnings",
554 "\tif (this.popup == null) {",
558 " this.popup.show();",
563 "string icon_name" : "dialog-warning",
564 "string label" : "0 Warnings",
566 "| void setNotices" : [
567 "(GLib.ListStore nots, GLib.ListStore fe ) {",
569 " if (nots.get_n_items() < 1 ) {",
570 " \tthis.el.hide();",
571 " \tif (this.popup != null) {",
572 " \t\tthis.popup.el.hide();",
578 " this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
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);",
588 "\tthis.popup.updateNotices(nots);",
595 "# GLib.ListStore notices" : "null",
597 "Xcls_ValaCompileErrors popup" : "",
598 "id" : "statusbar_depricated",
603 "\tif (this.popup == null) {",
607 " this.popup.show();",
612 "string icon_name" : "dialog-information",
613 "string label" : "0 Depricated",
615 "| void setNotices" : [
617 "(GLib.ListStore nots, GLib.ListStore fe ) {",
619 " if (nots.get_n_items() < 1 ) {",
620 " \tthis.el.hide();",
621 " \tif (this.popup != null) {",
622 " \t\tthis.popup.el.hide();",
628 " this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
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);",
638 "\tthis.popup.updateNotices(nots);",
646 "Xcls_ValaCompileErrors popup" : "",
647 "id" : "statusbar_run",
652 " if (_this.windowstate.file == null) {",
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.",
661 "\tvar req = new Palete.ValaCompileRequest(",
662 "\t\tPalete.ValaCompileRequestType.RUN,",
663 "\t\t_this.windowstate.file,",
670 "\t_this.windowstate.compile_results.el.set_parent(this.el);",
671 "\t_this.windowstate.compile_results.show(this.el,true);",
676 "string icon_name" : "media-playback-start",
677 "string label" : "Run",
685 "id" : "statusbar_compile_spinner",
686 "int margin_end" : 4,
687 "int margin_start" : 4,
688 "string tooltip_text" : "Compiling",
693 " this.el.start(); ",
718 "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
721 "\t this.windowstate.file.getLanguageServer().document_close(",
722 "\t \tthis.windowstate.file",
725 "\t BuilderApplication.removeWindow(this);",
727 "\t if (BuilderApplication.windows.size < 1) {",
728 "\t\tthis.windowstate.file.getLanguageServer().exit();",
729 "\t\tBuilderApplication.singleton( null ).quit();",
744 " // hide the file editing..",
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();",
754 " Resources.singleton().checkResources();",
761 "string title" : "Roo Application Builder",
762 "xtype" : "ApplicationWindow",
763 "| void initChildren" : [
765 " // this needs putting in a better place..",
766 " this.windowstate = new WindowState(this);",
778 "| void openNewWindow" : [
781 " var w = new Xcls_MainWindow();",
783 "\tBuilderApplication.addWindow(w);",
785 " w.initChildren();",
786 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
791 "| void setTitle" : [
793 " if (_this.windowstate.project == null || ",
794 "\t _this.windowstate.file == null",
796 " \tthis.el.set_title(\"Select File\");",
799 " _this.el.set_title(",
800 " \t_this.windowstate.project.name + ",
802 "\t\t_this.windowstate.file.relpath);",
809 " if (this.windowstate.file == null) {",
810 " \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
814 "| void updateErrors" : [
818 " \tGLib.debug(\"updateErrors\");",
820 "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
822 "\tthis.statusbar_errors.setNotices(",
824 "\t\tthis.windowstate.file.getErrors(\"ERR\")",
827 "\tthis.statusbar_warnings.setNotices(",
828 "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
829 "\t\tthis.windowstate.file.getErrors(\"WARN\")",
831 "\tthis.statusbar_depricated.setNotices(",
832 "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
833 "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
836 "\t_this.statusbar_run.el.hide();",
838 "\tif (pr.get_n_items() < 1) {",
839 "\t\t_this.statusbar_run.el.show();",
846 "name" : "MainWindow"