Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-13 12:16:03 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-06-13 12:16:03 (GMT)
commitc84af0839782820ff42a8cf08c3b76d830f77757 (patch)
tree9c4c7bbd9474dc3dfa45f2b00e65e2b839e6d0ac
parentfe86acf314161823a648dd480e55915dc184e057 (diff)
Implement get_doc_shell in python.
-rw-r--r--python/hulahop.defs6
-rw-r--r--python/hulahop.override7
-rw-r--r--python/webview.py3
-rw-r--r--src/hulahop-web-view.cpp13
-rw-r--r--src/hulahop-web-view.h1
5 files changed, 2 insertions, 28 deletions
diff --git a/python/hulahop.defs b/python/hulahop.defs
index 8fafc59..4f18c2d 100644
--- a/python/hulahop.defs
+++ b/python/hulahop.defs
@@ -29,12 +29,6 @@
(return-type "none")
)
-(define-method get_doc_shell
- (of-object "HulahopWebView")
- (c-name "hulahop_web_view_get_doc_shell")
- (return-type "none")
-)
-
(define-function startup
(c-name "hulahop_startup")
(return-type "gboolean")
diff --git a/python/hulahop.override b/python/hulahop.override
index 4353268..d846c64 100644
--- a/python/hulahop.override
+++ b/python/hulahop.override
@@ -29,10 +29,3 @@ _wrap_hulahop_web_view_get_window_root(PyGObject *self)
return hulahop_web_view_get_window_root(HULAHOP_WEB_VIEW(self->obj));
}
%%
-override hulahop_web_view_get_doc_shell noargs
-static PyObject *
-_wrap_hulahop_web_view_get_doc_shell(PyGObject *self)
-{
- return hulahop_web_view_get_doc_shell(HULAHOP_WEB_VIEW(self->obj));
-}
-%%
diff --git a/python/webview.py b/python/webview.py
index 7f2534e..1c2a80c 100644
--- a/python/webview.py
+++ b/python/webview.py
@@ -193,7 +193,8 @@ class WebView(_hulahop.WebView):
return _hulahop.WebView.get_browser(self)
def get_doc_shell(self):
- return _hulahop.WebView.get_doc_shell(self)
+ requestor = self.browser.queryInterface(interfaces.nsIInterfaceRequestor)
+ return requestor.getInterface(interfaces.nsIDocShell)
def get_web_progress(self):
return self.doc_shell.queryInterface(interfaces.nsIWebProgress)
diff --git a/src/hulahop-web-view.cpp b/src/hulahop-web-view.cpp
index bd6f14e..2eeebc6 100644
--- a/src/hulahop-web-view.cpp
+++ b/src/hulahop-web-view.cpp
@@ -27,7 +27,6 @@
#include <nsIDOMWindow2.h>
#include <nsIDOMEventTarget.h>
#include <nsIBaseWindow.h>
-#include <nsIDocShell.h>
#include <nsIInterfaceRequestorUtils.h>
#include <PyXPCOM.h>
@@ -275,18 +274,6 @@ hulahop_web_view_get_window_root(HulahopWebView *web_view)
NS_GET_IID(nsIDOMEventTarget));
}
-PyObject *
-hulahop_web_view_get_doc_shell(HulahopWebView *web_view)
-{
- nsresult rv;
-
- nsCOMPtr<nsIDocShell> docShell(do_GetInterface(web_view->browser, &rv));
- NS_ENSURE_SUCCESS (rv, NULL);
-
- return PyObject_FromNSInterface(docShell,
- NS_GET_IID(nsIDocShell));
-}
-
void
hulahop_web_view_create_window(HulahopWebView *web_view)
{
diff --git a/src/hulahop-web-view.h b/src/hulahop-web-view.h
index d90a46f..7f56a63 100644
--- a/src/hulahop-web-view.h
+++ b/src/hulahop-web-view.h
@@ -41,7 +41,6 @@ void hulahop_web_view_grab_focus (HulahopWebView *web_view);
void hulahop_web_view_create_window (HulahopWebView *web_view);
PyObject *hulahop_web_view_get_browser (HulahopWebView *web_view);
PyObject *hulahop_web_view_get_window_root (HulahopWebView *web_view);
-PyObject *hulahop_web_view_get_doc_shell (HulahopWebView *web_view);
G_END_DECLS