From da7e7dde8c571ffefd235665742d8df1596777b1 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 7 Feb 2024 15:31:03 +0800 Subject: [PATCH] Fix #8019 - tidy up resource usage --- .gitignore | 1 + meson.build | 2 +- resources/gresources.xml | 6 +- resources/html/RooUsage.txt | 767 -------------------------------- src/Builder4/WindowRooView.bjs | 76 ++-- src/Builder4/WindowRooView.vala | 127 +++--- src/Palete/Roo.vala | 17 +- src/Project/Project.vala | 3 + src/Resources.vala | 23 +- 9 files changed, 135 insertions(+), 887 deletions(-) delete mode 100644 resources/html/RooUsage.txt diff --git a/.gitignore b/.gitignore index 36e9fcdbe..0dcb6770a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ debian/roobuilder debian/auto* debian/debhelper* debian/files +build-dir/* .flatpak-builder/* .gdb_history diff --git a/meson.build b/meson.build index dda42709a..ecee95146 100644 --- a/meson.build +++ b/meson.build @@ -78,7 +78,7 @@ gnome.post_install(gtk_update_icon_cache : true) roobuilder_resources = gnome.compile_resources( 'roobuilder-resources', 'resources/gresources.xml', - source_dir: [ 'resources/glade-icons', 'resources/html', 'resources/Editors' ], + source_dir: [ 'resources/glade-icons', 'resources/html', 'resources/data', 'resources/Editors' ], c_name: 'roobuilder_resources' ) diff --git a/resources/gresources.xml b/resources/gresources.xml index c85b0866d..1030680af 100644 --- a/resources/gresources.xml +++ b/resources/gresources.xml @@ -156,13 +156,15 @@ widget-vte-terminal.png - bootstrap4.builder.html - RooUsage.txt bootstrap.builder.html + bootstrap4.builder.html mailer.builder.html roo.builder.html roo.builder.js + + roodata.json + diff --git a/resources/html/RooUsage.txt b/resources/html/RooUsage.txt deleted file mode 100644 index 18f06c45c..000000000 --- a/resources/html/RooUsage.txt +++ /dev/null @@ -1,767 +0,0 @@ - -// what can be added where... - -left: - *top -right: - Roo.LayoutDialog - Roo.NestedLayoutPanel - Roo.ContentPanel - Roo.GridPanel - Roo.TreePanel - Roo.bootstrap.Body - Roo.bootstrap.Modal - Roo.bootstrap.layout.Border - Roo.bootstrap.panel.Content - Roo.bootstrap.panel.Nest - Roo.bootstrap.panel.Grid - Roo.bootstrap.Container - Roo.bootstrap.Popover - Roo.mailer.Body - Roo.doc.Entry - - - -// added with a property.. (*prop) - -left: - Roo.LayoutDialog:center - Roo.LayoutDialog:east - Roo.LayoutDialog:west - Roo.LayoutDialog:south - Roo.LayoutDialog:north - Roo.BorderLayout:center - Roo.BorderLayout:east - Roo.BorderLayout:west - Roo.BorderLayout:south - Roo.BorderLayout:north -right: - Roo.LayoutRegion - -// add with region? region= - -left: - Roo.LayoutDialog - Roo.BorderLayout -right: - Roo.ContentPanel - Roo.NestedLayoutPanel - Roo.GridPanel - Roo.TreePanel - -// should probably look like this -// Roo.ContentPanel:region=center -// Roo.NestedLayoutPanel:region=center -// Roo.GridPanel:region=center -// Roo.TreePanel:region=center - - -left: - Roo.NestedLayoutPanel:layout -right: - Roo.BorderLayout - - -left: - Roo.ContentPanel -right: - Roo.form.Form - Roo.JsonView - Roo.View - -// some popup menus.. -left: - Roo.ContentPanel:menu - Roo.NestedLayoutPanel:menu - Roo.GridPanel:menu - Roo.TreePanel:menu -right: - Roo.menu.Menu - - -// Parent items -left: - Roo.form.Form - Roo.form.FieldSet - Roo.form.Column - Roo.form.Row - -right: - Roo.form.Column - Roo.form.FieldSet - Roo.form.Row - Roo.form.Hidden - Roo.form.TextField - Roo.form.GridField - Roo.form.DateField - Roo.form.MonthField - Roo.form.NumberField - Roo.form.Checkbox - Roo.form.Radio - Roo.form.ComboBox - Roo.form.ComboBoxArray - Roo.form.TextArea - Roo.form.HtmlEditor - Roo.form.FCKeditor - Roo.Button - Roo.form.TextItem - -left: - Roo.form.HtmlEditor:toolbars[] -right: - Roo.form.HtmlEditor.ToolbarStandard - Roo.form.HtmlEditor.ToolbarContext - -left: - Roo.form.HtmlEditor.ToolbarStandard:btns[] - Roo.form.HtmlEditor.ToolbarContext:btns[] -right: - Roo.form.TextField - Roo.form.DateField - Roo.form.MonthField - Roo.form.NumberField - Roo.form.Checkbox - Roo.form.Radio - Roo.form.ComboBox - Roo.form.TextArea - Roo.Toolbar.Button - Roo.Toolbar.Fill - Roo.Toolbar.Separator - Roo.Toolbar.Spacer - Roo.Toolbar.SplitButton - Roo.Toolbar.TextItem - -left: - Roo.grid.GridEditor:field -right: - Roo.form.TextField - Roo.form.DateField - Roo.form.MonthField - Roo.form.NumberField - Roo.form.Checkbox - Roo.form.Radio - Roo.form.ComboBox - Roo.form.TextArea - - - -left: - Roo.LayoutDialog:buttons[] - Roo.form.Form:buttons[] -right: - Roo.Button - - - - - -//Toolbar -left: - Roo.Toolbar - Roo.PagingToolbar -right: - Roo.Toolbar.Button - Roo.Toolbar.Fill - Roo.Toolbar.Separator - Roo.Toolbar.Spacer - Roo.Toolbar.SplitButton - Roo.Toolbar.TextItem - Roo.form.ComboBox - Roo.form.ComboBoxArray - Roo.form.DateField - Roo.form.MonthField - Roo.form.TextField - - -left: - Roo.Toolbar.Button:menu - Roo.Toolbar.SplitButton:menu - Roo.menu.Item:menu -right: - Roo.menu.Menu - - - - -//Menu -left: - Roo.menu.Menu -right: - Roo.menu.CheckItem - Roo.menu.ColorItem - Roo.menu.DateItem - Roo.menu.DateMenu - Roo.menu.Separator - Roo.menu.TextItem - Roo.menu.Item - - - - -//Grids -left: - Roo.GridPanel:grid -right: - Roo.grid.Grid - Roo.grid.EditorGrid - Roo.grid.PropertyGrid - - -left: - Roo.grid.Grid:sm - Roo.grid.EditorGrid:sm -right: - Roo.grid.CellSelectionModel - Roo.grid.RowSelectionModel - -left: - Roo.grid.Grid:view -right: - Roo.grid.EditorGrid:view - Roo.grid.GridView - -left: - Roo.grid.Grid:cm[] - Roo.grid.EditorGrid:cm[] -right: - Roo.grid.ColumnModel - -left: - Roo.grid.ColumnModel:editor -right: - Roo.grid.GridEditor - - -left: - Roo.grid.EditorGrid:footer - Roo.grid.Grid:footer - Roo.Grid:footer -right: - Roo.PagingToolbar - - -left: - Roo.grid.EditorGrid:toolbar - Roo.grid.Grid:toolbar - Roo.Grid:toolbar - Roo.ContentPanel:toolbar - Roo.TreePanel:toolbar -right: - Roo.Toolbar - - - - -//Tree -left: - Roo.TreePanel:tree -right: - Roo.tree.TreePanel - -left: - Roo.tree.TreePanel:root -right: - Roo.tree.AsyncTreeNode - Roo.tree.TreeNode - -left: - Roo.tree.TreePanel:editor -right: - Roo.tree.TreeEditor - -left: - Roo.tree.TreeEditor:field -right: - Roo.form.TextField - - - -left: - Roo.tree.TreePanel:loader -right: - Roo.tree.TreeLoader - -left: - Roo.tree.TreePanel:sm -right: - Roo.tree.DefaultSelectionModel - Roo.tree.MultiSelectionModel - - -// combos - -left: - Roo.grid.EditorGrid:ds - Roo.grid.Grid:ds - Roo.form.ComboBox:store - Roo.View:store - Roo.JsonView:store - Roo.bootstrap.ComboBox:store - Roo.bootstrap.Calendar:store - Roo.bootstrap.Table:store - Roo.bootstrap.PhoneInput -right: - Roo.data.Store - Roo.data.SimpleStore - -left: - Roo.form.ComboBoxArray:combo -right: - Roo.form.ComboBox - -left: - Roo.data.Store:proxy -right: - Roo.data.HttpProxy - Roo.data.MemoryProxy - - -left: - Roo.data.Store:reader -right: - Roo.data.JsonReader - Roo.data.ArrayReader - Roo.data.XmlReader - -left: - Roo.View:tpl - Roo.JsonView:tpl -right: - Roo.Template - - - //drag drop.. -left: - Roo.grid.Grid:dropTarget -right: - Roo.dd.DropTarget - - - - -// bootstrap? - -left: - Roo.bootstrap.Body - Roo.bootstrap.Container - Roo.bootstrap.Card - Roo.bootstrap.Modal - Roo.bootstrap.Column - Roo.bootstrap.Row - Roo.bootstrap.TabPanel - Roo.bootstrap.Element - Roo.bootstrap.Form - Roo.bootstrap.UploadCropbox - Roo.bootstrap.Popover - Roo.bootstrap.Link - Roo.bootstrap.panel.Content -right: - Roo.bootstrap.Container - Roo.bootstrap.Card - Roo.bootstrap.Button - Roo.bootstrap.ButtonGroup - Roo.bootstrap.ButtonUploader - Roo.bootstrap.Column - Roo.bootstrap.Form - Roo.bootstrap.Navbar - Roo.bootstrap.NavGroup - Roo.bootstrap.NavSimplebar - Roo.bootstrap.NavHeaderbar - Roo.bootstrap.NavSidebar - Roo.bootstrap.Row - Roo.bootstrap.Header - Roo.bootstrap.Img - Roo.bootstrap.Link - Roo.bootstrap.Calendar - Roo.bootstrap.Popover - Roo.bootstrap.Input - Roo.bootstrap.TextArea - Roo.bootstrap.Table - Roo.bootstrap.Pagination - Roo.bootstrap.Progress - Roo.bootstrap.TabPanel - Roo.bootstrap.DateField - Roo.bootstrap.MonthField - Roo.bootstrap.TimeField - Roo.bootstrap.CheckBox - Roo.bootstrap.ComboBox - Roo.bootstrap.Element - Roo.bootstrap.HtmlEditor - Roo.bootstrap.MessageBar - Roo.bootstrap.dash.NumberBox - Roo.bootstrap.Graph - Roo.bootstrap.dash.TabBox - Roo.bootstrap.menu.Menu - Roo.bootstrap.LocationPicker - Roo.bootstrap.Alert - Roo.bootstrap.TabGroup - Roo.bootstrap.LayoutMasonry - Roo.bootstrap.UploadCropbox - Roo.bootstrap.DocumentManager - Roo.bootstrap.DocumentViewer - Roo.bootstrap.PagingToolbar - Roo.bootstrap.NavProgressBar - Roo.bootstrap.FieldLabel - Roo.bootstrap.DateSplitField - Roo.bootstrap.Brick - Roo.bootstrap.NumberField - Roo.bootstrap.DocumentSlider - Roo.bootstrap.RadioSet - Roo.bootstrap.SecurePass - Roo.bootstrap.PhoneInput - Roo.bootstrap.MoneyField - Roo.bootstrap.BezierSignature - Roo.bootstrap.CardUploader - Roo.bootstrap.breadcrumb.Nav - - -left: - Roo.bootstrap.Card -right: - Roo.bootstrap.CardHeader - Roo.bootstrap.CardImageTop - Roo.bootstrap.CardFooter - -left: - Roo.bootstrap.TabGroup -right: - Roo.bootstrap.TabPanel - -left: - Roo.bootstrap.RadioSet -right: - Roo.bootstrap.Radio - - -left: - Roo.bootstrap.Progress -right: - Roo.bootstrap.ProgressBar - -left: - Roo.bootstrap.Table -right: - Roo.bootstrap.TableRow - Roo.bootstrap.TableCell - Roo.bootstrap.TableBody - -left: - Roo.bootstrap.Table:cm[] -right: - Roo.grid.ColumnModel - - -#-??? it this correct? -left: - Roo.bootstrap.Table:sm -right: - Roo.bootstrap.Table.RowSelectionModel - - -left: - Roo.bootstrap.Table:footer -right: - Roo.bootstrap.PagingToolbar - -left: - Roo.bootstrap.PagingToolbar:buttons[] -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - -left: - Roo.bootstrap.PagingToolbar:store -right: - Roo.data.Store - -left: - Roo.bootstrap.NavProgressBar:bullets[] -right: - Roo.bootstrap.NavProgressItem - -left: - Roo.bootstrap.TableBody -right: - Roo.bootstrap.TableRow - Roo.bootstrap.TableCell - -left: - Roo.bootstrap.TableRow -right: - Roo.bootstrap.TableCell - -left: - Roo.bootstrap.TableCell -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - -left: - Roo.bootstrap.ButtonGroup -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - Roo.bootstrap.Form - -left: - Roo.bootstrap.Button:menu - Roo.bootstrap.NavItem:menu - Roo.bootstrap.NavSidebarItem:menu -right: - Roo.bootstrap.Menu - -left: - Roo.bootstrap.Menu -right: - Roo.bootstrap.MenuItem - -left: - Roo.bootstrap.Navbar - Roo.bootstrap.NavSimplebar - Roo.bootstrap.NavHeaderbar - Roo.bootstrap.NavSidebar - Roo.bootstrap.PopoverNav -right: - Roo.bootstrap.NavGroup - Roo.bootstrap.Form - Roo.bootstrap.Row - Roo.bootstrap.Column - Roo.bootstrap.Container - Roo.bootstrap.Link - -left: - Roo.bootstrap.NavGroup -right: - Roo.bootstrap.NavItem - Roo.bootstrap.NavSidebarItem - - -left: - Roo.bootstrap.Form - Roo.bootstrap.Container - Roo.bootstrap.Card -right: - Roo.bootstrap.Input - Roo.bootstrap.TextArea - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - Roo.bootstrap.ComboBox - Roo.bootstrap.Container - Roo.bootstrap.Card - Roo.bootstrap.Row - Roo.bootstrap.TabPanel - Roo.bootstrap.DateField - Roo.bootstrap.MonthField - Roo.bootstrap.TimeField - Roo.bootstrap.CheckBox - Roo.bootstrap.Radio -// Roo.bootstrap.Fieldset - -left: - Roo.bootstrap.Body -right: - Roo.bootstrap.Modal - -left: - Roo.bootstrap.Modal:buttons[] -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - -left: - Roo.bootstrap.Modal:tmpl -right: - Roo.Template - Roo.XTemplate - Roo.DomTemplate - -left: - Roo.bootstrap.Modal -right: - Roo.bootstrap.layout.Border - -left: - Roo.bootstrap.Header -right: - Roo.bootstrap.Container - -left: - Roo.bootstrap.NavItem - Roo.bootstrap.NavSidebarItem -right: - Roo.bootstrap.Container - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - -left: - Roo.bootstrap.Pagination -right: - Roo.bootstrap.PaginationItem - -left: - Roo.bootstrap.Input:before - Roo.bootstrap.Input:after -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - -left: - Roo.mailer.Body -right: - Roo.mailer.BodyContainer - -left: - Roo.mailer.BodyContainer -right: - Roo.mailer.Block - -left: - Roo.mailer.Block -right: - Roo.mailer.Column - -left: - Roo.mailer.Column - Roo.mailer.Block -right: - Roo.bootstrap.Header - Roo.bootstrap.Container - Roo.bootstrap.Image - Roo.bootstrap.Link -left: - Roo.bootstrap.dash.TabBox -right: - Roo.bootstrap.dash.TabPane - -left: - Roo.bootstrap.dash.TabPane -right: - Roo.bootstrap.Graph - Roo.bootstrap.Column - - -left: - Roo.bootstrap.menu.Menu -right: - Roo.bootstrap.menu.Item - Roo.bootstrap.menu.Separator - -left: - Roo.bootstrap.menu.Item -right: - Roo.bootstrap.menu.Menu - -left: - Roo.bootstrap.MenuItem -right: - Roo.bootstrap.Button - Roo.bootstrap.ButtonUploader - Roo.bootstrap.Row - Roo.bootstrap.Column - Roo.bootstrap.Container - -left: - Roo.bootstrap.LayoutMasonry -right: - Roo.bootstrap.Element - Roo.bootstrap.Image - Roo.bootstrap.MasonryBrick - - -// bootstrap layout - -left: - Roo.bootstrap.layout.Border:center - Roo.bootstrap.layout.Border:east - Roo.bootstrap.layout.Border:west - Roo.bootstrap.layout.Border:south - Roo.bootstrap.layout.Border:north -right: - Roo.bootstrap.layout.Region - - -left: - Roo.bootstrap.layout.Border -right: - Roo.bootstrap.panel.Content - Roo.bootstrap.panel.Nest - Roo.bootstrap.panel.Grid - -left: - Roo.bootstrap.panel.Nest:layout -right: - Roo.bootstrap.layout.Border - -left: - Roo.bootstrap.panel.Grid:grid -right: - Roo.bootstrap.Table - -left: - Roo.bootstrap.panel.Grid:toolbar -right: - Roo.bootstrap.NavSimplebar - -left: - Roo.bootstrap.breadcrumb.Nav -right: - Roo.bootstrap.breadcrumb.Item - - - - -// docbook!!! - -// top level ? - fake body??? - not sure yet.. - -left: - Roo.bootstrap.Body -right: - Roo.doc.Entry - Roo.doc.Book - -left: - Roo.doc.Book -right: - Roo.doc.Entry - - -left: - Roo.doc.Entry -right: - Roo.doc.Synopsis - Roo.doc.Section - -left: - Roo.doc.Synopsis -right: - Roo.doc.Param - -left: - Roo.doc.Section -right: - Roo.doc.Para - Roo.doc.Param - Roo.doc.Example - -left: - Roo.bootstrap.NavSidebar -right: - Roo.doc.NavCategory - - -left: - Roo.doc.NavCategory -right: - Roo.bootstrap.NavGroup - -left: - Roo.bootstrap.MoneyField:store -right: - Roo.data.Store - -left: - Roo.bootstrap.Popover -right: - Roo.bootstrap.PopoverNav - \ No newline at end of file diff --git a/src/Builder4/WindowRooView.bjs b/src/Builder4/WindowRooView.bjs index 6c9452d65..9ceb8035f 100644 --- a/src/Builder4/WindowRooView.bjs +++ b/src/Builder4/WindowRooView.bjs @@ -379,39 +379,37 @@ " this.pendingRedraw = true;", "", " var runhtml = \"\\n\" ;", "", " // fix to make sure they are the same..", " this.runhtml = project.runhtml;", " // need to modify paths", "", - " string inhtml;", + " uint8[] inhtml;", " var base_template = project.base_template;", + " var f = GLib. File.new_for_uri(\"resources:///html/\" + base_template);", " ", - " if (base_template.length > 0 && !FileUtils.test(", - " BuilderApplication.configDirectory() + \"/resources/\" + base_template, FileTest.EXISTS) ", - " ) {", - " print(\"invalid base_template name - using default: %s\\n\", base_template);", - " base_template = \"\";", + " if (base_template.length > 0 && !f.query_exists(null)) {", + " ", + " GLib.debug(\"invalid base_template name - using default: %Scanner\", base_template);", + " f = GLib. File.new_for_uri(\"resources:///html/roo.builder.html\");", " ", " }", " try {", - " GLib.FileUtils.get_contents(", - " BuilderApplication.configDirectory() + \"/resources/\" + ", - " (base_template.length > 0 ? base_template : \"roo.builder.html\")", - " , out inhtml);", + "\t f.load_contents(null, out inhtml, null);", + " ", " ", " } catch (Error e) {", - " inhtml = \"\";", + " inhtml = {};", " } ", " this.renderedData = js;", "", @@ -437,25 +435,25 @@ " //this.runjs = js_src;", " var fc = FakeServerCache.factory_with_data(js_src);", " this.runjs = fc.fname;", + " var html = (string) inhtml;", + "\thtml = html.replace(\"\", runhtml + this.runhtml + ", + " \"\" + ", + " // \"\" + ", + " ", + " \"\");", + " //print(\"LOAD HTML \" + html);", + " ", + " var rootURL = project.rootURL;", + "", " ", - " var html = inhtml.replace(\"\", runhtml + this.runhtml + ", - " \"\" + ", - " // \"\" + ", - " ", - " \"\");", - " //print(\"LOAD HTML \" + html);", - " ", - " var rootURL = project.rootURL;", - " ", - " ", - " ", - " this.el.load_html( html , ", - " //fixme - should be a config option!", - " (rootURL.length > 0 ? rootURL : \"xhttp://localhost/roobuilder/\")", - " );", - " this.initInspector(); ", + " ", + " this.el.load_html( html , ", + " //fixme - should be a config option!", + " (rootURL.length > 0 ? rootURL : \"xhttp://localhost/roobuilder/\")", + " );", + " this.initInspector(); ", " // force the inspector... ", " // this.initInspector();", " ", @@ -498,10 +496,13 @@ "id" : "sourceviewscroll", "items" : [ { + "# Gtk.CssProvider? css" : "null", "# JsRender.Node? node_selected" : "null", "# bool button_is_pressed" : false, "# bool key_is_pressed" : false, "# bool loading" : true, + "# bool show_line_marks" : true, + "# id" : "sourceview", "# int editable_start_pos" : "-1", "# string prop_selected" : "\"\"", "$ xns" : "GtkSource", @@ -573,11 +574,8 @@ "" ], "* pack" : "set_child", - "Gtk.CssProvider css" : "", - "gboolean editable" : false, - "gboolean show_line_marks" : true, - "gboolean show_line_numbers" : true, - "id" : "sourceview", + "bool editable" : false, + "bool show_line_numbers" : true, "items" : [ { "$ xns" : "GtkSource", @@ -1132,7 +1130,7 @@ " ", "" ], - "Gtk.CssProvider css" : "", + "Gtk.CssProvider? css" : "null", "bool hexpand" : true, "id" : "search_entry", "items" : [ diff --git a/src/Builder4/WindowRooView.vala b/src/Builder4/WindowRooView.vala index 2f018c88c..838f910f8 100644 --- a/src/Builder4/WindowRooView.vala +++ b/src/Builder4/WindowRooView.vala @@ -373,7 +373,7 @@ public class Xcls_WindowRooView : Object new Xcls_label_code( _this ); new Xcls_paned( _this ); this.el.append_page ( _this.paned.el , _this.label_preview.el ); - var child_4 = new Xcls_Box13( _this ); + var child_4 = new Xcls_Box12( _this ); child_4.ref(); this.el.append_page ( child_4.el , _this.label_code.el ); } @@ -473,7 +473,7 @@ public class Xcls_WindowRooView : Object // set gobject values this.el.homogeneous = false; this.el.vexpand = true; - var child_1 = new Xcls_Box7( _this ); + var child_1 = new Xcls_Box6( _this ); child_1.ref(); this.el.append( child_1.el ); new Xcls_view( _this ); @@ -482,7 +482,7 @@ public class Xcls_WindowRooView : Object // user defined functions } - public class Xcls_Box7 : Object + public class Xcls_Box6 : Object { public Gtk.Box el; private Xcls_WindowRooView _this; @@ -491,7 +491,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Box7(Xcls_WindowRooView _owner ) + public Xcls_Box6(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); @@ -502,19 +502,19 @@ public class Xcls_WindowRooView : Object this.el.homogeneous = true; this.el.height_request = 20; this.el.vexpand = false; - var child_1 = new Xcls_Button8( _this ); + var child_1 = new Xcls_Button7( _this ); child_1.ref(); this.el.append( child_1.el ); new Xcls_AutoRedraw( _this ); this.el.append( _this.AutoRedraw.el ); - var child_3 = new Xcls_Button10( _this ); + var child_3 = new Xcls_Button9( _this ); child_3.ref(); this.el.append( child_3.el ); } // user defined functions } - public class Xcls_Button8 : Object + public class Xcls_Button7 : Object { public Gtk.Button el; private Xcls_WindowRooView _this; @@ -523,7 +523,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Button8(Xcls_WindowRooView _owner ) + public Xcls_Button7(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -572,7 +572,7 @@ public class Xcls_WindowRooView : Object // user defined functions } - public class Xcls_Button10 : Object + public class Xcls_Button9 : Object { public Gtk.Button el; private Xcls_WindowRooView _this; @@ -581,7 +581,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Button10(Xcls_WindowRooView _owner ) + public Xcls_Button9(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -890,39 +890,37 @@ public class Xcls_WindowRooView : Object this.pendingRedraw = true; var runhtml = "\n" ; // fix to make sure they are the same.. this.runhtml = project.runhtml; // need to modify paths - string inhtml; + uint8[] inhtml; var base_template = project.base_template; + var f = GLib. File.new_for_uri("resources:///html/" + base_template); - if (base_template.length > 0 && !FileUtils.test( - BuilderApplication.configDirectory() + "/resources/" + base_template, FileTest.EXISTS) - ) { - print("invalid base_template name - using default: %s\n", base_template); - base_template = ""; + if (base_template.length > 0 && !f.query_exists(null)) { + + GLib.debug("invalid base_template name - using default: %Scanner", base_template); + f = GLib. File.new_for_uri("resources:///html/roo.builder.html"); } try { - GLib.FileUtils.get_contents( - BuilderApplication.configDirectory() + "/resources/" + - (base_template.length > 0 ? base_template : "roo.builder.html") - , out inhtml); + f.load_contents(null, out inhtml, null); + } catch (Error e) { - inhtml = ""; + inhtml = {}; } this.renderedData = js; @@ -948,25 +946,25 @@ public class Xcls_WindowRooView : Object //this.runjs = js_src; var fc = FakeServerCache.factory_with_data(js_src); this.runjs = fc.fname; + var html = (string) inhtml; + html = html.replace("", runhtml + this.runhtml + + "" + + // "" + + + ""); + //print("LOAD HTML " + html); - var html = inhtml.replace("", runhtml + this.runhtml + - "" + - // "" + - - ""); - //print("LOAD HTML " + html); - - var rootURL = project.rootURL; - - - - this.el.load_html( html , - //fixme - should be a config option! - (rootURL.length > 0 ? rootURL : "xhttp://localhost/roobuilder/") - ); - this.initInspector(); + var rootURL = project.rootURL; + + + + this.el.load_html( html , + //fixme - should be a config option! + (rootURL.length > 0 ? rootURL : "xhttp://localhost/roobuilder/") + ); + this.initInspector(); // force the inspector... // this.initInspector(); @@ -1007,7 +1005,7 @@ public class Xcls_WindowRooView : Object } - public class Xcls_Box13 : Object + public class Xcls_Box12 : Object { public Gtk.Box el; private Xcls_WindowRooView _this; @@ -1016,7 +1014,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Box13(Xcls_WindowRooView _owner ) + public Xcls_Box12(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); @@ -1027,7 +1025,7 @@ public class Xcls_WindowRooView : Object this.el.vexpand = true; new Xcls_sourceviewscroll( _this ); this.el.append( _this.sourceviewscroll.el ); - var child_2 = new Xcls_Box18( _this ); + var child_2 = new Xcls_Box17( _this ); child_2.ref(); this.el.append( child_2.el ); } @@ -1070,8 +1068,9 @@ public class Xcls_WindowRooView : Object public bool loading; public bool button_is_pressed; public string prop_selected; + public Gtk.CssProvider? css; public bool key_is_pressed; - public Gtk.CssProvider css; + public bool show_line_marks; public JsRender.Node? node_selected; // ctor @@ -1086,17 +1085,18 @@ public class Xcls_WindowRooView : Object this.loading = true; this.button_is_pressed = false; this.prop_selected = ""; + this.css = null; this.key_is_pressed = false; + this.show_line_marks = true; this.node_selected = null; // set gobject values this.el.name = "roo-view"; this.el.editable = false; - this.el.show_line_marks = true; this.el.show_line_numbers = true; new Xcls_buffer( _this ); this.el.set_buffer ( _this.buffer.el ); - var child_2 = new Xcls_EventControllerKey17( _this ); + var child_2 = new Xcls_EventControllerKey16( _this ); child_2.ref(); this.el.add_controller ( child_2.el ); @@ -1650,7 +1650,7 @@ public class Xcls_WindowRooView : Object } } - public class Xcls_EventControllerKey17 : Object + public class Xcls_EventControllerKey16 : Object { public Gtk.EventControllerKey el; private Xcls_WindowRooView _this; @@ -1659,7 +1659,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_EventControllerKey17(Xcls_WindowRooView _owner ) + public Xcls_EventControllerKey16(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.EventControllerKey(); @@ -1699,7 +1699,7 @@ public class Xcls_WindowRooView : Object - public class Xcls_Box18 : Object + public class Xcls_Box17 : Object { public Gtk.Box el; private Xcls_WindowRooView _this; @@ -1708,7 +1708,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Box18(Xcls_WindowRooView _owner ) + public Xcls_Box17(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); @@ -1726,7 +1726,7 @@ public class Xcls_WindowRooView : Object this.el.append( _this.nextBtn.el ); new Xcls_backBtn( _this ); this.el.append( _this.backBtn.el ); - var child_5 = new Xcls_MenuButton24( _this ); + var child_5 = new Xcls_MenuButton23( _this ); child_5.ref(); this.el.append( child_5.el ); } @@ -1740,7 +1740,7 @@ public class Xcls_WindowRooView : Object // my vars (def) - public Gtk.CssProvider css; + public Gtk.CssProvider? css; // ctor public Xcls_search_entry(Xcls_WindowRooView _owner ) @@ -1750,12 +1750,13 @@ public class Xcls_WindowRooView : Object this.el = new Gtk.SearchEntry(); // my vars (dec) + this.css = null; // set gobject values this.el.name = "roo-search-entry"; this.el.hexpand = true; this.el.placeholder_text = "Press enter to search"; - var child_1 = new Xcls_EventControllerKey20( _this ); + var child_1 = new Xcls_EventControllerKey19( _this ); child_1.ref(); this.el.add_controller( child_1.el ); @@ -1814,7 +1815,7 @@ public class Xcls_WindowRooView : Object } } - public class Xcls_EventControllerKey20 : Object + public class Xcls_EventControllerKey19 : Object { public Gtk.EventControllerKey el; private Xcls_WindowRooView _this; @@ -1823,7 +1824,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_EventControllerKey20(Xcls_WindowRooView _owner ) + public Xcls_EventControllerKey19(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.EventControllerKey(); @@ -1974,7 +1975,7 @@ public class Xcls_WindowRooView : Object // user defined functions } - public class Xcls_MenuButton24 : Object + public class Xcls_MenuButton23 : Object { public Gtk.MenuButton el; private Xcls_WindowRooView _this; @@ -1984,7 +1985,7 @@ public class Xcls_WindowRooView : Object public bool always_show_image; // ctor - public Xcls_MenuButton24(Xcls_WindowRooView _owner ) + public Xcls_MenuButton23(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.MenuButton(); @@ -2018,13 +2019,13 @@ public class Xcls_WindowRooView : Object // my vars (dec) // set gobject values - var child_1 = new Xcls_Box26( _this ); + var child_1 = new Xcls_Box25( _this ); this.el.child = child_1.el; } // user defined functions } - public class Xcls_Box26 : Object + public class Xcls_Box25 : Object { public Gtk.Box el; private Xcls_WindowRooView _this; @@ -2033,7 +2034,7 @@ public class Xcls_WindowRooView : Object // my vars (def) // ctor - public Xcls_Box26(Xcls_WindowRooView _owner ) + public Xcls_Box25(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); diff --git a/src/Palete/Roo.vala b/src/Palete/Roo.vala index 853b8e0e0..549288453 100644 --- a/src/Palete/Roo.vala +++ b/src/Palete/Roo.vala @@ -88,15 +88,24 @@ namespace Palete { } - // this.loadUsageFile(BuilderApplication.configDirectory() + "/resources/RooUsage.txt"); + this.classes = new Gee.HashMap(); var add_to = new Gee.HashMap>(); - + + var f = GLib. File.new_for_path(BuilderApplication.configDirectory() + "/resources/roodata.json"); + if (!f.query_exists(null)) { + f = GLib. File.new_for_uri("resources:///html/roodata.json"); + } + + + var pa = new Json.Parser(); try { - pa.load_from_file(BuilderApplication.configDirectory() + "/resources/roodata.json"); + uint8[] data; + f.load_contents( null, out data, null ); + pa.load_from_data((string) data); } catch(GLib.Error e) { - GLib.error("Could not load %s",BuilderApplication.configDirectory() + "/resources/roodata.json"); + GLib.error("Could not load %s",f.get_uri()); } var node = pa.get_root(); diff --git a/src/Project/Project.vala b/src/Project/Project.vala index 7060c2be4..28028fc4b 100644 --- a/src/Project/Project.vala +++ b/src/Project/Project.vala @@ -692,6 +692,9 @@ namespace Project { if (subdir == "build") { // cmake! return; } + if (subdir == "build-dir") { // flatpack + return; + } if (subdir == "autom4te.cache") { // automake? return; } diff --git a/src/Resources.vala b/src/Resources.vala index a2d4ad4bd..6dceca77a 100644 --- a/src/Resources.vala +++ b/src/Resources.vala @@ -90,11 +90,11 @@ public class Resources : Object public void initFiles() { string[] avail_files = { - "roodata.json", - "flutter_tree.json", - "*", - "Editors/*.js", - "vapi/*" + "roodata.json", /// << this is the only one we get now.. +// "flutter_tree.json", +// "*", + // "Editors/*.js", +// "vapi/*" }; this.fetch_files = new Gee.ArrayList(); @@ -108,7 +108,7 @@ public class Resources : Object if (target == "flutter_tree.json") { src = "https://raw.githubusercontent.com/roojs/flutter-docs-json/master/tree.json"; } - + /* if (target.contains("*")) { var split = target.split("*"); @@ -119,7 +119,7 @@ public class Resources : Object } } - + */ this.fetch_files.add(new ResourcesItem(src,target, "")); } @@ -164,18 +164,18 @@ public class Resources : Object // this has to check the required files, not the list... string[] required = { - "bootstrap.builder.html", + /*"bootstrap.builder.html", "bootstrap4.builder.html", "mailer.builder.html", "roo.builder.html", "roo.builder.js", - + */ "roodata.json", //"RooUsage.txt" ?? not needed it's doen from roodata. - "Gir.overides" //?? needed anymnore? + // "Gir.overides" //?? needed anymnore? }; @@ -304,6 +304,7 @@ public class Resources : Object GLib.error("Problem writing data %s", e.message); } switch (item.target) { + /* case "Gir.overides": // clear all the project caches.... foreach(var p in Project.Project.allProjectsByName()) { @@ -313,7 +314,7 @@ public class Resources : Object } break; - + */ case "roodata.json": Palete.Roo.classes_cache = null; // clear the cache. -- 2.39.2