BrowserWindow.bjs
[app.webkitpdf] / BrowserWindow.bjs
1 {
2  "name" : "BrowserWindow",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.webkitpdf/BrowserWindow.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "NEW GROUP",
9  "items" : [
10   {
11    "listeners" : {
12     "destroy" : "() => {\n    Gtk.main_quit();\n}",
13     "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\n}"
14    },
15    "xtype" : "OffscreenWindow",
16    "$ xns" : "Gtk",
17    "items" : [
18     {
19      "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
20      "* pack" : "add",
21      "xtype" : "ScrolledWindow",
22      "$ xns" : "Gtk",
23      "items" : [
24       {
25        "listeners" : {
26         "resource_request_starting" : "(p0, webres, netreq ) => {\n  print(\"resource req. started %s\\n\", netreq.uri);\n  \n  \n}",
27         "load_finished" : "( ) => {\n\t\t \n       this.printit();\n \n}"
28        },
29        "id" : "view",
30        "| void printit" : "() {\n   print(\"load_finsihed\\n\");\n \n\t// inject any javascript if needed..\n\tif (webkitpdf.opt_inject_js != null) {\n\t\tfor(var i =0; i < webkitpdf.opt_inject_js.length;i++) {\n\t\t\tstring str;\n\t\t\ttry {\n\t\t\t\tFileUtils.get_contents( webkitpdf.opt_inject_js[i], out str);\n\t\t\t} catch(FileError e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.el.execute_script(str);\n\t\t}\n\t}\n\n\tprint(\"calling print in %d seconds\\n\", (int)webkitpdf.opt_delay);\n    GLib.Timeout.add_seconds(webkitpdf.opt_delay, () => { \n\t\n    }, GLib.Priority.DEFAULT);\n}\n",
31        "* pack" : "add",
32        "xtype" : "WebView",
33        "$ xns" : "WebKit",
34        "| return_type printpdf" : "() {\n\n}\n"
35       }
36      ]
37     }
38    ]
39   }
40  ]
41 }