From: Alan Knowles Date: Wed, 3 Jun 2015 03:43:26 +0000 (+0800) Subject: src/Builder4/WindowRooView.bjs X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=5dcb8194e382c134ef54dc5d300c5578aabb88c1 src/Builder4/WindowRooView.bjs src/Builder4/WindowRooView.vala --- diff --git a/src/Builder4/WindowRooView.bjs b/src/Builder4/WindowRooView.bjs index 2bdc86d6b..89b2b991f 100644 --- a/src/Builder4/WindowRooView.bjs +++ b/src/Builder4/WindowRooView.bjs @@ -12,7 +12,7 @@ "size_allocate" : "(aloc) => {\n\n this.width = aloc.width;\n this.height =aloc.height;\n}\n " }, "| void scroll_to_line" : "(int line) {\n this.notebook.el.page = 1;// code preview...\n \n GLib.Timeout.add(500, () => {\n \n \n\t \n\t \n\t\t var buf = this.sourceview.el.get_buffer();\n\t \n\t\tvar sbuf = (Gtk.SourceBuffer) buf;\n\n\n\t\tGtk.TextIter iter; \n\t\tsbuf.get_iter_at_line(out iter, line);\n\t\tthis.sourceview.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);\n\t\treturn false;\n\t}); \n\n \n}\n", - "id" : "GtkView", + "id" : "WindowRooView", "# Gtk.Widget lastObj" : "null", "| void createThumb" : "() {\n \n \n if (this.file == null) {\n return;\n }\n // only screenshot the gtk preview..\n if (this.notebook.el.page > 0 ) {\n return;\n }\n \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 try {\n Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n screenshot.save(filename,\"png\");\n } catch (Error e) {\n \n }\n\n \n return;\n \n \n \n \n \n // should we hold until it's printed...\n \n \n\n \n \n\n\n \n \n}\n", "| void loadFile" : "(JsRender.JsRender file) \n{\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.notebook.el.page = 0;// gtk preview \n \n \n \n this.file = file; \n this.sourceview.loadFile();\n this.searchcontext = null;\n \n\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 ", diff --git a/src/Builder4/WindowRooView.vala b/src/Builder4/WindowRooView.vala index 093ad4725..bdaec475a 100644 --- a/src/Builder4/WindowRooView.vala +++ b/src/Builder4/WindowRooView.vala @@ -1,16 +1,16 @@ -static Xcls_GtkView _GtkView; +static Xcls_WindowRooView _WindowRooView; -public class Xcls_GtkView : Object +public class Xcls_WindowRooView : Object { public Gtk.Box el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; - public static Xcls_GtkView singleton() + public static Xcls_WindowRooView singleton() { - if (_GtkView == null) { - _GtkView= new Xcls_GtkView(); + if (_WindowRooView == null) { + _WindowRooView= new Xcls_WindowRooView(); } - return _GtkView; + return _WindowRooView; } public Xcls_notebook notebook; public Xcls_label_preview label_preview; @@ -33,7 +33,7 @@ public class Xcls_GtkView : Object public Xcls_MainWindow main_window; // ctor - public Xcls_GtkView() + public Xcls_WindowRooView() { _this = this; this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); @@ -223,13 +223,13 @@ public class Xcls_GtkView : Object public class Xcls_notebook : Object { public Gtk.Notebook el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_notebook(Xcls_GtkView _owner ) + public Xcls_notebook(Xcls_WindowRooView _owner ) { _this = _owner; _this.notebook = this; @@ -255,13 +255,13 @@ public class Xcls_GtkView : Object public class Xcls_label_preview : Object { public Gtk.Label el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_label_preview(Xcls_GtkView _owner ) + public Xcls_label_preview(Xcls_WindowRooView _owner ) { _this = _owner; _this.label_preview = this; @@ -278,13 +278,13 @@ public class Xcls_GtkView : Object public class Xcls_label_code : Object { public Gtk.Label el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_label_code(Xcls_GtkView _owner ) + public Xcls_label_code(Xcls_WindowRooView _owner ) { _this = _owner; _this.label_code = this; @@ -301,14 +301,14 @@ public class Xcls_GtkView : Object public class Xcls_WindowRooView : Object { public Gtk.Paned el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) public JsRender.JsRender file; // ctor - public Xcls_WindowRooView(Xcls_GtkView _owner ) + public Xcls_WindowRooView(Xcls_WindowRooView _owner ) { _this = _owner; _this.WindowRooView = this; @@ -361,13 +361,13 @@ public class Xcls_GtkView : Object public class Xcls_viewbox : Object { public Gtk.Box el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_viewbox(Xcls_GtkView _owner ) + public Xcls_viewbox(Xcls_WindowRooView _owner ) { _this = _owner; _this.viewbox = this; @@ -390,13 +390,13 @@ public class Xcls_GtkView : Object public class Xcls_Box7 : Object { public Gtk.Box el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_Box7(Xcls_GtkView _owner ) + public Xcls_Box7(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); @@ -423,13 +423,13 @@ public class Xcls_GtkView : Object public class Xcls_Button8 : Object { public Gtk.Button el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_Button8(Xcls_GtkView _owner ) + public Xcls_Button8(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -451,13 +451,13 @@ public class Xcls_GtkView : Object public class Xcls_AutoRedraw : Object { public Gtk.CheckButton el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_AutoRedraw(Xcls_GtkView _owner ) + public Xcls_AutoRedraw(Xcls_WindowRooView _owner ) { _this = _owner; _this.AutoRedraw = this; @@ -481,13 +481,13 @@ public class Xcls_GtkView : Object public class Xcls_Button10 : Object { public Gtk.Button el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_Button10(Xcls_GtkView _owner ) + public Xcls_Button10(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -515,13 +515,13 @@ public class Xcls_GtkView : Object public class Xcls_viewcontainer : Object { public Gtk.ScrolledWindow el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_viewcontainer(Xcls_GtkView _owner ) + public Xcls_viewcontainer(Xcls_WindowRooView _owner ) { _this = _owner; _this.viewcontainer = this; @@ -545,7 +545,7 @@ public class Xcls_GtkView : Object public class Xcls_view : Object { public WebKit.WebView el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) @@ -559,7 +559,7 @@ public class Xcls_GtkView : Object public bool pendingRedraw; // ctor - public Xcls_view(Xcls_GtkView _owner ) + public Xcls_view(Xcls_WindowRooView _owner ) { _this = _owner; _this.view = this; @@ -970,13 +970,13 @@ public class Xcls_GtkView : Object public class Xcls_inspectorcontainer : Object { public Gtk.ScrolledWindow el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_inspectorcontainer(Xcls_GtkView _owner ) + public Xcls_inspectorcontainer(Xcls_WindowRooView _owner ) { _this = _owner; _this.inspectorcontainer = this; @@ -999,13 +999,13 @@ public class Xcls_GtkView : Object public class Xcls_ScrolledWindow14 : Object { public Gtk.ScrolledWindow el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) // ctor - public Xcls_ScrolledWindow14(Xcls_GtkView _owner ) + public Xcls_ScrolledWindow14(Xcls_WindowRooView _owner ) { _this = _owner; this.el = new Gtk.ScrolledWindow( null, null ); @@ -1023,7 +1023,7 @@ public class Xcls_GtkView : Object public class Xcls_sourceview : Object { public Gtk.SourceView el; - private Xcls_GtkView _this; + private Xcls_WindowRooView _this; // my vars (def) @@ -1031,7 +1031,7 @@ public class Xcls_GtkView : Object public bool allow_node_scroll; // ctor - public Xcls_sourceview(Xcls_GtkView _owner ) + public Xcls_sourceview(Xcls_WindowRooView _owner ) { _this = _owner; _this.sourceview = this;