Sample/Window.bjs
authorAlan Knowles <alan@akbkhome.com>
Mon, 14 Jun 2010 09:25:42 +0000 (17:25 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 14 Jun 2010 09:25:42 +0000 (17:25 +0800)
Sample/Window.bjs

index e9929b4..b126265 100644 (file)
                                                                                                 "drag_drop": "function (w, ctx, x, y,time, ud) {\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}",
                                                                                                 "drag_data_received": "function (w, ctx,  x,  y, sel_data,  target_type,  time, ud) \n    {\n        print(\"Browser: drag-data-received\");\n        var delete_selection_data = false;\n        vardnd_success = false;\n        /* Deal with what we are given from source */\n        if( sel_data && sel_data.length ) {\n            \n            if (ctx.action == Gdk.DragAction.ASK)  {\n                /* Ask the user to move or copy, then set the ctx action. */\n            }\n\n            if (ctx.action == Gdk.DragAction.MOVE) {\n                delete_selection_data = true;\n            }\n            var source = Gtk.drag_get_source_widget(ctx);\n\n            print(\"Browser: source.DRAGDATA? \" + source.dragData);\n            if (this.targetData) {\n                print(this.targetData);\n                this.get('/LeftTree.model').dropNode(this.targetData,  source.dragData);\n            }\n            \n            \n            \n            dnd_success = true;\n\n        }\n\n        if (dnd_success == false)\n        {\n                Seed.print (\"DnD data transfer failed!\\n\");\n        }\n        \n        Gtk.drag_finish (ctx, dnd_success, delete_selection_data, time);\n        return true;\n    }",
                                                                                                 "new_window_policy_decision_requested": "function (self, object, p0, p1, p2) {\nprint(\"new window policy decision\");\n    return false;\n}",
-                                                                                                "navigation_policy_decision_requested": "function (self, object, p0, p1, p2) {\nprint(\"navigation  policy decision\");\n    return false;\n}"
+                                                                                                "navigation_policy_decision_requested": "function (self, object, p0, p1, p2) {\nprint(\"navigation  policy decision\");\n    return false;\n}",
+                                                                                                "mime_type_policy_decision_requested": "function (self, object, p0, p1, p2) {\n    return false;\n}"
                                                                                             },
                                                                                             "id": "view",
                                                                                             "pack": "add",