2 "build_module" : "builder",
5 "# Project.Project project" : "null",
6 "# WindowState windowstate" : "null",
7 "# int no_windows" : 1,
8 "# string title" : "\"Roo Application Builder\"",
9 "$ type" : "Gtk.WindowType.TOPLEVEL",
14 " //this.el.show_all();",
16 " this.el.set_icon_name(\"roobuilder\");",
17 "\t//} catch (Exception e) {",
18 "\t//\tprint(\"no icon found\");",
22 "default_height" : 750,
23 "default_width" : 1200,
28 "* pack" : "set_titlebar",
29 "bool show_close_button" : true,
34 "* pack" : "pack_start",
35 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
39 "\"Open a new Window",
44 "bool always_show_image" : true,
49 "* pack" : "set_image",
50 "utf8 icon_name" : "window-new",
57 " _this.openNewWindow();",
63 "string label" : "New Window",
67 "$ tooltop_text" : "\"Open File\"",
70 "bool always_show_image" : true,
71 "id" : "open_projects_btn",
75 "* pack" : "set_image",
76 "utf8 icon_name" : "system-file-manager",
83 " \t_this.windowstate.showPopoverFiles(this.el, _this.project);",
88 "string label" : "Files / Projects",
95 "string title" : "Application Builder",
99 "$ homogeneous" : false,
102 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
106 "# int lastWidth" : 0,
108 "* pack" : "pack_start,true,true,0",
109 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
115 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
120 "* pack" : "pack_start,true,true,0",
121 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
127 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
134 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
147 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
150 "$ xns" : "GtkClutter",
152 " var stage = this.el.get_stage();",
153 " stage.set_background_color( Clutter.Color.from_string(\"#000\"));",
158 "* pack" : "pack_start,true,true,0",
159 "id" : "clutterembed",
162 "$ xns" : "GtkClutter",
167 " this.el.add_constraint(",
168 " new Clutter.AlignConstraint(",
169 " _this.clutterembed.el.get_stage(), ",
170 " Clutter.AlignAxis.X_AXIS,",
175 " //this.el.set_position(100,100);",
176 " this.el.set_pivot_point(1.0f,1.0f);",
178 " this.el.set_size(_this.clutterembed.el.get_stage().width-50,",
179 " _this.clutterembed.el.get_stage().height);",
183 "* pack" : "get_stage().add_child",
188 "$ xns" : "GtkClutter",
193 " this.el.add_constraint(",
194 " new Clutter.AlignConstraint(",
195 " _this.clutterembed.el.get_stage(), ",
196 " Clutter.AlignAxis.X_AXIS,",
201 " this.el.fixed_x = 50.0f;",
202 " this.el.fixed_y = 0.0f;",
203 " //this.el.set_position(100,100);",
204 " this.el.set_pivot_point(0.0f,0.0f);",
205 " this.el.set_scale(0.0f,1.0f);",
206 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
207 " _this.clutterembed.el.get_stage().height);",
211 "* pack" : "get_stage().add_child",
216 "$ xns" : "GtkClutter",
221 " this.el.add_constraint(",
222 " new Clutter.AlignConstraint(",
223 " _this.clutterembed.el.get_stage(), ",
224 " Clutter.AlignAxis.X_AXIS,",
229 " this.el.fixed_x = 50.0f;",
230 " this.el.fixed_y = 0.0f;",
231 " //this.el.set_position(100,100);",
232 " this.el.set_pivot_point(0.0f,0.0f);",
233 " this.el.set_scale(0.0f,1.0f);",
234 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
235 " _this.clutterembed.el.get_stage().height);",
239 "* pack" : "get_stage().add_child",
240 "id" : "codeeditview",
244 "$ xns" : "GtkClutter",
249 " this.el.add_constraint(",
250 " new Clutter.AlignConstraint(",
251 " _this.clutterembed.el.get_stage(), ",
252 " Clutter.AlignAxis.X_AXIS,",
257 " this.el.fixed_x = 50.0f;",
258 " this.el.fixed_y = 0.0f;",
259 " //this.el.set_position(100,100);",
260 " this.el.set_pivot_point(0.0f,0.0f);",
261 " this.el.set_scale(0.0f,1.0f);",
262 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
263 " _this.clutterembed.el.get_stage().height);",
267 "* pack" : "get_stage().add_child",
268 "id" : "addpropsview",
276 " this.el.add_constraint(",
277 " new Clutter.AlignConstraint(",
278 " _this.clutterembed.el.get_stage(), ",
279 " Clutter.AlignAxis.X_AXIS,",
285 " //this.el.set_position(100,100);",
286 " this.el.set_pivot_point(0.5f,0.5f);",
287 " this.el.set_size(50,",
288 " _this.clutterembed.el.get_stage().height);",
292 "* pack" : "get_stage().add_child",
293 "id" : "buttonlayout",
296 "$ orientation" : "Clutter.Orientation.VERTICAL",
298 "* prop" : "layout_manager",
299 "xtype" : "BoxLayout"
303 "* init" : "this.el.set_size(50,50);",
304 "* pack" : "add_child",
308 "$ xns" : "GtkClutter",
309 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
310 "* pack" : "add_child",
315 "height_request" : 50,
319 "* pack" : "set_image",
320 "utf8 icon_name" : "go-previous",
327 " // if (_this.windowstate.state == WindowState.State.FILEPROJECT) {",
329 "//\t _this.windowstate.switchState(WindowState.State.FILES);",
331 "\t _this.windowstate.switchState(WindowState.State.PREVIEW);",
338 "utf8 tooltip_text" : "Back",
339 "width_request" : 50,
350 "* init" : "this.el.set_size(50,50);",
351 "* pack" : "add_child",
352 "id" : "objectshowbutton",
355 "$ xns" : "GtkClutter",
356 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
357 "* pack" : "add_child",
360 "$ tooltip_text" : "\"Add Child Element\"",
363 "height_request" : 50,
367 "* pack" : "set_image",
368 "utf8 icon_name" : "list-add",
377 " \t_this.windowstate.showAddObject(this.el);",
382 "width_request" : 50,
392 " this.el.background_color = Clutter.Color.from_string(\"#333\");",
398 " this.el.background_color = Clutter.Color.from_string(\"#000\");",
407 "* init" : "this.el.set_size(50,50);",
408 "* pack" : "add_child",
409 "id" : "addpropbutton",
412 "$ xns" : "GtkClutter",
413 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
414 "* pack" : "add_child",
417 "$ tooltip_text" : "\"Add Property\"",
420 "height_request" : 50,
424 "* pack" : "set_image",
425 "utf8 icon_name" : "format-justify-left",
433 " _this.windowstate.showProps(this.el, \"props\");",
439 "width_request" : 50,
450 "* init" : "this.el.set_size(50,50);",
451 "* pack" : "add_child",
452 "id" : "addlistenerbutton",
455 "$ xns" : "GtkClutter",
456 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
457 "* pack" : "add_child",
460 "$ tooltip_text" : "\"Add Event Code\"",
463 "height_request" : 50,
467 "* pack" : "set_image",
468 "utf8 icon_name" : "appointment-new",
477 " _this.windowstate.showProps(this.el, \"signals\");",
483 "width_request" : 50,
499 " if (_this.windowstate == null) {",
502 " _this.windowstate.resizeCanvas(); ",
518 "* pack" : "pack_end,false,true,0",
519 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
520 "bool homogeneous" : false,
523 "$ tooltip_text" : "\"Project Details\"",
526 "bool always_show_image" : true,
527 "height_request" : 50,
531 "* pack" : "set_image",
532 "utf8 icon_name" : "emblem-system",
540 " _this.windowstate.projectPopoverShow(this.el, _this.project);",
546 "string label" : "Edit Project Settings",
547 "width_request" : 50,
551 "$ tooltip_text" : "\"File Details\"",
554 "bool always_show_image" : true,
555 "height_request" : 50,
559 "* pack" : "set_image",
560 "utf8 icon_name" : "document-properties",
568 " // create a new file in project..",
569 " if (_this.project == null || _this.windowstate.file == null) {",
572 " _this.windowstate.file_details.show(",
573 " _this.windowstate.file, this.el",
582 "string label" : "Edit File Properties",
583 "width_request" : 50,
589 "bool always_show_image" : true,
595 " this.el.show_all();",
599 "* pack" : "set_popup",
608 " Resources.singleton().fetchStart();",
612 "string label" : "Download updated Resources",
621 " About.singleton().el.show();",
625 "string label" : "About the Builder",
633 "* pack" : "set_image",
634 "utf8 icon_name" : "dialog-information",
638 "string label" : "About",
639 "xtype" : "MenuButton"
643 "* pack" : "pack_start,true,true,0",
644 "string label" : " ",
651 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
654 " _this.mainpane.el.set_sensitive(true);",
658 " _this.mainpane.el.set_sensitive(false);",
660 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
661 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
667 "* pack" : "pack_start,true,true,0",
668 "bool show_text" : true,
670 "ulong handler_id" : "-1",
671 "xtype" : "ProgressBar"
676 "var description = Pango.FontDescription.from_string(\"monospace\");",
677 "\tdescription.set_size(8000);",
678 "\t this.el.override_font(description);",
682 "* pack" : "pack_start,false,true,0",
683 "id" : "search_entry",
687 "\tif (this.el.text == \"\") {",
688 "\t\t_this.search_results.el.hide();",
692 "\tswitch(_this.windowstate.state) {",
693 "\t\tcase WindowState.State.CODEONLY:",
694 "\t\t///case WindowState.State.CODE:",
695 "\t\t\t// search the code being edited..",
696 "\t\t\tres = _this.windowstate.code_editor_tab.search(this.el.text);",
699 "\t\tcase WindowState.State.PREVIEW:",
700 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
701 "\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);",
703 "\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t",
709 "\t_this.search_results.el.show();",
711 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
713 "\t\t_this.search_results.el.label = \"No Matches\";",
721 "key_press_event" : [
724 " \tif (event.keyval == Gdk.Key.Return) {",
725 "\t\tthis.forwardSearch(false);",
729 " // print(event.key.keyval)",
736 "xtype" : "SearchEntry",
737 "| void forwardSearch" : [
738 "(bool change_focus) {",
739 "\tswitch(_this.windowstate.state) {",
740 "\t\tcase WindowState.State.CODEONLY:",
741 "\t\t//case WindowState.State.CODE:",
742 "\t\t\t// search the code being edited..",
743 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
746 "\t\tcase WindowState.State.PREVIEW:",
747 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
748 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
750 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
767 "Xcls_ValaCompileErrors popup" : "",
768 "bool always_show_image" : true,
769 "id" : "search_results",
773 "* pack" : "set_image",
774 "bool sensitive" : false,
775 "utf8 icon_name" : "system-search",
780 "button_press_event" : [
783 " if (this.popup == null) {",
784 " this.popup = new Xcls_ValaCompileErrors();",
785 " this.popup.window = _this;",
789 " this.popup.show(this.notices, this.el);",
795 "string label" : "Matches",
796 "xtype" : "ImageMenuItem"
801 "id" : "statusbar_compilestatus_label",
802 "string label" : "Compile Status:",
806 "# Json.Object notices" : "new Json.Object() ",
809 "Xcls_ValaCompileErrors popup" : "",
810 "bool always_show_image" : true,
811 "id" : "statusbar_errors",
815 "* pack" : "set_image",
816 "utf8 icon_name" : "dialog-error",
821 "button_press_event" : [
823 " if (this.popup == null) {",
824 " this.popup = new Xcls_ValaCompileErrors();",
825 " this.popup.window = _this;",
829 " this.popup.show(this.notices, this.el);",
834 "string label" : "Errors",
835 "xtype" : "ImageMenuItem",
836 "| void setNotices" : [
837 "(Json.Object nots, int qty) {",
839 " this.el.label = qty.to_string() + \" Errors\";",
840 " this.notices = nots;",
847 "# Json.Object notices" : "new Json.Object()",
850 "Xcls_ValaCompileErrors popup" : "",
851 "bool always_show_image" : true,
852 "id" : "statusbar_warnings",
856 "* pack" : "set_image",
857 "utf8 icon_name" : "dialog-warning",
862 "button_press_event" : [
864 " if (this.popup == null) {",
865 " this.popup = new Xcls_ValaCompileErrors();",
866 " this.popup.window = _this;",
869 " this.popup.show(this.notices, this.el);",
874 "string label" : "Warnings",
875 "xtype" : "ImageMenuItem",
876 "| void setNotices" : [
877 "(Json.Object nots, int qty) {",
879 " this.el.label = qty.to_string() + \" Warnings\";",
880 " this.notices = nots;",
887 "# Json.Object notices" : "new Json.Object()",
890 "Xcls_ValaCompileErrors popup" : "",
891 "bool always_show_image" : true,
892 "id" : "statusbar_depricated",
896 "* pack" : "set_image",
897 "utf8 icon_name" : "dialog-information",
902 "button_press_event" : [
904 " if (this.popup == null) {",
905 " this.popup = new Xcls_ValaCompileErrors();",
906 " this.popup.window = _this;",
910 " this.popup.show(this.notices, this.el);",
915 "string label" : "Depricated",
916 "xtype" : "ImageMenuItem",
917 "| void setNotices" : [
918 "(Json.Object nots, int qty) {",
920 " this.el.label = qty.to_string() + \" Depricated\";",
921 " this.notices = nots;",
930 "Xcls_ValaCompileErrors popup" : "",
931 "bool always_show_image" : true,
932 "id" : "statusbar_run",
936 "* pack" : "set_image",
937 "utf8 icon_name" : "media-playback-start",
942 "button_press_event" : [
944 "\tif (_this.windowstate.file == null) {",
947 "\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);",
949 "\t_this.windowstate.compile_results.show(this.el,true);",
955 "string label" : "Run",
956 "xtype" : "ImageMenuItem"
959 "string tooltip_text" : "Update Resources / About Roobuilder",
965 "id" : "statusbar_compile_spinner",
966 "string tooltip_text" : "Compiling",
971 " this.el.start(); ",
998 " Xcls_MainWindow.singleton().no_windows--;",
1000 " Resources.singleton().disconnect(_this.statusbar.handler_id);",
1003 " if (Xcls_MainWindow.singleton().no_windows < 1) {",
1005 " Gtk.main_quit();",
1009 "key_release_event" : [
1012 " if (this.search_entry.el.is_visible()) {",
1013 "\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1014 "\t\t print(\"SAVE: ctrl-f pressed\");",
1015 "\t\t\tthis.search_entry.el.grab_focus();",
1016 "\t\t return false;",
1019 "\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1020 "\t\t print(\"SAVE: ctrl-g pressed\");",
1021 "\t\t\tthis.search_entry.forwardSearch(true);",
1022 "\t\t return false;",
1027 "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1028 "\t\tprint(\"SAVE: ctrl-n pressed\");",
1029 "\t\tthis.openNewWindow();",
1030 "\t\treturn false;",
1033 " // print(event.key.keyval)",
1043 " // hide the file editing..",
1045 " //this.hideViewEditing();",
1046 " _this.statusbar.el.hide();",
1047 " _this.statusbar_errors.el.hide();",
1048 " _this.statusbar_warnings.el.hide();",
1049 " _this.statusbar_depricated.el.hide();",
1050 " _this.statusbar_compile_spinner.el.hide();",
1052 " Resources.singleton().checkResources();",
1058 "| void setTitle" : [
1060 " this.headerbar.el.set_title(this.title + \" - \" + str);",
1067 " this.el.show_all();",
1071 "| void initChildren" : [
1073 " // this needs putting in a better place..",
1074 " this.windowstate = new WindowState(this);",
1077 " //w.el.show_all();",
1078 " var tl = new Clutter.Timeline(6000);",
1079 " tl.set_repeat_count(-1);",
1090 "| void openNewWindow" : [
1092 "\tXcls_MainWindow.singleton().no_windows++;",
1093 " var w = new Xcls_MainWindow();",
1096 " w.el.show_all();",
1097 " w.initChildren();",
1098 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project);",
1099 " // should open the file dialog...",
1100 " //w.windowstate.switchState(WindowState.State.FILES);",
1107 "name" : "MainWindow",
1109 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",