From: Alan Knowles Date: Wed, 31 Jan 2024 11:06:00 +0000 (+0800) Subject: Fix #7996 - handle namespaces in glade, adw overlay for window selection and open X-Git-Tag: release-5.0.2~17 X-Git-Url: http://git.roojs.org/?p=roobuilder;a=commitdiff_plain;h=9e01314cb1c0e1cf67f75d3bdc42163e44c2e738 Fix #7996 - handle namespaces in glade, adw overlay for window selection and open --- diff --git a/.roobuilder.jcfg b/.roobuilder.jcfg index 2d7b1ebd1..d85f7732d 100644 --- a/.roobuilder.jcfg +++ b/.roobuilder.jcfg @@ -89,6 +89,7 @@ "gtksourceview-5", "libgda-5.0", "jsonrpc-glib-1.0", - "gio-unix-2.0" + "gio-unix-2.0", + "libadwaita-1" ] } \ No newline at end of file diff --git a/meson.build b/meson.build index c5d929ac5..a121621f9 100644 --- a/meson.build +++ b/meson.build @@ -30,6 +30,7 @@ deps = [ dependency('libgda-5.0'), dependency('jsonrpc-glib-1.0'), dependency('gio-unix-2.0'), + dependency('libadwaita-1'), ] diff --git a/src/Application.vala b/src/Application.vala index 9708a4a83..dd2c63490 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -149,6 +149,7 @@ flags: ApplicationFlags.FLAGS_NONE ); BuilderApplication.windows = new Gee.ArrayList(); + BuilderApplication.windowlist = new GLib.ListStore(typeof(WindowState)); //BuilderApplication.valacompilequeue = new Palete.ValaCompileQueue(); @@ -627,12 +628,14 @@ flutter-project - was try and read flutter data (but desnt work.) // move to 'window colletction? public static Gee.ArrayList windows; + public static GLib.ListStore windowlist; public static void addWindow(Xcls_MainWindow w) { + windowlist.append(w.windowstate); BuilderApplication.windows.add(w); - BuilderApplication.updateWindows(); + } @@ -641,7 +644,15 @@ flutter-project - was try and read flutter data (but desnt work.) { //GLib.debug("remove window before = %d", BuilderApplication.windows.size); BuilderApplication.windows.remove(w); - BuilderApplication.updateWindows(); + for(var i = 0 ; i < windowlist.get_n_items(); i++) { + var ws = windowlist.get_item(i) as WindowState; + if (ws.file.path == w.windowstate.file.path && ws.project.path == w.windowstate.project.path) { + windowlist.remove(i); + break; + } + } + + w.el.hide(); w.el.close(); @@ -650,12 +661,7 @@ flutter-project - was try and read flutter data (but desnt work.) } - public static void updateWindows() - { - foreach(var ww in BuilderApplication.windows) { - ww.windowbtn.updateMenu(); - } - } + public static Xcls_MainWindow? getWindow(JsRender.JsRender file) { foreach(var ww in BuilderApplication.windows) { @@ -671,8 +677,9 @@ flutter-project - was try and read flutter data (but desnt work.) { var w = new Xcls_MainWindow(); w.ref(); - BuilderApplication.addWindow(w); w.initChildren(); + BuilderApplication.addWindow(w); + w.windowstate.init(); w.windowstate.fileViewOpen(file, false, line); w.el.present(); @@ -805,4 +812,4 @@ flutter-project - was try and read flutter data (but desnt work.) - \ No newline at end of file + diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index 30bfedde6..79d63cb90 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -1148,16 +1148,27 @@ "\t if (eline > tlines || eline < 0) {", "\t continue;", "\t }", - "\t ", "\t ", "\t buf.get_iter_at_line( out iter, eline);", "\t \tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);", "\t buf.create_source_mark( msg, diag.category, iter);", + "\t ", + " \t var spos = (int)diag.range.start.character - hoffset;", + " \t if (spos < 0) { spos =0 ; }", + " \t if (spos > iter.get_chars_in_line()) {", + " \t \tspos = iter.get_chars_in_line();", + " \t}", + "\t\tbuf.get_iter_at_line( out iter, eline_to);", + "\t\tvar epos = (int)diag.range.end.character - hoffset;", + " \t if (epos < 0) { epos =0 ; }", + " \t if (epos > iter.get_chars_in_line()) {", + " \t \tepos = iter.get_chars_in_line();", + " \t}", + " \t ", " \t ", - " \t buf.get_iter_at_line_offset( out start, ", - " \t \teline, (int)diag.range.start.character - hoffset); ", - " \t buf.get_iter_at_line_offset( out end, ", - " \t \teline_to, (int)diag.range.end.character - hoffset); ", + " \t buf.get_iter_at_line_offset( out start, eline, spos); ", + " \t ", + " \t buf.get_iter_at_line_offset( out end, eline_to,epos); ", " \t \t", "\t buf.apply_tag_by_name(diag.category, start, end);", "\t ", diff --git a/src/Builder4/Editor.vala b/src/Builder4/Editor.vala index bdd158cbd..9d0ed02e5 100644 --- a/src/Builder4/Editor.vala +++ b/src/Builder4/Editor.vala @@ -331,16 +331,27 @@ public class Editor : Object if (eline > tlines || eline < 0) { continue; } - buf.get_iter_at_line( out iter, eline); var msg = "Line: %d %s : %s".printf(eline+1, diag.category, diag.message); buf.create_source_mark( msg, diag.category, iter); + + var spos = (int)diag.range.start.character - hoffset; + if (spos < 0) { spos =0 ; } + if (spos > iter.get_chars_in_line()) { + spos = iter.get_chars_in_line(); + } + buf.get_iter_at_line( out iter, eline_to); + var epos = (int)diag.range.end.character - hoffset; + if (epos < 0) { epos =0 ; } + if (epos > iter.get_chars_in_line()) { + epos = iter.get_chars_in_line(); + } + - buf.get_iter_at_line_offset( out start, - eline, (int)diag.range.start.character - hoffset); - buf.get_iter_at_line_offset( out end, - eline_to, (int)diag.range.end.character - hoffset); + buf.get_iter_at_line_offset( out start, eline, spos); + + buf.get_iter_at_line_offset( out end, eline_to,epos); buf.apply_tag_by_name(diag.category, start, end); diff --git a/src/Builder4/MainWindow.bjs b/src/Builder4/MainWindow.bjs index 1ffe5b1a6..5e0e29706 100644 --- a/src/Builder4/MainWindow.bjs +++ b/src/Builder4/MainWindow.bjs @@ -5,17 +5,14 @@ { "# Project.Project project" : "null", "# WindowState windowstate" : "", + "# 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, @@ -34,202 +31,30 @@ "* pack" : "pack_start", "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "items" : [ - { - "# Gee.ArrayList mitems" : "", - "$ Gtk.Align halign" : "Gtk.Align.START", - "$ xns" : "Gtk", - "* init" : [ - "{", - "\tthis.mitems = new Gee.ArrayList();", - "}", - "" - ], - "id" : "windowbtn", - "int margin_end" : 4, - "items" : [ - { - "$ xns" : "Gtk", - "* pack" : false, - "id" : "windowspopup", - "items" : [ - { - "$ xns" : "Gtk", - "* pack" : "set_child", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", - "id" : "popover_menu", - "int spacing" : 0, - "items" : [ - { - "$ xns" : "Gtk", - "* pack" : "append", - "items" : [ - { - "$ Gtk.ShortcutScope scope" : "Gtk.ShortcutScope.GLOBAL", - "$ xns" : "Gtk", - "* init" : [ - "{", - "\tthis.el.add_shortcut(", - "\t\tnew Gtk.Shortcut(", - "\t\t\tnew Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),", - "\t\t\tnew Gtk.SignalAction(\"clicked\")", - "\t\t)", - "\t);", - "}", - "" - ], - "xtype" : "ShortcutController" - } - ], - "listeners" : { - "clicked" : [ - "( ) => {", - "\t_this.windowspopup.el.hide();", - "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);", - "}", - "" - ] - }, - "string label" : "New Window", - "xtype" : "Button" - }, - { - "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", - "$ xns" : "Gtk", - "* pack" : "append", - "xtype" : "Separator" - } - ], - "xtype" : "Box" - } - ], - "xtype" : "Popover" - }, - { - "$ xns" : "Gtk", - "* prop" : "child", - "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", - "items" : [ - { - "$ xns" : "Gtk", - "int margin_start" : 4, - "string icon_name" : "window-new", - "xtype" : "Image" - }, - { - "$ xns" : "Gtk", - "string label" : "Windows (Add/List)", - "xtype" : "Label" - } - ], - "xtype" : "Box" - } - ], - "listeners" : { - "clicked" : [ - "( ) => {", - "\tthis.updateMenu();", - "", - "\t _this.windowspopup.el.set_parent(this.el);", - "", - "\t _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); ", - "\t _this.windowspopup.el.popup(); ", - "}", - "" - ] - }, - "xtype" : "Button", - "| void updateMenu" : [ - "() {", - "\t foreach(var m in this.mitems) {", - "\t \t _this.popover_menu.el.remove(m);", - "\t }", - "\t this.mitems.clear();", - "\t", - "\t BuilderApplication.windows.sort((a,b) => {", - "\t \tif (a.windowstate == null ||", - " \t\t\t a.windowstate.file == null || ", - " \t\t\t b.windowstate == null ||", - " \t\t\t b.windowstate.file == null", - " \t\t\t ) { ", - " \t\t\treturn 0;", - "\t\t}", - "", - "\t \tvar ap = a.windowstate.file.project.name;", - "\t \tvar bp = b.windowstate.file.project.name;", - "\t \t", - "", - "\t \t", - "\t \tif (ap != bp) {", - "\t \t\treturn ap.collate(bp);", - "\t \t}", - "\t \tvar af = a.windowstate.file == null ? \"\" : a.windowstate.file.getTitle();", - "\t \tvar bf = b.windowstate.file == null ? \"\" : b.windowstate.file.getTitle();\t \t", - "\t\treturn af.collate(bf);", - "\t ", - "\t });", - "\t ", - "\t var p = \"\";", - "\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// should not happen...", - "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {", - "\t \t\tcontinue;", - " \t\t}", - " \t\tif (w.windowstate.file.project.name != p || p != \"\") {", - " \t\t\tvar ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);", - " \t\t\t_this.popover_menu.el.append(ms);", - "\t\t \tms.show();", - "\t\t \tthis.mitems.add(ms);", - " \t\t}", - " \t\t", - " \t\tp = w.windowstate.file.project.name;", - " \t\t", - "", - " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);", - " \t\t", - " \t\t", - " \t\t", - "\t \tvar m = new Gtk.Button.with_label(", - "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.relpath", - "\t \t);", - "\t \tm.halign = Gtk.Align.START;", - "\t \t", - "\t \t", - "\t \t//w.windowstate.file.path);", - "\t \tm.clicked.connect(() => {", - "\t\t \t_this.windowspopup.el.hide();", - "\t \t\t BuilderApplication.windows.get(wid).el.present();", - "\t \t});", - "\t \t_this.popover_menu.el.append(m);", - "\t \t//m.show();", - "\t \tthis.mitems.add(m);", - "\t }", - "}" - ] - }, { "$ xns" : "Gtk", "* pack" : "append", - "bool always_show_image" : true, - "id" : "open_projects_btn", + "bool has_frame" : false, "listeners" : { "clicked" : [ " ( ) => {", - " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);", + " \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;", + " \tif (_this.splitview.el.show_sidebar) {", + " \t\t_this.filesearch.el.grab_focus();", + " \t\t_this.winloading = true;", + " \t\t_this.winmodel.el.remove_all();", + " \t\t_this.filesearch.el.set_text(\"\");", + " \t\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {", + "\t\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));", + "\t\t}", + "\t\t_this.winsel.selectCurrent();", + "\t\t_this.winloading = false;", + " \t}", "}" ] }, - "string icon_name" : "system-file-manager", - "string label" : "Files / Projects", - "tooltop_text" : "\"Open File\"", + "string icon_name" : "preferences-system-windows", + "tooltop_text" : "Manage Windows", "xtype" : "Button" } ], @@ -239,460 +64,631 @@ "xtype" : "HeaderBar" }, { - "$ xns" : "Gtk", - "* pack" : "set_child", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", - "bool homogeneous" : false, - "bool vexpand" : true, - "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", - "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "* prop" : "content", + "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "bool hexpand" : true, - "bool vexpand" : true, - "id" : "mainpane", + "bool homogeneous" : false, + "bool vexpand" : false, + "id" : "vbox", + "int spacing" : 0, "items" : [ { + "# int lastWidth" : 0, "$ xns" : "Gtk", - "* prop" : "start_child", "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "bool hexpand" : true, "bool vexpand" : true, - "id" : "leftpane", + "id" : "mainpane", "items" : [ { "$ xns" : "Gtk", + "* 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", - "* prop" : "start_child", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "bool hexpand" : true, "bool vexpand" : true, - "id" : "tree", + "id" : "rooviewbox", "xtype" : "Box" }, { "$ xns" : "Gtk", - "* prop" : "end_child", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "bool hexpand" : true, "bool vexpand" : true, - "id" : "props", + "id" : "codeeditviewbox", "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" } ], - "xtype" : "Box" + "listeners" : { + "accept_position" : [ + "( ) => {", + "\t_this.windowstate.left_tree.onresize();", + "\treturn true;", + "}", + "" + ] + }, + "position" : 400, + "xtype" : "Paned" }, { "$ xns" : "Gtk", - "* prop" : "end_child", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", - "bool hexpand" : true, - "bool vexpand" : true, + "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "bool homogeneous" : false, + "bool vexpand" : false, "items" : [ { + "$ tooltip_text" : "\"Project Details\"", "$ xns" : "Gtk", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", - "bool hexpand" : true, - "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", + "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", + "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", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "bool hexpand" : true, - "bool vexpand" : true, - "id" : "codeeditviewbox", + "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()));", + " ", + " });", + "}", + "" + ], + "bool show_text" : true, + "id" : "statusbar", + "ulong handler_id" : "-1", + "xtype" : "ProgressBar" + }, + { + "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "$ xns" : "Gtk", + "items" : [ + { + "$ xns" : "Gtk", + "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" : { + "clicked" : [ + "() => {", + " ", + "\tif (this.popup == null) {", + "\t\treturn;", + "\t}", + " ", + " this.popup.show();", + " ", + "}" + ] + }, + "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", + "Palete.ValaCompileRequest? last_request" : "null", + "Xcls_ValaCompileErrors popup" : "", + "bool visible" : false, + "id" : "statusbar_run", + "listeners" : { + "clicked" : [ + "() => {", + " ", + " 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 icon_name" : "media-playback-start", + "string label" : "Run", + "xtype" : "Button" + } + ], "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", + "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL", + "id" : "statusbar_compile_icon", + "int margin_end" : 4, + "int margin_start" : 4, + "xtype" : "Image" } ], "xtype" : "Box" } ], - "listeners" : { - "accept_position" : [ - "( ) => {", - "\t_this.windowstate.left_tree.onresize();", - "\treturn true;", - "}", - "" - ] - }, - "position" : 400, - "xtype" : "Paned" + "xtype" : "Box" }, { "$ xns" : "Gtk", - "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", - "bool homogeneous" : false, - "bool vexpand" : false, + "* prop" : "sidebar", + "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", + "int spacing" : 0, "items" : [ { - "$ tooltip_text" : "\"Project Details\"", "$ xns" : "Gtk", - "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", - "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" + "bool hexpand" : true, + "bool search_mode_enabled" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "child", + "bool hexpand" : true, + "id" : "filesearch", + "listeners" : { + "search_changed" : [ + "( ) => {", + "", + "\t_this.windowsearch.el.set_search(this.el.get_text());", + "}", + "" + ] + }, + "string placeholder_text" : "Search for file", + "xtype" : "SearchEntry" + } + ], + "xtype" : "SearchBar" }, { "$ xns" : "Gtk", - "bool always_show_image" : true, + "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "bool hexpand" : true, + "int spacing" : 0, "items" : [ { "$ xns" : "Gtk", - "* ctor" : "new Gtk.PopoverMenu.from_model(null)", - "* init" : [ - "{", - " // this.el.show();", - "}", - "" - ], - "* prop" : "popover", - "id" : "topbarmenu", + "bool hexpand" : true, + "id" : "open_projects_btn", "items" : [ { "$ xns" : "Gtk", - "* pack" : "set_child", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", + "* prop" : "child", + "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "int spacing" : 0, "items" : [ { "$ xns" : "Gtk", - "listeners" : { - "activate" : [ - " ( ) => {", - " Resources.singleton().fetchStart();", - "}" - ] - }, - "string label" : "Download updated Resources", - "xtype" : "Button" + "int margin_end" : 4, + "string icon_name" : "document-open", + "xtype" : "Image" }, { "$ xns" : "Gtk", - "listeners" : { - "clicked" : [ - "() => {", - " About.singleton().el.show();", - " }" - ] - }, - "string label" : "About the Builder", - "xtype" : "Button" + "string label" : "Open File", + "xtype" : "Label" } ], "xtype" : "Box" } ], - "xtype" : "PopoverMenu" - } - ], - "string icon_name" : "dialog-information", - "string label" : "About", - "xtype" : "MenuButton" - }, - { - "$ xns" : "Gtk", - "bool hexpand" : true, - "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()));", - " ", - " });", - "}", - "" - ], - "bool show_text" : true, - "id" : "statusbar", - "ulong handler_id" : "-1", - "xtype" : "ProgressBar" - }, - { - "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", - "$ xns" : "Gtk", - "items" : [ - { - "$ xns" : "Gtk", - "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" : { "clicked" : [ - "() => {", - " ", - "\tif (this.popup == null) {", - "\t\treturn;", - "\t}", - " ", - " this.popup.show();", - " ", + " ( ) => {", + " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);", "}" ] }, - "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 ", - "}", - "" - ] + "tooltop_text" : "\"Open File\"", + "xtype" : "Button" }, { "$ xns" : "Gtk", - "Palete.ValaCompileRequest? last_request" : "null", - "Xcls_ValaCompileErrors popup" : "", - "bool visible" : false, - "id" : "statusbar_run", + "bool hexpand" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* 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" : { "clicked" : [ - "() => {", - " ", - " 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 ", + "( ) => {", + "\t_this.splitview.el.show_sidebar = false;", + "\t_this.windowstate.showPopoverFiles(_this.el, _this.project, true);", "}" ] }, - "string icon_name" : "media-playback-start", - "string label" : "Run", "xtype" : "Button" } ], @@ -700,53 +696,379 @@ }, { "$ 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 ", - "}", - "" + "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", + "bool vexpand" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "start_child", + "items" : [ + { + "$ xns" : "Gtk", + "* 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) => {", + "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();", + "\t var item = (listitem as Gtk.ListItem).get_item() as WindowState;", + "\t ", + "\t lb.label = item.project.name;", + "", + "", + " ", + "", + "}", + "" + ], + "setup" : [ + "(listitem) => {", + "\tvar lbl = new Gtk.Label(\"\");", + " \t(listitem as Gtk.ListItem).set_child(lbl);", + " \tlbl.justify = Gtk.Justification.LEFT;", + " \tlbl.xalign = 0;", + " \tlbl.use_markup = true;", + "\tlbl.ellipsize = Pango.EllipsizeMode.START;", + " ", + "\t(listitem as Gtk.ListItem).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) => {", + " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();", + " var item = (listitem as Gtk.ListItem).get_item() as WindowState;", + " ", + " lb.label = item.file.relpath;", + "", + "", + " ", + "", + "}", + "" + ], + "setup" : [ + "(listitem) => {", + "\tvar lbl = new Gtk.Label(\"\");", + " \t(listitem as Gtk.ListItem).set_child(lbl);", + " \tlbl.justify = Gtk.Justification.LEFT;", + " \tlbl.xalign = 0;", + " \tlbl.use_markup = true;", + "\tlbl.ellipsize = Pango.EllipsizeMode.START;", + " ", + "\t(listitem as Gtk.ListItem).activatable = true;", + "}", + "" + ] + }, + "xtype" : "SignalListItemFactory" + } + ], + "title" : "File", + "xtype" : "ColumnViewColumn" + } + ], + "xtype" : "ColumnView" + } + ], + "xtype" : "ScrolledWindow" + }, + { + "* prop" : "end_child", + "bool hexpand" : true, + "bool vexpand" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "child", + "bool hexpand" : true, + "bool vexpand" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "model", + "bool autoselect" : false, + "bool can_unselect" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "model", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "model", + "items" : [ + { + "$ xns" : "GLib", + "* prop" : "model", + "GLib.Type item_type" : "typeof(WindowState)", + "id" : "histmodel", + "xtype" : "ListStore" + }, + { + "$ xns" : "Gtk", + "* prop" : "filter", + "id" : "histsearch", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "expression", + "GLib.Type this_type" : "typeof(WindowState)", + "string property_name" : "file_name", + "xtype" : "PropertyExpression" + } + ], + "xtype" : "StringFilter" + } + ], + "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" + } + ], + "xtype" : "SingleSelection" + }, + { + "$ xns" : "Gtk", + "bool expand" : true, + "bool resizable" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "factory", + "listeners" : { + "bind" : [ + "(listitem) => {", + "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();", + "\t var item = (listitem as Gtk.ListItem).get_item() as WindowState;", + "\t ", + "\t lb.label = item.project.name;", + "", + "", + " ", + "", + "}", + "" + ], + "setup" : [ + "(listitem) => {", + "\tvar lbl = new Gtk.Label(\"\");", + " \t(listitem as Gtk.ListItem).set_child(lbl);", + " \tlbl.justify = Gtk.Justification.LEFT;", + " \tlbl.xalign = 1;", + " \tlbl.use_markup = true;", + "\tlbl.ellipsize = Pango.EllipsizeMode.START;", + " ", + "\t(listitem as Gtk.ListItem).activatable = true;", + "}", + "" + ] + }, + "xtype" : "SignalListItemFactory" + } + ], + "title" : "Project", + "xtype" : "ColumnViewColumn" + }, + { + "$ xns" : "Gtk", + "* pack" : "append_column", + "bool expand" : true, + "bool resizable" : true, + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "factory", + "listeners" : { + "bind" : [ + "(listitem) => {", + " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();", + " var item = (listitem as Gtk.ListItem).get_item() as WindowState;", + " ", + " lb.label = item.file.relpath;", + "", + "", + " ", + "", + "}", + "" + ], + "setup" : [ + "(listitem) => {", + "\tvar lbl = new Gtk.Label(\"\");", + " \t(listitem as Gtk.ListItem).set_child(lbl);", + " \tlbl.justify = Gtk.Justification.LEFT;", + " \tlbl.xalign = 1;", + " \tlbl.use_markup = true;", + "\tlbl.ellipsize = Pango.EllipsizeMode.START;", + " ", + "\t(listitem as Gtk.ListItem).activatable = true;", + "}", + "" + ] + }, + "xtype" : "SignalListItemFactory" + } + ], + "title" : "File", + "xtype" : "ColumnViewColumn" + } + ], + "xtype" : "ColumnView" + } + ], + "string xns" : "Gtk", + "string xtype" : "ScrolledWindow" + } ], - "| void stop" : [ - "() {", - " this.el.stop();", - " this.el.hide();", - " _this.statusbar_compile_icon.el.hide(); ", - "}", - "" - ] - }, - { - "$ xns" : "Gtk", - "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL", - "id" : "statusbar_compile_icon", - "int margin_end" : 4, - "int margin_start" : 4, - "xtype" : "Image" + "xtype" : "Paned" } ], "xtype" : "Box" } ], - "xtype" : "Box" + "xtype" : "OverlaySplitView" } ], "listeners" : { @@ -800,7 +1122,10 @@ "| void initChildren" : [ " () {", " // this needs putting in a better place..", - " this.windowstate = new WindowState(this);", + " if (this.windowstate == null) {", + " \tthis.windowstate = new WindowState(this);", + " ", + " }", " ", "", " ", diff --git a/src/Builder4/MainWindow.vala b/src/Builder4/MainWindow.vala index ed15fc2f8..c38134b38 100644 --- a/src/Builder4/MainWindow.vala +++ b/src/Builder4/MainWindow.vala @@ -13,10 +13,7 @@ public class Xcls_MainWindow : Object return _MainWindow; } public Xcls_headerbar headerbar; - public Xcls_windowbtn windowbtn; - public Xcls_windowspopup windowspopup; - public Xcls_popover_menu popover_menu; - public Xcls_open_projects_btn open_projects_btn; + public Xcls_splitview splitview; public Xcls_vbox vbox; public Xcls_mainpane mainpane; public Xcls_leftpane leftpane; @@ -34,9 +31,20 @@ public class Xcls_MainWindow : Object public Xcls_statusbar_run statusbar_run; public Xcls_statusbar_compile_spinner statusbar_compile_spinner; public Xcls_statusbar_compile_icon statusbar_compile_icon; + public Xcls_filesearch filesearch; + public Xcls_open_projects_btn open_projects_btn; + public Xcls_winsel winsel; + public Xcls_winfilter winfilter; + public Xcls_windowsearch windowsearch; + public Xcls_winmodel winmodel; + public Xcls_projcol projcol; + public Xcls_filecol filecol; + public Xcls_histmodel histmodel; + public Xcls_histsearch histsearch; // my vars (def) public WindowState windowstate; + public bool winloading; public Project.Project project; // ctor @@ -46,6 +54,7 @@ public class Xcls_MainWindow : Object this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({})); // my vars (dec) + this.winloading = false; this.project = null; // set gobject values @@ -54,8 +63,8 @@ public class Xcls_MainWindow : Object this.el.default_width = 1200; new Xcls_headerbar( _this ); this.el.set_titlebar ( _this.headerbar.el ); - new Xcls_vbox( _this ); - this.el.set_child ( _this.vbox.el ); + new Xcls_splitview( _this ); + this.el.child = _this.splitview.el; // init method @@ -132,7 +141,10 @@ public class Xcls_MainWindow : Object } public void initChildren () { // this needs putting in a better place.. - this.windowstate = new WindowState(this); + if (this.windowstate == null) { + this.windowstate = new WindowState(this); + + } @@ -217,185 +229,14 @@ public class Xcls_MainWindow : Object // my vars (dec) // set gobject values - new Xcls_windowbtn( _this ); - this.el.append( _this.windowbtn.el ); - new Xcls_open_projects_btn( _this ); - this.el.append ( _this.open_projects_btn.el ); - } - - // user defined functions - } - public class Xcls_windowbtn : Object - { - public Gtk.Button el; - private Xcls_MainWindow _this; - - - // my vars (def) - public Gee.ArrayList mitems; - - // ctor - public Xcls_windowbtn(Xcls_MainWindow _owner ) - { - _this = _owner; - _this.windowbtn = this; - this.el = new Gtk.Button(); - - // my vars (dec) - - // set gobject values - this.el.margin_end = 4; - this.el.halign = Gtk.Align.START; - new Xcls_windowspopup( _this ); - var child_2 = new Xcls_Box10( _this ); - this.el.child = child_2.el; - - // init method - - { - this.mitems = new Gee.ArrayList(); - } - - //listeners - this.el.clicked.connect( ( ) => { - this.updateMenu(); - - _this.windowspopup.el.set_parent(this.el); - - _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); - _this.windowspopup.el.popup(); - }); - } - - // user defined functions - public void updateMenu () { - foreach(var m in this.mitems) { - _this.popover_menu.el.remove(m); - } - this.mitems.clear(); - - BuilderApplication.windows.sort((a,b) => { - if (a.windowstate == null || - a.windowstate.file == null || - b.windowstate == null || - b.windowstate.file == null - ) { - return 0; - } - - var ap = a.windowstate.file.project.name; - var bp = b.windowstate.file.project.name; - - - - if (ap != bp) { - return ap.collate(bp); - } - var af = a.windowstate.file == null ? "" : a.windowstate.file.getTitle(); - var bf = b.windowstate.file == null ? "" : b.windowstate.file.getTitle(); - return af.collate(bf); - - }); - - var p = ""; - foreach(var w in BuilderApplication.windows) { - var wid = BuilderApplication.windows.index_of(w); - // fixme find a better way to display this. - if (w.windowstate == null || - w.windowstate.file == null || - _this.windowstate == null || - _this.windowstate.file == null - ) { - continue; - } - // should not happen... - if (w.windowstate.file.path == _this.windowstate.file.path) { - continue; - } - if (w.windowstate.file.project.name != p || p != "") { - var ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL); - _this.popover_menu.el.append(ms); - ms.show(); - this.mitems.add(ms); - } - - p = w.windowstate.file.project.name; - - - GLib.debug("add menuitem %s", w.windowstate.file.path); - - - - var m = new Gtk.Button.with_label( - w.windowstate.file.project.name + " : " + w.windowstate.file.relpath - ); - m.halign = Gtk.Align.START; - - - //w.windowstate.file.path); - m.clicked.connect(() => { - _this.windowspopup.el.hide(); - BuilderApplication.windows.get(wid).el.present(); - }); - _this.popover_menu.el.append(m); - //m.show(); - this.mitems.add(m); - } - } - } - public class Xcls_windowspopup : Object - { - public Gtk.Popover el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_windowspopup(Xcls_MainWindow _owner ) - { - _this = _owner; - _this.windowspopup = this; - this.el = new Gtk.Popover(); - - // my vars (dec) - - // set gobject values - new Xcls_popover_menu( _this ); - this.el.set_child ( _this.popover_menu.el ); - } - - // user defined functions - } - public class Xcls_popover_menu : Object - { - public Gtk.Box el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_popover_menu(Xcls_MainWindow _owner ) - { - _this = _owner; - _this.popover_menu = this; - this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); - - // my vars (dec) - - // set gobject values - var child_1 = new Xcls_Button7( _this ); + var child_1 = new Xcls_Button4( _this ); child_1.ref(); this.el.append ( child_1.el ); - var child_2 = new Xcls_Separator9( _this ); - child_2.ref(); - this.el.append ( child_2.el ); } // user defined functions } - public class Xcls_Button7 : Object + public class Xcls_Button4 : Object { public Gtk.Button el; private Xcls_MainWindow _this; @@ -404,7 +245,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Button7(Xcls_MainWindow _owner ) + public Xcls_Button4(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -412,188 +253,60 @@ public class Xcls_MainWindow : Object // my vars (dec) // set gobject values - this.el.label = "New Window"; - var child_1 = new Xcls_ShortcutController8( _this ); - child_1.ref(); - this.el.add_controller( child_1.el ); + this.el.icon_name = "preferences-system-windows"; + this.el.has_frame = false; //listeners this.el.clicked.connect( ( ) => { - _this.windowspopup.el.hide(); - _this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true); + _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar; + if (_this.splitview.el.show_sidebar) { + _this.filesearch.el.grab_focus(); + _this.winloading = true; + _this.winmodel.el.remove_all(); + _this.filesearch.el.set_text(""); + for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) { + _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i)); + } + _this.winsel.selectCurrent(); + _this.winloading = false; + } }); } // user defined functions } - public class Xcls_ShortcutController8 : Object - { - public Gtk.ShortcutController el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_ShortcutController8(Xcls_MainWindow _owner ) - { - _this = _owner; - this.el = new Gtk.ShortcutController(); - - // my vars (dec) - - // set gobject values - this.el.scope = Gtk.ShortcutScope.GLOBAL; - - // init method - - { - this.el.add_shortcut( - new Gtk.Shortcut( - new Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK), - new Gtk.SignalAction("clicked") - ) - ); - } - } - - // user defined functions - } - - - public class Xcls_Separator9 : Object - { - public Gtk.Separator el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_Separator9(Xcls_MainWindow _owner ) - { - _this = _owner; - this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL ); - - // my vars (dec) - - // set gobject values - } - - // user defined functions - } - - - - public class Xcls_Box10 : Object - { - public Gtk.Box el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_Box10(Xcls_MainWindow _owner ) - { - _this = _owner; - this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); - - // my vars (dec) - - // set gobject values - var child_1 = new Xcls_Image11( _this ); - child_1.ref(); - this.el.append( child_1.el ); - var child_2 = new Xcls_Label12( _this ); - child_2.ref(); - this.el.append( child_2.el ); - } - - // user defined functions - } - public class Xcls_Image11 : Object - { - public Gtk.Image el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_Image11(Xcls_MainWindow _owner ) - { - _this = _owner; - this.el = new Gtk.Image(); - - // my vars (dec) - - // set gobject values - this.el.icon_name = "window-new"; - this.el.margin_start = 4; - } - - // user defined functions - } - - public class Xcls_Label12 : Object - { - public Gtk.Label el; - private Xcls_MainWindow _this; - - - // my vars (def) - - // ctor - public Xcls_Label12(Xcls_MainWindow _owner ) - { - _this = _owner; - this.el = new Gtk.Label( "Windows (Add/List)" ); - - // my vars (dec) - - // set gobject values - } - - // user defined functions - } - public class Xcls_open_projects_btn : Object + public class Xcls_splitview : Object { - public Gtk.Button el; + public Adw.OverlaySplitView el; private Xcls_MainWindow _this; // my vars (def) - public bool always_show_image; // ctor - public Xcls_open_projects_btn(Xcls_MainWindow _owner ) + public Xcls_splitview(Xcls_MainWindow _owner ) { _this = _owner; - _this.open_projects_btn = this; - this.el = new Gtk.Button(); + _this.splitview = this; + this.el = new Adw.OverlaySplitView(); // my vars (dec) - this.always_show_image = true; // set gobject values - this.el.icon_name = "system-file-manager"; - this.el.label = "Files / Projects"; - - //listeners - this.el.clicked.connect( ( ) => { - _this.windowstate.showPopoverFiles(this.el, _this.project, false); - }); + this.el.collapsed = true; + this.el.sidebar_width_fraction = 0.40000; + this.el.show_sidebar = false; + new Xcls_vbox( _this ); + this.el.content = _this.vbox.el; + var child_2 = new Xcls_Box33( _this ); + this.el.sidebar = child_2.el; } // user defined functions } - - - public class Xcls_vbox : Object { public Gtk.Box el; @@ -613,10 +326,11 @@ public class Xcls_MainWindow : Object // set gobject values this.el.homogeneous = false; - this.el.vexpand = true; + this.el.hexpand = true; + this.el.vexpand = false; new Xcls_mainpane( _this ); this.el.append( _this.mainpane.el ); - var child_2 = new Xcls_Box23( _this ); + var child_2 = new Xcls_Box15( _this ); child_2.ref(); this.el.append( child_2.el ); } @@ -648,7 +362,7 @@ public class Xcls_MainWindow : Object this.el.position = 400; new Xcls_leftpane( _this ); this.el.start_child = _this.leftpane.el; - var child_2 = new Xcls_Box20( _this ); + var child_2 = new Xcls_Box12( _this ); this.el.end_child = child_2.el; //listeners @@ -774,7 +488,7 @@ public class Xcls_MainWindow : Object - public class Xcls_Box20 : Object + public class Xcls_Box12 : Object { public Gtk.Box el; private Xcls_MainWindow _this; @@ -783,7 +497,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Box20(Xcls_MainWindow _owner ) + public Xcls_Box12(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); @@ -853,7 +567,7 @@ public class Xcls_MainWindow : Object - public class Xcls_Box23 : Object + public class Xcls_Box15 : Object { public Gtk.Box el; private Xcls_MainWindow _this; @@ -862,7 +576,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Box23(Xcls_MainWindow _owner ) + public Xcls_Box15(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); @@ -872,21 +586,21 @@ public class Xcls_MainWindow : Object // set gobject values this.el.homogeneous = false; this.el.vexpand = false; - var child_1 = new Xcls_Button24( _this ); + var child_1 = new Xcls_Button16( _this ); child_1.ref(); this.el.append( child_1.el ); - var child_2 = new Xcls_Button25( _this ); + var child_2 = new Xcls_Button17( _this ); child_2.ref(); this.el.append( child_2.el ); - var child_3 = new Xcls_MenuButton26( _this ); + var child_3 = new Xcls_MenuButton18( _this ); child_3.ref(); this.el.append( child_3.el ); - var child_4 = new Xcls_Label31( _this ); + var child_4 = new Xcls_Label23( _this ); child_4.ref(); this.el.append( child_4.el ); new Xcls_statusbar( _this ); this.el.append( _this.statusbar.el ); - var child_6 = new Xcls_Box33( _this ); + var child_6 = new Xcls_Box25( _this ); child_6.ref(); this.el.append( child_6.el ); new Xcls_statusbar_compile_spinner( _this ); @@ -897,7 +611,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_Button24 : Object + public class Xcls_Button16 : Object { public Gtk.Button el; private Xcls_MainWindow _this; @@ -907,7 +621,7 @@ public class Xcls_MainWindow : Object public bool always_show_image; // ctor - public Xcls_Button24(Xcls_MainWindow _owner ) + public Xcls_Button16(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -932,7 +646,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_Button25 : Object + public class Xcls_Button17 : Object { public Gtk.Button el; private Xcls_MainWindow _this; @@ -942,7 +656,7 @@ public class Xcls_MainWindow : Object public bool always_show_image; // ctor - public Xcls_Button25(Xcls_MainWindow _owner ) + public Xcls_Button17(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -975,7 +689,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_MenuButton26 : Object + public class Xcls_MenuButton18 : Object { public Gtk.MenuButton el; private Xcls_MainWindow _this; @@ -985,7 +699,7 @@ public class Xcls_MainWindow : Object public bool always_show_image; // ctor - public Xcls_MenuButton26(Xcls_MainWindow _owner ) + public Xcls_MenuButton18(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.MenuButton(); @@ -1020,7 +734,7 @@ public class Xcls_MainWindow : Object // my vars (dec) // set gobject values - var child_1 = new Xcls_Box28( _this ); + var child_1 = new Xcls_Box20( _this ); child_1.ref(); this.el.set_child ( child_1.el ); @@ -1033,7 +747,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_Box28 : Object + public class Xcls_Box20 : Object { public Gtk.Box el; private Xcls_MainWindow _this; @@ -1042,7 +756,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Box28(Xcls_MainWindow _owner ) + public Xcls_Box20(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); @@ -1050,17 +764,17 @@ public class Xcls_MainWindow : Object // my vars (dec) // set gobject values - var child_1 = new Xcls_Button29( _this ); + var child_1 = new Xcls_Button21( _this ); child_1.ref(); this.el.append( child_1.el ); - var child_2 = new Xcls_Button30( _this ); + var child_2 = new Xcls_Button22( _this ); child_2.ref(); this.el.append( child_2.el ); } // user defined functions } - public class Xcls_Button29 : Object + public class Xcls_Button21 : Object { public Gtk.Button el; private Xcls_MainWindow _this; @@ -1069,7 +783,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Button29(Xcls_MainWindow _owner ) + public Xcls_Button21(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -1088,7 +802,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_Button30 : Object + public class Xcls_Button22 : Object { public Gtk.Button el; private Xcls_MainWindow _this; @@ -1097,7 +811,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Button30(Xcls_MainWindow _owner ) + public Xcls_Button22(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -1119,7 +833,7 @@ public class Xcls_MainWindow : Object - public class Xcls_Label31 : Object + public class Xcls_Label23 : Object { public Gtk.Label el; private Xcls_MainWindow _this; @@ -1128,7 +842,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Label31(Xcls_MainWindow _owner ) + public Xcls_Label23(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Label( " " ); @@ -1186,7 +900,7 @@ public class Xcls_MainWindow : Object // user defined functions } - public class Xcls_Box33 : Object + public class Xcls_Box25 : Object { public Gtk.Box el; private Xcls_MainWindow _this; @@ -1195,7 +909,7 @@ public class Xcls_MainWindow : Object // my vars (def) // ctor - public Xcls_Box33(Xcls_MainWindow _owner ) + public Xcls_Box25(Xcls_MainWindow _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); @@ -1575,4 +1289,1171 @@ public class Xcls_MainWindow : Object + public class Xcls_Box33 : Object + { + public Gtk.Box el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Box33(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_SearchBar34( _this ); + child_1.ref(); + this.el.append( child_1.el ); + var child_2 = new Xcls_Box36( _this ); + child_2.ref(); + this.el.append( child_2.el ); + var child_3 = new Xcls_Paned45( _this ); + child_3.ref(); + this.el.append( child_3.el ); + } + + // user defined functions + } + public class Xcls_SearchBar34 : Object + { + public Gtk.SearchBar el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SearchBar34(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.SearchBar(); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + this.el.search_mode_enabled = true; + new Xcls_filesearch( _this ); + this.el.child = _this.filesearch.el; + } + + // user defined functions + } + public class Xcls_filesearch : Object + { + public Gtk.SearchEntry el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_filesearch(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.filesearch = this; + this.el = new Gtk.SearchEntry(); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + this.el.placeholder_text = "Search for file"; + + //listeners + this.el.search_changed.connect( ( ) => { + + _this.windowsearch.el.set_search(this.el.get_text()); + }); + } + + // user defined functions + } + + + public class Xcls_Box36 : Object + { + public Gtk.Box el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Box36(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + new Xcls_open_projects_btn( _this ); + this.el.append( _this.open_projects_btn.el ); + var child_2 = new Xcls_Button41( _this ); + child_2.ref(); + this.el.append( child_2.el ); + } + + // user defined functions + } + public class Xcls_open_projects_btn : Object + { + public Gtk.Button el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_open_projects_btn(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.open_projects_btn = this; + this.el = new Gtk.Button(); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + var child_1 = new Xcls_Box38( _this ); + this.el.child = child_1.el; + + //listeners + this.el.clicked.connect( ( ) => { + _this.windowstate.showPopoverFiles(this.el, _this.project, false); + }); + } + + // user defined functions + } + public class Xcls_Box38 : Object + { + public Gtk.Box el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Box38(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_Image39( _this ); + child_1.ref(); + this.el.append( child_1.el ); + var child_2 = new Xcls_Label40( _this ); + child_2.ref(); + this.el.append( child_2.el ); + } + + // user defined functions + } + public class Xcls_Image39 : Object + { + public Gtk.Image el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Image39(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Image(); + + // my vars (dec) + + // set gobject values + this.el.icon_name = "document-open"; + this.el.margin_end = 4; + } + + // user defined functions + } + + public class Xcls_Label40 : Object + { + public Gtk.Label el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Label40(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Label( "Open File" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + public class Xcls_Button41 : Object + { + public Gtk.Button el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Button41(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Button(); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + var child_1 = new Xcls_Box42( _this ); + this.el.child = child_1.el; + + //listeners + this.el.clicked.connect( ( ) => { + _this.splitview.el.show_sidebar = false; + _this.windowstate.showPopoverFiles(_this.el, _this.project, true); + }); + } + + // user defined functions + } + public class Xcls_Box42 : Object + { + public Gtk.Box el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Box42(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_Image43( _this ); + child_1.ref(); + this.el.append( child_1.el ); + var child_2 = new Xcls_Label44( _this ); + child_2.ref(); + this.el.append( child_2.el ); + } + + // user defined functions + } + public class Xcls_Image43 : Object + { + public Gtk.Image el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Image43(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Image(); + + // my vars (dec) + + // set gobject values + this.el.icon_name = "window-new"; + this.el.margin_end = 4; + } + + // user defined functions + } + + public class Xcls_Label44 : Object + { + public Gtk.Label el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Label44(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Label( "New Window" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + + public class Xcls_Paned45 : Object + { + public Gtk.Paned el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_Paned45(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL ); + + // my vars (dec) + + // set gobject values + this.el.vexpand = true; + var child_1 = new Xcls_ScrolledWindow46( _this ); + this.el.start_child = child_1.el; + var child_2 = new Xcls_ScrolledWindow60( _this ); + this.el.end_child = child_2.el; + } + + // user defined functions + } + public class Xcls_ScrolledWindow46 : Object + { + public Gtk.ScrolledWindow el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ScrolledWindow46(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.ScrolledWindow(); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_ColumnView47( _this ); + this.el.child = child_1.el; + } + + // user defined functions + } + public class Xcls_ColumnView47 : Object + { + public Gtk.ColumnView el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ColumnView47(Xcls_MainWindow _owner ) + { + _this = _owner; + new Xcls_winsel( _this ); + this.el = new Gtk.ColumnView( _this.winsel.el ); + + // my vars (dec) + + // set gobject values + new Xcls_projcol( _this ); + this.el.append_column( _this.projcol.el ); + new Xcls_filecol( _this ); + this.el.append_column ( _this.filecol.el ); + } + + // user defined functions + } + public class Xcls_winsel : Object + { + public Gtk.SingleSelection el; + private Xcls_MainWindow _this; + + + // my vars (def) + public bool selecting; + + // ctor + public Xcls_winsel(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.winsel = this; + var child_1 = new Xcls_SortListModel49( _this ); + child_1.ref(); + this.el = new Gtk.SingleSelection( child_1.el ); + + // my vars (dec) + this.selecting = false; + + // set gobject values + this.el.can_unselect = false; + this.el.autoselect = false; + + //listeners + this.el.notify["selected"].connect( () => { + if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) { + return; + } + var ws = this.el.selected_item as WindowState; + if (ws == null) { + return; + } + if (ws.file.path != _this.windowstate.file.path) { + _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1); + _this.splitview.el.show_sidebar = false; + } + + this.selectCurrent(); + }); + } + + // user defined functions + public void selectCurrent () { + this.selecting = true; + + for(var i = 0;i < this.el.get_n_items(); i++) { + var ws = this.el.get_item(i) as WindowState; + if (ws.file.path == _this.windowstate.file.path) { + this.el.selected = i; + break; + } + } + this.selecting = false; + + + } + } + public class Xcls_SortListModel49 : Object + { + public Gtk.SortListModel el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SortListModel49(Xcls_MainWindow _owner ) + { + _this = _owner; + new Xcls_winfilter( _this ); + var child_2 = new Xcls_StringSorter54( _this ); + child_2.ref(); + this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_winfilter : Object + { + public Gtk.FilterListModel el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_winfilter(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.winfilter = this; + new Xcls_winmodel( _this ); + new Xcls_windowsearch( _this ); + this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_windowsearch : Object + { + public Gtk.StringFilter el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_windowsearch(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.windowsearch = this; + var child_1 = new Xcls_PropertyExpression52( _this ); + child_1.ref(); + this.el = new Gtk.StringFilter( child_1.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_PropertyExpression52 : Object + { + public Gtk.PropertyExpression el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_PropertyExpression52(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + public class Xcls_winmodel : Object + { + public GLib.ListStore el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_winmodel(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.winmodel = this; + this.el = new GLib.ListStore( typeof(WindowState) ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + public class Xcls_StringSorter54 : Object + { + public Gtk.StringSorter el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_StringSorter54(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_PropertyExpression55( _this ); + child_1.ref(); + this.el = new Gtk.StringSorter( child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.ignore_case = true; + } + + // user defined functions + } + public class Xcls_PropertyExpression55 : Object + { + public Gtk.PropertyExpression el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_PropertyExpression55(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + + public class Xcls_projcol : Object + { + public Gtk.ColumnViewColumn el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_projcol(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.projcol = this; + var child_1 = new Xcls_SignalListItemFactory57( _this ); + child_1.ref(); + this.el = new Gtk.ColumnViewColumn( "Project", child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.id = "projcol"; + this.el.expand = true; + this.el.resizable = true; + } + + // user defined functions + } + public class Xcls_SignalListItemFactory57 : Object + { + public Gtk.SignalListItemFactory el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SignalListItemFactory57(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.SignalListItemFactory(); + + // my vars (dec) + + // set gobject values + + //listeners + this.el.setup.connect( (listitem) => { + var lbl = new Gtk.Label(""); + (listitem as Gtk.ListItem).set_child(lbl); + lbl.justify = Gtk.Justification.LEFT; + lbl.xalign = 0; + lbl.use_markup = true; + lbl.ellipsize = Pango.EllipsizeMode.START; + + (listitem as Gtk.ListItem).activatable = true; + }); + this.el.bind.connect( (listitem) => { + var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child(); + var item = (listitem as Gtk.ListItem).get_item() as WindowState; + + lb.label = item.project.name; + + + + + }); + } + + // user defined functions + } + + + public class Xcls_filecol : Object + { + public Gtk.ColumnViewColumn el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_filecol(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.filecol = this; + var child_1 = new Xcls_SignalListItemFactory59( _this ); + child_1.ref(); + this.el = new Gtk.ColumnViewColumn( "File", child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.id = "filecol"; + this.el.expand = true; + this.el.resizable = true; + } + + // user defined functions + } + public class Xcls_SignalListItemFactory59 : Object + { + public Gtk.SignalListItemFactory el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.SignalListItemFactory(); + + // my vars (dec) + + // set gobject values + + //listeners + this.el.setup.connect( (listitem) => { + var lbl = new Gtk.Label(""); + (listitem as Gtk.ListItem).set_child(lbl); + lbl.justify = Gtk.Justification.LEFT; + lbl.xalign = 0; + lbl.use_markup = true; + lbl.ellipsize = Pango.EllipsizeMode.START; + + (listitem as Gtk.ListItem).activatable = true; + }); + this.el.bind.connect( (listitem) => { + var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child(); + var item = (listitem as Gtk.ListItem).get_item() as WindowState; + + lb.label = item.file.relpath; + + + + + }); + } + + // user defined functions + } + + + + + public class Xcls_ScrolledWindow60 : Object + { + public Gtk.ScrolledWindow el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ScrolledWindow60(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.ScrolledWindow(); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + this.el.vexpand = true; + var child_1 = new Xcls_ColumnView61( _this ); + this.el.child = child_1.el; + } + + // user defined functions + } + public class Xcls_ColumnView61 : Object + { + public Gtk.ColumnView el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ColumnView61(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_SingleSelection62( _this ); + child_1.ref(); + this.el = new Gtk.ColumnView( child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.hexpand = true; + this.el.vexpand = true; + var child_2 = new Xcls_ColumnViewColumn70( _this ); + child_2.ref(); + this.el.append_column( child_2.el ); + var child_3 = new Xcls_ColumnViewColumn72( _this ); + child_3.ref(); + this.el.append_column ( child_3.el ); + } + + // user defined functions + } + public class Xcls_SingleSelection62 : Object + { + public Gtk.SingleSelection el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SingleSelection62(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_SortListModel63( _this ); + child_1.ref(); + this.el = new Gtk.SingleSelection( child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.can_unselect = true; + this.el.autoselect = false; + } + + // user defined functions + } + public class Xcls_SortListModel63 : Object + { + public Gtk.SortListModel el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SortListModel63(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_FilterListModel64( _this ); + child_1.ref(); + var child_2 = new Xcls_StringSorter68( _this ); + child_2.ref(); + this.el = new Gtk.SortListModel( child_1.el, child_2.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_FilterListModel64 : Object + { + public Gtk.FilterListModel el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_FilterListModel64(Xcls_MainWindow _owner ) + { + _this = _owner; + new Xcls_histmodel( _this ); + new Xcls_histsearch( _this ); + this.el = new Gtk.FilterListModel( _this.histmodel.el, _this.histsearch.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_histmodel : Object + { + public GLib.ListStore el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_histmodel(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.histmodel = this; + this.el = new GLib.ListStore( typeof(WindowState) ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + public class Xcls_histsearch : Object + { + public Gtk.StringFilter el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_histsearch(Xcls_MainWindow _owner ) + { + _this = _owner; + _this.histsearch = this; + var child_1 = new Xcls_PropertyExpression67( _this ); + child_1.ref(); + this.el = new Gtk.StringFilter( child_1.el ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + public class Xcls_PropertyExpression67 : Object + { + public Gtk.PropertyExpression el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_PropertyExpression67(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + public class Xcls_StringSorter68 : Object + { + public Gtk.StringSorter el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_StringSorter68(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_PropertyExpression69( _this ); + child_1.ref(); + this.el = new Gtk.StringSorter( child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.ignore_case = true; + } + + // user defined functions + } + public class Xcls_PropertyExpression69 : Object + { + public Gtk.PropertyExpression el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_PropertyExpression69(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + + public class Xcls_ColumnViewColumn70 : Object + { + public Gtk.ColumnViewColumn el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ColumnViewColumn70(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_SignalListItemFactory71( _this ); + child_1.ref(); + this.el = new Gtk.ColumnViewColumn( "Project", child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.expand = true; + this.el.resizable = true; + } + + // user defined functions + } + public class Xcls_SignalListItemFactory71 : Object + { + public Gtk.SignalListItemFactory el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SignalListItemFactory71(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.SignalListItemFactory(); + + // my vars (dec) + + // set gobject values + + //listeners + this.el.setup.connect( (listitem) => { + var lbl = new Gtk.Label(""); + (listitem as Gtk.ListItem).set_child(lbl); + lbl.justify = Gtk.Justification.LEFT; + lbl.xalign = 1; + lbl.use_markup = true; + lbl.ellipsize = Pango.EllipsizeMode.START; + + (listitem as Gtk.ListItem).activatable = true; + }); + this.el.bind.connect( (listitem) => { + var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child(); + var item = (listitem as Gtk.ListItem).get_item() as WindowState; + + lb.label = item.project.name; + + + + + }); + } + + // user defined functions + } + + + public class Xcls_ColumnViewColumn72 : Object + { + public Gtk.ColumnViewColumn el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_ColumnViewColumn72(Xcls_MainWindow _owner ) + { + _this = _owner; + var child_1 = new Xcls_SignalListItemFactory73( _this ); + child_1.ref(); + this.el = new Gtk.ColumnViewColumn( "File", child_1.el ); + + // my vars (dec) + + // set gobject values + this.el.expand = true; + this.el.resizable = true; + } + + // user defined functions + } + public class Xcls_SignalListItemFactory73 : Object + { + public Gtk.SignalListItemFactory el; + private Xcls_MainWindow _this; + + + // my vars (def) + + // ctor + public Xcls_SignalListItemFactory73(Xcls_MainWindow _owner ) + { + _this = _owner; + this.el = new Gtk.SignalListItemFactory(); + + // my vars (dec) + + // set gobject values + + //listeners + this.el.setup.connect( (listitem) => { + var lbl = new Gtk.Label(""); + (listitem as Gtk.ListItem).set_child(lbl); + lbl.justify = Gtk.Justification.LEFT; + lbl.xalign = 1; + lbl.use_markup = true; + lbl.ellipsize = Pango.EllipsizeMode.START; + + (listitem as Gtk.ListItem).activatable = true; + }); + this.el.bind.connect( (listitem) => { + var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child(); + var item = (listitem as Gtk.ListItem).get_item() as WindowState; + + lb.label = item.file.relpath; + + + + + }); + } + + // user defined functions + } + + + + + + + } diff --git a/src/Builder4/WindowState.vala b/src/Builder4/WindowState.vala index f3ea8c8ab..02005d532 100644 --- a/src/Builder4/WindowState.vala +++ b/src/Builder4/WindowState.vala @@ -42,8 +42,12 @@ public class WindowState : Object public Xcls_PopoverFileDetails file_details; public Xcls_ValaCompileResults compile_results; - // dialogs?? + // used by window list.. + public string file_name { + owned get { return this.file.relpath; } + private set {} + } //public Palete.ValaSource valasource; // the spawner that runs the vala compiler. @@ -52,7 +56,12 @@ public class WindowState : Object // ctor public WindowState(Xcls_MainWindow win) { - this.win = win; + this.win = win; + } + + public void init() + { + // initialize // left elements.. @@ -652,7 +661,7 @@ public class WindowState : Object this.win.project = file.project; this.project = file.project; this.file = file; - BuilderApplication.updateWindows(); + file.getLanguageServer().document_open(file); BuilderApplication.showSpinner("spinner", "document open sent"); diff --git a/src/JsRender/Node.vala b/src/JsRender/Node.vala index 8d64b09ab..229021ddc 100644 --- a/src/JsRender/Node.vala +++ b/src/JsRender/Node.vala @@ -363,7 +363,10 @@ public class JsRender.Node : GLib.Object { owned get { return this.fqn(); } private set {} } - + public string NS { // for sorting + owned get { return this.props.has_key("xns") ? this.props.get("xns").val : ""; } + private set {} + } public string fqn() { if (!this.hasXnsType ()) { diff --git a/src/JsRender/NodeToGlade.vala b/src/JsRender/NodeToGlade.vala index 785db383f..d796ce751 100644 --- a/src/JsRender/NodeToGlade.vala +++ b/src/JsRender/NodeToGlade.vala @@ -99,6 +99,14 @@ public class JsRender.NodeToGlade : Object { if (gdata.inherits.contains("Gtk.Native")&& !is_top) { return doc; } + // what namespaces are supported + switch(this.node.NS) { + case "Gtk": + case "Webkit": //?? + break; + default: + return doc; + } // other problems!!! diff --git a/src/Main.vala b/src/Main.vala index 82465d657..a906fcd85 100644 --- a/src/Main.vala +++ b/src/Main.vala @@ -23,11 +23,11 @@ int main (string[] args) { app.activate.connect(() => { var w = new Xcls_MainWindow(); - + w.initChildren(); BuilderApplication.addWindow(w); // it looks like showall after children causes segfault on ubuntu 14.4 - w.initChildren(); + w.windowstate.init(); // w.windowstate.showPopoverFiles(w.open_projects_btn.el, null, false); w.show();