2 "build_module" : "builder",
5 "# Project.Project project" : "null",
6 "# WindowState windowstate" : "",
7 "# string title" : "\"Roo Application Builder\"",
8 "$ type" : "Gtk.WindowType.TOPLEVEL",
13 " this.el.set_icon_name(\"roobuilder\");",
17 "default_height" : 850,
18 "default_width" : 1200,
23 "* pack" : "set_titlebar",
24 "bool show_close_button" : true,
29 "* pack" : "pack_start",
30 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
33 "# Gee.ArrayList<Gtk.MenuItem> mitems" : "",
34 "$ Gtk.Align halign" : "Gtk.Align.START",
35 "$ Gtk.ArrowType direction" : "Gtk.ArrowType.DOWN",
39 "\tthis.mitems = new Gee.ArrayList<Gtk.MenuItem>();",
44 "bool always_show_image" : true,
45 "bool use_popover" : false,
51 "* pack" : "set_image",
52 "utf8 icon_name" : "window-new",
59 " this.el.show_all();",
71 "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
76 "string label" : "New Window",
82 "xtype" : "SeparatorMenuItem"
88 "string label" : "Windows",
89 "xtype" : "MenuButton",
90 "| void updateMenu" : [
92 "\t foreach(var m in this.mitems) {",
93 "\t \t this.el.popup.remove(m);",
95 "\t this.mitems.clear();",
97 "\t BuilderApplication.windows.sort((a,b) => {",
98 "\t \tif (a.windowstate == null ||",
99 " \t\t\t a.windowstate.file == null || ",
100 " \t\t\t b.windowstate == null ||",
101 " \t\t\t b.windowstate.file == null",
106 "\t \tvar ap = a.windowstate.file.project.name;",
107 "\t \tvar bp = b.windowstate.file.project.name;",
111 "\t \tif (ap != bp) {",
112 "\t \t\treturn ap.collate(bp);",
114 "\t \tvar af = a.windowstate.file.getTitle();",
115 "\t \tvar bf = b.windowstate.file.getTitle();\t \t",
116 "\t\treturn af.collate(bf);",
121 "\t foreach(var w in BuilderApplication.windows) {",
122 "\t \tvar wid = BuilderApplication.windows.index_of(w);",
123 "\t \t// fixme find a better way to display this.",
124 " \t\tif (w.windowstate == null ||",
125 " \t\t\t w.windowstate.file == null || ",
126 " \t\t\t _this.windowstate == null ||",
127 " \t\t\t _this.windowstate.file == null",
131 "\t \t// should not happen...",
132 "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
135 " \t\tif (w.windowstate.file.project.name != p || p != \"\") {",
136 " \t\t\tvar ms = new Gtk.SeparatorMenuItem();",
137 " \t\t\tthis.el.popup.append(ms);",
139 "\t\t \tthis.mitems.add(ms);",
142 " \t\tp = w.windowstate.file.project.name;",
145 " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
149 "\t \tvar m = new Gtk.MenuItem.with_label(",
150 "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.getTitle()",
153 "\t \t//w.windowstate.file.path);",
154 "\t \tm.activate.connect(() => {",
155 "\t \t\t BuilderApplication.windows.get(wid).el.present();",
157 "\t \tthis.el.popup.append(m);",
159 "\t \tthis.mitems.add(m);",
165 "$ tooltop_text" : "\"Open File\"",
168 "bool always_show_image" : true,
169 "id" : "open_projects_btn",
173 "* pack" : "set_image",
174 "utf8 icon_name" : "system-file-manager",
181 " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
186 "string label" : "Files / Projects",
193 "string title" : "Application Builder",
194 "xtype" : "HeaderBar"
197 "$ homogeneous" : false,
200 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
204 "# int lastWidth" : 0,
206 "* pack" : "pack_start,true,true,0",
207 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
213 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
218 "* pack" : "pack_start,true,true,0",
219 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
225 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
232 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
238 "accept_position" : [
240 "\tGLib.debug(\"Accept postion\");",
246 "\tGLib.debug(\"Move handle\");",
259 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
264 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
265 "bool vexpand" : true,
272 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
273 "bool vexpand" : true,
274 "id" : "codeeditviewbox",
286 "* pack" : "pack_end,false,true,0",
287 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
288 "bool homogeneous" : false,
291 "$ tooltip_text" : "\"Project Details\"",
294 "bool always_show_image" : true,
298 "* pack" : "set_image",
299 "utf8 icon_name" : "emblem-system",
307 " _this.windowstate.projectPopoverShow(this.el, _this.project);",
313 "string label" : "Edit Project Settings",
317 "$ tooltip_text" : "\"File Details\"",
320 "bool always_show_image" : true,
324 "* pack" : "set_image",
325 "utf8 icon_name" : "document-properties",
333 " // create a new file in project..",
334 " if (_this.project == null || _this.windowstate.file == null) {",
337 " _this.windowstate.file_details.show(",
338 " _this.windowstate.file, this.el, false",
347 "string label" : "Edit File Properties",
353 "bool always_show_image" : true,
359 " this.el.show_all();",
363 "* pack" : "set_popup",
372 " Resources.singleton().fetchStart();",
376 "string label" : "Download updated Resources",
385 " About.singleton().el.show();",
389 "string label" : "About the Builder",
397 "* pack" : "set_image",
398 "utf8 icon_name" : "dialog-information",
402 "string label" : "About",
403 "xtype" : "MenuButton"
407 "* pack" : "pack_start,true,true,0",
408 "string label" : " ",
415 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
418 " _this.mainpane.el.set_sensitive(true);",
422 " _this.mainpane.el.set_sensitive(false);",
424 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
425 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
431 "* pack" : "pack_start,true,true,0",
432 "bool show_text" : true,
434 "ulong handler_id" : "-1",
435 "xtype" : "ProgressBar"
444 "id" : "statusbar_compilestatus_label",
445 "string label" : "Compile Status:",
449 "# Json.Object notices" : "new Json.Object() ",
452 "Xcls_ValaCompileErrors popup" : "",
453 "id" : "statusbar_errors",
457 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
462 "utf8 icon_name" : "dialog-error",
467 "id" : "statusbar_errors_label",
468 "string label" : "Errors",
476 "button_press_event" : [
478 " if (this.popup == null) {",
479 " this.popup = new Xcls_ValaCompileErrors();",
480 " this.popup.window = _this;",
484 " this.popup.show(this.notices, this.el);",
489 "xtype" : "MenuItem",
490 "| void setNotices" : [
491 "(Json.Object nots, int qty) {",
492 " this.el.show_all();",
493 " _this.statusbar_errors_label.el.label = qty.to_string() + \" Errors\";",
494 " this.notices = nots;",
501 "# Json.Object notices" : "new Json.Object()",
504 "Xcls_ValaCompileErrors popup" : "",
505 "id" : "statusbar_warnings",
509 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
514 "utf8 icon_name" : "dialog-warning",
519 "id" : "statusbar_warnings_label",
520 "string label" : "Errors",
528 "button_press_event" : [
530 " if (this.popup == null) {",
531 " this.popup = new Xcls_ValaCompileErrors();",
532 " this.popup.window = _this;",
535 " this.popup.show(this.notices, this.el);",
540 "xtype" : "MenuItem",
541 "| void setNotices" : [
542 "(Json.Object nots, int qty) {",
543 " this.el.show_all();",
544 " _this.statusbar_warnings_label.el.label = qty.to_string() + \" Warnings\";",
545 " this.notices = nots;",
552 "# Json.Object notices" : "new Json.Object()",
555 "Xcls_ValaCompileErrors popup" : "",
556 "id" : "statusbar_depricated",
560 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
565 "utf8 icon_name" : "dialog-information",
570 "id" : "statusbar_depricated_label",
571 "string label" : "Errors",
579 "button_press_event" : [
581 " if (this.popup == null) {",
582 " this.popup = new Xcls_ValaCompileErrors();",
583 " this.popup.window = _this;",
587 " this.popup.show(this.notices, this.el);",
592 "xtype" : "MenuItem",
593 "| void setNotices" : [
594 "(Json.Object nots, int qty) {",
595 " this.el.show_all();",
596 " _this.statusbar_depricated_label.el.label = qty.to_string() + \" Depricated\";",
597 " this.notices = nots;",
606 "Xcls_ValaCompileErrors popup" : "",
607 "id" : "statusbar_run",
611 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
616 "utf8 icon_name" : "media-playback-start",
621 "string label" : "Run",
629 "button_press_event" : [
631 "\tif (_this.windowstate.file == null) {",
634 "\tBuilderApplication.valasource.spawnExecute(_this.windowstate.file);",
636 "\t_this.windowstate.compile_results.show(this.el,true);",
650 "id" : "statusbar_compile_spinner",
651 "string tooltip_text" : "Compiling",
656 " this.el.start(); ",
685 " Resources.singleton().disconnect(_this.statusbar.handler_id);",
687 " BuilderApplication.removeWindow(this);",
689 " if (BuilderApplication.windows.size < 1) {",
695 "key_release_event" : [
700 "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
701 "\t\tprint(\"SAVE: ctrl-n pressed\");",
702 "\t\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
706 " // print(event.key.keyval)",
716 " // hide the file editing..",
718 " //this.hideViewEditing();",
719 " _this.statusbar.el.hide();",
720 " _this.statusbar_errors.el.hide();",
721 " _this.statusbar_warnings.el.hide();",
722 " _this.statusbar_depricated.el.hide();",
723 " _this.statusbar_compile_spinner.el.hide();",
725 " Resources.singleton().checkResources();",
731 "| void initChildren" : [
733 " // this needs putting in a better place..",
734 " this.windowstate = new WindowState(this);",
746 "| void openNewWindow" : [
749 " var w = new Xcls_MainWindow();",
751 "\tBuilderApplication.addWindow(w);",
753 " w.initChildren();",
754 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
759 "| void setTitle" : [
761 " this.headerbar.el.set_title(this.title + \" - \" + str);",
768 " this.el.show_all();",
775 "name" : "MainWindow",
777 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",