{
"build_module" : "builder",
+ "gen_extended" : false,
"items" : [
{
"# Project.Project project" : "null",
"# WindowState windowstate" : "",
- "# string title" : "\"Roo Application Builder\"",
+ "# bool winloading" : false,
"$ type" : "Gtk.WindowType.TOPLEVEL",
"$ xns" : "Gtk",
+ "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
"* init" : [
- " ",
- " ",
- " this.el.set_icon_name(\"roobuilder\");",
- " "
+ "",
+ "this.el.set_icon_name(\"roobuilder\");",
+ ""
],
"border_width" : 0,
"default_height" : 850,
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
"items" : [
{
- "# Gee.ArrayList<Gtk.MenuItem> mitems" : "",
- "$ Gtk.Align halign" : "Gtk.Align.START",
- "$ Gtk.ArrowType direction" : "Gtk.ArrowType.DOWN",
"$ xns" : "Gtk",
- "* init" : [
- "{",
- "\tthis.mitems = new Gee.ArrayList<Gtk.MenuItem>();",
- "\t",
- "}",
- ""
- ],
- "bool always_show_image" : true,
- "bool use_popover" : false,
- "id" : "windowbtn",
- "int margin_end" : 4,
+ "* pack" : "append",
+ "bool has_frame" : false,
+ "bool has_tooltip" : true,
"items" : [
{
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "window-new",
- "xtype" : "Image"
- },
- {
- "$ xns" : "Gtk",
- "* init" : [
- "{",
- " this.el.show_all();",
- "}",
- ""
- ],
- "* prop" : "popup",
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "append",
- "listeners" : {
- "activate" : [
- "( ) => {",
- "",
- "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
- "}",
- ""
- ]
- },
- "string label" : "New Window",
- "xtype" : "MenuItem"
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "append",
- "xtype" : "SeparatorMenuItem"
- }
- ],
- "xtype" : "Menu"
+ "$ xns" : "Adw",
+ "* prop" : "child",
+ "string icon_name" : "preferences-system-windows",
+ "string label" : " Files",
+ "xtype" : "ButtonContent"
}
],
- "string label" : "Windows",
- "xtype" : "MenuButton",
- "| void updateMenu" : [
- "() {",
- "\t foreach(var m in this.mitems) {",
- "\t \t this.el.popup.remove(m);",
- "\t }",
- "\t this.mitems.clear();",
- "\t ",
- "\t foreach(var w in BuilderApplication.windows) {",
- "\t \tvar wid = BuilderApplication.windows.index_of(w);",
- "\t \t// fixme find a better way to display this.",
- " \t\tif (w.windowstate == null ||",
- " \t\t\t w.windowstate.file == null || ",
- " \t\t\t _this.windowstate == null ||",
- " \t\t\t _this.windowstate.file == null",
- " \t\t\t ) { ",
- " \t\t\tcontinue;",
- "\t\t}",
- "\t \t",
- "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
- "\t \t\tcontinue;",
- " \t\t}",
- "",
- " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
- "\t \tvar m = new Gtk.MenuItem.with_label(w.windowstate.file.path);",
- "\t \tm.activate.connect(() => {",
- "\t \t\t BuilderApplication.windows.get(wid).el.present();",
- "\t \t});",
- "\t \tthis.el.popup.append(m);",
- "\t \tm.show();",
- "\t \tthis.mitems.add(m);",
- "\t }",
- "}"
- ]
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;",
+ " \tif (_this.splitview.el.show_sidebar) {",
+ " \t\t_this.sidebar.show(); ",
+ " \t}",
+ "}"
+ ]
+ },
+ "string tooltip_text" : "Manage Windows (Ctrl-O)",
+ "xtype" : "Button"
},
{
- "$ tooltop_text" : "\"Open File\"",
"$ xns" : "Gtk",
- "* pack" : "add",
- "bool always_show_image" : true,
- "id" : "open_projects_btn",
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "system-file-manager",
- "xtype" : "Image"
- }
- ],
+ "bool has_frame" : false,
"listeners" : {
"clicked" : [
- " ( ) => {",
- " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
+ "( ) => {",
+ "\t",
+ "\tGLib.debug(\"undo clicked\");",
+ "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
+ "\t\t_this.windowstate.code_editor_tab.buffer.el.undo();",
+ "\t}",
+ "\tif (!_this.windowstate.file.undoStep(-1)) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t ",
+ "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
+ "\t// this triggers loadItems..",
+ "\t_this.windowstate.left_tree.model.loadFile(",
+ "\t\t_this.windowstate.file);",
+ "\t ",
"",
- "}"
+ "\t",
+ " ",
+ "",
+ "\t// load it everywhere",
+ "}",
+ ""
+ ]
+ },
+ "string icon_name" : "edit-undo",
+ "xtype" : "Button"
+ },
+ {
+ "$ xns" : "Gtk",
+ "bool has_frame" : false,
+ "listeners" : {
+ "clicked" : [
+ "( ) => {",
+ "\t",
+ "\tGLib.debug(\"undo clicked\");",
+ "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
+ "\t\t_this.windowstate.code_editor_tab.buffer.el.redo();",
+ "\t}",
+ "\tif (!_this.windowstate.file.undoStep(1)) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t ",
+ "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
+ "\t// this triggers loadItems..",
+ "\t_this.windowstate.left_tree.model.loadFile(",
+ "\t\t_this.windowstate.file);",
+ "\t ",
+ "",
+ "\t",
+ " ",
+ "",
+ "\t// load it everywhere",
+ "}",
+ ""
]
},
- "string label" : "Files / Projects",
+ "string icon_name" : "edit-redo",
"xtype" : "Button"
}
],
"xtype" : "Box"
}
],
- "string title" : "Application Builder",
"xtype" : "HeaderBar"
},
{
- "$ homogeneous" : false,
- "$ xns" : "Gtk",
- "* pack" : "add",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "id" : "vbox",
+ "$ xns" : "Adw",
+ "* prop" : "child",
+ "bool collapsed" : true,
+ "bool show_sidebar" : false,
+ "double sidebar_width_fraction" : 0.40000000000000002,
+ "id" : "splitview",
"items" : [
{
- "# int lastWidth" : 0,
"$ xns" : "Gtk",
- "* pack" : "pack_start,true,true,0",
- "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "id" : "mainpane",
+ "* prop" : "content",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool hexpand" : true,
+ "bool homogeneous" : false,
+ "bool vexpand" : false,
+ "id" : "vbox",
+ "int spacing" : 0,
"items" : [
{
+ "# int lastWidth" : 0,
"$ xns" : "Gtk",
- "* pack" : "add",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "id" : "leftpane",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "mainpane",
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "pack_start,true,true,0",
+ "* prop" : "start_child",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "id" : "editpane",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "leftpane",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "id" : "editpane",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "start_child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "tree",
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "end_child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "props",
+ "xtype" : "Box"
+ }
+ ],
+ "listeners" : {
+ "accept_position" : [
+ "( ) => {",
+ "\t_this.windowstate.left_tree.onresize();",
+ "\treturn true;",
+ "}",
+ ""
+ ],
+ "move_handle" : [
+ "(scroll) => {",
+ "\tGLib.debug(\"Move handle\");",
+ "\treturn true;",
+ "}"
+ ]
+ },
+ "xtype" : "Paned"
+ }
+ ],
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "end_child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "add1",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "id" : "tree",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "rooviewbox",
"xtype" : "Box"
},
{
"$ xns" : "Gtk",
- "* pack" : "add2",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "id" : "props",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "codeeditviewbox",
"xtype" : "Box"
}
],
- "listeners" : {
- "accept_position" : [
- "() => {",
- "\tGLib.debug(\"Accept postion\");",
- "\treturn true;",
- "}"
- ],
- "move_handle" : [
- "(scroll) => {",
- "\tGLib.debug(\"Move handle\");",
- "\treturn true;",
- "}"
- ]
- },
- "xtype" : "Paned"
+ "xtype" : "Box"
}
],
- "xtype" : "Box"
+ "listeners" : {
+ "accept_position" : [
+ "( ) => {",
+ "\t_this.windowstate.left_tree.onresize();",
+ "\treturn true;",
+ "}",
+ ""
+ ]
+ },
+ "position" : 400,
+ "xtype" : "Paned"
},
{
"$ xns" : "Gtk",
- "* pack" : "add2",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "bool homogeneous" : false,
+ "bool vexpand" : false,
"items" : [
{
+ "$ tooltip_text" : "\"Project Details\"",
"$ xns" : "Gtk",
- "* pack" : "add",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "bool vexpand" : true,
- "id" : "rooviewbox",
- "xtype" : "Box"
+ "bool always_show_image" : true,
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " ",
+ " _this.windowstate.projectPopoverShow(_this.el, null, null);",
+ " ",
+ " ",
+ "}"
+ ]
+ },
+ "string icon_name" : "emblem-system",
+ "string label" : "Edit Project Settings",
+ "xtype" : "Button"
},
{
+ "$ tooltip_text" : "\"File Details\"",
"$ xns" : "Gtk",
- "* pack" : "add",
- "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
- "bool vexpand" : true,
- "id" : "codeeditviewbox",
- "xtype" : "Box"
- }
- ],
- "xtype" : "Box"
- }
- ],
- "position" : 400,
- "xtype" : "Paned"
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "pack_end,false,true,0",
- "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "bool homogeneous" : false,
- "items" : [
- {
- "$ tooltip_text" : "\"Project Details\"",
- "$ xns" : "Gtk",
- "* pack" : "add",
- "bool always_show_image" : true,
- "items" : [
+ "bool always_show_image" : true,
+ "listeners" : {
+ "clicked" : [
+ " ( ) => {",
+ " ",
+ " // create a new file in project..",
+ " if (_this.project == null || _this.windowstate.file == null) {",
+ " return ;",
+ " }",
+ " _this.windowstate.file_details.show(",
+ " _this.windowstate.file, _this.el, false",
+ " );",
+ " ",
+ " return ; ",
+ "",
+ "",
+ "}"
+ ]
+ },
+ "string icon_name" : "document-properties",
+ "string label" : "Edit File Properties",
+ "xtype" : "Button"
+ },
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "emblem-system",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " ",
- " _this.windowstate.projectPopoverShow(this.el, _this.project);",
- " ",
- " ",
- "}"
- ]
- },
- "string label" : "Edit Project Settings",
- "xtype" : "Button"
- },
- {
- "$ tooltip_text" : "\"File Details\"",
- "$ xns" : "Gtk",
- "* pack" : "add",
- "bool always_show_image" : true,
- "items" : [
+ "bool always_show_image" : true,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
+ "* init" : [
+ "{",
+ " // this.el.show();",
+ "}",
+ ""
+ ],
+ "* prop" : "popover",
+ "id" : "topbarmenu",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "set_child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "int spacing" : 0,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "listeners" : {
+ "activate" : [
+ " ( ) => {",
+ " Resources.singleton().fetchStart();",
+ "}"
+ ]
+ },
+ "string label" : "Download updated Resources",
+ "xtype" : "Button"
+ },
+ {
+ "$ xns" : "Gtk",
+ "listeners" : {
+ "clicked" : [
+ "() => {",
+ " About.singleton().el.show();",
+ " }"
+ ]
+ },
+ "string label" : "About the Builder",
+ "xtype" : "Button"
+ }
+ ],
+ "xtype" : "Box"
+ }
+ ],
+ "xtype" : "PopoverMenu"
+ }
+ ],
+ "string icon_name" : "dialog-information",
+ "string label" : "About",
+ "xtype" : "MenuButton"
+ },
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "document-properties",
- "xtype" : "Image"
- }
- ],
- "listeners" : {
- "clicked" : [
- " ( ) => {",
- " ",
- " // create a new file in project..",
- " if (_this.project == null || _this.windowstate.file == null) {",
- " return ;",
- " }",
- " _this.windowstate.file_details.show(",
- " _this.windowstate.file, this.el, false",
- " );",
- " ",
- " return ; ",
- "",
- "",
- "}"
- ]
- },
- "string label" : "Edit File Properties",
- "xtype" : "Button"
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "add",
- "bool always_show_image" : true,
- "items" : [
+ "bool hexpand" : true,
+ "string label" : " ",
+ "xtype" : "Label"
+ },
{
"$ xns" : "Gtk",
"* init" : [
"{",
- " this.el.show_all();",
+ " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
+ " if (pos < 1) {",
+ " this.el.hide();",
+ " _this.mainpane.el.set_sensitive(true);",
+ " ",
+ " return;",
+ " }",
+ " _this.mainpane.el.set_sensitive(false);",
+ " this.el.show();",
+ " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
+ " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
+ " ",
+ " });",
"}",
""
],
- "* pack" : "set_popup",
- "id" : "topbarmenu",
+ "bool show_text" : true,
+ "id" : "statusbar",
+ "ulong handler_id" : "-1",
+ "xtype" : "ProgressBar"
+ },
+ {
+ "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "$ xns" : "Gtk",
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "append",
+ "id" : "statusbar_compilestatus_label",
+ "int margin_end" : 4,
+ "int margin_start" : 4,
+ "string label" : "Compile Status:",
+ "xtype" : "Label"
+ },
+ {
+ "$ xns" : "Gtk",
+ "Xcls_ValaCompileErrors popup" : "",
+ "id" : "statusbar_errors",
+ "listeners" : {
+ "clicked" : [
+ "() => {",
+ " ",
+ "\tif (this.popup == null) {",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
+ " ",
+ "}"
+ ]
+ },
+ "string icon_name" : "dialog-error",
+ "string label" : "0 Errors",
+ "xtype" : "Button",
+ "| void setNotices" : [
+ "(GLib.ListStore nots, int ferrors ) {",
+ " BuilderApplication.showSpinner(\"\");",
+ " if (nots.get_n_items() < 1 ) {",
+ " \tthis.el.hide();",
+ " \tif (this.popup != null) {",
+ " \t\tthis.popup.el.hide();",
+ "\t\t}",
+ " \treturn;",
+ " }",
+ " ",
+ " this.el.show();",
+ " this.el.label = \"%d/%d Errors\".printf(ferrors,(int)nots.get_n_items());",
+ "",
+ " ",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
+ " }",
+ " ",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
+ "}",
+ ""
+ ]
+ },
+ {
+ "$ xns" : "Gtk",
+ "Xcls_ValaCompileErrors popup" : "",
+ "id" : "statusbar_warnings",
+ "listeners" : {
+ "clicked" : [
+ "() => {",
+ " ",
+ "\tif (this.popup == null) {",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
+ " return;",
+ "}"
+ ]
+ },
+ "string icon_name" : "dialog-warning",
+ "string label" : "0 Warnings",
+ "xtype" : "Button",
+ "| void setNotices" : [
+ "(GLib.ListStore nots, int ferrs ) {",
+ " ",
+ " if (nots.get_n_items() < 1 ) {",
+ " \tthis.el.hide();",
+ " \tif (this.popup != null) {",
+ " \t\tthis.popup.el.hide();",
+ "\t\t}",
+ " \treturn;",
+ " }",
+ " ",
+ " this.el.show();",
+ " this.el.label = \"%d/%d Warnings\".printf(ferrs,(int)nots.get_n_items());",
+ "",
+ " ",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
+ " }",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
+ "}",
+ ""
+ ]
+ },
+ {
+ "# GLib.ListStore notices" : "null",
+ "$ xns" : "Gtk",
+ "Xcls_ValaCompileErrors popup" : "",
+ "id" : "statusbar_depricated",
"listeners" : {
- "activate" : [
- " ( ) => {",
- " Resources.singleton().fetchStart();",
+ "clicked" : [
+ "() => {",
+ " ",
+ "\tif (this.popup == null) {",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
+ " ",
"}"
]
},
- "string label" : "Download updated Resources",
- "xtype" : "MenuItem"
+ "string icon_name" : "dialog-information",
+ "string label" : "0 Depricated",
+ "xtype" : "Button",
+ "| void setNotices" : [
+ "",
+ "(GLib.ListStore nots, int ferrs ) {",
+ " ",
+ " if (nots.get_n_items() < 1 ) {",
+ " \tthis.el.hide();",
+ " \tif (this.popup != null) {",
+ " \t\tthis.popup.el.hide();",
+ "\t\t}",
+ " \treturn;",
+ " }",
+ " ",
+ " this.el.show();",
+ " this.el.label = \"%d/%d Depricated\".printf(ferrs,(int)nots.get_n_items());",
+ "",
+ " ",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
+ " }",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
+ "}",
+ ""
+ ]
},
{
"$ xns" : "Gtk",
- "* pack" : "append",
+ "Palete.ValaCompileRequest? last_request" : "null",
+ "Xcls_ValaCompileErrors popup" : "",
+ "bool visible" : false,
+ "id" : "statusbar_run",
"listeners" : {
- "activate" : [
+ "clicked" : [
"() => {",
- " About.singleton().el.show();",
- " }"
+ " ",
+ " if (_this.windowstate.file == null) {",
+ "\t\treturn;",
+ "\t}",
+ " if (_this.statusbar_compile_spinner.el.spinning) {",
+ " \t_this.windowstate.compile_results.el.set_parent(this.el);",
+ "\t _this.windowstate.compile_results.el.show(); // show currently running.",
+ " \treturn;",
+ "\t}",
+ "\t",
+ "\tif (this.last_request != null) {",
+ "\t\tthis.last_request.cancel();",
+ "\t\tif (this.last_request.terminal_pid > 0) {",
+ "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
+ "\t\t}",
+ "\t}",
+ "\tvar pr = _this.windowstate.project as Project.Gtk;",
+ "\tif (pr == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t",
+ "\tthis.last_request= new Palete.ValaCompileRequest(",
+ "\t\tpr,",
+ "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
+ "\t);",
+ "\tthis.last_request.onOutput.connect( ( str) => {",
+ "\t\t_this.windowstate.compile_results.addLine(str);",
+ "\t});",
+ "\tthis.last_request.run.begin( ( a, r) => {",
+ "\t\tthis.last_request.run.end(r);",
+ "\t});",
+ "\t if (_this.windowstate.compile_results.el.parent == null) {",
+ "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
+ "\t}",
+ "\t_this.windowstate.compile_results.show(this.el,true);",
+ "\t ",
+ "}"
]
},
- "string label" : "About the Builder",
- "xtype" : "MenuItem"
+ "string icon_name" : "media-playback-start",
+ "string label" : "Run",
+ "xtype" : "Button"
}
],
- "xtype" : "Menu"
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "statusbar_compile_spinner",
+ "int margin_end" : 4,
+ "int margin_start" : 4,
+ "string tooltip_text" : "Compiling",
+ "xtype" : "Spinner",
+ "| void start" : [
+ "(string icon, string tooltip) {",
+ "",
+ "\tif (icon == \"spinner\") {",
+ "\t this.el.show();",
+ "\t this.el.start(); ",
+ "\t this.el.tooltip_text = tooltip;",
+ "\t _this.statusbar_compile_icon.el.hide();",
+ " } else {",
+ "\t this.el.hide();",
+ "\t// GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
+ "\t _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
+ "\t _this.statusbar_compile_icon.el.icon_name = icon;",
+ "\t _this.statusbar_compile_icon.el.show();\t ",
+ " }",
+ " ",
+ "\t ",
+ "}",
+ ""
+ ],
+ "| void stop" : [
+ "() {",
+ " this.el.stop();",
+ " this.el.hide();",
+ " _this.statusbar_compile_icon.el.hide(); ",
+ "}",
+ ""
+ ]
},
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "dialog-information",
+ "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
+ "id" : "statusbar_compile_icon",
+ "int margin_end" : 4,
+ "int margin_start" : 4,
"xtype" : "Image"
}
],
- "string label" : "About",
- "xtype" : "MenuButton"
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "pack_start,true,true,0",
- "string label" : " ",
- "xtype" : "Label"
- },
- {
- "$ xns" : "Gtk",
- "* init" : [
- "{",
- " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
- " if (pos < 1) {",
- " this.el.hide();",
- " _this.mainpane.el.set_sensitive(true);",
- " ",
- " return;",
- " }",
- " _this.mainpane.el.set_sensitive(false);",
- " this.el.show();",
- " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
- " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
- " ",
- " });",
- "}",
- ""
- ],
- "* pack" : "pack_start,true,true,0",
- "bool show_text" : true,
- "id" : "statusbar",
- "ulong handler_id" : "-1",
- "xtype" : "ProgressBar"
- },
+ "xtype" : "Box"
+ }
+ ],
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "sidebar",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "id" : "sidebar",
+ "int spacing" : 0,
+ "items" : [
{
"$ xns" : "Gtk",
- "* init" : [
- "var description = Pango.FontDescription.from_string(\"monospace\");",
- "\tdescription.set_size(8000);",
- "\t this.el.override_font(description);",
- "",
- ""
+ "bool has_tooltip" : true,
+ "bool hexpand" : true,
+ "id" : "filesearch",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "listeners" : {
+ "key_released" : [
+ "(keyval, keycode, state) => {",
+ "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
+ "\t\treturn;",
+ "\t}",
+ "\t//GLib.debug(",
+ "\t//\t\"searcj key release %d, %d, %d ?= %d\" , ",
+ "\t//\t\t(int) keyval, (int) keycode, state,",
+ "\t//\t\t(int)Gdk.Key.Return",
+ "\t//\t);",
+ "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
+ "\t\treturn;",
+ "\t}",
+ "\t\t",
+ "\tvar dir = 0;",
+ "\t",
+ "\tif (keyval == Gdk.Key.Return) {",
+ "\t\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
+ "\t\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
+ "\t\tvar f = (JsRender.JsRender) tr.item;",
+ "\t\tGLib.debug(\"Click %s\", f.name);",
+ "\t\tif (f.xtype == \"Dir\") {",
+ "\t\t\treturn;",
+ "\t\t}",
+ "\t\t",
+ "\t\t",
+ "\t \t_this.windowstate.fileViewOpen(f,",
+ "\t \t\t_this.keystate.is_shift != 1 ",
+ "\t\t);",
+ "\t\t",
+ "\t\t_this.splitview.el.show_sidebar = false;",
+ "\t\treturn;",
+ "\t\t",
+ "\t",
+ "\t}",
+ "\tif (keyval == Gdk.Key.Up) {",
+ "\t\tdir = -1;",
+ "\t}if (keyval == Gdk.Key.Down) {",
+ "\t\tdir = 1;",
+ "\t}",
+ "\tif (dir == 0) {",
+ "\t\treturn;",
+ "\t}",
+ "\tvar ns = _this.treeselmodel.el.selected + dir;",
+ "\tif (ns < 0) {",
+ "\t\tns = 0;",
+ "\t}",
+ "\tif (ns >= _this.treeselmodel.el.get_n_items()) {",
+ "\t\tns = _this.treeselmodel.el.get_n_items()-1;",
+ "\t}",
+ "\t_this.treeselmodel.el.selected = ns;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "EventControllerKey"
+ }
],
- "* pack" : "pack_start,false,true,0",
- "id" : "search_entry",
- "int width_request" : 300,
"listeners" : {
- "changed" : [
- "() => {",
+ "search_changed" : [
+ "( ) => {",
+ "",
+ "\t_this.windowsearch.el.set_search(this.el.get_text());",
"\tif (this.el.text == \"\") {",
- "\t\t_this.search_results.el.hide();",
+ "\t\t_this.treescroll.el.visible = false;",
"\t\treturn;",
"\t}",
- "\tvar res = 0;",
- "\tswitch(_this.windowstate.state) {",
- "\t\tcase WindowState.State.CODEONLY:",
- "\t\t///case WindowState.State.CODE:",
- "\t\t\t// search the code being edited..",
- "\t\t\tres = _this.windowstate.code_editor_tab.search(this.el.text);",
- "\t\t\t",
- "\t\t\tbreak;",
- "\t\tcase WindowState.State.PREVIEW:",
- "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
- "\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);",
- "\t\t\t} else { ",
- "\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t",
- "\t\t\t}",
- "\t\t",
- "\t\t",
- "\t\t\tbreak;",
- "\t}",
- "\t_this.search_results.el.show();",
- "\tif (res > 0) {",
- "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
- "\t} else {",
- "\t\t_this.search_results.el.label = \"No Matches\";",
- "\t}",
- "\t\t",
- "\t",
- "\t",
+ "\t_this.treescroll.el.visible = true;",
+ "\t_this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);",
"}",
""
- ],
- "key_press_event" : [
- "(event) => {",
- " ",
- " \tif (event.keyval == Gdk.Key.Return) {",
- "\t\tthis.forwardSearch(false);",
- "\t return true;",
- "",
- "\t} ",
- " // print(event.key.keyval)",
- " ",
- " return false;",
- "",
- "} "
]
},
- "xtype" : "SearchEntry",
- "| void forwardSearch" : [
- "(bool change_focus) {",
- "\tswitch(_this.windowstate.state) {",
- "\t\tcase WindowState.State.CODEONLY:",
- "\t\t//case WindowState.State.CODE:",
- "\t\t\t// search the code being edited..",
- "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
- "\t\t\t ",
- "\t\t\tbreak;",
- "\t\tcase WindowState.State.PREVIEW:",
- "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
- "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
- "\t\t\t} else { ",
- "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
- "\t\t\t}",
- "\t\t",
- "\t\t\tbreak;",
- "\t}",
- "\t",
- "}",
- ""
- ]
+ "string placeholder_text" : "Search for file",
+ "string tooltip_text" : [
+ "up/down arrow to select file from lower file list",
+ "enter opens selected in new window",
+ "shift+enter opens it in this window "
+ ],
+ "xtype" : "SearchEntry"
},
{
"$ xns" : "Gtk",
- "* pack" : "add",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "bool hexpand" : true,
+ "int spacing" : 0,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "add",
- "Xcls_ValaCompileErrors popup" : "",
- "bool always_show_image" : true,
- "id" : "search_results",
+ "bool hexpand" : true,
+ "id" : "open_projects_btn",
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "bool sensitive" : false,
- "utf8 icon_name" : "system-search",
- "xtype" : "Image"
+ "* prop" : "child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "int spacing" : 0,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "int margin_end" : 4,
+ "string icon_name" : "document-open",
+ "xtype" : "Image"
+ },
+ {
+ "$ xns" : "Gtk",
+ "string label" : "Open File",
+ "xtype" : "Label"
+ }
+ ],
+ "xtype" : "Box"
}
],
"listeners" : {
- "button_press_event" : [
- "() => {",
- "/*",
- " if (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " }",
- " ",
- " ",
- " this.popup.show(this.notices, this.el);",
- " */",
- " return true;",
+ "clicked" : [
+ " ( ) => {",
+ " \t_this.splitview.el.show_sidebar = false;",
+ " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
"}"
]
},
- "string label" : "Matches",
- "xtype" : "ImageMenuItem"
+ "tooltop_text" : "\"Open File\"",
+ "xtype" : "Button"
},
{
"$ xns" : "Gtk",
- "* pack" : "add",
- "id" : "statusbar_compilestatus_label",
- "string label" : "Compile Status:",
- "xtype" : "MenuItem"
- },
- {
- "# Json.Object notices" : "new Json.Object() ",
- "$ xns" : "Gtk",
- "* pack" : "add",
- "Xcls_ValaCompileErrors popup" : "",
- "bool always_show_image" : true,
- "id" : "statusbar_errors",
+ "bool hexpand" : true,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "dialog-error",
- "xtype" : "Image"
+ "* prop" : "child",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+ "int spacing" : 0,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "int margin_end" : 4,
+ "string icon_name" : "window-new",
+ "xtype" : "Image"
+ },
+ {
+ "$ xns" : "Gtk",
+ "string label" : "New Window",
+ "xtype" : "Label"
+ }
+ ],
+ "xtype" : "Box"
}
],
"listeners" : {
- "button_press_event" : [
- "() => {",
- " if (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " }",
- " ",
- " ",
- " this.popup.show(this.notices, this.el);",
- " return true;",
+ "clicked" : [
+ "( ) => {",
+ "\t_this.splitview.el.show_sidebar = false;",
+ "\t_this.windowstate.showPopoverFiles(_this.el, _this.project, true);",
"}"
]
},
- "string label" : "Errors",
- "xtype" : "ImageMenuItem",
- "| void setNotices" : [
- "(Json.Object nots, int qty) {",
- " this.el.show();",
- " this.el.label = qty.to_string() + \" Errors\";",
- " this.notices = nots;",
- "",
- "}",
- ""
- ]
- },
+ "xtype" : "Button"
+ }
+ ],
+ "xtype" : "Box"
+ },
+ {
+ "$ xns" : "Gtk",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+ "bool vexpand" : true,
+ "items" : [
{
- "# Json.Object notices" : "new Json.Object()",
"$ xns" : "Gtk",
- "* pack" : "add",
- "Xcls_ValaCompileErrors popup" : "",
- "bool always_show_image" : true,
- "id" : "statusbar_warnings",
+ "* prop" : "start_child",
+ "bool has_frame" : true,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "dialog-warning",
- "xtype" : "Image"
+ "* prop" : "child",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "bool autoselect" : false,
+ "bool can_unselect" : false,
+ "bool selecting" : false,
+ "id" : "winsel",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "id" : "winfilter",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "filter",
+ "id" : "windowsearch",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "expression",
+ "GLib.Type this_type" : "typeof(WindowState)",
+ "string property_name" : "file_name",
+ "xtype" : "PropertyExpression"
+ }
+ ],
+ "xtype" : "StringFilter"
+ },
+ {
+ "$ xns" : "GLib",
+ "* prop" : "model",
+ "GLib.Type item_type" : "typeof(WindowState)",
+ "id" : "winmodel",
+ "xtype" : "ListStore"
+ }
+ ],
+ "xtype" : "FilterListModel"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "sorter",
+ "bool ignore_case" : true,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "expression",
+ "GLib.Type this_type" : "typeof(WindowState)",
+ "string property_name" : "file_name",
+ "xtype" : "PropertyExpression"
+ }
+ ],
+ "xtype" : "StringSorter"
+ }
+ ],
+ "xtype" : "SortListModel"
+ }
+ ],
+ "listeners" : {
+ "notify[\"selected\"]" : [
+ "() => {",
+ "\tif (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {",
+ "\t\treturn;",
+ "\t}",
+ "\tvar ws = this.el.selected_item as WindowState;",
+ "\tif (ws == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\tif (ws.file.path != _this.windowstate.file.path) {",
+ "\t\t_this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);",
+ "\t\t_this.splitview.el.show_sidebar = false;",
+ "\t}",
+ "\t",
+ "\tthis.selectCurrent();",
+ " }"
+ ]
+ },
+ "xtype" : "SingleSelection",
+ "| void selectCurrent" : [
+ "() {",
+ "\tthis.selecting = true;",
+ "\t ",
+ "\tfor(var i = 0;i < this.el.get_n_items(); i++) {",
+ "\t\tvar ws = this.el.get_item(i) as WindowState;",
+ "\t\tif (ws.file.path == _this.windowstate.file.path) {",
+ "\t\t \tthis.el.selected = i;",
+ "\t\t \tbreak;",
+ "\t \t}",
+ "\t}",
+ "\tthis.selecting = false;",
+ " ",
+ "",
+ "}"
+ ]
+ },
+ {
+ "$ xns" : "Gtk",
+ "bool expand" : true,
+ "bool resizable" : true,
+ "id" : "projcol",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "factory",
+ "listeners" : {
+ "bind" : [
+ "(listitem) => {",
+ "\tvar li = (listitem as Gtk.ListItem);",
+ "\tif (li == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
+ "\t if (lb == null) {",
+ "\t \treturn;",
+ " \t}",
+ "\t var item = li.get_item() as WindowState;",
+ "\t if (item == null) {",
+ "\t \treturn;",
+ " \t}",
+ "\t lb.label = item.project.name;",
+ "",
+ "",
+ " ",
+ "",
+ "}",
+ ""
+ ],
+ "setup" : [
+ "(listitem) => {",
+ "",
+ "\tvar li = (listitem as Gtk.ListItem);",
+ "\tif (li == null) {",
+ "\t\treturn;",
+ "\t}",
+ "",
+ "\tvar lbl = new Gtk.Label(\"\");",
+ " \tli.set_child(lbl);",
+ " \tlbl.justify = Gtk.Justification.LEFT;",
+ " \tlbl.xalign = 0;",
+ " \tlbl.use_markup = true;",
+ "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
+ " ",
+ "\tli.activatable = true;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "SignalListItemFactory"
+ }
+ ],
+ "title" : "Project",
+ "xtype" : "ColumnViewColumn"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "append_column",
+ "bool expand" : true,
+ "bool resizable" : true,
+ "id" : "filecol",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "factory",
+ "listeners" : {
+ "bind" : [
+ "(listitem) => {",
+ "\tvar li = (listitem as Gtk.ListItem);",
+ "\tif (li == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
+ "\t if (lb == null) {",
+ "\t \treturn;",
+ " \t}",
+ "\t var item = li.get_item() as WindowState;",
+ "\t if (item == null) {",
+ "\t \treturn;",
+ " \t}",
+ " \t",
+ " \t ",
+ " ",
+ " \tlb.label = item.file.relpath;",
+ "",
+ "",
+ " ",
+ "",
+ "}",
+ ""
+ ],
+ "setup" : [
+ "(listitem) => {",
+ "\tvar li = (listitem as Gtk.ListItem);",
+ "\tif (li == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\tvar lbl = new Gtk.Label(\"\");",
+ " \tli.set_child(lbl);",
+ " \tlbl.justify = Gtk.Justification.LEFT;",
+ " \tlbl.xalign = 0;",
+ " \tlbl.use_markup = true;",
+ "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
+ " ",
+ "\tli.activatable = true;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "SignalListItemFactory"
+ }
+ ],
+ "title" : "File",
+ "xtype" : "ColumnViewColumn"
+ }
+ ],
+ "xtype" : "ColumnView"
}
],
- "listeners" : {
- "button_press_event" : [
- "() => {",
- " if (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " }",
- " ",
- " this.popup.show(this.notices, this.el);",
- " return true;",
- "}"
- ]
- },
- "string label" : "Warnings",
- "xtype" : "ImageMenuItem",
- "| void setNotices" : [
- "(Json.Object nots, int qty) {",
- " this.el.show();",
- " this.el.label = qty.to_string() + \" Warnings\";",
- " this.notices = nots;",
- "",
- "}",
- ""
- ]
+ "xtype" : "ScrolledWindow"
},
{
- "# Json.Object notices" : "new Json.Object()",
- "$ xns" : "Gtk",
- "* pack" : "add",
- "Xcls_ValaCompileErrors popup" : "",
- "bool always_show_image" : true,
- "id" : "statusbar_depricated",
+ "* prop" : "end_child",
+ "bool has_frame" : true,
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "bool visible" : false,
+ "id" : "treescroll",
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "dialog-information",
- "xtype" : "Image"
+ "* prop" : "child",
+ "bool hexpand" : true,
+ "bool vexpand" : true,
+ "id" : "treeview",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "listeners" : {
+ "pressed" : [
+ "(n_press, x, y) => {",
+ "\tif (n_press == 2) {",
+ "\t\tGLib.debug(\"double cliced\");",
+ "\t} else {",
+ "\t\treturn;",
+ "\t}",
+ "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
+ "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
+ "\tvar f = (JsRender.JsRender) tr.item;",
+ "\tGLib.debug(\"Click %s\", f.name);",
+ "\tif (f.xtype == \"Dir\") {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t",
+ " \t_this.windowstate.fileViewOpen(f,",
+ " \t\t_this.keystate.is_shift != 1 ",
+ "\t);",
+ "\t",
+ "\t_this.splitview.el.show_sidebar = false;",
+ "\t",
+ "\t",
+ "",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "GestureClick"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "bool autoselect" : true,
+ "bool can_unselect" : true,
+ "id" : "treeselmodel",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "bool incremental" : true,
+ "id" : "treelistsort",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "model",
+ "Gtk.TreeListModelCreateModelFunc create_func" : [
+ "(item) => {",
+ "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
+ "\treturn ((JsRender.JsRender)item).childfiles;",
+ "} "
+ ],
+ "bool autoexpand" : true,
+ "bool passthrough" : false,
+ "id" : "treelistmodel",
+ "items" : [
+ {
+ "$ xns" : "GLib",
+ "* prop" : "root",
+ "GLib.Type item_type" : "typeof(JsRender.JsRender)",
+ "id" : "treemodel",
+ "xtype" : "ListStore"
+ }
+ ],
+ "xtype" : "TreeListModel"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "sorter",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "sorter",
+ "bool ignore_case" : true,
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "expression",
+ "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
+ "string property_name" : "name",
+ "xtype" : "PropertyExpression"
+ }
+ ],
+ "xtype" : "StringSorter"
+ }
+ ],
+ "xtype" : "TreeListRowSorter"
+ }
+ ],
+ "xtype" : "SortListModel"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "filter",
+ "Gtk.CustomFilterFunc match_func" : [
+ "(item) => { ",
+ "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
+ "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
+ "\tvar j = (JsRender.JsRender) tr;",
+ "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
+ "\t\treturn false;",
+ "\t}",
+ "\tvar str = _this.filesearch.el.text.down();\t",
+ "\tif (j.xtype == \"Dir\") {",
+ "\t",
+ "\t\t",
+ "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
+ "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
+ "\t\t\t//if (f.xtype != \"PlainFile\") {",
+ "\t\t\t//\tcontinue;",
+ "\t\t\t//}",
+ "\t\t\tif (f.content_type.contains(\"image\")) {",
+ "\t\t\t\tcontinue;",
+ "\t\t\t}",
+ "\t\t\tif (str.length < 1) {",
+ "\t\t\t\treturn true;",
+ "\t\t\t}",
+ "\t\t\tif (f.name.down().contains(str)) {",
+ "\t\t\t\treturn true;",
+ "\t\t\t}",
+ "\t\t\t",
+ "\t\t}",
+ "\t\t ",
+ "\t\treturn false;",
+ "\t}",
+ "\t//if (j.xtype != \"PlainFile\") {",
+ "\t//\treturn false;",
+ "\t//}",
+ " \tif (j.content_type.contains(\"image\")) {",
+ "\t\treturn false;",
+ "\t}",
+ "\t\t\t ",
+ "\tif (str.length < 1) { // no search.",
+ "\t\treturn true;",
+ "\t}",
+ "\tif (j.name.down().contains(str)) {",
+ "\t\treturn true;",
+ "\t}",
+ "\treturn false; ",
+ "",
+ "}"
+ ],
+ "id" : "treefilter",
+ "xtype" : "CustomFilter"
+ }
+ ],
+ "xtype" : "FilterListModel"
+ }
+ ],
+ "xtype" : "SingleSelection"
+ },
+ {
+ "$ xns" : "Gtk",
+ "* init" : [
+ "{",
+ "\t// this.el.set_sorter( new Gtk.StringSorter(",
+ "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
+ " //\t));",
+ "\t\t",
+ "}",
+ ""
+ ],
+ "* pack" : "append_column",
+ "bool expand" : true,
+ "bool resizable" : true,
+ "id" : "name",
+ "items" : [
+ {
+ "$ xns" : "Gtk",
+ "* prop" : "factory",
+ "listeners" : {
+ "bind" : [
+ "(listitem) => {",
+ "\t",
+ "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
+ " \t",
+ " \t",
+ " \t",
+ " \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
+ " \tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
+ " \t ",
+ " \tvar hbox = (Gtk.Box) expand.child;",
+ " ",
+ "\t",
+ "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
+ "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
+ "",
+ " ",
+ " \t",
+ " \t if (lbl == null || lbl.label != \"\") { // do not update",
+ " \t \treturn;",
+ " \t}",
+ " \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
+ " \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
+ " ",
+ " \t",
+ " \tvar jr =(JsRender.JsRender) lr.get_item();",
+ " \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
+ " \t",
+ " \t if (jr == null) {",
+ " \t\t GLib.debug(\"Problem getting item\"); ",
+ " \t\t return;",
+ " \t }",
+ "",
+ "\t\tjr.bind_property(\"icon\",",
+ " img, \"gicon\",",
+ " GLib.BindingFlags.SYNC_CREATE);",
+ "",
+ " \t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
+ " \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
+ " \tlbl.tooltip_markup = jr.path;",
+ " \t ",
+ " expand.set_hide_expander( jr.xtype != \"Dir\" );",
+ " \t expand.set_list_row(lr);",
+ " ",
+ " \t ",
+ " \t// bind image...",
+ "}",
+ ""
+ ],
+ "setup" : [
+ "(listitem) => {",
+ "\t",
+ "\tvar expand = new Gtk.TreeExpander();",
+ "\t ",
+ "\texpand.set_indent_for_depth(true);",
+ "\texpand.set_indent_for_icon(true);",
+ "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
+ "\tvar icon = new Gtk.Image();",
+ "\ticon.margin_end = 4;",
+ "\tvar lbl = new Gtk.Label(\"\");",
+ "\tlbl.use_markup = true;",
+ "\t",
+ "\t",
+ " \tlbl.justify = Gtk.Justification.LEFT;",
+ " \tlbl.xalign = 0;",
+ "",
+ " \thbox.append(icon);",
+ "\thbox.append(lbl);",
+ "\texpand.set_child(hbox);",
+ "\t((Gtk.ListItem)listitem).set_child(expand);",
+ "\t((Gtk.ListItem)listitem).activatable = false;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "SignalListItemFactory"
+ }
+ ],
+ "string title" : "All Project Files",
+ "xtype" : "ColumnViewColumn"
+ }
+ ],
+ "xtype" : "ColumnView"
}
],
- "listeners" : {
- "button_press_event" : [
- "() => {",
- " if (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " }",
- " ",
- " ",
- " this.popup.show(this.notices, this.el);",
- " return true;",
- "}"
- ]
- },
- "string label" : "Depricated",
- "xtype" : "ImageMenuItem",
- "| void setNotices" : [
- "(Json.Object nots, int qty) {",
- " this.el.show();",
- " this.el.label = qty.to_string() + \" Depricated\";",
- " this.notices = nots;",
- "",
- "}",
- ""
- ]
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "add",
- "Xcls_ValaCompileErrors popup" : "",
- "bool always_show_image" : true,
- "id" : "statusbar_run",
- "items" : [
- {
- "$ xns" : "Gtk",
- "* pack" : "set_image",
- "utf8 icon_name" : "media-playback-start",
- "xtype" : "Image"
- }
+ "string tooltip_text" : [
+ "dbl-click - opens in NEW window ",
+ "shift--dbl-click opens in this window"
],
- "listeners" : {
- "button_press_event" : [
- "() => {",
- "\tif (_this.windowstate.file == null) {",
- "\t\treturn true;",
- "\t}",
- "\tBuilderApplication.valasource.spawnExecute(_this.windowstate.file);",
- "\t",
- "\t_this.windowstate.compile_results.show(this.el,true);",
- "\t",
- "\treturn true;",
- "}"
- ]
- },
- "string label" : "Run",
- "xtype" : "ImageMenuItem"
+ "string xns" : "Gtk",
+ "string xtype" : "ScrolledWindow"
}
],
- "string tooltip_text" : "Update Resources / About Roobuilder",
- "xtype" : "MenuBar"
- },
- {
- "$ xns" : "Gtk",
- "* pack" : "add",
- "id" : "statusbar_compile_spinner",
- "string tooltip_text" : "Compiling",
- "xtype" : "Spinner",
- "| void start" : [
- "() {",
- " this.el.show();",
- " this.el.start(); ",
- "}",
- ""
- ],
- "| void stop" : [
- "() {",
- " this.el.stop();",
- " this.el.hide();",
- "}",
- ""
- ]
+ "xtype" : "Paned"
}
],
- "xtype" : "Box"
+ "xtype" : "Box",
+ "| void show" : [
+ "() {",
+ "\t_this.splitview.el.show_sidebar = true;",
+ " \t ",
+ "\t_this.filesearch.el.grab_focus();",
+ "\t_this.winloading = true;",
+ "\t_this.winmodel.el.remove_all();",
+ "\t_this.filesearch.el.set_text(\"\");",
+ "\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
+ "\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
+ "\t}",
+ "\t_this.winsel.selectCurrent();",
+ "\t_this.winloading = false;",
+ "\t",
+ "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
+ "\t",
+ "\t_this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);",
+ "\t",
+ "\t_this.treeview.el.set_model(_this.treeselmodel.el);",
+ "\t",
+ " \t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
+ "\t",
+ "}"
+ ]
+ },
+ {
+ "$ xns" : "Gtk",
+ "id" : "keystate",
+ "int is_shift" : 0,
+ "listeners" : {
+ "key_pressed" : [
+ "(keyval, keycode, state) => {",
+ "",
+ " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
+ " \t\tthis.is_shift = 1;",
+ " \t\t",
+ "\t}",
+ "\t",
+ "\t",
+ "\treturn true;",
+ "\t",
+ "}",
+ ""
+ ],
+ "key_released" : [
+ "(keyval, keycode, state) => {",
+ "\t//GLib.debug(",
+ "\t//\t\"key release %d, %d, %d ?= %d %d\" , ",
+ "\t//\t\t(int) keyval, (int) keycode, state,",
+ "\t//\t\t(int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK",
+ "\t//\t);",
+ " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
+ " \t\tthis.is_shift = 0;",
+ "\t}",
+ "\t//GLib.debug(\"set state %d , shift = %d\", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);",
+ "\tif (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {",
+ "\t\t// ctrl O pressed",
+ "\t\tif (!_this.splitview.el.show_sidebar) {",
+ "\t \t\t_this.sidebar.show(); ",
+ "\t \t}",
+ "\t}",
+ "\t",
+ "",
+ " ",
+ "}"
+ ]
+ },
+ "xtype" : "EventControllerKey"
}
],
- "xtype" : "Box"
+ "xtype" : "OverlaySplitView"
}
],
"listeners" : {
- "delete_event" : [
- " ( event) => {",
- " return false;",
- "} "
+ "close_request" : [
+ "( ) => {",
+ "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
+ "\t ",
+ "\t ",
+ "\t this.windowstate.file.getLanguageServer().document_close(",
+ "\t \tthis.windowstate.file",
+ " \t);",
+ "\t ",
+ "\t BuilderApplication.removeWindow(this);",
+ "\t ",
+ "\t if (BuilderApplication.windows.size < 1) {",
+ "\t \ttry {",
+ "\t\t\tthis.windowstate.file.getLanguageServer().exit();",
+ "\t\t} catch(Error e) {}",
+ "\t\t",
+ "\t\tBuilderApplication.singleton( null ).quit();",
+ "\t }",
+ "\treturn true;",
+ "\t",
+ "}",
+ ""
],
- "destroy" : [
+ "hide" : [
"() => {",
" ",
" ",
- " Resources.singleton().disconnect(_this.statusbar.handler_id);",
- " ",
- " BuilderApplication.removeWindow(this);",
- " ",
- " if (BuilderApplication.windows.size < 1) {",
"",
- " Gtk.main_quit();",
- " }",
"}"
],
- "key_release_event" : [
- " (event) => {",
- " ",
- " if (this.search_entry.el.is_visible()) {",
- "\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
- "\t\t print(\"SAVE: ctrl-f pressed\");",
- "\t\t\tthis.search_entry.el.grab_focus();",
- "\t\t return false;",
- "\t\t}",
- "\t\t",
- "\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
- "\t\t print(\"SAVE: ctrl-g pressed\");",
- "\t\t\tthis.search_entry.forwardSearch(true);",
- "\t\t return false;",
- "\t\t}",
- "\t\t",
- "\t} ",
- "\t",
- "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
- "\t\tprint(\"SAVE: ctrl-n pressed\");",
- "\t\tthis.openNewWindow();",
- "\t\treturn false;",
- "\t}",
- "\t",
- " // print(event.key.keyval)",
- " ",
- " return false;",
- "",
- "} ",
- "",
- ""
- ],
"show" : [
" ( ) => {",
" // hide the file editing..",
" ",
" //this.hideViewEditing();",
- " _this.statusbar.el.hide();",
- " _this.statusbar_errors.el.hide();",
- " _this.statusbar_warnings.el.hide();",
- " _this.statusbar_depricated.el.hide();",
+ " // this is updated by windowstate - we try and fill it in..",
+ " _this.statusbar.el.hide();",
+ " //_this.statusbar_errors.el.hide();",
+ " //_this.statusbar_warnings.el.hide();",
+ " //_this.statusbar_depricated.el.hide();",
" _this.statusbar_compile_spinner.el.hide();",
" ",
" Resources.singleton().checkResources();",
+ " ",
+ " ",
"",
"}"
]
},
- "xtype" : "Window",
+ "string title" : "Roo Application Builder",
+ "xtype" : "ApplicationWindow",
"| void initChildren" : [
" () {",
" // this needs putting in a better place..",
- " this.windowstate = new WindowState(this);",
+ " if (this.windowstate == null) {",
+ " \tthis.windowstate = new WindowState(this);",
+ " ",
+ " }",
" ",
"",
" ",
" var w = new Xcls_MainWindow();",
" w.ref();",
"\tBuilderApplication.addWindow(w);",
- " w.el.show_all();",
+ " w.el.show();",
" w.initChildren();",
" w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
" ",
""
],
"| void setTitle" : [
- " (string str) {",
- " this.headerbar.el.set_title(this.title + \" - \" + str);",
- "} ",
- ""
+ " () {",
+ " if (_this.windowstate.project == null || ",
+ "\t _this.windowstate.file == null",
+ " ) {",
+ " \tthis.el.set_title(\"Select File\");",
+ " \treturn;",
+ "\t}",
+ " _this.el.set_title(",
+ " \t_this.windowstate.project.name + ",
+ " \t\" - \" +",
+ "\t\t_this.windowstate.file.relpath);",
+ "} "
],
"| void show" : [
"() {",
" ",
- " this.el.show_all();",
+ " this.el.show();",
+ " if (this.windowstate.file == null) {",
+ " \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
+ " }",
+ "}"
+ ],
+ "| void updateErrors" : [
+ "() {",
+ "",
+ "",
+ " \tGLib.debug(\"updateErrors\");",
+ "\t",
+ "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
+ "\t",
+ "\tthis.statusbar_errors.setNotices(",
+ "\t\tpr,",
+ "\t\tthis.windowstate.file.getErrorsTotal(\"ERR\")",
+ "\t);",
+ "\t",
+ "\tthis.statusbar_warnings.setNotices(",
+ "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
+ "\t\tthis.windowstate.file.getErrorsTotal(\"WARN\")",
+ "\t);",
+ "\tthis.statusbar_depricated.setNotices(",
+ "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
+ "\t\tthis.windowstate.file.getErrorsTotal(\"DEPR\")",
+ "\t);",
+ "",
+ "\t_this.statusbar_run.el.hide();",
"",
+ "\tif (pr.get_n_items() < 1) {",
+ "\t\t_this.statusbar_run.el.show();",
+ "\t} ",
+ "\t",
"}"
]
}
],
- "modOrder" : "",
- "name" : "MainWindow",
- "parent" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",
- "permname" : "",
- "title" : ""
+ "name" : "MainWindow"
}
\ No newline at end of file