src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 23 Mar 2015 09:49:04 +0000 (17:49 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 23 Mar 2015 09:49:04 +0000 (17:49 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 01d2f48..4cf0d43 100644 (file)
 {
-    "name" : "GtkView",
-    "parent" : "",
-    "title" : "",
-    "path" : "/home/alan/gitlive/app.Builder.js/Builder4/GtkView.bjs",
-    "permname" : "",
-    "modOrder" : "",
-    "items" : [
+ "name" : "GtkView",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/GtkView.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "items" : [
+  {
+   "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.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\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 ",
+   "xtype" : "VPaned",
+   "# JsRender.JsRender file" : "null",
+   "$ xns" : "Gtk",
+   "items" : [
+    {
+     "* pack" : "pack1,true,true",
+     "xtype" : "Layout",
+     "$ xns" : "Gtk",
+     "items" : [
+      {
+       "id" : "container",
+       "xtype" : "HBox",
+       "* pack" : "add",
+       "$ xns" : "Gtk"
+      }
+     ]
+    },
+    {
+     "* pack" : "pack2,true,true",
+     "xtype" : "VBox",
+     "gboolean homogeneous" : false,
+     "$ xns" : "Gtk",
+     "items" : [
+      {
+       "* pack" : "pack_start,false,false,0",
+       "xtype" : "HBox",
+       "$ xns" : "Gtk",
+       "items" : [
         {
-            "id" : "GtkView",
-            "# Gtk.Widget lastObj" : "null",
-            "| 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",
-            "| void loadFile" : "(JsRender.JsRender file) \n{\n    \n        this.el.set_position((int)(this.el.max_position * 0.7));\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\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 ",
-            "xtype" : "VPaned",
-            "# JsRender.JsRender file" : "null",
-            "$ xns" : "Gtk",
-            "items" : [
-                {
-                    "* pack" : "pack1,true,true",
-                    "xtype" : "Viewport",
-                    "$ xns" : "Gtk",
-                    "items" : [
-                        {
-                            "id" : "container",
-                            "* pack" : "add",
-                            "xtype" : "HBox",
-                            "$ xns" : "Gtk"
-                        }
-                    ]
-                },
-                {
-                    "* pack" : "pack2,true,true",
-                    "xtype" : "VBox",
-                    "gboolean homogeneous" : false,
-                    "$ xns" : "Gtk",
-                    "items" : [
-                        {
-                            "* pack" : "pack_start,false,false,0",
-                            "xtype" : "HBox",
-                            "$ xns" : "Gtk",
-                            "items" : [
-                                {
-                                    "* pack" : "pack_start,true,true,0",
-                                    "xtype" : "Button",
-                                    "$ xns" : "Gtk",
-                                    "utf8 label" : "Full Compile"
-                                }
-                            ]
-                        },
-                        {
-                            "* pack" : "pack_start,true,true,0",
-                            "xtype" : "HBox",
-                            "gboolean homogeneous" : true,
-                            "$ xns" : "Gtk",
-                            "items" : [
-                                {
-                                    "* pack" : "add",
-                                    "xtype" : "TreeView",
-                                    "$ xns" : "Gtk",
-                                    "items" : [
-                                        {
-                                            "gint n_columns" : 1,
-                                            "columns" : "  typeof(string)",
-                                            "* pack" : "set_model",
-                                            "xtype" : "ListStore",
-                                            "$ xns" : "Gtk"
-                                        },
-                                        {
-                                            "utf8 title" : "Compile output",
-                                            "xtype" : "TreeViewColumn",
-                                            "string id" : "column",
-                                            "$ xns" : "Gtk",
-                                            "items" : [
-                                                {
-                                                    "* pack" : "pack_start,false",
-                                                    "xtype" : "CellRendererText",
-                                                    "$ xns" : "Gtk"
-                                                }
-                                            ]
-                                        }
-                                    ]
-                                },
-                                {
-                                    "* pack" : "pack_start,true,true,0",
-                                    "xtype" : "ScrolledWindow",
-                                    "$ xns" : "Gtk",
-                                    "items" : [
-                                        {
-                                            "gboolean show_line_marks" : true,
-                                            "* pack" : "add",
-                                            "xtype" : "View",
-                                            "$ xns" : "GtkSource",
-                                            "gboolean show_line_numbers" : true,
-                                            "gboolean editable" : false
-                                        }
-                                    ]
-                                }
-                            ]
-                        }
-                    ]
-                }
-            ]
+         "* pack" : "pack_start,true,true,0",
+         "xtype" : "Button",
+         "$ xns" : "Gtk",
+         "utf8 label" : "Full Compile"
         }
-    ]
+       ]
+      },
+      {
+       "* pack" : "pack_start,true,true,0",
+       "xtype" : "HBox",
+       "gboolean homogeneous" : true,
+       "$ xns" : "Gtk",
+       "items" : [
+        {
+         "* pack" : "add",
+         "xtype" : "TreeView",
+         "$ xns" : "Gtk",
+         "items" : [
+          {
+           "gint n_columns" : 1,
+           "columns" : "  typeof(string)",
+           "* pack" : "set_model",
+           "xtype" : "ListStore",
+           "$ xns" : "Gtk"
+          },
+          {
+           "utf8 title" : "Compile output",
+           "xtype" : "TreeViewColumn",
+           "string id" : "column",
+           "$ xns" : "Gtk",
+           "items" : [
+            {
+             "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
+             "$ xns" : "Gtk"
+            }
+           ]
+          }
+         ]
+        },
+        {
+         "* pack" : "pack_start,true,true,0",
+         "xtype" : "ScrolledWindow",
+         "$ xns" : "Gtk",
+         "items" : [
+          {
+           "gboolean show_line_marks" : true,
+           "xtype" : "View",
+           "* pack" : "add",
+           "$ xns" : "GtkSource",
+           "gboolean show_line_numbers" : true,
+           "gboolean editable" : false
+          }
+         ]
+        }
+       ]
+      }
+     ]
+    }
+   ]
+  }
+ ]
 }
\ No newline at end of file
index 4d764a3..c31b4c5 100644 (file)
@@ -29,7 +29,7 @@ public class Xcls_GtkView : Object
         this.file = null;
 
         // set gobject values
-        var child_0 = new Xcls_Viewport2( _this );
+        var child_0 = new Xcls_Layout2( _this );
         child_0.ref();
         this.el.pack1 (  child_0.el , true,true );
         var child_1 = new Xcls_VBox4( _this );
@@ -97,19 +97,19 @@ public class Xcls_GtkView : Object
             this.container.el.add(obj);
             obj.show_all();
     }
-    public class Xcls_Viewport2 : Object 
+    public class Xcls_Layout2 : Object 
     {
-        public Gtk.Viewport el;
+        public Gtk.Layout el;
         private Xcls_GtkView  _this;
 
 
             // my vars (def)
 
         // ctor 
-        public Xcls_Viewport2(Xcls_GtkView _owner )
+        public Xcls_Layout2(Xcls_GtkView _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Viewport( null, null );
+            this.el = new Gtk.Layout( null, null );
 
             // my vars (dec)