src/Builder4/DialogPluginWebkit.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 16 Apr 2015 08:37:33 +0000 (16:37 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 16 Apr 2015 08:37:33 +0000 (16:37 +0800)
src/Builder4/DialogPluginWebkit.vala

src/Builder4/DialogPluginWebkit.bjs
src/Builder4/DialogPluginWebkit.vala

index b9e85aa..90204f4 100644 (file)
     {
      "xtype" : "VBox",
      "$ pack" : "get_content_area().add",
-     "$ xns" : "Gtk"
+     "$ xns" : "Gtk",
+     "items" : [
+      {
+       "* init" : "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
+       "* pack" : "pack_end,true,true,0",
+       "xtype" : "ScrolledWindow",
+       "$ xns" : "Gtk",
+       "items" : [
+        {
+         "$ clear" : "function() {\n    \n    \n    \n     \n   // remove..\n    var s  = \"document.body.textContent='';\"\n        \n    this.el.execute_script(s);\n        \n        \n    \n    \n    \n}\n",
+         "id" : "patchview",
+         "xtype" : "WebView",
+         "* pack" : "add",
+         "$ showDiff" : "function(files) {\n    this.clear();\n    \n    \n     var model = this.get('/historyTreeStore');\n    \n    if (model.release === false) {\n        return;\n    }\n    \n    var diff = Merger.repo.diff(files, model.release, model.rev);\n    \n   // remove..\n    var s  = \"var pre  = document.createElement('pre'); document.body.appendChild(pre);\";\n    s += \"pre.textContent =  \" +\n             JSON.stringify(Merger.repo.lastCmd + \"\\n\") + '+  ' + \n           JSON.stringify(diff) + \";\";\n    print(s);\n        \n    this.el.execute_script(s);\n        \n        \n    \n    \n    \n}\n",
+         "$ xns" : "WebKit"
+        }
+       ]
+      }
+     ]
     }
    ]
   }
index 271a4df..8603968 100644 (file)
@@ -12,6 +12,7 @@ public class DialogPluginWebkit : Object
         }
         return _DialogPluginWebkit;
     }
+    public Xcls_patchview patchview;
 
         // my vars (def)
 
@@ -46,6 +47,62 @@ public class DialogPluginWebkit : Object
 
             // my vars (dec)
 
+            // set gobject values
+            var child_0 = new Xcls_ScrolledWindow3( _this );
+            child_0.ref();
+            this.el.pack_end (  child_0.el , true,true,0 );
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_ScrolledWindow3 : Object 
+    {
+        public Gtk.ScrolledWindow el;
+        private DialogPluginWebkit  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_ScrolledWindow3(DialogPluginWebkit _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.ScrolledWindow( null, null );
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_patchview( _this );
+            child_0.ref();
+            this.el.add (  child_0.el  );
+
+            // init method 
+
+            function() {
+                XObject.prototype.init.call(this);
+                  this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+            }
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_patchview : Object 
+    {
+        public WebKit.WebView el;
+        private DialogPluginWebkit  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_patchview(DialogPluginWebkit _owner )
+        {
+            _this = _owner;
+            _this.patchview = this;
+            this.el = new WebKit.WebView();
+
+            // my vars (dec)
+
             // set gobject values
         }