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:",
499 "# GLib.ListStore notices" : "null",
501 "Xcls_ValaCompileErrors popup" : "",
502 "id" : "statusbar_errors",
509 " if (this.popup == null) {",
510 " this.popup = new Xcls_ValaCompileErrors();",
511 " this.popup.window = _this;",
512 " //this.popup.el.application = _this.el.application;",
513 "\t // this.popup.el.set_transient_for( _this.el );",
514 " this.popup.el.set_parent(this.el);",
516 " if (_this.statusbar_compile_spinner.el.spinning) {",
517 "\t\tthis.popup.el.show(); \t",
520 " this.popup.show(this.notices, this.el);",
525 "string icon_name" : "dialog-error",
526 "string label" : "0 Errors",
528 "| void setNotices" : [
529 "(GLib.ListStore nots, int qty, int tf) {",
532 " \tthis.el.hide();",
533 " \tif (this.popup != null && this.popup.el.visible) {",
534 " \t\tthis.popup.el.hide();",
540 " this.el.label = \"%d/%d Errors\".printf(tf,qty);",
541 " this.notices = nots;",
542 "\tif (this.popup != null && this.popup.el.visible) {",
543 "\t\t this.popup.show(this.notices, this.el);",
550 "# GLib.ListStore notices" : "null",
552 "Xcls_ValaCompileErrors popup" : "",
553 "id" : "statusbar_warnings",
558 "\tif (this.popup == null) {",
559 " this.popup = new Xcls_ValaCompileErrors();",
560 " this.popup.window = _this;",
561 " // this.popup.el.set_transient_for( _this.el );",
562 " this.popup.el.set_parent(this.el);",
564 " if (_this.statusbar_compile_spinner.el.spinning) {",
565 "\t\tthis.popup.el.show(); \t",
568 " this.popup.show(this.notices, this.el);",
573 "string icon_name" : "dialog-warning",
574 "string label" : "0 Warnings",
576 "| void setNotices" : [
577 "(GLib.ListStore nots, int qty, int tf) {",
580 " \tthis.el.hide();",
581 " \tif (this.popup != null && this.popup.el.visible) {",
582 " \t\tthis.popup.el.hide();",
587 " this.el.label = \"%d/%d Warnings\".printf(tf,qty);",
588 " this.notices = nots;",
589 " if (this.popup != null && this.popup.el.visible) {",
590 "\t\t this.popup.show(this.notices, this.el);",
599 "# GLib.ListStore notices" : "null",
601 "Xcls_ValaCompileErrors popup" : "",
602 "id" : "statusbar_depricated",
607 "\tif (this.popup == null) {",
608 " this.popup = new Xcls_ValaCompileErrors();",
609 " this.popup.window = _this;",
610 " // this.popup.el.set_transient_for( _this.el );",
611 " this.popup.el.set_parent(this.el);",
613 " if (_this.statusbar_compile_spinner.el.spinning) {",
614 "\t\tthis.popup.el.show(); \t",
618 " this.popup.show(this.notices, this.el);",
623 "string icon_name" : "dialog-information",
624 "string label" : "0 Depricated",
626 "| void setNotices" : [
627 "(GLib.ListStore nots, int qty, int tf) {",
629 " \tthis.el.hide();",
630 " \tif (this.popup != null && this.popup.el.visible) {",
631 "\t\t\t this.popup.el.hide();",
639 " this.el.label = \"%d/%d Depricated\".printf(tf,qty);",
640 " this.notices = nots;",
641 "\tif (this.popup != null && this.popup.el.visible) {",
642 "\t\t this.popup.show(this.notices, this.el);",
650 "Xcls_ValaCompileErrors popup" : "",
651 "id" : "statusbar_run",
656 " if (_this.windowstate.file == null) {",
659 " if (_this.statusbar_compile_spinner.el.spinning) {",
660 " \t_this.windowstate.compile_results.el.set_parent(this.el);",
661 "\t _this.windowstate.compile_results.el.show(); // show currently running.",
664 "\tBuilderApplication.valacompilequeue.addFile( ",
665 "\t \t\t\t\t\tPalete.ValaCompileRequestType.RUN, ",
666 "\t \t\t\t\t\t_this.windowstate.file, \"\", true ) ;",
668 "\t_this.windowstate.compile_results.el.set_parent(this.el);",
669 "\t_this.windowstate.compile_results.show(this.el,true);",
674 "string icon_name" : "media-playback-start",
675 "string label" : "Run",
683 "id" : "statusbar_compile_spinner",
684 "int margin_end" : 4,
685 "int margin_start" : 4,
686 "string tooltip_text" : "Compiling",
691 " this.el.start(); ",
716 "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
718 "\t BuilderApplication.removeWindow(this);",
720 "\t if (BuilderApplication.windows.size < 1) {",
722 "\t\tBuilderApplication.singleton( null ).quit();",
737 " // hide the file editing..",
739 " //this.hideViewEditing();",
740 " // this is updated by windowstate - we try and fill it in..",
741 " _this.statusbar.el.hide();",
742 " //_this.statusbar_errors.el.hide();",
743 " //_this.statusbar_warnings.el.hide();",
744 " //_this.statusbar_depricated.el.hide();",
745 " _this.statusbar_compile_spinner.el.hide();",
747 " Resources.singleton().checkResources();",
754 "string title" : "Roo Application Builder",
755 "xtype" : "ApplicationWindow",
756 "| void initChildren" : [
758 " // this needs putting in a better place..",
759 " this.windowstate = new WindowState(this);",
771 "| void openNewWindow" : [
774 " var w = new Xcls_MainWindow();",
776 "\tBuilderApplication.addWindow(w);",
778 " w.initChildren();",
779 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
784 "| void setTitle" : [
786 " if (_this.windowstate.project == null || ",
787 "\t _this.windowstate.file == null",
789 " \tthis.el.set_title(\"Select File\");",
792 " _this.el.set_title(",
793 " \t_this.windowstate.project.name + ",
795 "\t\t_this.windowstate.file.relpath);",
802 " if (this.windowstate.file == null) {",
803 " \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
807 "| void updateErrors" : [
808 "(Palete.ValaCompileRequest? req) {",
810 "\tif (req == null) {",
812 "\t _this.statusbar_errors.el.hide();",
813 "\t\t_this.statusbar_warnings.el.hide();",
814 "\t\t_this.statusbar_depricated.el.hide();",
819 "\tthis.statusbar_errors.setNotices(",
820 "\t\treq.errorByType.get(\"ERR\"),",
821 "\t\treq.totalErrors(\"ERR\"),",
822 "\t\treq.totalErrors(\"ERR\", this.windowstate.file)",
824 "\tthis.statusbar_warnings.setNotices(",
825 "\t\treq.errorByType.get(\"WARN\"),",
826 "\t\treq.totalErrors(\"WARN\"),",
827 "\t\treq.totalErrors(\"WARN\", this.windowstate.file)",
829 "\tthis.statusbar_depricated.setNotices(",
830 "\t\treq.errorByType.get(\"DEPR\"),",
831 "\t\treq.totalErrors(\"DEPR\"),",
832 "\t\treq.totalErrors(\"DEPR\", this.windowstate.file)",
835 "\t_this.statusbar_run.el.hide();",
837 "\tif (req.totalErrors(\"ERR\") < 1) {",
838 "\t\t_this.statusbar_run.el.show();",
845 "name" : "MainWindow"