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 foreach(var w in BuilderApplication.windows) {",
98 "\t \tvar wid = BuilderApplication.windows.index_of(w);",
99 "\t \t// fixme find a better way to display this.",
100 " \t\tif (w.windowstate == null ||",
101 " \t\t\t w.windowstate.file == null || ",
102 " \t\t\t _this.windowstate == null ||",
103 " \t\t\t _this.windowstate.file == null",
108 "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
112 " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
113 "\t \tvar m = new Gtk.MenuItem.with_label(w.windowstate.file.path);",
114 "\t \tm.activate.connect(() => {",
115 "\t \t\t BuilderApplication.windows.get(wid).el.present();",
117 "\t \tthis.el.popup.append(m);",
119 "\t \tthis.mitems.add(m);",
125 "$ tooltop_text" : "\"Open File\"",
128 "bool always_show_image" : true,
129 "id" : "open_projects_btn",
133 "* pack" : "set_image",
134 "utf8 icon_name" : "system-file-manager",
141 " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
146 "string label" : "Files / Projects",
153 "string title" : "Application Builder",
154 "xtype" : "HeaderBar"
157 "$ homogeneous" : false,
160 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
164 "# int lastWidth" : 0,
166 "* pack" : "pack_start,true,true,0",
167 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
173 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
178 "* pack" : "pack_start,true,true,0",
179 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
185 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
192 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
198 "accept_position" : [
200 "\tGLib.debug(\"Accept postion\");",
206 "\tGLib.debug(\"Move handle\");",
219 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
224 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
225 "bool vexpand" : true,
232 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
233 "bool vexpand" : true,
234 "id" : "codeeditviewbox",
246 "* pack" : "pack_end,false,true,0",
247 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
248 "bool homogeneous" : false,
251 "$ tooltip_text" : "\"Project Details\"",
254 "bool always_show_image" : true,
258 "* pack" : "set_image",
259 "utf8 icon_name" : "emblem-system",
267 " _this.windowstate.projectPopoverShow(this.el, _this.project);",
273 "string label" : "Edit Project Settings",
277 "$ tooltip_text" : "\"File Details\"",
280 "bool always_show_image" : true,
284 "* pack" : "set_image",
285 "utf8 icon_name" : "document-properties",
293 " // create a new file in project..",
294 " if (_this.project == null || _this.windowstate.file == null) {",
297 " _this.windowstate.file_details.show(",
298 " _this.windowstate.file, this.el, false",
307 "string label" : "Edit File Properties",
313 "bool always_show_image" : true,
319 " this.el.show_all();",
323 "* pack" : "set_popup",
332 " Resources.singleton().fetchStart();",
336 "string label" : "Download updated Resources",
345 " About.singleton().el.show();",
349 "string label" : "About the Builder",
357 "* pack" : "set_image",
358 "utf8 icon_name" : "dialog-information",
362 "string label" : "About",
363 "xtype" : "MenuButton"
367 "* pack" : "pack_start,true,true,0",
368 "string label" : " ",
375 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
378 " _this.mainpane.el.set_sensitive(true);",
382 " _this.mainpane.el.set_sensitive(false);",
384 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
385 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
391 "* pack" : "pack_start,true,true,0",
392 "bool show_text" : true,
394 "ulong handler_id" : "-1",
395 "xtype" : "ProgressBar"
404 "id" : "statusbar_compilestatus_label",
405 "string label" : "Compile Status:",
409 "# Json.Object notices" : "new Json.Object() ",
412 "Xcls_ValaCompileErrors popup" : "",
413 "bool always_show_image" : true,
414 "id" : "statusbar_errors",
418 "* pack" : "set_image",
419 "utf8 icon_name" : "dialog-error",
424 "button_press_event" : [
426 " if (this.popup == null) {",
427 " this.popup = new Xcls_ValaCompileErrors();",
428 " this.popup.window = _this;",
432 " this.popup.show(this.notices, this.el);",
437 "string label" : "Errors",
438 "xtype" : "ImageMenuItem",
439 "| void setNotices" : [
440 "(Json.Object nots, int qty) {",
442 " this.el.label = qty.to_string() + \" Errors\";",
443 " this.notices = nots;",
450 "# Json.Object notices" : "new Json.Object()",
453 "Xcls_ValaCompileErrors popup" : "",
454 "bool always_show_image" : true,
455 "id" : "statusbar_warnings",
459 "* pack" : "set_image",
460 "utf8 icon_name" : "dialog-warning",
465 "button_press_event" : [
467 " if (this.popup == null) {",
468 " this.popup = new Xcls_ValaCompileErrors();",
469 " this.popup.window = _this;",
472 " this.popup.show(this.notices, this.el);",
477 "string label" : "Warnings",
478 "xtype" : "ImageMenuItem",
479 "| void setNotices" : [
480 "(Json.Object nots, int qty) {",
482 " this.el.label = qty.to_string() + \" Warnings\";",
483 " this.notices = nots;",
490 "# Json.Object notices" : "new Json.Object()",
493 "Xcls_ValaCompileErrors popup" : "",
494 "bool always_show_image" : true,
495 "id" : "statusbar_depricated",
499 "* pack" : "set_image",
500 "utf8 icon_name" : "dialog-information",
505 "button_press_event" : [
507 " if (this.popup == null) {",
508 " this.popup = new Xcls_ValaCompileErrors();",
509 " this.popup.window = _this;",
513 " this.popup.show(this.notices, this.el);",
518 "string label" : "Depricated",
519 "xtype" : "ImageMenuItem",
520 "| void setNotices" : [
521 "(Json.Object nots, int qty) {",
523 " this.el.label = qty.to_string() + \" Depricated\";",
524 " this.notices = nots;",
533 "Xcls_ValaCompileErrors popup" : "",
534 "bool always_show_image" : true,
535 "id" : "statusbar_run",
539 "* pack" : "set_image",
540 "utf8 icon_name" : "media-playback-start",
545 "button_press_event" : [
547 "\tif (_this.windowstate.file == null) {",
550 "\tBuilderApplication.valasource.spawnExecute(_this.windowstate.file);",
552 "\t_this.windowstate.compile_results.show(this.el,true);",
558 "string label" : "Run",
559 "xtype" : "ImageMenuItem"
567 "id" : "statusbar_compile_spinner",
568 "string tooltip_text" : "Compiling",
573 " this.el.start(); ",
602 " Resources.singleton().disconnect(_this.statusbar.handler_id);",
604 " BuilderApplication.removeWindow(this);",
606 " if (BuilderApplication.windows.size < 1) {",
612 "key_release_event" : [
617 "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
618 "\t\tprint(\"SAVE: ctrl-n pressed\");",
619 "\t\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
623 " // print(event.key.keyval)",
633 " // hide the file editing..",
635 " //this.hideViewEditing();",
636 " _this.statusbar.el.hide();",
637 " _this.statusbar_errors.el.hide();",
638 " _this.statusbar_warnings.el.hide();",
639 " _this.statusbar_depricated.el.hide();",
640 " _this.statusbar_compile_spinner.el.hide();",
642 " Resources.singleton().checkResources();",
648 "| void initChildren" : [
650 " // this needs putting in a better place..",
651 " this.windowstate = new WindowState(this);",
663 "| void openNewWindow" : [
666 " var w = new Xcls_MainWindow();",
668 "\tBuilderApplication.addWindow(w);",
670 " w.initChildren();",
671 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
676 "| void setTitle" : [
678 " this.headerbar.el.set_title(this.title + \" - \" + str);",
685 " this.el.show_all();",
692 "name" : "MainWindow",
694 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",