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 ) {",
520 " BuilderApplication.showSpinner(\"\");",
521 " if (nots.get_n_items() < 1 ) {",
522 " \tthis.el.hide();",
523 " \tif (this.popup != null) {",
524 " \t\tthis.popup.el.hide();",
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);",
541 "\tthis.popup.updateNotices(nots);",
549 "Xcls_ValaCompileErrors popup" : "",
550 "id" : "statusbar_warnings",
555 "\tif (this.popup == null) {",
559 " this.popup.show();",
564 "string icon_name" : "dialog-warning",
565 "string label" : "0 Warnings",
567 "| void setNotices" : [
568 "(GLib.ListStore nots, GLib.ListStore fe ) {",
570 " if (nots.get_n_items() < 1 ) {",
571 " \tthis.el.hide();",
572 " \tif (this.popup != null) {",
573 " \t\tthis.popup.el.hide();",
579 " this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
583 "\tif (this.popup == null) {",
584 " this.popup = new Xcls_ValaCompileErrors();",
585 " this.popup.window = _this;",
586 " // this.popup.el.set_transient_for( _this.el );",
587 " this.popup.el.set_parent(this.el);",
589 "\tthis.popup.updateNotices(nots);",
596 "# GLib.ListStore notices" : "null",
598 "Xcls_ValaCompileErrors popup" : "",
599 "id" : "statusbar_depricated",
604 "\tif (this.popup == null) {",
608 " this.popup.show();",
613 "string icon_name" : "dialog-information",
614 "string label" : "0 Depricated",
616 "| void setNotices" : [
618 "(GLib.ListStore nots, GLib.ListStore fe ) {",
620 " if (nots.get_n_items() < 1 ) {",
621 " \tthis.el.hide();",
622 " \tif (this.popup != null) {",
623 " \t\tthis.popup.el.hide();",
629 " this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
633 "\tif (this.popup == null) {",
634 " this.popup = new Xcls_ValaCompileErrors();",
635 " this.popup.window = _this;",
636 " // this.popup.el.set_transient_for( _this.el );",
637 " this.popup.el.set_parent(this.el);",
639 "\tthis.popup.updateNotices(nots);",
647 "Palete.ValaCompileRequest? last_request" : "null",
648 "Xcls_ValaCompileErrors popup" : "",
649 "bool visible" : false,
650 "id" : "statusbar_run",
655 " if (_this.windowstate.file == null) {",
658 " if (_this.statusbar_compile_spinner.el.spinning) {",
659 " \t_this.windowstate.compile_results.el.set_parent(this.el);",
660 "\t _this.windowstate.compile_results.el.show(); // show currently running.",
664 "\tif (this.last_request != null) {",
665 "\t\tthis.last_request.cancel();",
666 "\t\tif (this.last_request.terminal_pid > 0) {",
667 "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
670 "\tvar pr = _this.windowstate.project as Project.Gtk;",
671 "\tif (pr == null) {",
676 "\tthis.last_request= new Palete.ValaCompileRequest(",
678 "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
680 "\tthis.last_request.onOutput.connect( ( str) => {",
681 "\t\t_this.windowstate.compile_results.addLine(str);",
683 "\tthis.last_request.run.begin( ( a, r) => {",
684 "\t\tthis.last_request.run.end(r);",
686 "\t if (_this.windowstate.compile_results.el.parent == null) {",
687 "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
689 "\t_this.windowstate.compile_results.show(this.el,true);",
694 "string icon_name" : "media-playback-start",
695 "string label" : "Run",
703 "id" : "statusbar_compile_spinner",
704 "int margin_end" : 4,
705 "int margin_start" : 4,
706 "string tooltip_text" : "Compiling",
709 "(string icon, string tooltip) {",
711 "\tif (icon == \"spinner\") {",
712 "\t this.el.show();",
713 "\t this.el.start(); ",
714 "\t this.el.tooltip_text = tooltip;",
715 "\t _this.statusbar_compile_icon.el.hide();",
717 "\t this.el.hide();",
718 "\t// GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
719 "\t _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
720 "\t _this.statusbar_compile_icon.el.icon_name = icon;",
721 "\t _this.statusbar_compile_icon.el.show();\t ",
732 " _this.statusbar_compile_icon.el.hide(); ",
739 "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
740 "id" : "statusbar_compile_icon",
741 "int margin_end" : 4,
742 "int margin_start" : 4,
755 "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
758 "\t this.windowstate.file.getLanguageServer().document_close(",
759 "\t \tthis.windowstate.file",
762 "\t BuilderApplication.removeWindow(this);",
764 "\t if (BuilderApplication.windows.size < 1) {",
765 "\t\tthis.windowstate.file.getLanguageServer().exit();",
766 "\t\tBuilderApplication.singleton( null ).quit();",
781 " // hide the file editing..",
783 " //this.hideViewEditing();",
784 " // this is updated by windowstate - we try and fill it in..",
785 " _this.statusbar.el.hide();",
786 " //_this.statusbar_errors.el.hide();",
787 " //_this.statusbar_warnings.el.hide();",
788 " //_this.statusbar_depricated.el.hide();",
789 " _this.statusbar_compile_spinner.el.hide();",
791 " Resources.singleton().checkResources();",
798 "string title" : "Roo Application Builder",
799 "xtype" : "ApplicationWindow",
800 "| void initChildren" : [
802 " // this needs putting in a better place..",
803 " this.windowstate = new WindowState(this);",
815 "| void openNewWindow" : [
818 " var w = new Xcls_MainWindow();",
820 "\tBuilderApplication.addWindow(w);",
822 " w.initChildren();",
823 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
828 "| void setTitle" : [
830 " if (_this.windowstate.project == null || ",
831 "\t _this.windowstate.file == null",
833 " \tthis.el.set_title(\"Select File\");",
836 " _this.el.set_title(",
837 " \t_this.windowstate.project.name + ",
839 "\t\t_this.windowstate.file.relpath);",
846 " if (this.windowstate.file == null) {",
847 " \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
851 "| void updateErrors" : [
855 " \tGLib.debug(\"updateErrors\");",
857 "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
859 "\tthis.statusbar_errors.setNotices(",
861 "\t\tthis.windowstate.file.getErrors(\"ERR\")",
864 "\tthis.statusbar_warnings.setNotices(",
865 "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
866 "\t\tthis.windowstate.file.getErrors(\"WARN\")",
868 "\tthis.statusbar_depricated.setNotices(",
869 "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
870 "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
873 "\t_this.statusbar_run.el.hide();",
875 "\tif (pr.get_n_items() < 1) {",
876 "\t\t_this.statusbar_run.el.show();",
883 "name" : "MainWindow"