2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Project.Project project" : "null",
7 "# WindowState windowstate" : "",
8 "# bool winloading" : false,
9 "$ type" : "Gtk.WindowType.TOPLEVEL",
11 "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
14 "this.el.set_icon_name(\"roobuilder\");",
18 "default_height" : 850,
19 "default_width" : 1200,
23 "$ string title" : "\"Application Builder\"",
25 "* pack" : "set_titlebar",
26 "bool show_close_button" : true,
31 "* pack" : "pack_start",
32 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
37 "bool has_frame" : false,
41 " \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;",
42 " \tif (_this.splitview.el.show_sidebar) {",
43 " \t\t_this.filesearch.el.grab_focus();",
44 " \t\t_this.winloading = true;",
45 " \t\t_this.winmodel.el.remove_all();",
46 " \t\t_this.filesearch.el.set_text(\"\");",
47 " \t\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
48 "\t\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
50 "\t\t_this.winsel.selectCurrent();",
51 "\t\t_this.winloading = false;",
56 "string icon_name" : "preferences-system-windows",
57 "tooltop_text" : "Manage Windows",
69 "bool collapsed" : true,
70 "bool show_sidebar" : false,
71 "double sidebar_width_fraction" : 0.40000000000000002,
77 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
78 "bool hexpand" : true,
79 "bool homogeneous" : false,
80 "bool vexpand" : false,
85 "# int lastWidth" : 0,
87 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
88 "bool hexpand" : true,
89 "bool vexpand" : true,
94 "* prop" : "start_child",
95 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
96 "bool hexpand" : true,
97 "bool vexpand" : true,
102 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
107 "* prop" : "start_child",
108 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
109 "bool hexpand" : true,
110 "bool vexpand" : true,
116 "* prop" : "end_child",
117 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
118 "bool hexpand" : true,
119 "bool vexpand" : true,
125 "accept_position" : [
127 "\t_this.windowstate.left_tree.onresize();",
134 "\tGLib.debug(\"Move handle\");",
146 "* prop" : "end_child",
147 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
148 "bool hexpand" : true,
149 "bool vexpand" : true,
153 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
154 "bool hexpand" : true,
155 "bool vexpand" : true,
161 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
162 "bool hexpand" : true,
163 "bool vexpand" : true,
164 "id" : "codeeditviewbox",
172 "accept_position" : [
174 "\t_this.windowstate.left_tree.onresize();",
185 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
186 "bool homogeneous" : false,
187 "bool vexpand" : false,
190 "$ tooltip_text" : "\"Project Details\"",
192 "bool always_show_image" : true,
197 " _this.windowstate.projectPopoverShow(_this.el, null, null);",
203 "string icon_name" : "emblem-system",
204 "string label" : "Edit Project Settings",
208 "$ tooltip_text" : "\"File Details\"",
210 "bool always_show_image" : true,
215 " // create a new file in project..",
216 " if (_this.project == null || _this.windowstate.file == null) {",
219 " _this.windowstate.file_details.show(",
220 " _this.windowstate.file, _this.el, false",
229 "string icon_name" : "document-properties",
230 "string label" : "Edit File Properties",
235 "bool always_show_image" : true,
239 "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
242 " // this.el.show();",
246 "* prop" : "popover",
251 "* pack" : "set_child",
252 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
260 " Resources.singleton().fetchStart();",
264 "string label" : "Download updated Resources",
272 " About.singleton().el.show();",
276 "string label" : "About the Builder",
283 "xtype" : "PopoverMenu"
286 "string icon_name" : "dialog-information",
287 "string label" : "About",
288 "xtype" : "MenuButton"
292 "bool hexpand" : true,
293 "string label" : " ",
300 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
303 " _this.mainpane.el.set_sensitive(true);",
307 " _this.mainpane.el.set_sensitive(false);",
309 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
310 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
316 "bool show_text" : true,
318 "ulong handler_id" : "-1",
319 "xtype" : "ProgressBar"
322 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
327 "id" : "statusbar_compilestatus_label",
328 "int margin_end" : 4,
329 "int margin_start" : 4,
330 "string label" : "Compile Status:",
335 "Xcls_ValaCompileErrors popup" : "",
336 "id" : "statusbar_errors",
341 "\tif (this.popup == null) {",
345 " this.popup.show();",
350 "string icon_name" : "dialog-error",
351 "string label" : "0 Errors",
353 "| void setNotices" : [
354 "(GLib.ListStore nots, int ferrors ) {",
355 " BuilderApplication.showSpinner(\"\");",
356 " if (nots.get_n_items() < 1 ) {",
357 " \tthis.el.hide();",
358 " \tif (this.popup != null) {",
359 " \t\tthis.popup.el.hide();",
365 " this.el.label = \"%d/%d Errors\".printf(ferrors,(int)nots.get_n_items());",
369 "\tif (this.popup == null) {",
370 " this.popup = new Xcls_ValaCompileErrors();",
371 " this.popup.window = _this;",
372 " // this.popup.el.set_transient_for( _this.el );",
373 " this.popup.el.set_parent(this.el);",
376 "\tthis.popup.updateNotices(nots);",
384 "Xcls_ValaCompileErrors popup" : "",
385 "id" : "statusbar_warnings",
390 "\tif (this.popup == null) {",
394 " this.popup.show();",
399 "string icon_name" : "dialog-warning",
400 "string label" : "0 Warnings",
402 "| void setNotices" : [
403 "(GLib.ListStore nots, int ferrs ) {",
405 " if (nots.get_n_items() < 1 ) {",
406 " \tthis.el.hide();",
407 " \tif (this.popup != null) {",
408 " \t\tthis.popup.el.hide();",
414 " this.el.label = \"%d/%d Warnings\".printf(ferrs,(int)nots.get_n_items());",
418 "\tif (this.popup == null) {",
419 " this.popup = new Xcls_ValaCompileErrors();",
420 " this.popup.window = _this;",
421 " // this.popup.el.set_transient_for( _this.el );",
422 " this.popup.el.set_parent(this.el);",
424 "\tthis.popup.updateNotices(nots);",
431 "# GLib.ListStore notices" : "null",
433 "Xcls_ValaCompileErrors popup" : "",
434 "id" : "statusbar_depricated",
439 "\tif (this.popup == null) {",
443 " this.popup.show();",
448 "string icon_name" : "dialog-information",
449 "string label" : "0 Depricated",
451 "| void setNotices" : [
453 "(GLib.ListStore nots, int ferrs ) {",
455 " if (nots.get_n_items() < 1 ) {",
456 " \tthis.el.hide();",
457 " \tif (this.popup != null) {",
458 " \t\tthis.popup.el.hide();",
464 " this.el.label = \"%d/%d Depricated\".printf(ferrs,(int)nots.get_n_items());",
468 "\tif (this.popup == null) {",
469 " this.popup = new Xcls_ValaCompileErrors();",
470 " this.popup.window = _this;",
471 " // this.popup.el.set_transient_for( _this.el );",
472 " this.popup.el.set_parent(this.el);",
474 "\tthis.popup.updateNotices(nots);",
482 "Palete.ValaCompileRequest? last_request" : "null",
483 "Xcls_ValaCompileErrors popup" : "",
484 "bool visible" : false,
485 "id" : "statusbar_run",
490 " if (_this.windowstate.file == null) {",
493 " if (_this.statusbar_compile_spinner.el.spinning) {",
494 " \t_this.windowstate.compile_results.el.set_parent(this.el);",
495 "\t _this.windowstate.compile_results.el.show(); // show currently running.",
499 "\tif (this.last_request != null) {",
500 "\t\tthis.last_request.cancel();",
501 "\t\tif (this.last_request.terminal_pid > 0) {",
502 "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
505 "\tvar pr = _this.windowstate.project as Project.Gtk;",
506 "\tif (pr == null) {",
511 "\tthis.last_request= new Palete.ValaCompileRequest(",
513 "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
515 "\tthis.last_request.onOutput.connect( ( str) => {",
516 "\t\t_this.windowstate.compile_results.addLine(str);",
518 "\tthis.last_request.run.begin( ( a, r) => {",
519 "\t\tthis.last_request.run.end(r);",
521 "\t if (_this.windowstate.compile_results.el.parent == null) {",
522 "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
524 "\t_this.windowstate.compile_results.show(this.el,true);",
529 "string icon_name" : "media-playback-start",
530 "string label" : "Run",
538 "id" : "statusbar_compile_spinner",
539 "int margin_end" : 4,
540 "int margin_start" : 4,
541 "string tooltip_text" : "Compiling",
544 "(string icon, string tooltip) {",
546 "\tif (icon == \"spinner\") {",
547 "\t this.el.show();",
548 "\t this.el.start(); ",
549 "\t this.el.tooltip_text = tooltip;",
550 "\t _this.statusbar_compile_icon.el.hide();",
552 "\t this.el.hide();",
553 "\t// GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
554 "\t _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
555 "\t _this.statusbar_compile_icon.el.icon_name = icon;",
556 "\t _this.statusbar_compile_icon.el.show();\t ",
567 " _this.statusbar_compile_icon.el.hide(); ",
574 "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
575 "id" : "statusbar_compile_icon",
576 "int margin_end" : 4,
577 "int margin_start" : 4,
588 "* prop" : "sidebar",
589 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
594 "bool hexpand" : true,
595 "bool search_mode_enabled" : true,
600 "bool hexpand" : true,
606 "\t_this.windowsearch.el.set_search(this.el.get_text());",
611 "string placeholder_text" : "Search for file",
612 "xtype" : "SearchEntry"
615 "xtype" : "SearchBar"
619 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
620 "bool hexpand" : true,
625 "bool hexpand" : true,
626 "id" : "open_projects_btn",
631 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
636 "int margin_end" : 4,
637 "string icon_name" : "document-open",
642 "string label" : "Open File",
652 " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
656 "tooltop_text" : "\"Open File\"",
661 "bool hexpand" : true,
666 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
671 "int margin_end" : 4,
672 "string icon_name" : "window-new",
677 "string label" : "New Window",
687 "\t_this.splitview.el.show_sidebar = false;",
688 "\t_this.windowstate.showPopoverFiles(_this.el, _this.project, true);",
699 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
700 "bool vexpand" : true,
704 "* prop" : "start_child",
713 "bool autoselect" : false,
714 "bool can_unselect" : false,
715 "bool selecting" : false,
730 "id" : "windowsearch",
734 "* prop" : "expression",
735 "GLib.Type this_type" : "typeof(WindowState)",
736 "string property_name" : "file_name",
737 "xtype" : "PropertyExpression"
740 "xtype" : "StringFilter"
745 "GLib.Type item_type" : "typeof(WindowState)",
747 "xtype" : "ListStore"
750 "xtype" : "FilterListModel"
755 "bool ignore_case" : true,
759 "* prop" : "expression",
760 "GLib.Type this_type" : "typeof(WindowState)",
761 "string property_name" : "file_name",
762 "xtype" : "PropertyExpression"
765 "xtype" : "StringSorter"
768 "xtype" : "SortListModel"
772 "notify[\"selected\"]" : [
774 "\tif (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {",
777 "\tvar ws = this.el.selected_item as WindowState;",
778 "\tif (ws == null) {",
781 "\tif (ws.file.path != _this.windowstate.file.path) {",
782 "\t\t_this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);",
783 "\t\t_this.splitview.el.show_sidebar = false;",
786 "\tthis.selectCurrent();",
790 "xtype" : "SingleSelection",
791 "| void selectCurrent" : [
793 "\tthis.selecting = true;",
795 "\tfor(var i = 0;i < this.el.get_n_items(); i++) {",
796 "\t\tvar ws = this.el.get_item(i) as WindowState;",
797 "\t\tif (ws.file.path == _this.windowstate.file.path) {",
798 "\t\t \tthis.el.selected = i;",
802 "\tthis.selecting = false;",
810 "bool expand" : true,
811 "bool resizable" : true,
816 "* prop" : "factory",
820 "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
821 "\t var item = (listitem as Gtk.ListItem).get_item() as WindowState;",
823 "\t lb.label = item.project.name;",
833 "\tvar lbl = new Gtk.Label(\"\");",
834 " \t(listitem as Gtk.ListItem).set_child(lbl);",
835 " \tlbl.justify = Gtk.Justification.LEFT;",
836 " \tlbl.xalign = 0;",
837 " \tlbl.use_markup = true;",
838 "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
840 "\t(listitem as Gtk.ListItem).activatable = true;",
845 "xtype" : "SignalListItemFactory"
849 "xtype" : "ColumnViewColumn"
853 "* pack" : "append_column",
854 "bool expand" : true,
855 "bool resizable" : true,
860 "* prop" : "factory",
864 " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
865 " var item = (listitem as Gtk.ListItem).get_item() as WindowState;",
867 " lb.label = item.file.relpath;",
877 "\tvar lbl = new Gtk.Label(\"\");",
878 " \t(listitem as Gtk.ListItem).set_child(lbl);",
879 " \tlbl.justify = Gtk.Justification.LEFT;",
880 " \tlbl.xalign = 0;",
881 " \tlbl.use_markup = true;",
882 "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
884 "\t(listitem as Gtk.ListItem).activatable = true;",
889 "xtype" : "SignalListItemFactory"
893 "xtype" : "ColumnViewColumn"
896 "xtype" : "ColumnView"
899 "xtype" : "ScrolledWindow"
902 "* prop" : "end_child",
903 "bool hexpand" : true,
904 "bool vexpand" : true,
909 "bool hexpand" : true,
910 "bool vexpand" : true,
915 "bool autoselect" : false,
916 "bool can_unselect" : true,
929 "GLib.Type item_type" : "typeof(WindowState)",
931 "xtype" : "ListStore"
940 "* prop" : "expression",
941 "GLib.Type this_type" : "typeof(WindowState)",
942 "string property_name" : "file_name",
943 "xtype" : "PropertyExpression"
946 "xtype" : "StringFilter"
949 "xtype" : "FilterListModel"
954 "bool ignore_case" : true,
958 "* prop" : "expression",
959 "GLib.Type this_type" : "typeof(WindowState)",
960 "string property_name" : "file_name",
961 "xtype" : "PropertyExpression"
964 "xtype" : "StringSorter"
967 "xtype" : "SortListModel"
970 "xtype" : "SingleSelection"
974 "bool expand" : true,
975 "bool resizable" : true,
979 "* prop" : "factory",
983 "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
984 "\t var item = (listitem as Gtk.ListItem).get_item() as WindowState;",
986 "\t lb.label = item.project.name;",
996 "\tvar lbl = new Gtk.Label(\"\");",
997 " \t(listitem as Gtk.ListItem).set_child(lbl);",
998 " \tlbl.justify = Gtk.Justification.LEFT;",
999 " \tlbl.xalign = 1;",
1000 " \tlbl.use_markup = true;",
1001 "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
1003 "\t(listitem as Gtk.ListItem).activatable = true;",
1008 "xtype" : "SignalListItemFactory"
1011 "title" : "Project",
1012 "xtype" : "ColumnViewColumn"
1016 "* pack" : "append_column",
1017 "bool expand" : true,
1018 "bool resizable" : true,
1022 "* prop" : "factory",
1026 " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
1027 " var item = (listitem as Gtk.ListItem).get_item() as WindowState;",
1029 " lb.label = item.file.relpath;",
1039 "\tvar lbl = new Gtk.Label(\"\");",
1040 " \t(listitem as Gtk.ListItem).set_child(lbl);",
1041 " \tlbl.justify = Gtk.Justification.LEFT;",
1042 " \tlbl.xalign = 1;",
1043 " \tlbl.use_markup = true;",
1044 "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
1046 "\t(listitem as Gtk.ListItem).activatable = true;",
1051 "xtype" : "SignalListItemFactory"
1055 "xtype" : "ColumnViewColumn"
1058 "xtype" : "ColumnView"
1061 "string xns" : "Gtk",
1062 "string xtype" : "ScrolledWindow"
1071 "xtype" : "OverlaySplitView"
1077 "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
1080 "\t this.windowstate.file.getLanguageServer().document_close(",
1081 "\t \tthis.windowstate.file",
1084 "\t BuilderApplication.removeWindow(this);",
1086 "\t if (BuilderApplication.windows.size < 1) {",
1087 "\t\tthis.windowstate.file.getLanguageServer().exit();",
1088 "\t\tBuilderApplication.singleton( null ).quit();",
1103 " // hide the file editing..",
1105 " //this.hideViewEditing();",
1106 " // this is updated by windowstate - we try and fill it in..",
1107 " _this.statusbar.el.hide();",
1108 " //_this.statusbar_errors.el.hide();",
1109 " //_this.statusbar_warnings.el.hide();",
1110 " //_this.statusbar_depricated.el.hide();",
1111 " _this.statusbar_compile_spinner.el.hide();",
1113 " Resources.singleton().checkResources();",
1120 "string title" : "Roo Application Builder",
1121 "xtype" : "ApplicationWindow",
1122 "| void initChildren" : [
1124 " // this needs putting in a better place..",
1125 " if (this.windowstate == null) {",
1126 " \tthis.windowstate = new WindowState(this);",
1140 "| void openNewWindow" : [
1143 " var w = new Xcls_MainWindow();",
1145 "\tBuilderApplication.addWindow(w);",
1147 " w.initChildren();",
1148 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
1153 "| void setTitle" : [
1155 " if (_this.windowstate.project == null || ",
1156 "\t _this.windowstate.file == null",
1158 " \tthis.el.set_title(\"Select File\");",
1161 " _this.el.set_title(",
1162 " \t_this.windowstate.project.name + ",
1164 "\t\t_this.windowstate.file.relpath);",
1171 " if (this.windowstate.file == null) {",
1172 " \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
1176 "| void updateErrors" : [
1180 " \tGLib.debug(\"updateErrors\");",
1182 "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
1184 "\tthis.statusbar_errors.setNotices(",
1186 "\t\tthis.windowstate.file.getErrorsTotal(\"ERR\")",
1189 "\tthis.statusbar_warnings.setNotices(",
1190 "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
1191 "\t\tthis.windowstate.file.getErrorsTotal(\"WARN\")",
1193 "\tthis.statusbar_depricated.setNotices(",
1194 "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
1195 "\t\tthis.windowstate.file.getErrorsTotal(\"DEPR\")",
1198 "\t_this.statusbar_run.el.hide();",
1200 "\tif (pr.get_n_items() < 1) {",
1201 "\t\t_this.statusbar_run.el.show();",
1208 "name" : "MainWindow"