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" : 500,
23 "default_width" : 800,
28 "* pack" : "set_titlebar",
29 "bool show_close_button" : true,
34 "* pack" : "pack_start",
35 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
40 "bool use_popover" : false,
46 " this.el.show_all();",
50 "* pack" : "set_popup",
59 " _this.openNewWindow();",
63 "string label" : "Open a new Window",
69 "xtype" : "SeparatorMenuItem"
77 " Resources.singleton().fetchStart();",
81 "string label" : "Download updated Resources",
90 " About.singleton().el.show();",
94 "string label" : "About the Builder",
102 "* pack" : "set_image",
103 "utf8 icon_name" : "help-about",
107 "xtype" : "MenuButton"
110 "$ tooltop_text" : "\"Open File\"",
117 "* pack" : "set_image",
118 "utf8 icon_name" : "document-open",
125 " _this.windowstate.switchState(WindowState.State.FILES);",
136 "bool visible" : false,
137 "id" : "openbackbtn",
141 "* pack" : "set_image",
142 "utf8 icon_name" : "go-previous",
150 " _this.windowstate.switchState(WindowState.State.PREVIEW);",
156 "utf8 tooltip_text" : "Back",
163 "string title" : "Application Builder",
164 "xtype" : "HeaderBar"
167 "$ homogeneous" : false,
170 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
174 "# int lastWidth" : 0,
176 "* pack" : "pack_start,true,true,0",
177 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
183 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
188 "* pack" : "pack_start,true,true,0",
189 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
195 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
202 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
215 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
218 "$ xns" : "GtkClutter",
220 " var stage = this.el.get_stage();",
221 " stage.set_background_color( Clutter.Color.from_string(\"#000\"));",
226 "* pack" : "pack_start,true,true,0",
227 "id" : "clutterembed",
230 "$ xns" : "GtkClutter",
235 " this.el.add_constraint(",
236 " new Clutter.AlignConstraint(",
237 " _this.clutterembed.el.get_stage(), ",
238 " Clutter.AlignAxis.X_AXIS,",
243 " //this.el.set_position(100,100);",
244 " this.el.set_pivot_point(1.0f,1.0f);",
246 " this.el.set_size(_this.clutterembed.el.get_stage().width-50,",
247 " _this.clutterembed.el.get_stage().height);",
251 "* pack" : "get_stage().add_child",
256 "$ xns" : "GtkClutter",
261 " this.el.add_constraint(",
262 " new Clutter.AlignConstraint(",
263 " _this.clutterembed.el.get_stage(), ",
264 " Clutter.AlignAxis.X_AXIS,",
269 " this.el.fixed_x = 50.0f;",
270 " this.el.fixed_y = 0.0f;",
271 " //this.el.set_position(100,100);",
272 " this.el.set_pivot_point(0.0f,0.0f);",
273 " this.el.set_scale(0.0f,1.0f);",
274 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
275 " _this.clutterembed.el.get_stage().height);",
279 "* pack" : "get_stage().add_child",
284 "$ xns" : "GtkClutter",
289 " this.el.add_constraint(",
290 " new Clutter.AlignConstraint(",
291 " _this.clutterembed.el.get_stage(), ",
292 " Clutter.AlignAxis.X_AXIS,",
297 " this.el.fixed_x = 50.0f;",
298 " this.el.fixed_y = 0.0f;",
299 " //this.el.set_position(100,100);",
300 " this.el.set_pivot_point(0.0f,0.0f);",
301 " this.el.set_scale(0.0f,1.0f);",
302 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
303 " _this.clutterembed.el.get_stage().height);",
307 "* pack" : "get_stage().add_child",
308 "id" : "codeeditview",
312 "$ xns" : "GtkClutter",
317 " this.el.add_constraint(",
318 " new Clutter.AlignConstraint(",
319 " _this.clutterembed.el.get_stage(), ",
320 " Clutter.AlignAxis.X_AXIS,",
325 " this.el.fixed_x = 50.0f;",
326 " this.el.fixed_y = 0.0f;",
327 " //this.el.set_position(100,100);",
328 " this.el.set_pivot_point(0.0f,0.0f);",
329 " this.el.set_scale(0.0f,1.0f);",
330 " this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,",
331 " _this.clutterembed.el.get_stage().height);",
335 "* pack" : "get_stage().add_child",
336 "id" : "addpropsview",
344 " this.el.add_constraint(",
345 " new Clutter.AlignConstraint(",
346 " _this.clutterembed.el.get_stage(), ",
347 " Clutter.AlignAxis.X_AXIS,",
353 " //this.el.set_position(100,100);",
354 " this.el.set_pivot_point(0.5f,0.5f);",
355 " this.el.set_size(50,",
356 " _this.clutterembed.el.get_stage().height);",
360 "* pack" : "get_stage().add_child",
361 "id" : "buttonlayout",
364 "$ orientation" : "Clutter.Orientation.VERTICAL",
366 "* prop" : "layout_manager",
367 "xtype" : "BoxLayout"
371 "* init" : "this.el.set_size(50,50);",
372 "* pack" : "add_child",
376 "$ xns" : "GtkClutter",
377 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
378 "* pack" : "add_child",
383 "height_request" : 50,
387 "* pack" : "set_image",
388 "utf8 icon_name" : "go-previous",
395 " // if (_this.windowstate.state == WindowState.State.FILEPROJECT) {",
397 "//\t _this.windowstate.switchState(WindowState.State.FILES);",
399 "\t _this.windowstate.switchState(WindowState.State.PREVIEW);",
406 "utf8 tooltip_text" : "Back",
407 "width_request" : 50,
418 "* init" : "this.el.set_size(50.0f,50.0f);",
419 "* pack" : "add_child",
420 "id" : "editfilebutton",
423 "$ xns" : "GtkClutter",
424 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
425 "* pack" : "add_child",
428 "$ tooltip_text" : "\"File Details\"",
431 "height_request" : 50,
435 "* pack" : "set_image",
436 "utf8 icon_name" : "document-properties",
444 " // create a new file in project..",
445 " if (_this.project == null || _this.windowstate.file == null) {",
448 " _this.windowstate.file_details.show(",
449 " _this.windowstate.file, this.el",
458 "width_request" : 50,
469 "* init" : "this.el.set_size(50,50);",
470 "* pack" : "add_child",
471 "id" : "projecteditbutton",
474 "$ xns" : "GtkClutter",
475 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
476 "* pack" : "add_child",
479 "$ tooltip_text" : "\"Project Details\"",
482 "height_request" : 50,
486 "* pack" : "set_image",
487 "utf8 icon_name" : "emblem-system",
495 " _this.windowstate.projectPopoverShow(this.el);",
501 "width_request" : 50,
512 "* init" : "this.el.set_size(50,50);",
513 "* pack" : "add_child",
514 "id" : "objectshowbutton",
517 "$ xns" : "GtkClutter",
518 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
519 "* pack" : "add_child",
522 "$ tooltip_text" : "\"Add Child Element\"",
525 "height_request" : 50,
529 "* pack" : "set_image",
530 "utf8 icon_name" : "list-add",
539 " \t_this.windowstate.showAddObject(this.el);",
544 "width_request" : 50,
554 " this.el.background_color = Clutter.Color.from_string(\"#333\");",
560 " this.el.background_color = Clutter.Color.from_string(\"#000\");",
569 "* init" : "this.el.set_size(50,50);",
570 "* pack" : "add_child",
571 "id" : "addpropbutton",
574 "$ xns" : "GtkClutter",
575 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
576 "* pack" : "add_child",
579 "$ tooltip_text" : "\"Add Property\"",
582 "height_request" : 50,
586 "* pack" : "set_image",
587 "utf8 icon_name" : "format-justify-left",
595 " _this.windowstate.showProps(this.el, \"props\");",
601 "width_request" : 50,
612 "* init" : "this.el.set_size(50,50);",
613 "* pack" : "add_child",
614 "id" : "addlistenerbutton",
617 "$ xns" : "GtkClutter",
618 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
619 "* pack" : "add_child",
622 "$ tooltip_text" : "\"Add Event Code\"",
625 "height_request" : 50,
629 "* pack" : "set_image",
630 "utf8 icon_name" : "appointment-new",
639 " _this.windowstate.showProps(this.el, \"signals\");",
645 "width_request" : 50,
656 "* init" : "this.el.set_size(50.0f,50.0f);",
657 "* pack" : "add_child",
658 "id" : "addprojectbutton",
661 "$ xns" : "GtkClutter",
662 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
663 "* pack" : "add_child",
666 "$ tooltip_text" : "\"New\\nProj.\"",
669 "height_request" : 50,
673 "* pack" : "set_image",
674 "utf8 icon_name" : "folder-new",
682 " // create a new file in project..",
683 " //Xcls_DialogNewComponent.singleton().show(",
684 " var pe = EditProject.singleton();",
685 " pe.el.set_transient_for(_this.el);",
686 " pe.el.set_modal(true); ",
688 " var p = pe.show();",
695 " _this.windowstate.left_projects.is_loaded = false; ",
696 " _this.windowstate.left_projects.load();",
697 " _this.windowstate.left_projects.selectProject(p);",
704 "width_request" : 50,
715 "* init" : "this.el.set_size(50.0f,50.0f);",
716 "* pack" : "add_child",
717 "id" : "addfilebutton",
720 "$ xns" : "GtkClutter",
721 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
722 "* pack" : "add_child",
725 "$ tooltip_text" : "\"Add File\"",
728 "height_request" : 50,
732 "* pack" : "set_image",
733 "utf8 icon_name" : "document-new",
740 " // create a new file in project..",
741 " print(\"add file selected\\n\");",
742 " // what's the currently selected project...",
743 " var proj = _this.windowstate.left_projects.getSelectedProject();",
745 " if (proj == null) {",
746 "\t\tprint(\"no project selected?\\n\");",
750 " print(\"creating file?\");",
752 " var f = JsRender.JsRender.factory(proj.xtype, proj, \"\");",
753 " _this.project = proj;",
754 " print(\"showing popup?\");",
755 " _this.windowstate.file_details.show(",
764 "width_request" : 50,
775 "* init" : "this.el.set_size(50,50);",
776 "* pack" : "add_child",
777 "id" : "delprojectbutton",
780 "$ xns" : "GtkClutter",
781 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
782 "* pack" : "add_child",
785 "$ tooltip_text" : "\"Delete Project\"",
788 "height_request" : 50,
792 "* pack" : "set_image",
793 "utf8 icon_name" : "user-trash",
801 " var cd = DialogConfirm.singleton();",
802 " cd.el.set_transient_for(_this.el);",
803 " cd.el.set_modal(true);",
805 " var project = _this.windowstate.left_projects.getSelectedProject();",
806 " if (project == null) {",
807 " print(\"SKIP - no project\\n\");",
812 " if (Gtk.ResponseType.YES != cd.show(\"Confirm\", ",
813 " \"Are you sure you want to delete project %s\".printf(project.name))) {",
819 " Project.Project.remove(project);",
820 " _this.project = null;",
822 " _this.windowstate.left_projects.is_loaded = false;",
823 " _this.windowstate.left_projects.load();",
824 " _this.windowstate.clutterfiles.clearFiles();",
829 "width_request" : 50,
845 " if (_this.windowstate == null) {",
848 " _this.windowstate.resizeCanvas(); ",
864 "* pack" : "pack_end,false,true,0",
865 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
866 "bool homogeneous" : false,
870 "* pack" : "pack_start,true,true,0",
871 "string label" : " ",
878 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
881 " _this.mainpane.el.set_sensitive(true);",
885 " _this.mainpane.el.set_sensitive(false);",
887 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
888 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
894 "* pack" : "pack_start,true,true,0",
895 "bool show_text" : true,
897 "ulong handler_id" : "-1",
898 "xtype" : "ProgressBar"
903 "var description = Pango.FontDescription.from_string(\"monospace\");",
904 "\tdescription.set_size(8000);",
905 "\t this.el.override_font(description);",
909 "* pack" : "pack_start,false,true,0",
910 "id" : "search_entry",
914 "\tif (this.el.text == \"\") {",
915 "\t\t_this.search_results.el.hide();",
919 "\tswitch(_this.windowstate.state) {",
920 "\t\tcase WindowState.State.CODEONLY:",
921 "\t\t///case WindowState.State.CODE:",
922 "\t\t\t// search the code being edited..",
923 "\t\t\tres = _this.windowstate.code_editor_tab.search(this.el.text);",
926 "\t\tcase WindowState.State.PREVIEW:",
927 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
928 "\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);",
930 "\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t",
936 "\t_this.search_results.el.show();",
938 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
940 "\t\t_this.search_results.el.label = \"No Matches\";",
948 "key_press_event" : [
951 " \tif (event.keyval == Gdk.Key.Return) {",
952 "\t\tthis.forwardSearch(false);",
956 " // print(event.key.keyval)",
963 "xtype" : "SearchEntry",
964 "| void forwardSearch" : [
965 "(bool change_focus) {",
966 "\tswitch(_this.windowstate.state) {",
967 "\t\tcase WindowState.State.CODEONLY:",
968 "\t\t//case WindowState.State.CODE:",
969 "\t\t\t// search the code being edited..",
970 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
973 "\t\tcase WindowState.State.PREVIEW:",
974 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
975 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
977 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
994 "Xcls_ValaCompileErrors popup" : "",
995 "bool always_show_image" : true,
996 "id" : "search_results",
1000 "* pack" : "set_image",
1001 "bool sensitive" : false,
1002 "utf8 icon_name" : "system-search",
1007 "button_press_event" : [
1010 " if (this.popup == null) {",
1011 " this.popup = new Xcls_ValaCompileErrors();",
1012 " this.popup.window = _this;",
1016 " this.popup.show(this.notices, this.el);",
1022 "string label" : "Matches",
1023 "xtype" : "ImageMenuItem"
1028 "id" : "statusbar_compilestatus_label",
1029 "string label" : "Compile Status:",
1030 "xtype" : "MenuItem"
1033 "# Json.Object notices" : "new Json.Object() ",
1036 "Xcls_ValaCompileErrors popup" : "",
1037 "bool always_show_image" : true,
1038 "id" : "statusbar_errors",
1042 "* pack" : "set_image",
1043 "utf8 icon_name" : "dialog-error",
1048 "button_press_event" : [
1050 " if (this.popup == null) {",
1051 " this.popup = new Xcls_ValaCompileErrors();",
1052 " this.popup.window = _this;",
1056 " this.popup.show(this.notices, this.el);",
1061 "string label" : "Errors",
1062 "xtype" : "ImageMenuItem",
1063 "| void setNotices" : [
1064 "(Json.Object nots, int qty) {",
1066 " this.el.label = qty.to_string() + \" Errors\";",
1067 " this.notices = nots;",
1074 "# Json.Object notices" : "new Json.Object()",
1077 "Xcls_ValaCompileErrors popup" : "",
1078 "bool always_show_image" : true,
1079 "id" : "statusbar_warnings",
1083 "* pack" : "set_image",
1084 "utf8 icon_name" : "dialog-warning",
1089 "button_press_event" : [
1091 " if (this.popup == null) {",
1092 " this.popup = new Xcls_ValaCompileErrors();",
1093 " this.popup.window = _this;",
1096 " this.popup.show(this.notices, this.el);",
1101 "string label" : "Warnings",
1102 "xtype" : "ImageMenuItem",
1103 "| void setNotices" : [
1104 "(Json.Object nots, int qty) {",
1106 " this.el.label = qty.to_string() + \" Warnings\";",
1107 " this.notices = nots;",
1114 "# Json.Object notices" : "new Json.Object()",
1117 "Xcls_ValaCompileErrors popup" : "",
1118 "bool always_show_image" : true,
1119 "id" : "statusbar_depricated",
1123 "* pack" : "set_image",
1124 "utf8 icon_name" : "dialog-information",
1129 "button_press_event" : [
1131 " if (this.popup == null) {",
1132 " this.popup = new Xcls_ValaCompileErrors();",
1133 " this.popup.window = _this;",
1137 " this.popup.show(this.notices, this.el);",
1142 "string label" : "Depricated",
1143 "xtype" : "ImageMenuItem",
1144 "| void setNotices" : [
1145 "(Json.Object nots, int qty) {",
1147 " this.el.label = qty.to_string() + \" Depricated\";",
1148 " this.notices = nots;",
1157 "Xcls_ValaCompileErrors popup" : "",
1158 "bool always_show_image" : true,
1159 "id" : "statusbar_run",
1163 "* pack" : "set_image",
1164 "utf8 icon_name" : "media-playback-start",
1169 "button_press_event" : [
1171 "\tif (_this.windowstate.file == null) {",
1174 "\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);",
1176 "\t_this.windowstate.compile_results.show(this.el,true);",
1182 "string label" : "Run",
1183 "xtype" : "ImageMenuItem"
1191 "id" : "statusbar_compile_spinner",
1192 "string tooltip_text" : "Compiling",
1193 "xtype" : "Spinner",
1197 " this.el.start(); ",
1224 " Xcls_MainWindow.singleton().no_windows--;",
1226 " Resources.singleton().disconnect(_this.statusbar.handler_id);",
1229 " if (Xcls_MainWindow.singleton().no_windows < 1) {",
1231 " Gtk.main_quit();",
1235 "key_release_event" : [
1238 " if (this.search_entry.el.is_visible()) {",
1239 "\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1240 "\t\t print(\"SAVE: ctrl-f pressed\");",
1241 "\t\t\tthis.search_entry.el.grab_focus();",
1242 "\t\t return false;",
1245 "\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1246 "\t\t print(\"SAVE: ctrl-g pressed\");",
1247 "\t\t\tthis.search_entry.forwardSearch(true);",
1248 "\t\t return false;",
1253 "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
1254 "\t\tprint(\"SAVE: ctrl-n pressed\");",
1255 "\t\tthis.openNewWindow();",
1256 "\t\treturn false;",
1259 " // print(event.key.keyval)",
1269 " // hide the file editing..",
1271 " //this.hideViewEditing();",
1272 " _this.statusbar.el.hide();",
1273 " _this.statusbar_errors.el.hide();",
1274 " _this.statusbar_warnings.el.hide();",
1275 " _this.statusbar_depricated.el.hide();",
1276 " _this.statusbar_compile_spinner.el.hide();",
1278 " Resources.singleton().checkResources();",
1284 "| void setTitle" : [
1286 " this.headerbar.el.set_title(this.title + \" - \" + str);",
1293 " this.el.show_all();",
1297 "| void initChildren" : [
1299 " // this needs putting in a better place..",
1300 " this.windowstate = new WindowState(this);",
1303 " //w.el.show_all();",
1304 " var tl = new Clutter.Timeline(6000);",
1305 " tl.set_repeat_count(-1);",
1316 "| void openNewWindow" : [
1318 "\tXcls_MainWindow.singleton().no_windows++;",
1319 " var w = new Xcls_MainWindow();",
1322 " w.el.show_all();",
1323 " w.initChildren();",
1324 " w.windowstate.switchState(WindowState.State.FILES);",
1331 "name" : "MainWindow",
1333 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",