diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-22 10:29:30 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-22 10:29:30 (GMT) |
commit | 2c92da58d54b62149d5e286f6d44d334cb415b5f (patch) | |
tree | a7dd03ef05367c37c7355720bb1b01d4d7457e13 /python | |
parent | 2022177e42224f24d1350d7bdebe4d6badc3d821 (diff) |
Skeleton implementation of chrome
Diffstat (limited to 'python')
-rw-r--r-- | python/hulahop.defs | 6 | ||||
-rw-r--r-- | python/webview.py | 53 |
2 files changed, 59 insertions, 0 deletions
diff --git a/python/hulahop.defs b/python/hulahop.defs index 49dff91..7c17625 100644 --- a/python/hulahop.defs +++ b/python/hulahop.defs @@ -5,6 +5,12 @@ (gtype-id "HULAHOP_TYPE_WEB_VIEW") ) +(define-method create_window + (of-object "HulahopWebView") + (c-name "hulahop_web_view_create_window") + (return-type "none") +) + (define-method get_browser (of-object "HulahopWebView") (c-name "hulahop_web_view_get_browser") diff --git a/python/webview.py b/python/webview.py index 81465fe..9c077a9 100644 --- a/python/webview.py +++ b/python/webview.py @@ -17,12 +17,65 @@ from hulahop import _hulahop +import xpcom from xpcom import components from xpcom.components import interfaces +class _Chrome: + _com_interfaces_ = interfaces.nsIWebBrowserChrome, \ + interfaces.nsIEmbeddingSiteWindow + + # nsIWebBrowserChrome + def destroyBrowserWindow(self): + pass + + def exitModalEventLoop(self, status): + pass + + def isWindowModal(self): + return False + + def setStatus(self, statusType, status): + pass + + def showAsModal(self): + pass + + def sizeBrowserTo(self, cx, cy): + pass + + # nsIEmbeddingSiteWindow + def getDimensions(self, flags): + pass + + def setDimensions(self, flags, x, y, cx, cy): + pass + + def setFocus(self): + pass + + def get_title(self): + return '' + + def set_title(self, title): + print title + + def get_visibility(self): + return True + + def set_visibility(self, visibility): + pass + class WebView(_hulahop.WebView): def __init__(self): _hulahop.WebView.__init__(self) + + self._chrome = xpcom.server.WrapObject( + _Chrome(), interfaces.nsIEmbeddingSiteWindow) + weak_ref = xpcom.client.WeakReference(self._chrome) + self.browser.containerWindow = self._chrome + + self.create_window() def get_window_root(self): return _hulahop.WebView.get_window_root(self) |