Spider.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 16 Aug 2016 05:13:55 +0000 (13:13 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 16 Aug 2016 05:13:55 +0000 (13:13 +0800)
Spider.bjs [deleted file]

diff --git a/Spider.bjs b/Spider.bjs
deleted file mode 100644 (file)
index 96f485e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name" : "Spider",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/app.webkitpdf/Spider.bjs",
- "permname" : "",
- "modOrder" : "",
- "build_module" : "NEW GROUP",
- "items" : [
-  {
-   "listeners" : {
-    "destroy" : "() => {\n    Gtk.main_quit();\n}",
-    "show" : "() => {\n\t\n\tprint(\"resizing window\\n\");\n\tthis.el.resize(1200,500);\n\tprint(\"loading url\\n\");\n\tthis.view.el.load_uri(webkitpdf.opt_url);\n\t\n\t// if we have not finished in 25 seconds\n\t// call printit...\n\t  GLib.Timeout.add_seconds(25, () => { \n\t\t\t_this.view.printit();\n\t\t\treturn true;\n\t});\n\t\n\n}"
-   },
-   "xtype" : "Window",
-   "$ xns" : "Gtk",
-   "Gtk.WindowType type" : "Gtk.WindowType.TOPLEVEL",
-   "items" : [
-    {
-     "id" : "scrolled_window",
-     "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
-     "* pack" : "add",
-     "xtype" : "ScrolledWindow",
-     "$ xns" : "Gtk",
-     "items" : [
-      {
-       "listeners" : {
-        "resource_request_starting" : "(p0, webres, netreq ) => {\n  print(\"resource req. started %s\\n\", netreq.uri);\n  \n  // block some stuff...\n  \n  \n  \n  \n  \n  \n}",
-        "resource_response_received" : "(p0, webres, netres ) => {\n  print(\"resource res. recieved [%s] from %s\\n\", \n\t  netreq.message.request_headers.get_content_type(null),\n\t  netreq.uri);\n  \n  // block some stuff...\n  \n  var msg = netreq.message.request_headers.get_content_type(null);\n  \n  \n  \n  \n}",
-        "load_finished" : "( ) => {\n\t\t \n       this.printit();\n \n}"
-       },
-       "id" : "view",
-       "| void printit" : "() {\n   print(\"load_finsihed\\n\");\n   \n   if (this.print_started) {\n      print(\"load_finsihed - already printing..\\n\");\n      return;\n   }\n    \n    \n}\n",
-       "* pack" : "add",
-       "xtype" : "WebView",
-       "bool print_started" : false,
-       "| void printpng" : "() {\n    //var filename = \"/tmp/test.pdf\";\n    //print(\"load_changed %d ?= %d\\n\", le, LoadEvent.FINISHED);\n\n    //if (le != LoadEvent.FINISHED) {\n    //    return;\n   // }\n   \n// what size is the documet.\n\n     print(\"making screenshot\\n\");\n     \n    // fix vapi - get_snapshot add '?' to all null.\n    var pixmap = _this.view.el.get_snapshot( null );\n\n    \n    \n    int w,h;\n    \n    // add out to gdkpixmap.get_size\n\tpixmap.get_size( out  w , out   h);\n\tvar pixbuf  = Gdk.pixbuf_get_from_drawable(null, pixmap, null , 0, 0, 0, 0, w, h);\n\tprint(\"pixbuf size: %d x %d\\n \", w,h);\n\t \n    \n    \n     pixbuf.save(webkitpdf.opt_target_png, \"png\");\n     print(\"Saved to %s\\n\", webkitpdf.opt_target_png);\n    //view.get_snapshot.begin(WebKit.SnapshotRegion.FULL_DOCUMENT, WebKit.SnapshotOptions.NONE, null, (obj, res) => {\n    //    var sf = view.get_snapshot.end(res);\n\n    //    sf.write_to_png(Browser.opt_target_png);\n    //});\n    Gtk.main_quit();\n     \n   \n    \n    \n\n}\n",
-       "$ xns" : "WebKit"
-      }
-     ]
-    }
-   ]
-  }
- ]
-}
\ No newline at end of file