JsRender/Gtk.vala.c
authorAlan Knowles <alan@roojs.com>
Tue, 16 Sep 2014 10:52:28 +0000 (18:52 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 16 Sep 2014 10:52:28 +0000 (18:52 +0800)
JsRender/JsRender.vala.c
JsRender/Lang.vala.c
JsRender/Node.vala.c
JsRender/NodeToGlade.vala.c
JsRender/NodeToGtk.vala.c
JsRender/NodeToJs.vala.c
JsRender/NodeToVala.vala.c
JsRender/Roo.vala.c
Project/Gtk.vala.c
Project/Project.vala.c
Project/Roo.vala.c
Palete/Gir.vala.c
Palete/Gtk.vala.c
Palete/Palete.vala.c
Palete/Roo.vala.c
Builder4/Application.vala.c
Builder4/About.vala.c
Builder4/DialogConfirm.vala.c
Builder4/DialogNewComponent.vala.c
Builder4/StandardErrorDialog.vala.c
Builder4/DialogSaveTemplate.vala.c
Builder4/DialogSaveModule.vala.c
Builder4/DialogTemplateSelect.vala.c
Builder4/EditProject.vala.c
Builder4/Editor.vala.c
Builder4/ProjectSettings.vala.c
Builder4/WindowRightPalete.vala.c
Builder4/WindowLeftTree.vala.c
Builder4/WindowRooView.vala.c
Builder4/WindowLeftProps.vala.c
Builder4/ClutterFiles.vala.c
Builder4/WindowLeftProjects.vala.c
Builder4/WindowAddProp.vala.c
Builder4/GtkView.vala.c
Builder4/MainWindow.vala.c
Builder4/Main.vala.c

Builder4/WindowRooView.bjs.orig [deleted file]
Builder4/WindowRooView.bjs.rej [deleted file]
Builder4/WindowRooView.js.orig [deleted file]
Builder4/WindowRooView.js.rej [deleted file]

diff --git a/Builder4/WindowRooView.bjs.orig b/Builder4/WindowRooView.bjs.orig
deleted file mode 100644 (file)
index fe84ebb..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-{
-    "name" : "WindowRooView",
-    "parent" : "",
-    "title" : "",
-    "path" : "/home/alan/gitlive/app.Builder.js/Builder4/WindowRooView.bjs",
-    "permname" : "",
-    "modOrder" : "",
-    "items" : [
-        {
-            "id" : "WindowRooView",
-            "| 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, this.el.position);\n\n    screenshot.save(filename,\"png\");\n    return;\n    \n    \n    \n    \n    \n    \n    \n    var p = new WebKit.PrintOperation(_this.view.el);\n     \n    var ps = new Gtk.PrintSettings();\n    ps.set_printer(\"Print to File\");\n    ps.set(\"output-file-format\", \"pdf\");\n    ps.set(\"output-uri\", \"file://\" + filename + \".pdf\");\n\n    // find the printer...\n    \n    /*\n    var ar = Gtk.PaperSize.get_paper_sizes(false);\n    var psetup = new Gtk.PageSetup();\n    for(var i = 0; i < ar.length(); i++) {\n        if (ar.nth_data(i).get_name() ==\"iso_a4\") {\n            psetup.set_paper_size(ar.nth_data(i));\n        }\n    }\n    psetup.set_orientation(Gtk.PageOrientation.LANDSCAPE);\n    \n     \n    p.set_page_setup(psetup);\n    */\n    p.set_print_settings(ps);\n    \n    p.finished.connect(() => {\n        print(\"creating thumbnail for \" + filename + \".pdf\\n\"); \n        var s = new Cairo.PdfSurface(filename + \".pdf\", 400,400);\n    \n        s.write_to_png (filename);\n        \n       // var f = GLib.File.new_for_path (filename + \".pdf\");\n       // f.delete();\n    });\n    \n    \n    p.print();\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 = file;\n    this.view.renderJS(true);\n}",
-            "* pack" : "add",
-            "xtype" : "VPaned",
-            "# JsRender.JsRender file" : "",
-            "| void requestRedraw" : "() {\n    this.view.renderJS(false);\n}",
-            "$ xns" : "Gtk",
-            "items" : [
-                {
-                    "* pack" : "pack1,true,true",
-                    "xtype" : "VBox",
-                    "$ xns" : "Gtk",
-                    "$ homogeneous" : false,
-                    "items" : [
-                        {
-                            "$ vexpand" : false,
-                            "$ height_request" : 20,
-                            "* pack" : "pack_start,false,true,0",
-                            "xtype" : "HBox",
-                            "$ xns" : "Gtk",
-                            "$ homogeneous" : true,
-                            "items" : [
-                                {
-                                    "listeners" : {
-                                        "clicked" : "( ) => {\n    _this.view.renderJS(  true);\n}"
-                                    },
-                                    "label" : "Redraw",
-                                    "xtype" : "Button",
-                                    "* pack" : "pack_start,false,false,0",
-                                    "$ xns" : "Gtk"
-                                },
-                                {
-                                    "listeners" : {
-                                        "toggled" : " (state) => {\n    this.el.set_label(this.el.active  ? \"Auto Redraw On\" : \"Auto Redraw Off\");\n}"
-                                    },
-                                    "label" : "Auto Redraw On",
-                                    "id" : "AutoRedraw",
-                                    "$ active" : true,
-                                    "* pack" : "pack_start,false,false,0",
-                                    "xtype" : "CheckButton",
-                                    "$ xns" : "Gtk"
-                                },
-                                {
-                                    "listeners" : {
-                                        "clicked" : " () => {\n  _this.view.redraws = 99;\n    _this.view.el.web_context.clear_cache();  \n  _this.view.renderJS(true);\n\n}"
-                                    },
-                                    "label" : "Full Redraw",
-                                    "xtype" : "Button",
-                                    "* pack" : "pack_start,false,false,0",
-                                    "$ xns" : "Gtk"
-                                }
-                            ]
-                        },
-                        {
-                            "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
-                            "$ shadow_type" : "Gtk.ShadowType.IN",
-                            "* pack" : "pack_end,true,true,0",
-                            "xtype" : "ScrolledWindow",
-                            "$ xns" : "Gtk"
-                        }
-                    ]
-                },
-                {
-                    "id" : "inspectorcontainer",
-                    "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
-                    "$ shadow_type" : "Gtk.ShadowType.IN",
-                    "xtype" : "ScrolledWindow",
-                    "* pack" : "pack2,true,true",
-                    "$ xns" : "Gtk",
-                    "items" : [
-                        {
-                            "listeners" : {
-                                "script_dialog" : " (dialog) => {\n     var msg = dialog.get_message();\n     if (msg.length < 4) {\n        return false;\n     }\n     if (msg.substring(0,4) != \"IPC:\") {\n         return false;\n     }\n     var ar = msg.split(\":\", 3);\n    if (ar.length < 3) {\n        return false;\n    }\n    switch(ar[1]) {\n        case \"SAVEHTML\":\n            _this.file.saveHTML(ar[2]);\n            return true;\n        default:\n            return false;\n    }\n    \n}",
-                                "show" : "  ( ) => {\n    this.inspector = this.el.get_inspector();\n    this.inspector.ref();\n    this.inspector.open_window.connect(() => {\n         this.inspector = this.el.get_inspector();\n        print(\"inspector attach\\n\");\n        var wv = this.inspector.get_web_view();\n        if (wv != null) {\n            print(\"got inspector web view\\n\");\n            _this.inspectorcontainer.el.add(wv);\n            wv.show();\n        } else {\n            print(\"no web view yet\\n\");\n        }\n        return true;\n       \n    });\n   this.inspector.closed.connect(() => {\n        \n        this.inspector.show();\n       \n    }); \n    \n    this.inspector.attach.connect(() => {\n         this.inspector = this.el.get_inspector();\n        print(\"inspector attach\\n\");\n        var wv = this.inspector.get_web_view();\n        if (wv != null) {\n            print(\"got inspector web view\\n\");\n            _this.inspectorcontainer.el.add(wv);\n            wv.show();\n        } else {\n            print(\"no web view yet\\n\");\n        }\n        return true;\n       \n    });    \n    \n    this.inspector.show();\n}",
-                                "drag_drop" : "  ( ctx, x, y,time, ud) => {\n    return false;\n    /*\n\tprint(\"TARGET: drag-drop\");\n        var is_valid_drop_site = true;\n        \n         \n        Gtk.drag_get_data\n        (\n                w,         // will receive 'drag-data-received' signal \n                ctx,        /* represents the current state of the DnD \n                this.get('/Window').atoms[\"STRING\"],    /* the target type we want \n                time            /* time stamp \n        );\n                        \n                        \n                        /* No target offered by source => error \n                       \n\n\treturn  is_valid_drop_site;\n\t*/\n}"
-                            },
-                            "# string renderedData" : "\"\"",
-                            "id" : "view",
-                            "# bool refreshRequired" : false,
-                            "* init" : " {\n    // this may not work!?\n    var settings =  this.el.get_settings();\n    settings.enable_developer_extras = true;\n    \n    // this was an attempt to change the url perms.. did not work..\n    // settings.enable_file_access_from_file_uris = true;\n    // settings.enable_offline_web_application_cache - true;\n    // settings.enable_universal_access_from_file_uris = true;\n   \n     \n    \n    \n    \n\n     // FIXME - base url of script..\n     // we need it so some of the database features work.\n    this.el.load_html( \"Render not ready\" , \n            //fixme - should be a config option!\n            // or should we catch stuff and fix it up..\n            \"http://localhost/app.Builder/\"\n    );\n        \n        \n   //this.el.open('file:///' + __script_path__ + '/../builder.html');\n    /*\n    Gtk.drag_dest_set\n    (\n            this.el,              //\n            Gtk.DestDefaults.MOTION  | Gtk.DestDefaults.HIGHLIGHT,\n            null,            // list of targets\n            Gdk.DragAction.COPY         // what to do with data after dropped \n    );\n                            \n   // print(\"RB: TARGETS : \" + LeftTree.atoms[\"STRING\"]);\n    Gtk.drag_dest_set_target_list(this.el, this.get('/Window').targetList);\n    */\n    GLib.Timeout.add_seconds(1,  ()  =>{\n         //print(\"run refresh?\");\n         this.runRefresh(); \n         return true;\n     });\n    \n    \n}\n",
-                            "* pack" : "add",
-                            "redraws" : 0,
-                            "xtype" : "WebView",
-                            "# WebKit.WebInspector inspector" : "",
-                            "# int redraws" : 0,
-                            "| void runRefresh" : " () \n{\n    // this is run every 2 seconds from the init..\n\n  \n    \n    if (!this.refreshRequired) {\n       // print(\"no refresh required\");\n        return;\n    }\n\n    if (this.lastRedraw != null) {\n       // do not redraw if last redraw was less that 5 seconds ago.\n       if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n            return;\n        }\n    }\n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n     this.refreshRequired = false;\n   //  print(\"HTML RENDERING\");\n     \n     \n     //this.get('/BottomPane').el.show();\n     //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n    _this.file.webkit_page_id  = this.el.get_page_id();\n    \n    var js = _this.file.toSourcePreview();\n\n    if (js.length < 1) {\n        print(\"no data\");\n        return;\n    }\n//    var  data = js[0];\n    this.redraws++;\n  \n    var project = _this.file.project;  \n\n     //print (project.fn);\n     // set it to non-empty.\n     \n//     runhtml = runhtml.length ?  runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n//   this.runhtml  = this.runhtml || '';\n \n \n    // then we need to reload the browser using\n    // load_html_string..\n\n    // then trigger a redraw once it's loaded..\n    this.pendingRedraw = true;\n\n    var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n    string builderhtml;\n    \n    \n    GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n\n    runhtml += builderhtml + \"\\n\";\n    runhtml += \"</script>\\n\" ;\n\n    // fix to make sure they are the same..\n    this.runhtml = project.runhtml;\n    // need to modify paths\n\n    string inhtml;\n    var base_template = _this.file.project.base_template;\n    \n    if (base_template.length > 0 && !FileUtils.test(\n        Builder4.Application.configDirectory() + \"/resources/\" +  base_template, FileTest.EXISTS)  \n        ) {\n           print(\"invalid base_template name - using default:  %s\\n\", base_template);\n           base_template = \"\";\n    \n    }\n    \n    GLib.FileUtils.get_contents(\n        Builder4.Application.configDirectory() + \"/resources/\" + \n            (base_template.length > 0 ? base_template :  \"roo.builder.html\")\n            , out inhtml);\n    \n    \n    this.renderedData = js;\n\n\n    string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" +  _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n    print(\"render js: \" + js);\n    //if (!this.ready) {\n  //      console.log('not loaded yet');\n    //}\n    this.lastRedraw = new DateTime.now_local();\n\n        var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n        \n                \"<script type=\\\"text/javascript\\\">\\n\" +\n                js_src + \"\\n\" + \n                \"</script>\" + \n                        \n        \"</head>\");\n        print(\"LOAD HTML \" + html);\n        \n         var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.el.load_html( html , \n            //fixme - should be a config option!\n            (rootURL.length > 0 ? rootURL : \"http://localhost/app.Builder/\")\n        );\n        \n    // force the inspector...        \n        this.el.get_inspector().show();\n        this.el.get_inspector().attach();\n        \n        // - no need for this, the builder javascript will call it when build is complete\n        //GLib.Timeout.add_seconds(1, () => {\n        //    this.el.run_javascript(\"Builder.saveHTML()\",null);\n        //    return false;\n        //});\n//     print( \"before render\" +    this.lastRedraw);\n//    print( \"after render\" +    (new Date()));\n    \n}\n",
-                            "$ xns" : "WebKit",
-                            "# GLib.DateTime lastRedraw" : "null",
-                            "# string runhtml" : "\"\"",
-                            "# bool pendingRedraw" : false,
-                            "| void renderJS" : "(bool force) {\n\n    // this is the public redraw call..\n    // we refresh in a loop privately..\n    var autodraw = _this.AutoRedraw.el.active;\n    if (!autodraw && !force) {\n        print(\"Skipping redraw - no force, and autodraw off\");\n        return;\n    }\n    this.refreshRequired  = true;\n}\n"
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
\ No newline at end of file
diff --git a/Builder4/WindowRooView.bjs.rej b/Builder4/WindowRooView.bjs.rej
deleted file mode 100644 (file)
index aa3574a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
---- Builder4/WindowRooView.bjs
-+++ Builder4/WindowRooView.bjs
-@@ -76,31 +76,29 @@
-                     "$ shadow_type" : "Gtk.ShadowType.IN",
-                     "xtype" : "ScrolledWindow",
-                     "* pack" : "pack2,true,true",
--                    "$ xns" : "Gtk",
--                    "items" : [
--                        {
--                            "listeners" : {
--                                "script_dialog" : " (dialog) => {\n     var msg = dialog.get_message();\n     if (msg.length < 4) {\n        return false;\n     }\n     if (msg.substring(0,4) != \"IPC:\") {\n         return false;\n     }\n     var ar = msg.split(\":\", 3);\n    if (ar.length < 3) {\n        return false;\n    }\n    switch(ar[1]) {\n        case \"SAVEHTML\":\n            _this.file.saveHTML(ar[2]);\n            return true;\n        default:\n            return false;\n    }\n    \n}",
--                                "show" : "  ( ) => {\n    this.inspector = this.el.get_inspector();\n    this.inspector.ref();\n    this.inspector.open_window.connect(() => {\n         this.inspector = this.el.get_inspector();\n        print(\"inspector attach\\n\");\n        var wv = this.inspector.get_web_view();\n        if (wv != null) {\n            print(\"got inspector web view\\n\");\n            _this.inspectorcontainer.el.add(wv);\n            wv.show();\n        } else {\n            print(\"no web view yet\\n\");\n        }\n        return true;\n       \n    });\n   this.inspector.closed.connect(() => {\n        \n        this.inspector.show();\n       \n    }); \n    this.inspector.show();\n}",
--                                "drag_drop" : "  ( ctx, x, y,time, ud) => {\n    return false;\n    /*\n\tprint(\"TARGET: drag-drop\");\n        var is_valid_drop_site = true;\n        \n         \n        Gtk.drag_get_data\n        (\n                w,         // will receive 'drag-data-received' signal \n                ctx,        /* represents the current state of the DnD \n                this.get('/Window').atoms[\"STRING\"],    /* the target type we want \n                time            /* time stamp \n        );\n                        \n                        \n                        /* No target offered by source => error \n                       \n\n\treturn  is_valid_drop_site;\n\t*/\n}"
--                            },
--                            "# string renderedData" : "\"\"",
--                            "id" : "view",
--                            "# bool refreshRequired" : false,
--                            "* init" : " {\n    // this may not work!?\n    var settings =  this.el.get_settings();\n    settings.enable_developer_extras = true;\n    \n    // this was an attempt to change the url perms.. did not work..\n    // settings.enable_file_access_from_file_uris = true;\n    // settings.enable_offline_web_application_cache - true;\n    // settings.enable_universal_access_from_file_uris = true;\n   \n     \n    \n    \n    \n\n     // FIXME - base url of script..\n     // we need it so some of the database features work.\n    this.el.load_html( \"Render not ready\" , \n            //fixme - should be a config option!\n            // or should we catch stuff and fix it up..\n            \"http://localhost/app.Builder/\"\n    );\n        \n        \n   //this.el.open('file:///' + __script_path__ + '/../builder.html');\n    /*\n    Gtk.drag_dest_set\n    (\n            this.el,              //\n            Gtk.DestDefaults.MOTION  | Gtk.DestDefaults.HIGHLIGHT,\n            null,            // list of targets\n            Gdk.DragAction.COPY         // what to do with data after dropped \n    );\n                            \n   // print(\"RB: TARGETS : \" + LeftTree.atoms[\"STRING\"]);\n    Gtk.drag_dest_set_target_list(this.el, this.get('/Window').targetList);\n    */\n    GLib.Timeout.add_seconds(1,  ()  =>{\n         //print(\"run refresh?\");\n         this.runRefresh(); \n         return true;\n     });\n    \n    \n}\n",
--                            "* pack" : "add",
--                            "redraws" : 0,
--                            "xtype" : "WebView",
--                            "# WebKit.WebInspector inspector" : "",
--                            "# int redraws" : 0,
--                            "| void runRefresh" : " () \n{\n    // this is run every 2 seconds from the init..\n\n  \n    \n    if (!this.refreshRequired) {\n       // print(\"no refresh required\");\n        return;\n    }\n\n    if (this.lastRedraw != null) {\n       // do not redraw if last redraw was less that 5 seconds ago.\n       if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n            return;\n        }\n    }\n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n     this.refreshRequired = false;\n   //  print(\"HTML RENDERING\");\n     \n     \n     //this.get('/BottomPane').el.show();\n     //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n    _this.file.webkit_page_id  = this.el.get_page_id();\n    \n    var js = _this.file.toSourcePreview();\n\n    if (js.length < 1) {\n        print(\"no data\");\n        return;\n    }\n//    var  data = js[0];\n    this.redraws++;\n  \n    var project = _this.file.project;  \n\n     //print (project.fn);\n     // set it to non-empty.\n     \n//     runhtml = runhtml.length ?  runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n//   this.runhtml  = this.runhtml || '';\n \n \n    // then we need to reload the browser using\n    // load_html_string..\n\n    // then trigger a redraw once it's loaded..\n    this.pendingRedraw = true;\n\n    var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n    string builderhtml;\n    \n    \n    GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n\n    runhtml += builderhtml + \"\\n\";\n    runhtml += \"</script>\\n\" ;\n\n    // fix to make sure they are the same..\n    this.runhtml = project.runhtml;\n    // need to modify paths\n\n    string inhtml;\n    var base_template = _this.file.project.base_template;\n    \n    if (base_template.length > 0 && !FileUtils.test(\n        Builder4.Application.configDirectory() + \"/resources/\" +  base_template, FileTest.EXISTS)  \n        ) {\n           print(\"invalid base_template name - using default:  %s\\n\", base_template);\n           base_template = \"\";\n    \n    }\n    \n    GLib.FileUtils.get_contents(\n        Builder4.Application.configDirectory() + \"/resources/\" + \n            (base_template.length > 0 ? base_template :  \"roo.builder.html\")\n            , out inhtml);\n    \n    \n    this.renderedData = js;\n\n\n    string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" +  _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n    print(\"render js: \" + js);\n    //if (!this.ready) {\n  //      console.log('not loaded yet');\n    //}\n    this.lastRedraw = new DateTime.now_local();\n\n        var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n        \n                \"<script type=\\\"text/javascript\\\">\\n\" +\n                js_src + \"\\n\" + \n                \"</script>\" + \n                        \n        \"</head>\");\n        print(\"LOAD HTML \" + html);\n        \n         var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.el.load_html( html , \n            //fixme - should be a config option!\n            (rootURL.length > 0 ? rootURL : \"http://localhost/app.Builder/\")\n        );\n        \n    // force the inspector...        \n        this.el.get_inspector().show();\n        this.el.get_inspector().open_window();\n        \n        // - no need for this, the builder javascript will call it when build is complete\n        //GLib.Timeout.add_seconds(1, () => {\n        //    this.el.run_javascript(\"Builder.saveHTML()\",null);\n        //    return false;\n        //});\n//     print( \"before render\" +    this.lastRedraw);\n//    print( \"after render\" +    (new Date()));\n    \n}\n",
--                            "$ xns" : "WebKit",
--                            "# GLib.DateTime lastRedraw" : "null",
--                            "# string runhtml" : "\"\"",
--                            "# bool pendingRedraw" : false,
--                            "| void renderJS" : "(bool force) {\n\n    // this is the public redraw call..\n    // we refresh in a loop privately..\n    var autodraw = _this.AutoRedraw.el.active;\n    if (!autodraw && !force) {\n        print(\"Skipping redraw - no force, and autodraw off\");\n        return;\n    }\n    this.refreshRequired  = true;\n}\n"
--                        }
--                    ]
-+                    "$ xns" : "Gtk"
-+                },
-+                {
-+                    "listeners" : {
-+                        "script_dialog" : " (dialog) => {\n     var msg = dialog.get_message();\n     if (msg.length < 4) {\n        return false;\n     }\n     if (msg.substring(0,4) != \"IPC:\") {\n         return false;\n     }\n     var ar = msg.split(\":\", 3);\n    if (ar.length < 3) {\n        return false;\n    }\n    switch(ar[1]) {\n        case \"SAVEHTML\":\n            _this.file.saveHTML(ar[2]);\n            return true;\n        default:\n            return false;\n    }\n    \n}",
-+                        "show" : "  ( ) => {\n    this.inspector = this.el.get_inspector();\n    this.inspector.ref();\n    this.inspector.open_window.connect(() => {\n         this.inspector = this.el.get_inspector();\n        print(\"inspector attach\\n\");\n        var wv = this.inspector.get_web_view();\n        if (wv != null) {\n            print(\"got inspector web view\\n\");\n            _this.inspectorcontainer.el.add(wv);\n            wv.show();\n        } else {\n            print(\"no web view yet\\n\");\n        }\n        return true;\n       \n    });\n   this.inspector.closed.connect(() => {\n        \n        this.inspector.show();\n       \n    }); \n    this.inspector.show();\n}",
-+                        "drag_drop" : "  ( ctx, x, y,time, ud) => {\n    return false;\n    /*\n\tprint(\"TARGET: drag-drop\");\n        var is_valid_drop_site = true;\n        \n         \n        Gtk.drag_get_data\n        (\n                w,         // will receive 'drag-data-received' signal \n                ctx,        /* represents the current state of the DnD \n                this.get('/Window').atoms[\"STRING\"],    /* the target type we want \n                time            /* time stamp \n        );\n                        \n                        \n                        /* No target offered by source => error \n                       \n\n\treturn  is_valid_drop_site;\n\t*/\n}"
-+                    },
-+                    "# string renderedData" : "\"\"",
-+                    "id" : "view",
-+                    "# bool refreshRequired" : false,
-+                    "* init" : " {\n    // this may not work!?\n    var settings =  this.el.get_settings();\n    settings.enable_developer_extras = true;\n    \n    // this was an attempt to change the url perms.. did not work..\n    // settings.enable_file_access_from_file_uris = true;\n    // settings.enable_offline_web_application_cache - true;\n    // settings.enable_universal_access_from_file_uris = true;\n   \n     \n    \n    \n    \n\n     // FIXME - base url of script..\n     // we need it so some of the database features work.\n    this.el.load_html( \"Render not ready\" , \n            //fixme - should be a config option!\n            // or should we catch stuff and fix it up..\n            \"http://localhost/app.Builder/\"\n    );\n        \n        \n   //this.el.open('file:///' + __script_path__ + '/../builder.html');\n    /*\n    Gtk.drag_dest_set\n    (\n            this.el,              //\n            Gtk.DestDefaults.MOTION  | Gtk.DestDefaults.HIGHLIGHT,\n            null,            // list of targets\n            Gdk.DragAction.COPY         // what to do with data after dropped \n    );\n                            \n   // print(\"RB: TARGETS : \" + LeftTree.atoms[\"STRING\"]);\n    Gtk.drag_dest_set_target_list(this.el, this.get('/Window').targetList);\n    */\n    GLib.Timeout.add_seconds(1,  ()  =>{\n         //print(\"run refresh?\");\n         this.runRefresh(); \n         return true;\n     });\n    \n    \n}\n",
-+                    "* pack" : "add",
-+                    "redraws" : 0,
-+                    "xtype" : "WebView",
-+                    "# WebKit.WebInspector inspector" : "",
-+                    "# int redraws" : 0,
-+                    "| void runRefresh" : " () \n{\n    // this is run every 2 seconds from the init..\n\n  \n    \n    if (!this.refreshRequired) {\n       // print(\"no refresh required\");\n        return;\n    }\n\n    if (this.lastRedraw != null) {\n       // do not redraw if last redraw was less that 5 seconds ago.\n       if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n            return;\n        }\n    }\n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n     this.refreshRequired = false;\n   //  print(\"HTML RENDERING\");\n     \n     \n     //this.get('/BottomPane').el.show();\n     //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n    _this.file.webkit_page_id  = this.el.get_page_id();\n    \n    var js = _this.file.toSourcePreview();\n\n    if (js.length < 1) {\n        print(\"no data\");\n        return;\n    }\n//    var  data = js[0];\n    this.redraws++;\n  \n    var project = _this.file.project;  \n\n     //print (project.fn);\n     // set it to non-empty.\n     \n//     runhtml = runhtml.length ?  runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n//   this.runhtml  = this.runhtml || '';\n \n \n    // then we need to reload the browser using\n    // load_html_string..\n\n    // then trigger a redraw once it's loaded..\n    this.pendingRedraw = true;\n\n    var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n    string builderhtml;\n    \n    \n    GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n\n    runhtml += builderhtml + \"\\n\";\n    runhtml += \"</script>\\n\" ;\n\n    // fix to make sure they are the same..\n    this.runhtml = project.runhtml;\n    // need to modify paths\n\n    string inhtml;\n    var base_template = _this.file.project.base_template;\n    \n    if (base_template.length > 0 && !FileUtils.test(\n        Builder4.Application.configDirectory() + \"/resources/\" +  base_template, FileTest.EXISTS)  \n        ) {\n           print(\"invalid base_template name - using default:  %s\\n\", base_template);\n           base_template = \"\";\n    \n    }\n    \n    GLib.FileUtils.get_contents(\n        Builder4.Application.configDirectory() + \"/resources/\" + \n            (base_template.length > 0 ? base_template :  \"roo.builder.html\")\n            , out inhtml);\n    \n    \n    this.renderedData = js;\n\n\n    string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" +  _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n    print(\"render js: \" + js);\n    //if (!this.ready) {\n  //      console.log('not loaded yet');\n    //}\n    this.lastRedraw = new DateTime.now_local();\n\n        var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n        \n                \"<script type=\\\"text/javascript\\\">\\n\" +\n                js_src + \"\\n\" + \n                \"</script>\" + \n                        \n        \"</head>\");\n        print(\"LOAD HTML \" + html);\n        \n         var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.el.load_html( html , \n            //fixme - should be a config option!\n            (rootURL.length > 0 ? rootURL : \"http://localhost/app.Builder/\")\n        );\n        \n    // force the inspector...        \n        this.el.get_inspector().show();\n        this.el.get_inspector().open_window();\n        \n        // - no need for this, the builder javascript will call it when build is complete\n        //GLib.Timeout.add_seconds(1, () => {\n        //    this.el.run_javascript(\"Builder.saveHTML()\",null);\n        //    return false;\n        //});\n//     print( \"before render\" +    this.lastRedraw);\n//    print( \"after render\" +    (new Date()));\n    \n}\n",
-+                    "$ xns" : "WebKit",
-+                    "# GLib.DateTime lastRedraw" : "null",
-+                    "# string runhtml" : "\"\"",
-+                    "# bool pendingRedraw" : false,
-+                    "| void renderJS" : "(bool force) {\n\n    // this is the public redraw call..\n    // we refresh in a loop privately..\n    var autodraw = _this.AutoRedraw.el.active;\n    if (!autodraw && !force) {\n        print(\"Skipping redraw - no force, and autodraw off\");\n        return;\n    }\n    this.refreshRequired  = true;\n}\n"
-                 }
-             ]
-         }
diff --git a/Builder4/WindowRooView.js.orig b/Builder4/WindowRooView.js.orig
deleted file mode 100644 (file)
index 4dbb407..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-Gtk = imports.gi.Gtk;
-Gdk = imports.gi.Gdk;
-Pango = imports.gi.Pango;
-GLib = imports.gi.GLib;
-Gio = imports.gi.Gio;
-GObject = imports.gi.GObject;
-GtkSource = imports.gi.GtkSource;
-WebKit = imports.gi.WebKit;
-Vte = imports.gi.Vte;
-console = imports.console;
-XObject = imports.XObject.XObject;
-WindowRooView=new XObject({
-    id : "WindowRooView",
-    createThumb : () {
-        
-        
-        if (this.file == null) {
-            return;
-        }
-        var filename = this.file.getIconFileName(false);
-        
-        var  win = this.el.get_parent_window();
-        var width = win.get_width();
-        var height = win.get_height();
-    
-        Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.el.position);
-    
-        screenshot.save(filename,"png");
-        return;
-        
-        
-        
-        
-        
-        
-        
-        var p = new WebKit.PrintOperation(_this.view.el);
-         
-        var ps = new Gtk.PrintSettings();
-        ps.set_printer("Print to File");
-        ps.set("output-file-format", "pdf");
-        ps.set("output-uri", "file://" + filename + ".pdf");
-    
-        // find the printer...
-        
-        /*
-        var ar = Gtk.PaperSize.get_paper_sizes(false);
-        var psetup = new Gtk.PageSetup();
-        for(var i = 0; i < ar.length(); i++) {
-            if (ar.nth_data(i).get_name() =="iso_a4") {
-                psetup.set_paper_size(ar.nth_data(i));
-            }
-        }
-        psetup.set_orientation(Gtk.PageOrientation.LANDSCAPE);
-        
-         
-        p.set_page_setup(psetup);
-        */
-        p.set_print_settings(ps);
-        
-        p.finished.connect(() => {
-            print("creating thumbnail for " + filename + ".pdf\n"); 
-            var s = new Cairo.PdfSurface(filename + ".pdf", 400,400);
-        
-            s.write_to_png (filename);
-            
-           // var f = GLib.File.new_for_path (filename + ".pdf");
-           // f.delete();
-        });
-        
-        
-        p.print();
-        
-        // should we hold until it's printed...
-        
-          
-    
-        
-        
-    
-    
-        
-         
-    },
-    loadFile : (JsRender.JsRender file)
-    {
-        this.file = file;
-        this.view.renderJS(true);
-    },
-    xtype : "VPaned",
-    file : "",
-    requestRedraw : () {
-        this.view.renderJS(false);
-    },
-    xns : Gtk,
-    items : [
-       {
-            xtype : "VBox",
-            xns : Gtk,
-            homogeneous : FALSE,
-            items : [
-               {
-                    vexpand : FALSE,
-                    height_request : 20,
-                    xtype : "HBox",
-                    xns : Gtk,
-                    homogeneous : TRUE,
-                    items : [
-                       {
-                            label : "Redraw",
-                            xtype : "Button",
-                            xns : Gtk,
-                            listeners : {
-                               clicked : ( ) => {
-                                      _this.view.renderJS(  true);
-                                  }
-                            }
-                        },
-                       {
-                            label : "Auto Redraw On",
-                            id : "AutoRedraw",
-                            active : TRUE,
-                            xtype : "CheckButton",
-                            xns : Gtk,
-                            listeners : {
-                               toggled : (state) => {
-                                      this.el.set_label(this.el.active  ? "Auto Redraw On" : "Auto Redraw Off");
-                                  }
-                            }
-                        },
-                       {
-                            label : "Full Redraw",
-                            xtype : "Button",
-                            xns : Gtk,
-                            listeners : {
-                               clicked : () => {
-                                    _this.view.redraws = 99;
-                                      _this.view.el.web_context.clear_cache();  
-                                    _this.view.renderJS(true);
-                                  
-                                  }
-                            }
-                        }
-                    ]
-
-                },
-               {
-                    shadow_type : Gtk.ShadowType.IN,
-                    xtype : "ScrolledWindow",
-                    xns : Gtk
-                }
-            ]
-
-        },
-       {
-            id : "inspectorcontainer",
-            shadow_type : Gtk.ShadowType.IN,
-            xtype : "ScrolledWindow",
-            xns : Gtk,
-            items : [
-               {
-                    renderedData : "\"\"",
-                    id : "view",
-                    refreshRequired : false,
-                    redraws : 0,
-                    xtype : "WebView",
-                    inspector : "",
-                    redraws : 0,
-                    runRefresh : () 
-                    {
-                        // this is run every 2 seconds from the init..
-                    
-                      
-                        
-                        if (!this.refreshRequired) {
-                           // print("no refresh required");
-                            return;
-                        }
-                    
-                        if (this.lastRedraw != null) {
-                           // do not redraw if last redraw was less that 5 seconds ago.
-                           if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {
-                                return;
-                            }
-                        }
-                        
-                        if (_this.file == null) {
-                            return;
-                        }
-                        
-                        
-                         this.refreshRequired = false;
-                       //  print("HTML RENDERING");
-                         
-                         
-                         //this.get('/BottomPane').el.show();
-                         //this.get('/BottomPane').el.set_current_page(2);// webkit inspector
-                        _this.file.webkit_page_id  = this.el.get_page_id();
-                        
-                        var js = _this.file.toSourcePreview();
-                    
-                        if (js.length < 1) {
-                            print("no data");
-                            return;
-                        }
-                    //    var  data = js[0];
-                        this.redraws++;
-                      
-                        var project = _this.file.project;  
-                    
-                         //print (project.fn);
-                         // set it to non-empty.
-                         
-                    //     runhtml = runhtml.length ?  runhtml : '<script type="text/javascript"></script>'; 
-                    
-                    
-                    //   this.runhtml  = this.runhtml || '';
-                     
-                     
-                        // then we need to reload the browser using
-                        // load_html_string..
-                    
-                        // then trigger a redraw once it's loaded..
-                        this.pendingRedraw = true;
-                    
-                        var runhtml = "<script type=\"text/javascript\">\n" ;
-                        string builderhtml;
-                        
-                        
-                        GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + "/resources/roo.builder.js", out builderhtml);
-                    
-                        runhtml += builderhtml + "\n";
-                        runhtml += "</script>\n" ;
-                    
-                        // fix to make sure they are the same..
-                        this.runhtml = project.runhtml;
-                        // need to modify paths
-                    
-                        string inhtml;
-                        var base_template = _this.file.project.base_template;
-                        
-                        if (base_template.length > 0 && !FileUtils.test(
-                            Builder4.Application.configDirectory() + "/resources/" +  base_template, FileTest.EXISTS)  
-                            ) {
-                               print("invalid base_template name - using default:  %s\n", base_template);
-                               base_template = "";
-                        
-                        }
-                        
-                        GLib.FileUtils.get_contents(
-                            Builder4.Application.configDirectory() + "/resources/" + 
-                                (base_template.length > 0 ? base_template :  "roo.builder.html")
-                                , out inhtml);
-                        
-                        
-                        this.renderedData = js;
-                    
-                    
-                        string js_src = js + "\n" +
-                       "Roo.onReady(function() {\n" +
-                       "if (" + _this.file.name +".show) " +  _this.file.name +".show({});\n" +
-                       "Roo.XComponent.build();\n" +
-                       "});\n";
-                       
-                        print("render js: " + js);
-                        //if (!this.ready) {
-                      //      console.log('not loaded yet');
-                        //}
-                        this.lastRedraw = new DateTime.now_local();
-                    
-                            var html = inhtml.replace("</head>", runhtml + this.runhtml + 
-                            
-                                    "<script type=\"text/javascript\">\n" +
-                                    js_src + "\n" + 
-                                    "</script>" + 
-                                            
-                            "</head>");
-                            print("LOAD HTML " + html);
-                            
-                             var rootURL = _this.file.project.rootURL;
-                       
-                            
-                            
-                            this.el.load_html( html , 
-                                //fixme - should be a config option!
-                                (rootURL.length > 0 ? rootURL : "http://localhost/app.Builder/")
-                            );
-                            
-                        // force the inspector...        
-                            this.el.get_inspector().show();
-                            this.el.get_inspector().attach();
-                            
-                            // - no need for this, the builder javascript will call it when build is complete
-                            //GLib.Timeout.add_seconds(1, () => {
-                            //    this.el.run_javascript("Builder.saveHTML()",null);
-                            //    return false;
-                            //});
-                    //     print( "before render" +    this.lastRedraw);
-                    //    print( "after render" +    (new Date()));
-                        
-                    },
-                    xns : WebKit,
-                    lastRedraw : "null",
-                    runhtml : "\"\"",
-                    pendingRedraw : false,
-                    renderJS : (bool force) {
-                    
-                        // this is the public redraw call..
-                        // we refresh in a loop privately..
-                        var autodraw = _this.AutoRedraw.el.active;
-                        if (!autodraw && !force) {
-                            print("Skipping redraw - no force, and autodraw off");
-                            return;
-                        }
-                        this.refreshRequired  = true;
-                    },
-                    listeners : {
-                       script_dialog : (dialog) => {
-                               var msg = dialog.get_message();
-                               if (msg.length < 4) {
-                                  return false;
-                               }
-                               if (msg.substring(0,4) != "IPC:") {
-                                   return false;
-                               }
-                               var ar = msg.split(":", 3);
-                              if (ar.length < 3) {
-                                  return false;
-                              }
-                              switch(ar[1]) {
-                                  case "SAVEHTML":
-                                      _this.file.saveHTML(ar[2]);
-                                      return true;
-                                  default:
-                                      return false;
-                              }
-                              
-                          },
-                       show : ( ) => {
-                              this.inspector = this.el.get_inspector();
-                              this.inspector.ref();
-                              this.inspector.open_window.connect(() => {
-                                   this.inspector = this.el.get_inspector();
-                                  print("inspector attach\n");
-                                  var wv = this.inspector.get_web_view();
-                                  if (wv != null) {
-                                      print("got inspector web view\n");
-                                      _this.inspectorcontainer.el.add(wv);
-                                      wv.show();
-                                  } else {
-                                      print("no web view yet\n");
-                                  }
-                                  return true;
-                                 
-                              });
-                             this.inspector.closed.connect(() => {
-                                  
-                                  this.inspector.show();
-                                 
-                              }); 
-                              
-                              this.inspector.attach.connect(() => {
-                                   this.inspector = this.el.get_inspector();
-                                  print("inspector attach\n");
-                                  var wv = this.inspector.get_web_view();
-                                  if (wv != null) {
-                                      print("got inspector web view\n");
-                                      _this.inspectorcontainer.el.add(wv);
-                                      wv.show();
-                                  } else {
-                                      print("no web view yet\n");
-                                  }
-                                  return true;
-                                 
-                              });    
-                              
-                              this.inspector.show();
-                          },
-                       drag_drop : ( ctx, x, y,time, ud) => {
-                              return false;
-                              /*
-                               print("TARGET: drag-drop");
-                                  var is_valid_drop_site = true;
-                                  
-                                   
-                                  Gtk.drag_get_data
-                                  (
-                                          w,         // will receive 'drag-data-received' signal 
-                                          ctx,        /* represents the current state of the DnD 
-                                          this.get('/Window').atoms["STRING"],    /* the target type we want 
-                                          time            /* time stamp 
-                                  );
-                                                  
-                                                  
-                                                  /* No target offered by source => error 
-                                                 
-                          
-                               return  is_valid_drop_site;
-                               */
-                          }
-                    }
-                }
-            ]
-
-        }
-    ]
-
-});
-WindowRooView.init();
-XObject.cache['/WindowRooView'] = WindowRooView;
diff --git a/Builder4/WindowRooView.js.rej b/Builder4/WindowRooView.js.rej
deleted file mode 100644 (file)
index 1acc28a..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
---- Builder4/WindowRooView.js
-+++ Builder4/WindowRooView.js
-@@ -156,236 +156,233 @@
-             id : "inspectorcontainer",
-             shadow_type : Gtk.ShadowType.IN,
-             xtype : "ScrolledWindow",
--            xns : Gtk,
--            items : [
--              {
--                    renderedData : "\"\"",
--                    id : "view",
--                    refreshRequired : false,
--                    redraws : 0,
--                    xtype : "WebView",
--                    inspector : "",
--                    redraws : 0,
--                    runRefresh : () 
--                    {
--                        // this is run every 2 seconds from the init..
--                    
--                      
--                        
--                        if (!this.refreshRequired) {
--                           // print("no refresh required");
--                            return;
--                        }
--                    
--                        if (this.lastRedraw != null) {
--                           // do not redraw if last redraw was less that 5 seconds ago.
--                           if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {
--                                return;
--                            }
--                        }
--                        
--                        if (_this.file == null) {
--                            return;
--                        }
--                        
--                        
--                         this.refreshRequired = false;
--                       //  print("HTML RENDERING");
--                         
--                         
--                         //this.get('/BottomPane').el.show();
--                         //this.get('/BottomPane').el.set_current_page(2);// webkit inspector
--                        _this.file.webkit_page_id  = this.el.get_page_id();
--                        
--                        var js = _this.file.toSourcePreview();
--                    
--                        if (js.length < 1) {
--                            print("no data");
--                            return;
--                        }
--                    //    var  data = js[0];
--                        this.redraws++;
--                      
--                        var project = _this.file.project;  
-+            xns : Gtk
-+        },
-+      {
-+            renderedData : "\"\"",
-+            id : "view",
-+            refreshRequired : false,
-+            redraws : 0,
-+            xtype : "WebView",
-+            inspector : "",
-+            redraws : 0,
-+            runRefresh : () 
-+            {
-+                // this is run every 2 seconds from the init..
-+            
-+              
-+                
-+                if (!this.refreshRequired) {
-+                   // print("no refresh required");
-+                    return;
-+                }
-+            
-+                if (this.lastRedraw != null) {
-+                   // do not redraw if last redraw was less that 5 seconds ago.
-+                   if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {
-+                        return;
-+                    }
-+                }
-+                
-+                if (_this.file == null) {
-+                    return;
-+                }
-+                
-+                
-+                 this.refreshRequired = false;
-+               //  print("HTML RENDERING");
-+                 
-+                 
-+                 //this.get('/BottomPane').el.show();
-+                 //this.get('/BottomPane').el.set_current_page(2);// webkit inspector
-+                _this.file.webkit_page_id  = this.el.get_page_id();
-+                
-+                var js = _this.file.toSourcePreview();
-+            
-+                if (js.length < 1) {
-+                    print("no data");
-+                    return;
-+                }
-+            //    var  data = js[0];
-+                this.redraws++;
-+              
-+                var project = _this.file.project;  
-+            
-+                 //print (project.fn);
-+                 // set it to non-empty.
-+                 
-+            //     runhtml = runhtml.length ?  runhtml : '<script type="text/javascript"></script>'; 
-+            
-+            
-+            //   this.runhtml  = this.runhtml || '';
-+             
-+             
-+                // then we need to reload the browser using
-+                // load_html_string..
-+            
-+                // then trigger a redraw once it's loaded..
-+                this.pendingRedraw = true;
-+            
-+                var runhtml = "<script type=\"text/javascript\">\n" ;
-+                string builderhtml;
-+                
-+                
-+                GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + "/resources/roo.builder.js", out builderhtml);
-+            
-+                runhtml += builderhtml + "\n";
-+                runhtml += "</script>\n" ;
-+            
-+                // fix to make sure they are the same..
-+                this.runhtml = project.runhtml;
-+                // need to modify paths
-+            
-+                string inhtml;
-+                var base_template = _this.file.project.base_template;
-+                
-+                if (base_template.length > 0 && !FileUtils.test(
-+                    Builder4.Application.configDirectory() + "/resources/" +  base_template, FileTest.EXISTS)  
-+                    ) {
-+                       print("invalid base_template name - using default:  %s\n", base_template);
-+                       base_template = "";
-+                
-+                }
-+                
-+                GLib.FileUtils.get_contents(
-+                    Builder4.Application.configDirectory() + "/resources/" + 
-+                        (base_template.length > 0 ? base_template :  "roo.builder.html")
-+                        , out inhtml);
-+                
-+                
-+                this.renderedData = js;
-+            
-+            
-+                string js_src = js + "\n" +
-+              "Roo.onReady(function() {\n" +
-+              "if (" + _this.file.name +".show) " +  _this.file.name +".show({});\n" +
-+              "Roo.XComponent.build();\n" +
-+              "});\n";
-+              
-+                print("render js: " + js);
-+                //if (!this.ready) {
-+              //      console.log('not loaded yet');
-+                //}
-+                this.lastRedraw = new DateTime.now_local();
-+            
-+                    var html = inhtml.replace("</head>", runhtml + this.runhtml + 
-                     
--                         //print (project.fn);
--                         // set it to non-empty.
--                         
--                    //     runhtml = runhtml.length ?  runhtml : '<script type="text/javascript"></script>'; 
-+                            "<script type=\"text/javascript\">\n" +
-+                            js_src + "\n" + 
-+                            "</script>" + 
-+                                    
-+                    "</head>");
-+                    print("LOAD HTML " + html);
-                     
-+                     var rootURL = _this.file.project.rootURL;
-+               
-                     
--                    //   this.runhtml  = this.runhtml || '';
--                     
--                     
--                        // then we need to reload the browser using
--                        // load_html_string..
-                     
--                        // then trigger a redraw once it's loaded..
--                        this.pendingRedraw = true;
-+                    this.el.load_html( html , 
-+                        //fixme - should be a config option!
-+                        (rootURL.length > 0 ? rootURL : "http://localhost/app.Builder/")
-+                    );
-                     
--                        var runhtml = "<script type=\"text/javascript\">\n" ;
--                        string builderhtml;
--                        
--                        
--                        GLib.FileUtils.get_contents(Builder4.Application.configDirectory() + "/resources/roo.builder.js", out builderhtml);
-+                // force the inspector...        
-+                    this.el.get_inspector().show();
-+                    this.el.get_inspector().open_window();
-                     
--                        runhtml += builderhtml + "\n";
--                        runhtml += "</script>\n" ;
--                    
--                        // fix to make sure they are the same..
--                        this.runhtml = project.runhtml;
--                        // need to modify paths
--                    
--                        string inhtml;
--                        var base_template = _this.file.project.base_template;
--                        
--                        if (base_template.length > 0 && !FileUtils.test(
--                            Builder4.Application.configDirectory() + "/resources/" +  base_template, FileTest.EXISTS)  
--                            ) {
--                               print("invalid base_template name - using default:  %s\n", base_template);
--                               base_template = "";
--                        
--                        }
--                        
--                        GLib.FileUtils.get_contents(
--                            Builder4.Application.configDirectory() + "/resources/" + 
--                                (base_template.length > 0 ? base_template :  "roo.builder.html")
--                                , out inhtml);
--                        
--                        
--                        this.renderedData = js;
--                    
--                    
--                        string js_src = js + "\n" +
--                      "Roo.onReady(function() {\n" +
--                      "if (" + _this.file.name +".show) " +  _this.file.name +".show({});\n" +
--                      "Roo.XComponent.build();\n" +
--                      "});\n";
--                      
--                        print("render js: " + js);
--                        //if (!this.ready) {
--                      //      console.log('not loaded yet');
--                        //}
--                        this.lastRedraw = new DateTime.now_local();
--                    
--                            var html = inhtml.replace("</head>", runhtml + this.runhtml + 
--                            
--                                    "<script type=\"text/javascript\">\n" +
--                                    js_src + "\n" + 
--                                    "</script>" + 
--                                            
--                            "</head>");
--                            print("LOAD HTML " + html);
--                            
--                             var rootURL = _this.file.project.rootURL;
--                       
--                            
--                            
--                            this.el.load_html( html , 
--                                //fixme - should be a config option!
--                                (rootURL.length > 0 ? rootURL : "http://localhost/app.Builder/")
--                            );
--                            
--                        // force the inspector...        
--                            this.el.get_inspector().show();
--                            this.el.get_inspector().open_window();
--                            
--                            // - no need for this, the builder javascript will call it when build is complete
--                            //GLib.Timeout.add_seconds(1, () => {
--                            //    this.el.run_javascript("Builder.saveHTML()",null);
--                            //    return false;
--                            //});
--                    //     print( "before render" +    this.lastRedraw);
--                    //    print( "after render" +    (new Date()));
--                        
--                    },
--                    xns : WebKit,
--                    lastRedraw : "null",
--                    runhtml : "\"\"",
--                    pendingRedraw : false,
--                    renderJS : (bool force) {
--                    
--                        // this is the public redraw call..
--                        // we refresh in a loop privately..
--                        var autodraw = _this.AutoRedraw.el.active;
--                        if (!autodraw && !force) {
--                            print("Skipping redraw - no force, and autodraw off");
--                            return;
--                        }
--                        this.refreshRequired  = true;
--                    },
--                    listeners : {
--                      script_dialog : (dialog) => {
--                              var msg = dialog.get_message();
--                              if (msg.length < 4) {
--                                 return false;
--                              }
--                              if (msg.substring(0,4) != "IPC:") {
--                                  return false;
--                              }
--                              var ar = msg.split(":", 3);
--                             if (ar.length < 3) {
--                                 return false;
--                             }
--                             switch(ar[1]) {
--                                 case "SAVEHTML":
--                                     _this.file.saveHTML(ar[2]);
--                                     return true;
--                                 default:
--                                     return false;
--                             }
--                             
--                         },
--                      show : ( ) => {
--                             this.inspector = this.el.get_inspector();
--                             this.inspector.ref();
--                             this.inspector.open_window.connect(() => {
--                                  this.inspector = this.el.get_inspector();
--                                 print("inspector attach\n");
--                                 var wv = this.inspector.get_web_view();
--                                 if (wv != null) {
--                                     print("got inspector web view\n");
--                                     _this.inspectorcontainer.el.add(wv);
--                                     wv.show();
--                                 } else {
--                                     print("no web view yet\n");
--                                 }
--                                 return true;
--                                
--                             });
--                            this.inspector.closed.connect(() => {
--                                 
--                                 this.inspector.show();
--                                
--                             }); 
--                             this.inspector.show();
--                         },
--                      drag_drop : ( ctx, x, y,time, ud) => {
--                             return false;
--                             /*
--                              print("TARGET: drag-drop");
--                                 var is_valid_drop_site = true;
--                                 
--                                  
--                                 Gtk.drag_get_data
--                                 (
--                                         w,         // will receive 'drag-data-received' signal 
--                                         ctx,        /* represents the current state of the DnD 
--                                         this.get('/Window').atoms["STRING"],    /* the target type we want 
--                                         time            /* time stamp 
--                                 );
--                                                 
--                                                 
--                                                 /* No target offered by source => error 
--                                                
--                         
--                              return  is_valid_drop_site;
--                              */
--                         }
--                    }
-+                    // - no need for this, the builder javascript will call it when build is complete
-+                    //GLib.Timeout.add_seconds(1, () => {
-+                    //    this.el.run_javascript("Builder.saveHTML()",null);
-+                    //    return false;
-+                    //});
-+            //     print( "before render" +    this.lastRedraw);
-+            //    print( "after render" +    (new Date()));
-+                
-+            },
-+            xns : WebKit,
-+            lastRedraw : "null",
-+            runhtml : "\"\"",
-+            pendingRedraw : false,
-+            renderJS : (bool force) {
-+            
-+                // this is the public redraw call..
-+                // we refresh in a loop privately..
-+                var autodraw = _this.AutoRedraw.el.active;
-+                if (!autodraw && !force) {
-+                    print("Skipping redraw - no force, and autodraw off");
-+                    return;
-                 }
--            ]
--
-+                this.refreshRequired  = true;
-+            },
-+            listeners : {
-+              script_dialog : (dialog) => {
-+                      var msg = dialog.get_message();
-+                      if (msg.length < 4) {
-+                         return false;
-+                      }
-+                      if (msg.substring(0,4) != "IPC:") {
-+                          return false;
-+                      }
-+                      var ar = msg.split(":", 3);
-+                     if (ar.length < 3) {
-+                         return false;
-+                     }
-+                     switch(ar[1]) {
-+                         case "SAVEHTML":
-+                             _this.file.saveHTML(ar[2]);
-+                             return true;
-+                         default:
-+                             return false;
-+                     }
-+                     
-+                 },
-+              show : ( ) => {
-+                     this.inspector = this.el.get_inspector();
-+                     this.inspector.ref();
-+                     this.inspector.open_window.connect(() => {
-+                          this.inspector = this.el.get_inspector();
-+                         print("inspector attach\n");
-+                         var wv = this.inspector.get_web_view();
-+                         if (wv != null) {
-+                             print("got inspector web view\n");
-+                             _this.inspectorcontainer.el.add(wv);
-+                             wv.show();
-+                         } else {
-+                             print("no web view yet\n");
-+                         }
-+                         return true;
-+                        
-+                     });
-+                    this.inspector.closed.connect(() => {
-+                         
-+                         this.inspector.show();
-+                        
-+                     }); 
-+                     this.inspector.show();
-+                 },
-+              drag_drop : ( ctx, x, y,time, ud) => {
-+                     return false;
-+                     /*
-+                      print("TARGET: drag-drop");
-+                         var is_valid_drop_site = true;
-+                         
-+                          
-+                         Gtk.drag_get_data
-+                         (
-+                                 w,         // will receive 'drag-data-received' signal 
-+                                 ctx,        /* represents the current state of the DnD 
-+                                 this.get('/Window').atoms["STRING"],    /* the target type we want 
-+                                 time            /* time stamp 
-+                         );
-+                                         
-+                                         
-+                                         /* No target offered by source => error 
-+                                        
-+                 
-+                      return  is_valid_drop_site;
-+                      */
-+                 }
-+            }
-         }
-     ]