From: Alan Knowles Date: Tue, 28 Apr 2015 02:38:03 +0000 (+0800) Subject: conf7819.file X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=ffd4b989d2a036c72a94ee83f83e7562a47eff56 conf7819.file conf7819 conf7819.dir --- diff --git a/configure.ac b/configure.ac index ca65be539..8779e4f4b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,11 +26,10 @@ PKG_CHECK_MODULES(BUILDER, [ json-glib-1.0 gee-1.0 gobject-introspection-1.0 - clutter-gtk-1.0 gladeui-2.0 libsoup-2.4 - + libgda-5.0 ]) diff --git a/src/Builder4/GtkView.bjs b/src/Builder4/GtkView.bjs index 0efc851d4..c219b4a30 100644 --- a/src/Builder4/GtkView.bjs +++ b/src/Builder4/GtkView.bjs @@ -13,7 +13,7 @@ "id" : "GtkView", "| void createThumb" : "() {\n \n \n if (this.file == null) {\n return;\n }\n var filename = this.file.getIconFileName(false);\n \n var win = this.el.get_parent_window();\n var width = win.get_width();\n var height = win.get_height();\n\n Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n\n screenshot.save(filename,\"png\");\n return;\n \n \n \n \n \n \n \n // should we hold until it's printed...\n \n \n\n \n \n\n\n \n \n}\n", "# Gtk.Widget lastObj" : "null", - "| void loadFile" : "(JsRender.JsRender file) \n{\n \n // this.el.set_position((int)(this.el.max_position * 0.7));\n this.el.set_position(this.el.max_position );\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.file = file;\n if (this.lastObj != null) {\n this.container.el.remove(this.lastObj);\n }\n \n // hide the compile view at present..\n \n \n var w = _this.el.get_allocated_width();\n var h = _this.el.get_allocated_height();\n \n print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n \n // set the container size min to 500/500 or 20 px less than max..\n w = int.max (w-20, 500);\n h = int.max (h-20, 500); \n \n print(\"SET SIZES %d, %d\\n\", w,h); \n _this.container.el.set_size_request(w,h);\n \n _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n var rgba = Gdk.RGBA ();\n rgba.parse (\"#ccc\");\n _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n \n \n\tvar x = new JsRender.NodeToGtk(file.tree);\n var obj = x.munge() as Gtk.Widget;\n this.lastObj = null;\n\tif (obj == null) {\n \treturn;\n\t}\n\tthis.lastObj = obj;\n \n this.container.el.add(obj);\n obj.show_all();\n \n \n \n}\n ", + "| void loadFile" : "(JsRender.JsRender file) \n{\n \n // this.el.set_position((int)(this.el.max_position * 0.7));\n this.el.set_position(this.el.max_position );\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.file = file;\n if (this.lastObj != null) {\n this.container.el.remove(this.lastObj);\n }\n \n // hide the compile view at present..\n \n \n var w = this.width;\n var h = this.height;\n \n print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n \n // set the container size min to 500/500 or 20 px less than max..\n w = int.max (w-20, 500);\n h = int.max (h-20, 500); \n \n print(\"SET SIZES %d, %d\\n\", w,h); \n _this.container.el.set_size_request(w,h);\n \n _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n var rgba = Gdk.RGBA ();\n rgba.parse (\"#ccc\");\n _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n \n \n\tvar x = new JsRender.NodeToGtk(file.tree);\n var obj = x.munge() as Gtk.Widget;\n this.lastObj = null;\n\tif (obj == null) {\n \treturn;\n\t}\n\tthis.lastObj = obj;\n \n this.container.el.add(obj);\n obj.show_all();\n \n \n \n}\n ", "int width" : 0, "xtype" : "VPaned", "# JsRender.JsRender file" : "null", diff --git a/src/Builder4/GtkView.vala b/src/Builder4/GtkView.vala index 900a67196..836103fe6 100644 --- a/src/Builder4/GtkView.vala +++ b/src/Builder4/GtkView.vala @@ -103,8 +103,8 @@ public class Xcls_GtkView : Object // hide the compile view at present.. - var w = _this.el.get_allocated_width(); - var h = _this.el.get_allocated_height(); + var w = this.width; + var h = this.height; print("ALLOC SET SIZES %d, %d\n", w,h); diff --git a/src/Makefile.am b/src/Makefile.am index c7f216d9c..675b51d7d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -131,7 +131,7 @@ builder_SOURCES = \ builder_VALAFLAGS = \ --thread --target-glib=2.32 --vapidir=$(srcdir)/vapi -g $(builder_PKGS) -builder_LDADD = $(BUILDER_LIBS) $(LIBVALA_LIBS) $(LIBGDA_LIBS) +builder_LDADD = $(BUILDER_LIBS) $(LIBVALA_LIBS) $(LIBGDA_LIBS) $(WEBKIT_LIBS) diff --git a/src/Palete/Gtk.vala b/src/Palete/Gtk.vala index 18eb44b2f..b3308a789 100644 --- a/src/Palete/Gtk.vala +++ b/src/Palete/Gtk.vala @@ -30,10 +30,8 @@ namespace Palete { base(); this.name = "Gtk"; var context = new Vala.CodeContext (); - if (dirname == "") { - dirname = Path.get_dirname (context.get_vapi_path("glib-2.0")); - } - this.loadPackages(); + + this.package_cache = this.loadPackages(Path.get_dirname (context.get_vapi_path("glib-2.0"))); //this.load(); // various loader methods.. //this.map = []; @@ -209,7 +207,14 @@ namespace Palete { var ret = new Gee.ArrayList(); ret.add_all(this.package_cache); for(var i = 0; i < vapidirs.length;i++) { - ret.add_all(this.loadPackages(vapidirs[i])); + var add = this.loadPackages(vapidirs[i]); + for (var j=0; j < add.size; j++) { + if (ret.contains(add.get(j))) { + continue; + } + ret.add(add.get(j)); + } + } return ret; diff --git a/src/Project/Gtk.vala b/src/Project/Gtk.vala index 910366b79..10d15499f 100644 --- a/src/Project/Gtk.vala +++ b/src/Project/Gtk.vala @@ -275,7 +275,7 @@ namespace Project { public string[] vapidirs() { string[] ret = {}; - var sources = this.compilegroups.get("_default_").sources + var sources = this.compilegroups.get("_default_").sources; for(var i =0; i< sources.size; i++) { var path = this.resolve_path( diff --git a/src/Resources.vala b/src/Resources.vala index 501157459..890086843 100644 --- a/src/Resources.vala +++ b/src/Resources.vala @@ -82,9 +82,7 @@ public class Resources : Object this.initFiles(); } - - - } + public void initFiles() { string[] avail_files = {