diff options
Diffstat (limited to 'WebKit/wx')
-rw-r--r-- | WebKit/wx/ChangeLog | 89 | ||||
-rw-r--r-- | WebKit/wx/WebFrame.cpp | 4 | ||||
-rw-r--r-- | WebKit/wx/WebKitSupport/ChromeClientWx.cpp | 12 | ||||
-rw-r--r-- | WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp | 4 | ||||
-rw-r--r-- | WebKit/wx/WebView.cpp | 68 | ||||
-rw-r--r-- | WebKit/wx/WebView.h | 21 | ||||
-rw-r--r-- | WebKit/wx/bindings/python/samples/simple.py | 6 | ||||
-rw-r--r-- | WebKit/wx/bindings/python/webview.i | 3 |
8 files changed, 197 insertions, 10 deletions
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index 76f4533..f2cc27f 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,92 @@ +2009-10-23 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Update the globalObject calls after changes. + + * WebFrame.cpp: + (wxWebFrame::RunScript): + * WebKitSupport/FrameLoaderClientWx.cpp: + (WebCore::FrameLoaderClientWx::windowObjectCleared): + +2009-10-21 Pedro Romano <pmcnr72@gmail.com> + + Reviewed by Kevin Ollivier. + + Include 'WebFrame.h' declared classes in wxPython bindings. + + https://bugs.webkit.org/show_bug.cgi?id=30504 + + * bindings/python/webview.i: + +2009-10-18 Kevin Watters <kevinwatters@gmail.com> + + Reviewed by Kevin Ollivier. + + Add the ability to specify a proxy for wxWebKit. + + https://bugs.webkit.org/show_bug.cgi?id=30446 + + * WebView.cpp: + (curlProxyType): + (wxWebView::SetProxyInfo): + * WebView.h: + +2009-10-18 Kevin Watters <kevinwatters@gmail.com> + + Reviewed by Kevin Ollivier. + + Add basic database support to wx API + + https://bugs.webkit.org/show_bug.cgi?id=30445 + + * WebKitSupport/ChromeClientWx.cpp: + (WebCore::ChromeClientWx::exceededDatabaseQuota): + * WebView.cpp: + (wxWebView::Create): + (wxWebView::SetDatabaseDirectory): + (wxWebView::GetDatabaseDirectory): + * WebView.h: + +2009-10-16 Kevin Watters <kevinwatters@gmail.com> + + Reviewed by Kevin Ollivier. + + Optionally allow the user to zoom text using the mouse wheel. + + https://bugs.webkit.org/show_bug.cgi?id=30444 + + * WebView.cpp: + (wxWebView::wxWebView): + (wxWebView::OnMouseEvents): + * WebView.h: + +2009-10-16 Kevin Ollivier <kevino@theolliviers.com> + + wxMSW non-precomp headers build fix. + + * WebView.cpp: + +2009-10-15 Robin Dunn <robin@alldunn.com> + + Reviewed by Kevin Ollivier. + + Update the wxPython simple.py sample to match current wxWebKit API. + + https://bugs.webkit.org/show_bug.cgi?id=30406 + + * bindings/python/samples/simple.py: + +2009-10-08 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Move executeScript from FrameLoader to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=30200 + + Update API call. + + * WebFrame.cpp: + (wxWebFrame::RunScript): + 2009-10-07 Adam Barth <abarth@webkit.org> Reviewed by Darin Adler. diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp index f205152..9018d37 100644 --- a/WebKit/wx/WebFrame.cpp +++ b/WebKit/wx/WebFrame.cpp @@ -188,9 +188,9 @@ wxString wxWebFrame::RunScript(const wxString& javascript) { wxString returnValue = wxEmptyString; if (m_impl->frame) { - JSC::JSValue result = m_impl->frame->loader()->executeScript(javascript, true).jsValue(); + JSC::JSValue result = m_impl->frame->script()->executeScript(javascript, true).jsValue(); if (result) - returnValue = wxString(result.toString(m_impl->frame->script()->globalObject()->globalExec()).UTF8String().c_str(), wxConvUTF8); + returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).UTF8String().c_str(), wxConvUTF8); } return returnValue; } diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp index 9b2f264..629463f 100644 --- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp @@ -28,8 +28,12 @@ #include "config.h" #include "ChromeClientWx.h" #include "Console.h" +#if ENABLE(DATABASE) +#include "DatabaseTracker.h" +#endif #include "FileChooser.h" #include "FloatRect.h" +#include "Frame.h" #include "FrameLoadRequest.h" #include "NotImplemented.h" #include "PlatformString.h" @@ -381,7 +385,13 @@ void ChromeClientWx::print(Frame*) #if ENABLE(DATABASE) void ChromeClientWx::exceededDatabaseQuota(Frame*, const String&) { - notImplemented(); + unsigned long long quota = 5 * 1024 * 1024; + + if (wxWebFrame* webFrame = m_webView->GetMainFrame()) + if (Frame* frame = webFrame->GetFrame()) + if (Document* document = frame->document()) + if (!DatabaseTracker::tracker().hasEntryForOrigin(document->securityOrigin())) + DatabaseTracker::tracker().setQuota(document->securityOrigin(), quota); } #endif diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp index 0a5eeaf..9d12ca7 100644 --- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp +++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp @@ -836,8 +836,8 @@ void FrameLoaderClientWx::windowObjectCleared() if (m_webView) { wxWebViewWindowObjectClearedEvent wkEvent(m_webView); Frame* coreFrame = m_webView->GetMainFrame()->GetFrame(); - JSGlobalContextRef context = toGlobalRef(coreFrame->script()->globalObject()->globalExec()); - JSObjectRef windowObject = toRef(coreFrame->script()->globalObject()); + JSGlobalContextRef context = toGlobalRef(coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()); + JSObjectRef windowObject = toRef(coreFrame->script()->globalObject(mainThreadNormalWorld())); wkEvent.SetJSContext(context); wkEvent.SetWindowObject(windowObject); m_webView->GetEventHandler()->ProcessEvent(wkEvent); diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp index 88b5990..1b27cde 100644 --- a/WebKit/wx/WebView.cpp +++ b/WebKit/wx/WebView.cpp @@ -39,6 +39,7 @@ #include "FrameLoader.h" #include "FrameView.h" #include "GraphicsContext.h" +#include "HTMLFormElement.h" #include "Logging.h" #include "markup.h" #include "Page.h" @@ -49,6 +50,7 @@ #include "PluginHalterClient.h" #include "RenderObject.h" #include "RenderView.h" +#include "ResourceHandleManager.h" #include "Scrollbar.h" #include "SelectionController.h" #include "Settings.h" @@ -67,6 +69,10 @@ #include <runtime/JSValue.h> #include <runtime/UString.h> +#if ENABLE(DATABASE) +#include "DatabaseTracker.h" +#endif + #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" @@ -268,6 +274,7 @@ wxWebView::wxWebView() : m_isEditable(false), m_isInitialized(false), m_beingDestroyed(false), + m_mouseWheelZooms(false), m_title(wxEmptyString) { } @@ -278,6 +285,7 @@ wxWebView::wxWebView(wxWindow* parent, int id, const wxPoint& position, m_isEditable(false), m_isInitialized(false), m_beingDestroyed(false), + m_mouseWheelZooms(false), m_title(wxEmptyString) { Create(parent, id, position, size, style, name); @@ -327,6 +335,10 @@ bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position, settings->setStandardFontFamily("Times New Roman"); settings->setJavaScriptEnabled(true); +#if ENABLE(DATABASE) + settings->setDatabasesEnabled(true); +#endif + m_isInitialized = true; return true; @@ -591,8 +603,16 @@ void wxWebView::OnMouseEvents(wxMouseEvent& event) wxEventType type = event.GetEventType(); if (type == wxEVT_MOUSEWHEEL) { - WebCore::PlatformWheelEvent wkEvent(event, globalPoint); - frame->eventHandler()->handleWheelEvent(wkEvent); + if (m_mouseWheelZooms && event.ControlDown() && !event.AltDown() && !event.ShiftDown()) { + if (event.GetWheelRotation() < 0) + DecreaseTextSize(); + else if (event.GetWheelRotation() > 0) + IncreaseTextSize(); + } else { + WebCore::PlatformWheelEvent wkEvent(event, globalPoint); + frame->eventHandler()->handleWheelEvent(wkEvent); + } + return; } @@ -887,3 +907,47 @@ bool wxWebView::ShouldClose() const return true; } + +/* static */ +void wxWebView::SetDatabaseDirectory(const wxString& databaseDirectory) +{ +#if ENABLE(DATABASE) + WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(databaseDirectory); +#endif +} + +/* static */ +wxString wxWebView::GetDatabaseDirectory() +{ +#if ENABLE(DATABASE) + return WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); +#else + return wxEmptyString; +#endif +} + +static WebCore::ResourceHandleManager::ProxyType curlProxyType(wxProxyType type) +{ + switch (type) { + case HTTP: return WebCore::ResourceHandleManager::HTTP; + case Socks4: return WebCore::ResourceHandleManager::Socks4; + case Socks4A: return WebCore::ResourceHandleManager::Socks4A; + case Socks5: return WebCore::ResourceHandleManager::Socks5; + case Socks5Hostname: return WebCore::ResourceHandleManager::Socks5Hostname; + default: + ASSERT_NOT_REACHED(); + return WebCore::ResourceHandleManager::HTTP; + } +} + +/* static */ +void wxWebView::SetProxyInfo(const wxString& host, + unsigned long port, + wxProxyType type, + const wxString& username, + const wxString& password) +{ + using WebCore::ResourceHandleManager; + if (ResourceHandleManager* mgr = ResourceHandleManager::sharedInstance()) + mgr->setProxyInfo(host, port, curlProxyType(type), username, password); +} diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h index e83c420..9b1cfab 100644 --- a/WebKit/wx/WebView.h +++ b/WebKit/wx/WebView.h @@ -105,6 +105,14 @@ enum { WebKitErrorJavaUnavailable = 202, }; +enum wxProxyType { + HTTP, + Socks4, + Socks4A, + Socks5, + Socks5Hostname +}; + class WXDLLIMPEXP_WEBKIT wxWebView : public wxWindow { // ChromeClientWx needs to get the Page* stored by the wxWebView @@ -194,6 +202,18 @@ public: static void SetCachePolicy(const wxWebViewCachePolicy& cachePolicy); static wxWebViewCachePolicy GetCachePolicy(); + void SetMouseWheelZooms(bool mouseWheelZooms) { m_mouseWheelZooms = mouseWheelZooms; } + bool GetMouseWheelZooms() const { return m_mouseWheelZooms; } + + static void SetDatabaseDirectory(const wxString& databaseDirectory); + static wxString GetDatabaseDirectory(); + + static void SetProxyInfo(const wxString& host = wxEmptyString, + unsigned long port = 0, + wxProxyType type = HTTP, + const wxString& username = wxEmptyString, + const wxString& password = wxEmptyString); + protected: // event handlers (these functions should _not_ be virtual) @@ -216,6 +236,7 @@ private: bool m_isEditable; bool m_isInitialized; bool m_beingDestroyed; + bool m_mouseWheelZooms; WebViewPrivate* m_impl; wxWebFrame* m_mainFrame; wxString m_title; diff --git a/WebKit/wx/bindings/python/samples/simple.py b/WebKit/wx/bindings/python/samples/simple.py index 52d4e1b..2756760 100644 --- a/WebKit/wx/bindings/python/samples/simple.py +++ b/WebKit/wx/bindings/python/samples/simple.py @@ -92,11 +92,11 @@ class TestPanel(wx.Panel): def OnStateChanged(self, event): statusbar = self.GetParent().GetStatusBar() if statusbar: - if event.GetState() == wx.webview.WEBVIEW_STATE_NEGOTIATING: + if event.GetState() == wx.webview.WEBVIEW_LOAD_NEGOTIATING: statusbar.SetStatusText("Contacting " + event.GetURL()) - elif event.GetState() == wx.webview.WEBVIEW_STATE_TRANSFERRING: + elif event.GetState() == wx.webview.WEBVIEW_LOAD_TRANSFERRING: statusbar.SetStatusText("Loading " + event.GetURL()) - elif event.GetState() == wx.webview.WEBVIEW_STATE_STOP: + elif event.GetState() == wx.webview.WEBVIEW_LOAD_DOC_COMPLETED: statusbar.SetStatusText("") self.location.SetValue(event.GetURL()) self.GetParent().SetTitle("wxWebView - " + self.webview.GetPageTitle()) diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i index 44b38ab..410191a 100644 --- a/WebKit/wx/bindings/python/webview.i +++ b/WebKit/wx/bindings/python/webview.i @@ -28,6 +28,7 @@ %{ #include "wx/wxPython/wxPython.h" #include "wx/wxPython/pyclasses.h" +#include "WebFrame.h" #include "WebView.h" #include "WebBrowserShell.h" %} @@ -38,9 +39,11 @@ MAKE_CONST_WXSTRING(WebViewNameStr); +MustHaveApp(wxWebFrame); MustHaveApp(wxWebView); MustHaveApp(wxWebBrowserShell); +%include WebFrame.h %include WebView.h %include WebBrowserShell.h |