summaryrefslogtreecommitdiffstats
path: root/WebKit/wx
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/wx')
-rw-r--r--WebKit/wx/Bakefiles.bkgen112
-rw-r--r--WebKit/wx/ChangeLog1075
-rw-r--r--WebKit/wx/WebBrowserShell.cpp329
-rw-r--r--WebKit/wx/WebBrowserShell.h98
-rw-r--r--WebKit/wx/WebFrame.cpp317
-rw-r--r--WebKit/wx/WebFrame.h120
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.cpp361
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.h121
-rw-r--r--WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp86
-rw-r--r--WebKit/wx/WebKitSupport/ContextMenuClientWx.h55
-rw-r--r--WebKit/wx/WebKitSupport/DragClientWx.cpp75
-rw-r--r--WebKit/wx/WebKitSupport/DragClientWx.h45
-rw-r--r--WebKit/wx/WebKitSupport/EditorClientWx.cpp390
-rw-r--r--WebKit/wx/WebKitSupport/EditorClientWx.h110
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp878
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h219
-rw-r--r--WebKit/wx/WebKitSupport/InspectorClientWx.cpp117
-rw-r--r--WebKit/wx/WebKitSupport/InspectorClientWx.h68
-rw-r--r--WebKit/wx/WebView.cpp594
-rw-r--r--WebKit/wx/WebView.h412
-rw-r--r--WebKit/wx/WebViewPrivate.h64
-rw-r--r--WebKit/wx/bindings/python/samples/simple.py162
-rw-r--r--WebKit/wx/bindings/python/webview.i60
-rw-r--r--WebKit/wx/bindings/python/wxwebkit-py.bkl116
-rw-r--r--WebKit/wx/dependencies.bkl175
-rw-r--r--WebKit/wx/presets/wxwebkit.bkl144
-rw-r--r--WebKit/wx/wxwebkit.bkl83
-rw-r--r--WebKit/wx/wxwk-settings.bkl101
28 files changed, 6487 insertions, 0 deletions
diff --git a/WebKit/wx/Bakefiles.bkgen b/WebKit/wx/Bakefiles.bkgen
new file mode 100644
index 0000000..44cc496
--- /dev/null
+++ b/WebKit/wx/Bakefiles.bkgen
@@ -0,0 +1,112 @@
+<?xml version="1.0" ?>
+<!--
+Copyright (C) 2005, 2006, 2007 Apple Computer, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Build configuration script for Bakefile.
+-->
+
+<bakefile-gen>
+
+ <input>
+ ../../JavaScriptCore/jscore.bkl
+ ../../WebCore/webcore-wx.bkl
+ wxwebkit.bkl
+ bindings/python/wxwebkit-py.bkl
+ ../../WebKitTools/wx/browser/browser.bkl
+ </input>
+
+ <!-- List of output formats to generate: -->
+ <add-formats>
+ gnu,msvs2005prj,msvc
+ </add-formats>
+
+ <!-- JSCore settings -->
+ <add-flags files="../../JavaScriptCore/jscore.bkl" formats="gnu">
+ -o../../JavaScriptCore/GNUmakefile
+ </add-flags>
+ <add-flags files="../../JavaScriptCore/jscore.bkl" formats="msvs2005prj">
+ -o../../JavaScriptCore/JavaScriptCore.sln
+ </add-flags>
+ <add-flags files="../../JavaScriptCore/jscore.bkl" formats="msvc">
+ -o../../JavaScriptCore/makefile.vc
+ </add-flags>
+ <!-- testing XCode backend
+ <add-flags files="jscore.bkl" formats="xcode2">
+ -o../WebCore/Projects/base/WebCoreBase.xcode
+ </add-flags>
+ -->
+
+ <!-- wx port settings -->
+ <add-flags files="../../WebCore/webcore-wx.bkl" formats="gnu">
+ -o../../WebCore/GNUmakefile
+ </add-flags>
+ <add-flags files="../../WebCore/webcore-wx.bkl" formats="msvs2005prj">
+ -o../../WebCore/webcore-wx.sln
+ </add-flags>
+ <add-flags files="../../WebCore/webcore-wx.bkl" formats="msvc">
+ -o../../WebCore/makefile.vc
+ </add-flags>
+
+ <add-flags files="wxwebkit.bkl" formats="gnu">
+ -oGNUmakefile
+ </add-flags>
+ <add-flags files="wxwebkit.bkl" formats="msvs2005prj">
+ -owxWebKit.sln
+ </add-flags>
+ <add-flags files="wxwebkit.bkl" formats="msvc">
+ -omakefile.vc
+ </add-flags>
+
+ <add-flags files="bindings/python/wxwebkit-py.bkl" formats="gnu">
+ -obindings/python/GNUmakefile
+ </add-flags>
+ <add-flags files="bindings/python/wxwebkit-py.bkl" formats="msvs2005prj">
+ -obindings/python/wxWebKit.sln
+ </add-flags>
+ <add-flags files="bindings/python/wxwebkit-py.bkl" formats="msvc">
+ -obindings/python/makefile.vc
+ </add-flags>
+
+ <add-flags files="../../WebKitTools/wx/browser/browser.bkl" formats="gnu">
+ -o../../WebKitTools/wx/browser/GNUmakefile
+ </add-flags>
+ <add-flags files="../../WebKitTools/wx/browser/browser.bkl" formats="msvs2005prj">
+ -o../../WebKitTools/wx/browser/browser.sln
+ </add-flags>
+ <add-flags files="../../WebKitTools/wx/browser/browser.bkl" formats="msvc">
+ -o../../WebKitTools/wx/browser/makefile.vc
+ </add-flags>
+ <!-- testing XCode backend
+ <add-flags files="webcore-wx.bkl" formats="xcode2">
+ -o../WebCore/Projects/wx/wxWebCore.xcode
+ </add-flags>
+ -->
+
+ <!-- Personal customizations (not in SVN): -->
+ <include file="Bakefiles.local.bkgen" ignore_missing="1"/>
+
+</bakefile-gen>
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
new file mode 100644
index 0000000..beb9f8a
--- /dev/null
+++ b/WebKit/wx/ChangeLog
@@ -0,0 +1,1075 @@
+2008-10-31 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMSW build fix. Missing header.
+
+ * WebKitSupport/ChromeClientWx.cpp:
+
+2008-10-29 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes after addition of runtime and ImageBuffer changes.
+
+ * presets/wxwebkit.bkl:
+
+2008-10-28 Cameron Zwarich <zwarich@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Move ForwardingHeaders to their correct location after the creation of
+ the runtime directory in JavaScriptCore.
+
+ * WebFrame.cpp:
+ * WebView.cpp:
+
+2008-10-27 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix on Linux/GTK. Enable support for #include <JavaScriptCore/XYZ.h> style includes.
+
+ * presets/wxwebkit.bkl:
+
+2008-10-25 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix.
+
+ * WebKitSupport/ChromeClientWx.h:
+
+2008-10-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Fix https://bugs.webkit.org/show_bug.cgi?id=21759
+ Layering violation: FileChooser should not depend on Document/Frame/Page
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::runOpenPanel):
+ * WebKitSupport/ChromeClientWx.h:
+
+2008-10-24 David Kilzer <ddkilzer@apple.com>
+
+ Build fix.
+
+ Reviewed by Greg Bolsinga.
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClientWx::populateSetting): Changed
+ InspectorClient:: to InspectorClientWx::.
+ (WebCore::InspectorClientWx::storeSetting): Ditto.
+ (WebCore::InspectorClientWx::removeSetting): Ditto.
+
+2008-10-24 Timothy Hatcher <timothy@apple.com>
+
+ Stub out new InspectorClient methods.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21856
+
+ Reviewed by Darin Adler.
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClient::populateSetting): Not implemented.
+ (WebCore::InspectorClient::storeSetting): Ditto.
+ (WebCore::InspectorClient::removeSetting): Ditto.
+ * WebKitSupport/InspectorClientWx.h:
+
+2008-10-24 Darin Adler <darin@apple.com>
+
+ - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
+
+ * WebFrame.cpp: (wxWebFrame::RunScript): Use JSValue* instead of JSValuePtr.
+
+2008-10-20 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Remove FrameLoaderClient::detachedFromParent4. It is no longer used by any port.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-10-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
+ improve performance by eliminating JSValue as a base class for JSCell
+
+ Remove most uses of JSValue, which will be removed in a future patch.
+
+ * WebFrame.cpp:
+ (wxWebFrame::RunScript): Use JSValuePtr.
+
+2008-10-17 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier
+
+ Fix wx port's scrollbar and drawing handling after recent changes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=21720
+
+ * WebView.cpp:
+ (wxWebView::OnPaint):
+ (wxWebView::OnSize):
+
+2008-10-09 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes.
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::repaint):
+ (WebCore::ChromeClientWx::scroll):
+ * WebKitSupport/ChromeClientWx.h:
+ * presets/wxwebkit.bkl:
+
+2008-10-06 David Hyatt <hyatt@apple.com>
+
+ Enable viewless Mac WebKit to paint some basic pages.
+
+ Reviewed by Sam Weinig
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-10-03 David Hyatt <hyatt@apple.com>
+
+ Remove addToDirtyRegion.
+
+ Reviewed by Oliver Hunt
+
+ * WebKitSupport/ChromeClientWx.cpp:
+
+2008-10-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes after Frame/ScrollView changes.
+
+ * WebView.cpp:
+ (wxWebView::OnPaint):
+
+2008-10-01 David Hyatt <hyatt@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=21282
+
+ Make contentsToScreen/screenToContents cross-platform. Only implemented by Mac/Win right now.
+
+ Reviewed by Adam Roben
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::windowToScreen):
+ (WebCore::ChromeClientWx::screenToWindow):
+ * WebKitSupport/ChromeClientWx.h:
+
+2008-09-30 Dave Hyatt <hyatt@apple.com>
+
+ http://bugs.webkit.org/show_bug.cgi?id=21250
+
+ Rename updateContents to repaintContentRectangle and make it cross-platform by always sending
+ repaints up through the ChromeClient.
+
+ Reviewed by Darin Adler
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::repaint):
+ * WebKitSupport/ChromeClientWx.h:
+
+2008-09-26 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes after Widget/ScrollView changes.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+
+2008-09-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix memory leak.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20505
+
+ * WebView.cpp:
+ (wxWebView::OnPaint):
+
+2008-09-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes. Added/removed build sources, and nativeWindow->platformWidget updates.
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::isEditable):
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+
+2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Maciej Stachowiak.
+
+ Bug 20704: Replace the KJS namespace
+ <https://bugs.webkit.org/show_bug.cgi?id=20704>
+
+ Rename the KJS namespace to JSC.
+
+ * WebFrame.cpp:
+ (wxWebFrame::RunScript):
+
+2008-09-04 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::pluginWillHandleLoadError):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-08-18 Kevin Ollivier <kevino@theolliviers.com>
+
+ Build fix for Win. Don't include the libxml/libxslt directories in the
+ include path, it picks up the wrong Pattern.h in that case.
+
+ * dependencies.bkl:
+
+2008-08-12 Timothy Hatcher <timothy@apple.com>
+
+ Add a stub for InspectorClient::setAttachedWindowHeight.
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClientWx::setAttachedWindowHeight):
+ Call notImplemented().
+ * WebKitSupport/InspectorClientWx.h:
+
+2008-08-06 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Create a wxWebFrame API to match other ports and to prepare for frames support.
+ Also fixes a frame leak in wx port on trunk.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19041
+
+ * WebFrame.cpp: Added.
+ (wxWebFrame::wxWebFrame):
+ (wxWebFrame::~wxWebFrame):
+ (wxWebFrame::GetFrame):
+ (wxWebFrame::Stop):
+ (wxWebFrame::Reload):
+ (wxWebFrame::GetPageSource):
+ (wxWebFrame::SetPageSource):
+ (wxWebFrame::GetInnerText):
+ (wxWebFrame::GetAsMarkup):
+ (wxWebFrame::GetExternalRepresentation):
+ (wxWebFrame::RunScript):
+ (wxWebFrame::LoadURL):
+ (wxWebFrame::GoBack):
+ (wxWebFrame::GoForward):
+ (wxWebFrame::CanGoBack):
+ (wxWebFrame::CanGoForward):
+ (wxWebFrame::CanIncreaseTextSize):
+ (wxWebFrame::IncreaseTextSize):
+ (wxWebFrame::CanDecreaseTextSize):
+ (wxWebFrame::DecreaseTextSize):
+ (wxWebFrame::MakeEditable):
+ (wxWebFrame::CanCopy):
+ (wxWebFrame::Copy):
+ (wxWebFrame::CanCut):
+ (wxWebFrame::Cut):
+ (wxWebFrame::CanPaste):
+ (wxWebFrame::Paste):
+ * WebFrame.h: Added.
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+ (wxWebView::Create):
+ (wxWebView::~wxWebView):
+ (wxWebView::Stop):
+ (wxWebView::Reload):
+ (wxWebView::GetPageSource):
+ (wxWebView::SetPageSource):
+ (wxWebView::GetInnerText):
+ (wxWebView::GetAsMarkup):
+ (wxWebView::GetExternalRepresentation):
+ (wxWebView::RunScript):
+ (wxWebView::LoadURL):
+ (wxWebView::GoBack):
+ (wxWebView::GoForward):
+ (wxWebView::CanGoBack):
+ (wxWebView::CanGoForward):
+ (wxWebView::CanIncreaseTextSize):
+ (wxWebView::IncreaseTextSize):
+ (wxWebView::CanDecreaseTextSize):
+ (wxWebView::DecreaseTextSize):
+ (wxWebView::OnPaint):
+ (wxWebView::OnSize):
+ (wxWebView::OnMouseEvents):
+ (wxWebView::CanCopy):
+ (wxWebView::Copy):
+ (wxWebView::CanCut):
+ (wxWebView::Cut):
+ (wxWebView::CanPaste):
+ (wxWebView::Paste):
+ (wxWebView::OnKeyEvents):
+ (wxWebView::OnSetFocus):
+ (wxWebView::OnKillFocus):
+ * WebView.h:
+ * wxwebkit.bkl:
+
+2008-07-27 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Sam Weinig.
+
+ Add tooltip support to the wx port.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20173
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::setToolTip):
+ * WebView.cpp:
+ (wxWebView::OnMouseEvents): Use mouseMoved instead of handleMouseMoveEvent.
+
+2008-07-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Fix pthread linkage under Linux.
+
+ * dependencies.bkl:
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - give Frame object functions shorter names: scriptProxy() -> script(),
+ selectionController() -> selection(), animationController() -> animation()
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::handleKeyboardEvent):
+ * WebView.cpp:
+ (wxWebView::RunScript):
+ (wxWebView::OnSetFocus):
+ (wxWebView::OnKillFocus):
+
+2008-06-15 Darin Adler <darin@apple.com>
+
+ - new names for a few key JavaScriptCore files
+
+ * WebView.cpp:
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Sam.
+
+ - new names for kjs_binding.h and kjs_proxy.h
+
+ * WebView.cpp:
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ - try to fix wx build, again
+
+ * WebView.cpp:
+ (wxWebView::Create): Use create function instead of new.
+
+2008-06-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - more https://bugs.webkit.org/show_bug.cgi?id=17257
+ start ref counts at 1 instead of 0 for speed
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::createDocumentLoader): Use create function
+ instead of new.
+
+2008-06-13 Darin Adler <darin@apple.com>
+
+ - try to fix build
+
+ * WebKitSupport/FrameLoaderClientWx.h: Add missing argument.
+
+2008-06-13 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - updated for addition of FormState argument to action policy functions
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction):
+
+2008-06-10 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx Linux build fix. Only use -undefined dynamic_lookup flag under Mac.
+
+ * bindings/python/wxwebkit-py.bkl:
+
+2008-05-28 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ This patch adds a new wx event type and code to send it when a new title is set
+ by the page being loaded.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19067
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDidReceiveTitle):
+ * WebView.cpp:
+ (wxWebViewReceivedTitleEvent::wxWebViewReceivedTitleEvent):
+ * WebView.h:
+ * bindings/python/webview.i:
+
+2008-05-28 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ This patch tweaks the wxWebView class to make it conform to normal wx patterns
+ for widget classes. It adds a default ctor and the Create method so it can use
+ the 2-phase create pattern, adds wxRTTI macros which is important for wxPython
+ and XRC, and fixes the LoadURL method to pass a wxString reference to save a
+ copy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=19068
+
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+ (wxWebView::Create):
+ (wxWebView::LoadURL):
+ * WebView.h:
+
+2008-05-27 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Accidently left a couple fixes out of the previous commit.
+
+ * presets/wxwebkit.bkl:
+
+2008-05-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ Rename wxWebFrame -> wxWebBrowserShell in preparation to introduce a WebFrame
+ counterpart in wx port. (Frame typically means 'top level window' in wx terms.)
+
+ https://bugs.webkit.org/show_bug.cgi?id=19041
+
+ * WebBrowserShell.cpp: Copied from WebKit/wx/WebFrame.cpp.
+ (wxWebBrowserShell::wxWebBrowserShell):
+ (wxWebBrowserShell::~wxWebBrowserShell):
+ (wxWebBrowserShell::ShowDebugMenu):
+ (wxWebBrowserShell::OnQuit):
+ (wxWebBrowserShell::OnAbout):
+ (wxWebBrowserShell::OnLoadFile):
+ (wxWebBrowserShell::OnLoadEvent):
+ (wxWebBrowserShell::OnBeforeLoad):
+ (wxWebBrowserShell::OnAddressBarEnter):
+ (wxWebBrowserShell::OnSearchCtrlEnter):
+ (wxWebBrowserShell::OnBack):
+ (wxWebBrowserShell::OnForward):
+ (wxWebBrowserShell::OnStop):
+ (wxWebBrowserShell::OnReload):
+ (wxWebBrowserShell::OnMakeTextLarger):
+ (wxWebBrowserShell::OnMakeTextSmaller):
+ (wxWebBrowserShell::OnGetSource):
+ (wxWebBrowserShell::OnSetSource):
+ (wxWebBrowserShell::OnBrowse):
+ (wxWebBrowserShell::OnEdit):
+ (wxWebBrowserShell::OnRunScript):
+ * WebBrowserShell.h: Copied from WebKit/wx/WebFrame.h.
+ * WebFrame.cpp: Removed.
+ * WebFrame.h: Removed.
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::createWindow):
+ * bindings/python/webview.i:
+ * wxwebkit.bkl:
+
+2008-05-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Update code after removal of Document::toString().
+
+ * WebView.cpp:
+ (wxWebView::GetPageSource):
+
+2008-05-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Add rendering/style to includes dir.
+
+ * presets/wxwebkit.bkl:
+
+2008-05-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ Previous commit made bdash sad. Restore happiness state by fixing missed style issue.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+
+2008-05-11 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Fix scrolling issues by implementing transitionToCommittedNewPage() so the scroll
+ positions are reset when a new page is loaded, and also maintained so that back
+ and next restore the scroll positions as well. This also simplifies the logic
+ for initializing and managing wxWebView.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18992
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::setWebView):
+ (WebCore::FrameLoaderClientWx::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientWx::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientWx::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientWx::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientWx::createFrame):
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+ * WebKitSupport/FrameLoaderClientWx.h:
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+ (wxWebView::~wxWebView):
+ (wxWebView::GetPageSource):
+ (wxWebView::GetInnerText):
+ (wxWebView::GetExternalRepresentation):
+ (wxWebView::OnPaint):
+ (wxWebView::OnSize):
+ (wxWebView::OnMouseEvents):
+ (wxWebView::CanCopy):
+ (wxWebView::CanCut):
+ (wxWebView::CanPaste):
+ (wxWebView::OnKeyEvents):
+ * WebViewPrivate.h:
+ (WebViewPrivate::WebViewPrivate):
+
+2008-05-04 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Allow events to specify the ID of the particular wxWebView they are to be sent to.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18659
+
+ * WebFrame.cpp:
+ (wxWebFrame::wxWebFrame):
+ * WebView.cpp:
+ (wxWebViewLoadEvent::wxWebViewLoadEvent):
+ (wxWebViewBeforeLoadEvent::wxWebViewBeforeLoadEvent):
+ (wxWebViewNewWindowEvent::wxWebViewNewWindowEvent):
+ (wxWebViewRightClickEvent::wxWebViewRightClickEvent):
+ (wxWebViewConsoleMessageEvent::wxWebViewConsoleMessageEvent):
+ * WebView.h:
+ * bindings/python/webview.i:
+
+2008-04-27 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add methods to check if there is a previous/next page in the history. Also some
+ coding style cleanup.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18757
+
+ * WebView.cpp:
+ (wxWebView::GoBack):
+ (wxWebView::GoForward):
+ (wxWebView::CanGoBack):
+ (wxWebView::CanGoForward):
+ * WebView.h:
+
+2008-04-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam.
+
+ Change some String arguments to be const references instead.
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::shouldInsertText):
+ * WebKitSupport/EditorClientWx.h:
+
+2008-04-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Alp Toker.
+
+ Typo fix to restore text entry.
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::handleKeyboardEvent):
+
+2008-04-19 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. renderer() -> contentRenderer()
+
+ * WebView.cpp:
+ (wxWebView::GetExternalRepresentation):
+ (wxWebView::OnPaint):
+
+2008-04-18 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. We need to use ENABLE_DOM_STORAGE now.
+
+ * wxwk-settings.bkl:
+
+2008-04-05 Kevin Ollivier <kevino@theolliviers.com>
+
+ Rubber stamped by Mark Rowe.
+
+ Don't assume wxWebKit to be part of the wx package. This allows
+ us to run it from any directory on the PYTHONPATH rather than
+ having to copy files into the wxPython directory.
+
+ * bindings/python/webview.i:
+
+2008-03-25 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin
+
+ Remove newly obsolete FrameLoaderClient methods
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Make sure we link png/jpeg libraries before
+ wx libraries to get the right symbols.
+
+ * wxwebkit.bkl:
+ * wxwk-settings.bkl:
+
+2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ Rubber stamped by Darin Adler.
+
+ Add set-webkit-configuration support for wx port, and centralize
+ build dir location setting.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17790
+
+ * bindings/python/wxwebkit-py.bkl:
+ * presets/wxwebkit.bkl:
+ * wxwebkit.bkl:
+ * wxwk-settings.bkl:
+
+2008-03-12 David Hyatt <hyatt@apple.com>
+
+ Make the zoom factor a float and not a percent.
+
+ Reviewed by antti
+
+ * WebView.cpp:
+ (wxWebView::IncreaseTextSize):
+ (wxWebView::DecreaseTextSize):
+
+2008-03-03 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix after Frame::setZoomFactor API change.
+
+ * WebView.cpp:
+ (wxWebView::IncreaseTextSize):
+ (wxWebView::DecreaseTextSize):
+
+2008-02-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
+ - remove separate client calls for "standard" and "reload' history
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::updateGlobalHistory):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2008-02-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ Move text drawing into wxcode, as we need platform-dependent
+ APIs for drawing non-kerned text, which wx doesn't yet have.
+ (But hopefully will, once these APIs are fleshed out on all
+ platforms!)
+
+ http://bugs.webkit.org/show_bug.cgi?id=17396
+
+ * wxwebkit.bkl:
+ We need to directly link against GDI+ on Windows since we now
+ directly call GDI+ APIs.
+
+2008-02-14 Darin Adler <darin@apple.com>
+
+ * WebView.cpp: Removed use of DeprecatedString to keep this compiling.
+
+2008-02-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ A couple quick wx fixes.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17321
+
+ * WebView.cpp:
+ (wxWebView::OnPaint):
+ Make sure wxGCDC has its paint origin set properly after
+ the move to wxWindow for scrolling.
+ * bindings/python/webview.i:
+ Update the wxPython bindings after event rename.
+
+2008-02-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Eric.
+
+ - http://bugs.webkit.org/show_bug.cgi?id=17256
+ eliminate default ref. count of 0 in RefCounted class
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::FrameLoaderClientWx):
+ Set the count to 0 explicitly (one stray client I missed in my last pass).
+
+2008-02-03 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ Typo fix. Don't use the provisionalDocumentLoader() after the
+ whole page has already been loaded.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDidHandleOnloadEvents):
+
+2008-02-03 Kevin Ollivier <kevino@theolliviers.com>
+
+ Build fix for last wx commit (a couple things were not committed).
+ Also fix some style issues.
+
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+ (wxWebView::OnPaint):
+ (wxWebView::OnSize):
+ (wxWebView::CanCopy):
+ (wxWebView::Copy):
+ (wxWebView::CanCut):
+ (wxWebView::Cut):
+ (wxWebView::CanPaste):
+ (wxWebView::Paste):
+ (wxWebView::OnKeyEvents):
+ (wxWebView::OnSetFocus):
+ (wxWebView::OnKillFocus):
+ (wxWebView::OnActivate):
+ * WebView.h:
+
+2008-01-31 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Adam Roben.
+
+ On MSW, the wx port internally uses callbacks for wxTimer, so the
+ wx port suffers from the same crash problem that was fixed
+ in r28500 for the Windows port. For now, use the SharedTimerWin.cpp
+ impl. for wx too on MSW, until a version of wx is released that
+ fixes the issue by reworking wxTimer.
+
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+
+2008-01-21 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - updated for changes to ChromeClient database functions
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::exceededDatabaseQuota):
+ * WebKitSupport/ChromeClientWx.h:
+
+2008-01-16 Adam Roben <aroben@apple.com>
+
+ Updated for WebCore method renames.
+
+ Reviewed by Darin Adler.
+
+ * WebView.cpp:
+ (wxWebView::OnSetFocus):
+ (wxWebView::OnKillFocus):
+ (wxWebView::OnActivate):
+
+2008-01-12 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ wxWebKit API changes in preparation for DRT implementation.
+ Specifically:
+
+ - Add CONSOLE_MESSAGE callback so clients can choose how to handle
+ console messages.
+ - Add more load events, and rename wxWebViewStateChangedEvent to
+ wxWebViewLoadEvent to reflect that all 'states' are load states.
+ - Add wxWebView impls. for GetInnerText(), GetAsMarkup() and
+ GetExternalRepresentation()
+
+ * WebFrame.cpp:
+ (wxWebFrame::OnLoadEvent):
+ * WebFrame.h:
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::ChromeClientWx):
+ (WebCore::ChromeClientWx::addMessageToConsole):
+ * WebKitSupport/ChromeClientWx.h:
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientWx::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientWx::postProgressFinishedNotification):
+ * WebView.cpp:
+ (wxWebViewLoadEvent::wxWebViewLoadEvent):
+ (wxWebViewConsoleMessageEvent::wxWebViewConsoleMessageEvent):
+ (wxWebView::wxWebView):
+ (wxWebView::GetPageSource):
+ (wxWebView::GetInnerText):
+ (wxWebView::GetAsMarkup):
+ (wxWebView::GetExternalRepresentation):
+ * WebView.h:
+
+2008-01-12 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Add WebCore/icu/include dir for OS X boxes with
+ only stock ICU installed.
+
+ * dependencies.bkl:
+
+2008-01-10 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam.
+
+ - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::requestQuotaIncreaseForNewDatabase):
+ (WebCore::ChromeClientWx::requestQuotaIncreaseForDatabaseOperation):
+ * WebKitSupport/ChromeClientWx.h:
+
+2007-12-16 Darin Adler <darin@apple.com>
+
+ - try to fix the build
+
+ * WebView.cpp:
+ (wxWebView::OnKeyEvents): Add a WebCore prefix.
+
+2007-12-16 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ http://bugs.webkit.org/show_bug.cgi?id=16462
+ REGRESSION: access keys broken on Windows
+
+ * WebView.cpp: (wxWebView::OnKeyEvents): Call handleAccessKey() as appropriate.
+
+2007-12-14 Darin Adler <darin@apple.com>
+
+ Reviewed by Alexey.
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::handleKeyboardEvent): Switched from Editor::execCommand
+ to Editor::command.
+
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ As part of doing some CachedPage and client cleanup, keep Wx building
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::savePlatformDataToCachedPage):
+ (WebCore::FrameLoaderClientWx::transitionToCommittedFromCachedPage):
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2007-12-12 Sam Weinig <sam@webkit.org>
+
+ Build fix.
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::createWindow):
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientWx::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientWx::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientWx::didChangeTitle):
+ (WebCore::FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction):
+
+2007-12-07 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/5535636>
+ Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard.
+
+ http://bugs.webkit.org/show_bug.cgi?id=13916
+ JavaScript detects Tab as a character input on a textfield validation
+
+ * WebKitSupport/EditorClientWx.cpp:
+ (WebCore::EditorClientWx::handleInputMethodKeydown):
+ (WebCore::EditorClientWx::handleKeyboardEvent):
+ * WebKitSupport/EditorClientWx.h:
+ Updated for cross-platform changes as much as it was possible without a wx build environment.
+ The keyboard event model of wx is similar to Windows one, so further fixes can be modeled
+ after the Windows port.
+
+2007-12-06 Kevin Ollivier <kevino@theolliviers.com>
+
+ Fix page leak caused because the Frame's page pointer is 0 by the
+ time we call delete on it. Store a reference to the page instead
+ and delete it that way.
+
+ Also, small fix to call PrepareDC(gcdc) when using wxGCDC because
+ on Linux the wxGCDC gcdc(dc) constructor will not retain the
+ changes made to dc by PrepareDC(dc).
+
+ Reviewed by Darin Adler.
+
+ * WebView.cpp:
+ (wxWebView::wxWebView):
+ (wxWebView::~wxWebView):
+ (wxWebView::OnPaint):
+ * WebViewPrivate.h:
+ (WebViewPrivate::WebViewPrivate):
+
+2007-12-06 Kevin Ollivier <kevino@theolliviers.com>
+
+ Linux build fix - ensure that webcore is linked before jscore
+ so that the linker will know which symbols it needs to link in.
+ Also fix MSVC project file name typo for sample app.
+
+ * Bakefiles.bkgen:
+ * wxwebkit.bkl:
+
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebKitSupport/FrameLoaderClientWx.h: Ditto.
+
+2007-12-03 Mark Rowe <mrowe@apple.com>
+
+ wx build fix.
+
+ * WebView.cpp:
+ (wxWebView::RunScript):
+
+2007-11-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Add WebCore/platform/graphics/wx to includes.
+
+ * wxwebkit.bkl:
+
+2007-11-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ Fix method signatures to be members of ClientChromeWx class.
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::requestQuotaIncreaseForNewDatabase):
+ (WebCore::ChromeClientWx::requestQuotaIncreaseForDatabaseOperation):
+
+2007-11-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ Build fix. Add platform/text to includes for targets that
+ need WebCore headers.
+
+ * presets/wxwebkit.bkl:
+
+2007-11-29 Brady Eidson <beidson@apple.com>
+
+ Keep it building with new client method
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClient::requestQuotaIncreaseForNewDatabase):
+ (WebCore::ChromeClient::requestQuotaIncreaseForDatabaseOperation):
+ * WebKitSupport/ChromeClientWx.h:
+
+2007-11-25 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Don't get xslt-config options at bake time, do it
+ at make time.
+
+ * dependencies.bkl:
+
+2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Include config.h in WebFrame/WebView to ensure
+ WebCore headers are properly configured, fix unicode/utf8.h and
+ config.h include ordering issues, centralize wx project options to
+ ensure proper configuration, and fix wxwebkit-python target so that
+ it links against wx libs.
+
+ * WebFrame.cpp:
+ * WebView.cpp:
+ * bindings/python/wxwebkit-py.bkl:
+ * dependencies.bkl:
+ * presets/wxwebkit.bkl:
+ * wxwebkit.bkl:
+ * wxwk-settings.bkl:
+
+2007-11-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix for Windows. Don't use WebCore/move-js-headers.sh as
+ it indiscriminately copies any headers inside JavaScriptCore,
+ which includes Tiger ICU headers.
+
+ * presets/wxwebkit.bkl:
+ Remove WebCore/include reference and add JSCore header dirs needed
+ instead.
+
+2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
+
+ Add pcre directory to JSCore includes, and update the wx port
+ to reflect the Shared -> RefCounted name change. Also, fix
+ WebFrame.cpp to re-enable code that should never have been
+ committed disabled.
+
+ Reviewed by Adam.
+
+ * WebFrame.cpp:
+ (wxWebFrame::wxWebFrame):
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::ref):
+ (WebCore::FrameLoaderClientWx::deref):
+ * WebKitSupport/FrameLoaderClientWx.h:
+ * presets/wxwebkit.bkl:
+
+2007-11-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 13470: i18n: The Web Inspector is not localizable
+ http://bugs.webkit.org/show_bug.cgi?id=13470
+
+ * WebKitSupport/InspectorClientWx.cpp:
+ (WebCore::InspectorClientWx::localizedStringsURL): Empty stub.
+ * WebKitSupport/InspectorClientWx.h: Added localizedStringsURL.
+
+2007-11-08 Kevin Ollivier <kevino@theolliviers.com>
+
+ Initial commit of wx implementation of WebKit. This includes
+ the wxWebFrame and wxWebView wx front end classes, the
+ WebKitSupport directory containing implementations of interfaces
+ used by WebCore to talk with the wxWebKit front end, and the
+ language bindings for wxWebKit (bindings dir), currently
+ only containing bindings and a sample app for wxPython.
+
+ Reviewed by Mark Rowe.
+
+ * Bakefiles.bkgen: Added.
+ * WebFrame.cpp: Added.
+ * WebFrame.h: Added.
+ * WebKitSupport: Added.
+ * WebKitSupport/ChromeClientWx.cpp: Added.
+ * WebKitSupport/ChromeClientWx.h: Added.
+ * WebKitSupport/ContextMenuClientWx.cpp: Added.
+ * WebKitSupport/ContextMenuClientWx.h: Added.
+ * WebKitSupport/DragClientWx.cpp: Added.
+ * WebKitSupport/DragClientWx.h: Added.
+ * WebKitSupport/EditorClientWx.cpp: Added.
+ * WebKitSupport/EditorClientWx.h: Added.
+ * WebKitSupport/FrameLoaderClientWx.cpp: Added.
+ * WebKitSupport/FrameLoaderClientWx.h: Added.
+ * WebKitSupport/InspectorClientWx.cpp: Added.
+ * WebKitSupport/InspectorClientWx.h: Added.
+ * WebView.cpp: Added.
+ * WebView.h: Added.
+ * WebViewPrivate.h: Added.
+ * bindings: Added.
+ * bindings/python: Added.
+ * bindings/python/samples: Added.
+ * bindings/python/samples/simple.py: Added.
+ * bindings/python/webview.i: Added.
+ * bindings/python/wxwebkit-py.bkl: Added.
+ * dependencies.bkl: Added.
+ * presets: Added.
+ * presets/wxwebkit.bkl: Added.
+ * wxwebkit.bkl: Added.
+ * wxwk-settings.bkl: Added.
+
diff --git a/WebKit/wx/WebBrowserShell.cpp b/WebKit/wx/WebBrowserShell.cpp
new file mode 100644
index 0000000..d2a30d5
--- /dev/null
+++ b/WebKit/wx/WebBrowserShell.cpp
@@ -0,0 +1,329 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This class provides a default new window implementation for wxWebView clients
+ * who don't want/need to roll their own browser frame UI.
+ */
+
+#include "config.h"
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "wx/artprov.h"
+
+#include "WebView.h"
+#include "WebBrowserShell.h"
+#include "WebViewPrivate.h"
+
+wxPageSourceViewFrame::wxPageSourceViewFrame(const wxString& source)
+ : wxFrame(NULL, wxID_ANY, _("Page Source View"), wxDefaultPosition, wxSize(600, 500))
+{
+ wxTextCtrl* control = new wxTextCtrl(this, -1, source, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
+}
+
+enum {
+ ID_LOADFILE = wxID_HIGHEST + 1,
+ ID_TEXTCTRL = wxID_HIGHEST + 2,
+ ID_BACK = wxID_HIGHEST + 3,
+ ID_FORWARD = wxID_HIGHEST + 4,
+ ID_TOGGLE_BEFORE_LOAD = wxID_HIGHEST + 5,
+ ID_MAKE_TEXT_LARGER = wxID_HIGHEST + 6,
+ ID_MAKE_TEXT_SMALLER = wxID_HIGHEST + 7,
+ ID_STOP = wxID_HIGHEST + 8,
+ ID_RELOAD = wxID_HIGHEST + 9,
+ ID_GET_SOURCE = wxID_HIGHEST + 10,
+ ID_SET_SOURCE = wxID_HIGHEST + 11,
+ ID_SEARCHCTRL = wxID_HIGHEST + 12,
+ ID_LOADURL = wxID_HIGHEST + 13,
+ ID_NEW_WINDOW = wxID_HIGHEST + 14,
+ ID_BROWSE = wxID_HIGHEST + 15,
+ ID_EDIT = wxID_HIGHEST + 16,
+ ID_RUN_SCRIPT = wxID_HIGHEST + 17,
+ ID_WEBVIEW = wxID_HIGHEST + 18
+};
+
+BEGIN_EVENT_TABLE(wxWebBrowserShell, wxFrame)
+ EVT_MENU(wxID_EXIT, wxWebBrowserShell::OnQuit)
+ EVT_MENU(wxID_ABOUT, wxWebBrowserShell::OnAbout)
+ EVT_MENU(ID_LOADFILE, wxWebBrowserShell::OnLoadFile)
+ EVT_TEXT_ENTER(ID_TEXTCTRL, wxWebBrowserShell::OnAddressBarEnter)
+ EVT_TEXT_ENTER(ID_SEARCHCTRL, wxWebBrowserShell::OnSearchCtrlEnter)
+ EVT_WEBVIEW_LOAD(ID_WEBVIEW, wxWebBrowserShell::OnLoadEvent)
+ EVT_WEBVIEW_BEFORE_LOAD(ID_WEBVIEW, wxWebBrowserShell::OnBeforeLoad)
+ EVT_MENU(ID_BACK, wxWebBrowserShell::OnBack)
+ EVT_MENU(ID_FORWARD, wxWebBrowserShell::OnForward)
+ EVT_MENU(ID_STOP, wxWebBrowserShell::OnStop)
+ EVT_MENU(ID_RELOAD, wxWebBrowserShell::OnReload)
+ EVT_MENU(ID_MAKE_TEXT_LARGER, wxWebBrowserShell::OnMakeTextLarger)
+ EVT_MENU(ID_MAKE_TEXT_SMALLER, wxWebBrowserShell::OnMakeTextSmaller)
+ EVT_MENU(ID_GET_SOURCE, wxWebBrowserShell::OnGetSource)
+ EVT_MENU(ID_SET_SOURCE, wxWebBrowserShell::OnSetSource)
+ EVT_MENU(ID_BROWSE, wxWebBrowserShell::OnBrowse)
+ EVT_MENU(ID_EDIT, wxWebBrowserShell::OnEdit)
+ EVT_MENU(ID_RUN_SCRIPT, wxWebBrowserShell::OnRunScript)
+END_EVENT_TABLE()
+
+
+wxWebBrowserShell::wxWebBrowserShell(const wxString& title) :
+ wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)),
+ m_checkBeforeLoad(false)
+{
+
+ // create a menu bar
+ wxMenu *fileMenu = new wxMenu;
+ fileMenu->Append(ID_NEW_WINDOW, _T("New Window\tCTRL+N"));
+ fileMenu->Append(ID_LOADFILE, _T("Open File...\tCTRL+O"));
+ fileMenu->Append(ID_LOADURL, _("Open Location...\tCTRL+L"));
+ fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit this program"));
+
+ wxMenu *editMenu = new wxMenu;
+ editMenu->Append(wxID_CUT, _T("Cut\tCTRL+X"));
+ editMenu->Append(wxID_COPY, _T("Copy\tCTRL+C"));
+ editMenu->Append(wxID_PASTE, _T("Paste\tCTRL+V"));
+
+ wxMenu* viewMenu = new wxMenu;
+ viewMenu->AppendRadioItem(ID_BROWSE, _("Browse"));
+ viewMenu->AppendRadioItem(ID_EDIT, _("Edit"));
+ viewMenu->AppendSeparator();
+ viewMenu->Append(ID_STOP, _("Stop"));
+ viewMenu->Append(ID_RELOAD, _("Reload Page"));
+ viewMenu->Append(ID_MAKE_TEXT_SMALLER, _("Make Text Smaller\tCTRL+-"));
+ viewMenu->Append(ID_MAKE_TEXT_LARGER, _("Make Text Bigger\tCTRL++"));
+ viewMenu->AppendSeparator();
+ viewMenu->Append(ID_GET_SOURCE, _("View Page Source"));
+ viewMenu->AppendSeparator();
+
+ m_debugMenu = new wxMenu;
+ m_debugMenu->Append(ID_SET_SOURCE, _("Test SetPageSource"));
+ m_debugMenu->Append(ID_RUN_SCRIPT, _("Test RunScript"));
+
+ // the "About" item should be in the help menu
+ wxMenu *helpMenu = new wxMenu;
+ helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog"));
+
+ // now append the freshly created menu to the menu bar...
+ wxMenuBar *menuBar = new wxMenuBar();
+ menuBar->Append(fileMenu, _T("&File"));
+ menuBar->Append(editMenu, _T("&Edit"));
+ menuBar->Append(viewMenu, _T("&View"));
+ menuBar->Append(helpMenu, _T("&Help"));
+
+ // ... and attach this menu bar to the frame
+ SetMenuBar(menuBar);
+
+ wxToolBar* toolbar = CreateToolBar();
+ toolbar->SetToolBitmapSize(wxSize(32, 32));
+
+ wxBitmap back = wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_TOOLBAR, wxSize(32,32));
+ toolbar->AddTool(ID_BACK, back, wxT("Back"));
+
+ wxBitmap forward = wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_TOOLBAR, wxSize(32,32));
+ toolbar->AddTool(ID_FORWARD, forward, wxT("Next"));
+
+ addressBar = new wxTextCtrl(toolbar, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(400, -1), wxTE_PROCESS_ENTER);
+ toolbar->AddControl(addressBar);
+
+ searchCtrl = new wxSearchCtrl(toolbar, ID_SEARCHCTRL, _("Search"), wxDefaultPosition, wxSize(200, -1), wxTE_PROCESS_ENTER);
+ toolbar->AddControl(searchCtrl);
+ toolbar->Realize();
+
+ SetToolBar(toolbar);
+
+ // Create the wxWebView Window
+ webview = new wxWebView((wxWindow*)this, ID_WEBVIEW, wxDefaultPosition, wxSize(200, 200));
+ webview->SetBackgroundColour(*wxWHITE);
+
+ // create a status bar just for fun (by default with 1 pane only)
+ CreateStatusBar(2);
+}
+
+wxWebBrowserShell::~wxWebBrowserShell()
+{
+ if (m_debugMenu && GetMenuBar()->FindMenu(_("&Debug")) == wxNOT_FOUND)
+ delete m_debugMenu;
+}
+
+void wxWebBrowserShell::ShowDebugMenu(bool show)
+{
+ int debugMenu = GetMenuBar()->FindMenu(_("&Debug"));
+ if (show && debugMenu == wxNOT_FOUND) {
+ int prevMenu = GetMenuBar()->FindMenu(_("&View"));
+ if (prevMenu != wxNOT_FOUND)
+ GetMenuBar()->Insert((size_t)prevMenu+1, m_debugMenu, _("&Debug"));
+ }
+ else if (!show && debugMenu != wxNOT_FOUND) {
+ GetMenuBar()->Remove(debugMenu);
+ }
+}
+
+// event handlers
+
+void wxWebBrowserShell::OnQuit(wxCommandEvent& WXUNUSED(event))
+{
+ // true is to force the frame to close
+ Close(true);
+}
+
+void wxWebBrowserShell::OnAbout(wxCommandEvent& WXUNUSED(event))
+{
+ wxString msg;
+ msg.Printf(_T("This is the About dialog of the wxWebKit sample.\n")
+ _T("Welcome to %s"), wxVERSION_STRING);
+
+ wxMessageBox(msg, _T("About wxWebKit Sample"), wxOK | wxICON_INFORMATION, this);
+
+}
+
+void wxWebBrowserShell::OnLoadFile(wxCommandEvent& WXUNUSED(event))
+{
+ wxFileDialog* dialog = new wxFileDialog(this, wxT("Choose a file"));
+ if (dialog->ShowModal() == wxID_OK) {
+ wxString path = dialog->GetPath().Prepend(wxT("file://"));
+
+ if (webview)
+ webview->LoadURL(path);
+ }
+}
+
+void wxWebBrowserShell::OnLoadEvent(wxWebViewLoadEvent& event)
+{
+ if (GetStatusBar() != NULL){
+ if (event.GetState() == wxWEBVIEW_LOAD_NEGOTIATING) {
+ GetStatusBar()->SetStatusText(_("Contacting ") + event.GetURL());
+ }
+ else if (event.GetState() == wxWEBVIEW_LOAD_TRANSFERRING) {
+ GetStatusBar()->SetStatusText(_("Loading ") + event.GetURL());
+ }
+ else if (event.GetState() == wxWEBVIEW_LOAD_ONLOAD_HANDLED) {
+ GetStatusBar()->SetStatusText(_("Load complete."));
+ addressBar->SetValue(event.GetURL());
+ SetTitle(webview->GetPageTitle());
+ }
+ else if (event.GetState() == wxWEBVIEW_LOAD_FAILED) {
+ GetStatusBar()->SetStatusText(_("Failed to load ") + event.GetURL());
+ }
+ }
+}
+
+void wxWebBrowserShell::OnBeforeLoad(wxWebViewBeforeLoadEvent& myEvent)
+{
+ if (m_checkBeforeLoad) {
+ int reply = wxMessageBox(_("Would you like to continue loading ") + myEvent.GetURL() + wxT("?"), _("Continue Loading?"), wxYES_NO);
+ if (reply == wxNO) {
+ myEvent.Cancel();
+ }
+ }
+}
+
+void wxWebBrowserShell::OnAddressBarEnter(wxCommandEvent& event)
+{
+ if (webview)
+ webview->LoadURL(addressBar->GetValue());
+}
+
+void wxWebBrowserShell::OnSearchCtrlEnter(wxCommandEvent& event)
+{
+ if (webview) {
+ webview->LoadURL(wxString::Format(wxT("http://www.google.com/search?rls=en&q=%s&ie=UTF-8&oe=UTF-8"), searchCtrl->GetValue().wc_str()));
+ }
+}
+
+void wxWebBrowserShell::OnBack(wxCommandEvent& event)
+{
+ if (webview)
+ webview->GoBack();
+}
+
+void wxWebBrowserShell::OnForward(wxCommandEvent& event)
+{
+ if (webview)
+ webview->GoForward();
+}
+
+void wxWebBrowserShell::OnStop(wxCommandEvent& myEvent)
+{
+ if (webview)
+ webview->Stop();
+}
+
+void wxWebBrowserShell::OnReload(wxCommandEvent& myEvent)
+{
+ if (webview)
+ webview->Reload();
+}
+
+void wxWebBrowserShell::OnMakeTextLarger(wxCommandEvent& myEvent)
+{
+ if (webview) {
+ if (webview->CanIncreaseTextSize())
+ webview->IncreaseTextSize();
+ }
+}
+
+void wxWebBrowserShell::OnMakeTextSmaller(wxCommandEvent& myEvent)
+{
+ if (webview) {
+ if (webview->CanDecreaseTextSize())
+ webview->DecreaseTextSize();
+ }
+}
+
+void wxWebBrowserShell::OnGetSource(wxCommandEvent& myEvent)
+{
+ if (webview) {
+ wxPageSourceViewFrame* pageSourceFrame = new wxPageSourceViewFrame(webview->GetPageSource());
+ pageSourceFrame->Show();
+ }
+}
+
+void wxWebBrowserShell::OnSetSource(wxCommandEvent& event)
+{
+ if (webview)
+ webview->SetPageSource(wxString(wxT("<p>Hello World!</p>")));
+}
+
+void wxWebBrowserShell::OnBrowse(wxCommandEvent& event)
+{
+ if (webview)
+ webview->MakeEditable(!event.IsChecked());
+}
+
+void wxWebBrowserShell::OnEdit(wxCommandEvent& event)
+{
+ if (webview)
+ webview->MakeEditable(event.IsChecked());
+}
+
+void wxWebBrowserShell::OnRunScript(wxCommandEvent& myEvent){
+ if (webview) {
+ wxTextEntryDialog* dialog = new wxTextEntryDialog(this, _("Type in a JavaScript to exectute."));
+ if (dialog->ShowModal() == wxID_OK)
+ wxMessageBox(wxT("Result is: ") + webview->RunScript(dialog->GetValue()));
+
+ dialog->Destroy();
+ }
+}
diff --git a/WebKit/wx/WebBrowserShell.h b/WebKit/wx/WebBrowserShell.h
new file mode 100644
index 0000000..9b48314
--- /dev/null
+++ b/WebKit/wx/WebBrowserShell.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WXWEBBROWSERSHELL_H
+#define WXWEBBROWSERSHELL_H
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "WebView.h"
+#include <wx/srchctrl.h>
+
+class WXDLLIMPEXP_WEBKIT wxWebBrowserShell : public wxFrame
+{
+public:
+ // ctor(s)
+#if SWIG
+ %pythonAppend wxWebBrowserShell "self._setOORInfo(self)"
+#endif
+ wxWebBrowserShell(const wxString& title);
+
+#ifndef SWIG
+ ~wxWebBrowserShell();
+#endif
+
+ void ShowDebugMenu(bool show = true);
+ wxWebView* webview;
+
+protected:
+
+ // event handlers (these functions should _not_ be virtual)
+ void OnQuit(wxCommandEvent& event);
+ void OnAbout(wxCommandEvent& event);
+ void OnLoadFile(wxCommandEvent& event);
+ void OnAddressBarEnter(wxCommandEvent& event);
+ void OnSearchCtrlEnter(wxCommandEvent& event);
+ void OnLoadEvent(wxWebViewLoadEvent& event);
+ void OnBeforeLoad(wxWebViewBeforeLoadEvent& event);
+ void OnBack(wxCommandEvent& event);
+ void OnForward(wxCommandEvent& event);
+ void OnStop(wxCommandEvent& event);
+ void OnReload(wxCommandEvent& event);
+ void OnBrowse(wxCommandEvent& event);
+ void OnEdit(wxCommandEvent& event);
+
+ void OnMakeTextLarger(wxCommandEvent& event);
+ void OnMakeTextSmaller(wxCommandEvent& event);
+ void OnGetSource(wxCommandEvent& event);
+
+ // debug menu items
+ void OnSetSource(wxCommandEvent& event);
+ void OnRunScript(wxCommandEvent& myEvent);
+
+private:
+ wxTextCtrl* addressBar;
+ wxSearchCtrl* searchCtrl;
+
+ bool m_checkBeforeLoad;
+ wxMenu* m_debugMenu;
+ // any class wishing to process wxWindows events must use this macro
+#ifndef SWIG
+ DECLARE_EVENT_TABLE()
+#endif
+};
+
+class WXDLLIMPEXP_WEBKIT wxPageSourceViewFrame : public wxFrame
+{
+public:
+ wxPageSourceViewFrame(const wxString& source);
+};
+
+#endif // ifndef WXWEBBROWSERSHELL_H
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
new file mode 100644
index 0000000..b1f03e0
--- /dev/null
+++ b/WebKit/wx/WebFrame.cpp
@@ -0,0 +1,317 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CString.h"
+#include "Document.h"
+#include "Editor.h"
+#include "Element.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameView.h"
+#include "HTMLFrameOwnerElement.h"
+#include "markup.h"
+#include "Page.h"
+#include "RenderTreeAsText.h"
+#include "RenderObject.h"
+#include "RenderView.h"
+
+#include "EditorClientWx.h"
+#include "FrameLoaderClientWx.h"
+
+#include "ScriptController.h"
+#include "JSDOMBinding.h"
+#include <runtime/JSValue.h>
+#include <kjs/ustring.h>
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "WebFrame.h"
+#include "WebView.h"
+#include "WebViewPrivate.h"
+
+#include <wx/defs.h>
+#include <wx/dcbuffer.h>
+
+// Match Safari's min/max zoom sizes by default
+#define MinimumTextSizeMultiplier 0.5f
+#define MaximumTextSizeMultiplier 3.0f
+#define TextSizeMultiplierRatio 1.2f
+
+wxWebFrame::wxWebFrame(wxWebView* container, wxWebFrame* parent, WebViewFrameData* data) :
+ m_textMagnifier(1.0),
+ m_isEditable(false),
+ m_isInitialized(false),
+ m_beingDestroyed(false),
+ m_title(wxEmptyString)
+{
+
+ m_impl = new WebViewPrivate();
+
+ WebCore::HTMLFrameOwnerElement* parentFrame = 0;
+
+ if (data) {
+ parentFrame = data->ownerElement;
+ }
+
+ WebCore::FrameLoaderClientWx* loaderClient = new WebCore::FrameLoaderClientWx();
+
+ m_impl->frame = WebCore::Frame::create(container->m_impl->page, parentFrame, loaderClient);
+ m_impl->frame->deref();
+
+ loaderClient->setFrame(m_impl->frame.get());
+ loaderClient->setWebView(container);
+
+ m_impl->frame->init();
+
+ m_isInitialized = true;
+}
+
+wxWebFrame::~wxWebFrame()
+{
+ m_impl->frame->loader()->detachFromParent();
+}
+
+WebCore::Frame* wxWebFrame::GetFrame()
+{
+ if (m_impl)
+ return m_impl->frame.get();
+
+ return 0;
+}
+
+void wxWebFrame::Stop()
+{
+ if (m_impl->frame && m_impl->frame->loader())
+ m_impl->frame->loader()->stop();
+}
+
+void wxWebFrame::Reload()
+{
+ if (m_impl->frame && m_impl->frame->loader())
+ m_impl->frame->loader()->reload();
+}
+
+wxString wxWebFrame::GetPageSource()
+{
+ if (m_impl->frame) {
+ if (m_impl->frame->view() && m_impl->frame->view()->layoutPending())
+ m_impl->frame->view()->layout();
+
+ WebCore::Document* doc = m_impl->frame->document();
+
+ if (doc) {
+ wxString source = createMarkup(doc);
+ return source;
+ }
+ }
+ return wxEmptyString;
+}
+
+void wxWebFrame::SetPageSource(const wxString& source, const wxString& baseUrl)
+{
+ if (m_impl->frame && m_impl->frame->loader()) {
+ WebCore::FrameLoader* loader = m_impl->frame->loader();
+ loader->begin(WebCore::KURL(static_cast<const char*>(baseUrl.mb_str(wxConvUTF8))));
+ loader->write(source);
+ loader->end();
+ }
+}
+
+wxString wxWebFrame::GetInnerText()
+{
+ if (m_impl->frame->view() && m_impl->frame->view()->layoutPending())
+ m_impl->frame->view()->layout();
+
+ WebCore::Element *documentElement = m_impl->frame->document()->documentElement();
+ return documentElement->innerText();
+}
+
+wxString wxWebFrame::GetAsMarkup()
+{
+ if (!m_impl->frame || !m_impl->frame->document())
+ return wxEmptyString;
+
+ return createMarkup(m_impl->frame->document());
+}
+
+wxString wxWebFrame::GetExternalRepresentation()
+{
+ if (m_impl->frame->view() && m_impl->frame->view()->layoutPending())
+ m_impl->frame->view()->layout();
+
+ return externalRepresentation(m_impl->frame->contentRenderer());
+}
+
+wxString wxWebFrame::RunScript(const wxString& javascript)
+{
+ wxString returnValue = wxEmptyString;
+ if (m_impl->frame) {
+ JSC::JSValue* result = m_impl->frame->loader()->executeScript(javascript, true);
+ if (result)
+ returnValue = wxString(result->toString(m_impl->frame->script()->globalObject()->globalExec()).UTF8String().c_str(), wxConvUTF8);
+ }
+ return returnValue;
+}
+
+void wxWebFrame::LoadURL(const wxString& url)
+{
+ if (m_impl->frame && m_impl->frame->loader()) {
+ WebCore::KURL kurl = WebCore::KURL(static_cast<const char*>(url.mb_str(wxConvUTF8)));
+ // NB: This is an ugly fix, but CURL won't load sub-resources if the
+ // protocol is omitted; sadly, it will not emit an error, either, so
+ // there's no way for us to catch this problem the correct way yet.
+ if (kurl.protocol().isEmpty()) {
+ // is it a file on disk?
+ if (wxFileExists(url)) {
+ kurl.setProtocol("file");
+ kurl.setPath("//" + kurl.path());
+ }
+ else {
+ kurl.setProtocol("http");
+ kurl.setPath("//" + kurl.path());
+ }
+ }
+ m_impl->frame->loader()->load(kurl);
+ }
+}
+
+bool wxWebFrame::GoBack()
+{
+ if (m_impl->frame && m_impl->frame->page())
+ return m_impl->frame->page()->goBack();
+
+ return false;
+}
+
+bool wxWebFrame::GoForward()
+{
+ if (m_impl->frame && m_impl->frame->page())
+ return m_impl->frame->page()->goForward();
+
+ return false;
+}
+
+bool wxWebFrame::CanGoBack()
+{
+ if (m_impl->frame && m_impl->frame->page() && m_impl->frame->page()->backForwardList())
+ return m_impl->frame->page()->backForwardList()->backItem() != NULL;
+
+ return false;
+}
+
+bool wxWebFrame::CanGoForward()
+{
+ if (m_impl->frame && m_impl->frame->page() && m_impl->frame->page()->backForwardList())
+ return m_impl->frame->page()->backForwardList()->forwardItem() != NULL;
+
+ return false;
+}
+bool wxWebFrame::CanIncreaseTextSize() const
+{
+ if (m_impl->frame) {
+ if (m_textMagnifier*TextSizeMultiplierRatio <= MaximumTextSizeMultiplier)
+ return true;
+ }
+ return false;
+}
+
+void wxWebFrame::IncreaseTextSize()
+{
+ if (CanIncreaseTextSize()) {
+ m_textMagnifier = m_textMagnifier*TextSizeMultiplierRatio;
+ m_impl->frame->setZoomFactor(m_textMagnifier, true);
+ }
+}
+
+bool wxWebFrame::CanDecreaseTextSize() const
+{
+ if (m_impl->frame) {
+ if (m_textMagnifier/TextSizeMultiplierRatio >= MinimumTextSizeMultiplier)
+ return true;
+ }
+ return false;
+}
+
+void wxWebFrame::DecreaseTextSize()
+{
+ if (CanDecreaseTextSize()) {
+ m_textMagnifier = m_textMagnifier/TextSizeMultiplierRatio;
+ m_impl->frame->setZoomFactor(m_textMagnifier, true);
+ }
+}
+
+void wxWebFrame::MakeEditable(bool enable)
+{
+ m_isEditable = enable;
+}
+
+
+
+bool wxWebFrame::CanCopy()
+{
+ if (m_impl->frame && m_impl->frame->view())
+ return (m_impl->frame->editor()->canCopy() || m_impl->frame->editor()->canDHTMLCopy());
+
+ return false;
+}
+
+void wxWebFrame::Copy()
+{
+ if (CanCopy())
+ m_impl->frame->editor()->copy();
+}
+
+bool wxWebFrame::CanCut()
+{
+ if (m_impl->frame && m_impl->frame->view())
+ return (m_impl->frame->editor()->canCut() || m_impl->frame->editor()->canDHTMLCut());
+
+ return false;
+}
+
+void wxWebFrame::Cut()
+{
+ if (CanCut())
+ m_impl->frame->editor()->cut();
+}
+
+bool wxWebFrame::CanPaste()
+{
+ if (m_impl->frame && m_impl->frame->view())
+ return (m_impl->frame->editor()->canPaste() || m_impl->frame->editor()->canDHTMLPaste());
+
+ return false;
+}
+
+void wxWebFrame::Paste()
+{
+ if (CanPaste())
+ m_impl->frame->editor()->paste();
+
+}
diff --git a/WebKit/wx/WebFrame.h b/WebKit/wx/WebFrame.h
new file mode 100644
index 0000000..a6961eb
--- /dev/null
+++ b/WebKit/wx/WebFrame.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WXWEBFRAME_H
+#define WXWEBFRAME_H
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+class WebViewPrivate;
+class WebViewFrameData;
+class wxWebView;
+
+namespace WebCore {
+ class ChromeClientWx;
+ class FrameLoaderClientWx;
+ class Frame;
+}
+
+#ifndef SWIG
+
+#if WXMAKINGDLL_WEBKIT
+#define WXDLLIMPEXP_WEBKIT WXEXPORT
+#elif defined(WXUSINGDLL_WEBKIT)
+#define WXDLLIMPEXP_WEBKIT WXIMPORT
+#else
+#define WXDLLIMPEXP_WEBKIT
+#endif
+
+#else
+#define WXDLLIMPEXP_WEBKIT
+#endif // SWIG
+
+class WXDLLIMPEXP_WEBKIT wxWebFrame
+{
+ // ChromeClientWx needs to get the Page* stored by the wxWebView
+ // for the createWindow function.
+ friend class WebCore::ChromeClientWx;
+ friend class WebCore::FrameLoaderClientWx;
+ friend class wxWebView;
+
+ wxWebFrame(wxWebView* container, wxWebFrame* parent = NULL, WebViewFrameData* data = NULL);
+
+ ~wxWebFrame();
+
+ void LoadURL(const wxString& url);
+ bool GoBack();
+ bool GoForward();
+ void Stop();
+ void Reload();
+
+ bool CanGoBack();
+ bool CanGoForward();
+
+ bool CanCut();
+ bool CanCopy();
+ bool CanPaste();
+
+ void Cut();
+ void Copy();
+ void Paste();
+
+ wxString GetPageSource();
+ void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString);
+
+ wxString GetInnerText();
+ wxString GetAsMarkup();
+ wxString GetExternalRepresentation();
+
+ wxString RunScript(const wxString& javascript);
+
+ bool CanIncreaseTextSize() const;
+ void IncreaseTextSize();
+ bool CanDecreaseTextSize() const;
+ void DecreaseTextSize();
+ void MakeEditable(bool enable);
+ bool IsEditable() const { return m_isEditable; }
+
+ wxString GetPageTitle() const { return m_title; }
+ void SetPageTitle(const wxString& title) { m_title = title; }
+
+ WebCore::Frame* GetFrame();
+
+private:
+ float m_textMagnifier;
+ bool m_isEditable;
+ bool m_isInitialized;
+ bool m_beingDestroyed;
+ WebViewPrivate* m_impl;
+ wxString m_title;
+
+};
+
+#endif // ifndef WXWEBFRAME_H
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
new file mode 100644
index 0000000..3d119a5
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ChromeClientWx.h"
+#include "FileChooser.h"
+#include "FloatRect.h"
+#include "FrameLoadRequest.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+#include <stdio.h>
+
+#include <wx/wxprec.h>
+#ifndef WX_PRECOMP
+ #include <wx/wx.h>
+#endif
+#include <wx/textdlg.h>
+#include <wx/tooltip.h>
+
+#include "WebBrowserShell.h"
+#include "WebView.h"
+#include "WebViewPrivate.h"
+
+namespace WebCore {
+
+ChromeClientWx::ChromeClientWx(wxWebView* webView)
+{
+ m_webView = webView;
+}
+
+ChromeClientWx::~ChromeClientWx()
+{
+}
+
+void ChromeClientWx::chromeDestroyed()
+{
+ notImplemented();
+}
+
+void ChromeClientWx::setWindowRect(const FloatRect&)
+{
+ notImplemented();
+}
+
+FloatRect ChromeClientWx::windowRect()
+{
+ notImplemented();
+ return FloatRect();
+}
+
+FloatRect ChromeClientWx::pageRect()
+{
+ notImplemented();
+ return FloatRect();
+}
+
+float ChromeClientWx::scaleFactor()
+{
+ notImplemented();
+ return 0.0;
+}
+
+void ChromeClientWx::focus()
+{
+ notImplemented();
+}
+
+void ChromeClientWx::unfocus()
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::canTakeFocus(FocusDirection)
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::takeFocus(FocusDirection)
+{
+ notImplemented();
+}
+
+
+Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures&)
+{
+
+ // FIXME: Create a EVT_WEBKIT_NEW_WINDOW event, and only run this code
+ // when that event is not handled.
+
+ Page* myPage = 0;
+ wxWebBrowserShell* newFrame = new wxWebBrowserShell(wxTheApp->GetAppName());
+
+ if (newFrame->webview) {
+ newFrame->webview->LoadURL(request.resourceRequest().url().string());
+ newFrame->Show(true);
+
+ WebViewPrivate* impl = newFrame->webview->m_impl;
+ if (impl)
+ myPage = impl->frame->page();
+ }
+
+ return myPage;
+}
+
+Page* ChromeClientWx::createModalDialog(Frame*, const FrameLoadRequest&)
+{
+ notImplemented();
+ return 0;
+}
+
+void ChromeClientWx::show()
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::canRunModal()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::runModal()
+{
+ notImplemented();
+}
+
+void ChromeClientWx::setToolbarsVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::toolbarsVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::setStatusbarVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::statusbarVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::setScrollbarsVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::scrollbarsVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::setMenubarVisible(bool)
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::menubarVisible()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientWx::setResizable(bool)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::addMessageToConsole(const String& message,
+ unsigned int lineNumber,
+ const String& sourceID)
+{
+ if (m_webView) {
+ wxWebViewConsoleMessageEvent wkEvent(m_webView);
+ wkEvent.SetMessage(message);
+ wkEvent.SetLineNumber(lineNumber);
+ wkEvent.SetSourceID(sourceID);
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+bool ChromeClientWx::canRunBeforeUnloadConfirmPanel()
+{
+ notImplemented();
+ return true;
+}
+
+bool ChromeClientWx::runBeforeUnloadConfirmPanel(const String& string,
+ Frame* frame)
+{
+ wxMessageDialog dialog(NULL, string, wxT("Confirm Action?"), wxYES_NO);
+ return dialog.ShowModal() == wxYES;
+}
+
+void ChromeClientWx::closeWindowSoon()
+{
+ notImplemented();
+}
+
+/*
+ Sites for testing prompts:
+ Alert - just type in a bad web address or http://www.htmlite.com/JS002.php
+ Prompt - http://www.htmlite.com/JS007.php
+ Confirm - http://www.htmlite.com/JS006.php
+*/
+
+void ChromeClientWx::runJavaScriptAlert(Frame* frame, const String& string)
+{
+ wxMessageBox(string, wxT("JavaScript Alert"), wxOK);
+}
+
+bool ChromeClientWx::runJavaScriptConfirm(Frame* frame, const String& string)
+{
+ wxMessageDialog dialog(NULL, string, wxT("JavaScript Confirm"), wxYES_NO);
+ dialog.Centre();
+ return (dialog.ShowModal() == wxID_YES);
+}
+
+bool ChromeClientWx::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
+{
+ wxTextEntryDialog dialog(NULL, message, wxT("JavaScript Prompt"), wxEmptyString, wxOK | wxCANCEL);
+ dialog.Centre();
+ if (dialog.ShowModal() == wxID_OK) {
+ result = dialog.GetValue();
+ return true;
+ }
+
+ return false;
+}
+
+void ChromeClientWx::setStatusbarText(const String&)
+{
+ notImplemented();
+}
+
+bool ChromeClientWx::shouldInterruptJavaScript()
+{
+ notImplemented();
+ return false;
+}
+
+bool ChromeClientWx::tabsToLinks() const
+{
+ notImplemented();
+ return false;
+}
+
+IntRect ChromeClientWx::windowResizerRect() const
+{
+ notImplemented();
+ return IntRect();
+}
+
+void ChromeClientWx::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly)
+{
+ if (!m_webView)
+ return;
+
+ if (contentChanged)
+ m_webView->RefreshRect(rect);
+
+ if (immediate) {
+ m_webView->Update();
+ }
+}
+
+IntRect ChromeClientWx::windowToScreen(const IntRect& rect) const
+{
+ notImplemented();
+ return rect;
+}
+
+IntPoint ChromeClientWx::screenToWindow(const IntPoint& point) const
+{
+ notImplemented();
+ return point;
+}
+
+PlatformWidget ChromeClientWx::platformWindow() const
+{
+ return 0;
+}
+
+void ChromeClientWx::scrollBackingStore(int dx, int dy,
+ const IntRect& scrollViewRect,
+ const IntRect& clipRect)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::updateBackingStore()
+{
+ notImplemented();
+}
+
+void ChromeClientWx::mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::setToolTip(const String& tip)
+{
+ wxToolTip* tooltip = m_webView->GetToolTip();
+ if (!tooltip || tooltip->GetTip() != wxString(tip))
+ m_webView->SetToolTip(tip);
+}
+
+void ChromeClientWx::print(Frame*)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::exceededDatabaseQuota(Frame*, const String&)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::scroll(const IntSize&, const IntRect&, const IntRect&)
+{
+ notImplemented();
+}
+
+void ChromeClientWx::runOpenPanel(Frame*, PassRefPtr<FileChooser>)
+{
+ notImplemented();
+}
+
+}
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h
new file mode 100644
index 0000000..d90788f
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ChromeClientWx_H
+#define ChromeClientWx_H
+
+#include "ChromeClient.h"
+#include "FocusDirection.h"
+#include "IntRect.h"
+#include "WebView.h"
+
+namespace WebCore {
+
+class ChromeClientWx : public ChromeClient {
+public:
+ ChromeClientWx(wxWebView*);
+ virtual ~ChromeClientWx();
+ virtual void chromeDestroyed();
+
+ virtual void setWindowRect(const FloatRect&);
+ virtual FloatRect windowRect();
+
+ virtual FloatRect pageRect();
+
+ virtual float scaleFactor();
+
+ virtual void focus();
+ virtual void unfocus();
+
+ virtual bool canTakeFocus(FocusDirection);
+ virtual void takeFocus(FocusDirection);
+
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual Page* createModalDialog(Frame*, const FrameLoadRequest&);
+ virtual void show();
+
+ virtual bool canRunModal();
+ virtual void runModal();
+
+ virtual void setToolbarsVisible(bool);
+ virtual bool toolbarsVisible();
+
+ virtual void setStatusbarVisible(bool);
+ virtual bool statusbarVisible();
+
+ virtual void setScrollbarsVisible(bool);
+ virtual bool scrollbarsVisible();
+
+ virtual void setMenubarVisible(bool);
+ virtual bool menubarVisible();
+
+ virtual void setResizable(bool);
+
+ virtual void addMessageToConsole(const String& message,
+ unsigned int lineNumber,
+ const String& sourceID);
+
+ virtual bool canRunBeforeUnloadConfirmPanel();
+ virtual bool runBeforeUnloadConfirmPanel(const String& message,
+ Frame* frame);
+
+ virtual void closeWindowSoon();
+
+ virtual void runJavaScriptAlert(Frame*, const String&);
+ virtual bool runJavaScriptConfirm(Frame*, const String&);
+ virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
+ virtual void setStatusbarText(const String&);
+ virtual bool shouldInterruptJavaScript();
+
+ virtual bool tabsToLinks() const;
+
+ virtual IntRect windowResizerRect() const;
+ virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
+ virtual void updateBackingStore();
+
+ virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+ virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+ virtual IntPoint screenToWindow(const IntPoint&) const;
+ virtual IntRect windowToScreen(const IntRect&) const;
+ virtual PlatformWidget platformWindow() const;
+
+ virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
+
+ virtual void setToolTip(const String&);
+
+ virtual void print(Frame*);
+
+ virtual void exceededDatabaseQuota(Frame*, const String&);
+
+ virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+
+private:
+ wxWebView* m_webView;
+};
+
+}
+#endif // ChromeClientWx_H
diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
new file mode 100644
index 0000000..8f88f1a
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextMenuClientWx.h"
+#include "NotImplemented.h"
+#include <stdio.h>
+
+namespace WebCore {
+
+ContextMenuClientWx::~ContextMenuClientWx()
+{
+}
+
+void ContextMenuClientWx::contextMenuDestroyed()
+{
+ notImplemented();
+}
+
+PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu*)
+{
+ notImplemented();
+ return 0;
+}
+
+void ContextMenuClientWx::contextMenuItemSelected(ContextMenuItem*,
+ const ContextMenu*)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::downloadURL(const KURL&)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::copyImageToClipboard(const HitTestResult&)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::searchWithGoogle(const Frame*)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::lookUpInDictionary(Frame*)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::speak(const String&)
+{
+ notImplemented();
+}
+
+void ContextMenuClientWx::stopSpeaking()
+{
+ notImplemented();
+}
+
+}
diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.h b/WebKit/wx/WebKitSupport/ContextMenuClientWx.h
new file mode 100644
index 0000000..2655974
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ContextMenuClientWx_h
+#define ContextMenuClientWx_h
+
+#include "ContextMenuClient.h"
+#include "PlatformMenuDescription.h"
+
+namespace WebCore {
+
+class ContextMenuClientWx : public ContextMenuClient {
+public:
+ virtual ~ContextMenuClientWx();
+ virtual void contextMenuDestroyed();
+
+ virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*);
+ virtual void contextMenuItemSelected(ContextMenuItem*,
+ const ContextMenu*);
+
+ virtual void downloadURL(const KURL&);
+ virtual void copyImageToClipboard(const HitTestResult&);
+ virtual void searchWithGoogle(const Frame*);
+ virtual void lookUpInDictionary(Frame*);
+ virtual void speak(const String&);
+ virtual void stopSpeaking();
+};
+
+}
+
+#endif // ContextMenuClientWx_h
diff --git a/WebKit/wx/WebKitSupport/DragClientWx.cpp b/WebKit/wx/WebKitSupport/DragClientWx.cpp
new file mode 100644
index 0000000..dcccc34
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/DragClientWx.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "DragClientWx.h"
+#include "NotImplemented.h"
+
+#include <stdio.h>
+
+namespace WebCore {
+
+DragDestinationAction DragClientWx::actionMaskForDrag(DragData*)
+{
+ notImplemented();
+ return DragDestinationActionAny;
+}
+
+void DragClientWx::willPerformDragDestinationAction(DragDestinationAction,
+ DragData*)
+{
+ notImplemented();
+}
+
+void DragClientWx::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
+{
+ notImplemented();
+}
+
+void DragClientWx::dragControllerDestroyed()
+{
+ notImplemented();
+}
+
+DragSourceAction DragClientWx::dragSourceActionMaskForPoint(const IntPoint&)
+{
+ notImplemented();
+ return DragSourceActionAny;
+}
+
+void DragClientWx::startDrag(DragImageRef dragImage,
+ const IntPoint& dragImageOrigin,
+ const IntPoint& eventPos, Clipboard*,
+ Frame*, bool linkDrag)
+{
+ notImplemented();
+}
+
+DragImageRef DragClientWx::createDragImageForLink(KURL&, const String& label, Frame*)
+{
+ notImplemented();
+ return 0;
+}
+
+}
diff --git a/WebKit/wx/WebKitSupport/DragClientWx.h b/WebKit/wx/WebKitSupport/DragClientWx.h
new file mode 100644
index 0000000..0e93e66
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/DragClientWx.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "DragClient.h"
+#include "DragData.h"
+
+namespace WebCore {
+
+class DragClientWx : public WebCore::DragClient {
+public:
+ virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction,
+ WebCore::DragData*);
+ virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
+
+ virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*);
+ virtual void dragControllerDestroyed();
+ virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&);
+
+ virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false);
+ virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*);
+};
+
+}
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
new file mode 100644
index 0000000..ade0f41
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
@@ -0,0 +1,390 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "EditorClientWx.h"
+
+#include "EditCommand.h"
+#include "Editor.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "KeyboardEvent.h"
+#include "KeyboardCodes.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformString.h"
+#include "SelectionController.h"
+#include "WebView.h"
+
+#include <stdio.h>
+
+namespace WebCore {
+
+EditorClientWx::~EditorClientWx()
+{
+ m_page = NULL;
+}
+
+void EditorClientWx::setPage(Page* page)
+{
+ m_page = page;
+}
+
+void EditorClientWx::pageDestroyed()
+{
+ notImplemented();
+}
+
+bool EditorClientWx::shouldDeleteRange(Range*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldShowDeleteInterface(HTMLElement*)
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientWx::smartInsertDeleteEnabled()
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientWx::isContinuousSpellCheckingEnabled()
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientWx::toggleContinuousSpellChecking()
+{
+ notImplemented();
+}
+
+bool EditorClientWx::isGrammarCheckingEnabled()
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientWx::toggleGrammarChecking()
+{
+ notImplemented();
+}
+
+int EditorClientWx::spellCheckerDocumentTag()
+{
+ notImplemented();
+ return 0;
+}
+
+bool EditorClientWx::selectWordBeforeMenuEvent()
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientWx::isEditable()
+{
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin)
+ return webKitWin->IsEditable();
+ }
+ return false;
+}
+
+bool EditorClientWx::shouldBeginEditing(Range*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldEndEditing(Range*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldInsertNode(Node*, Range*,
+ EditorInsertAction)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldInsertText(const String&, Range*,
+ EditorInsertAction)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldApplyStyle(CSSStyleDeclaration*,
+ Range*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldMoveRangeAfterDelete(Range*, Range*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EditorClientWx::shouldChangeSelectedRange(Range* fromRange, Range* toRange,
+ EAffinity, bool stillSelecting)
+{
+ notImplemented();
+ return true;
+}
+
+void EditorClientWx::didBeginEditing()
+{
+ notImplemented();
+}
+
+void EditorClientWx::respondToChangedContents()
+{
+ notImplemented();
+}
+
+void EditorClientWx::didEndEditing()
+{
+ notImplemented();
+}
+
+void EditorClientWx::didWriteSelectionToPasteboard()
+{
+ notImplemented();
+}
+
+void EditorClientWx::didSetSelectionTypesForPasteboard()
+{
+ notImplemented();
+}
+
+void EditorClientWx::registerCommandForUndo(PassRefPtr<EditCommand>)
+{
+ notImplemented();
+}
+
+void EditorClientWx::registerCommandForRedo(PassRefPtr<EditCommand>)
+{
+ notImplemented();
+}
+
+void EditorClientWx::clearUndoRedoOperations()
+{
+ notImplemented();
+}
+
+bool EditorClientWx::canUndo() const
+{
+ notImplemented();
+ return false;
+}
+
+bool EditorClientWx::canRedo() const
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientWx::undo()
+{
+ notImplemented();
+}
+
+void EditorClientWx::redo()
+{
+ notImplemented();
+}
+
+void EditorClientWx::handleInputMethodKeydown(KeyboardEvent* event)
+{
+// NOTE: we don't currently need to handle this. When key events occur,
+// both this method and handleKeyboardEvent get a chance at handling them.
+// We might use this method later on for IME-specific handling.
+}
+
+void EditorClientWx::handleKeyboardEvent(KeyboardEvent* event)
+{
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+ if (!frame)
+ return;
+
+ const PlatformKeyboardEvent* kevent = event->keyEvent();
+ if (kevent->type() != PlatformKeyboardEvent::KeyUp) {
+ Node* start = frame->selection()->start().node();
+ if (!start || !start->isContentEditable())
+ return;
+
+ if (kevent->type() == PlatformKeyboardEvent::Char && !kevent->ctrlKey() && !kevent->altKey()) {
+ switch (kevent->windowsVirtualKeyCode()) {
+ // we handled these on key down, ignore them for char events
+ case VK_BACK:
+ case VK_DELETE:
+ case VK_LEFT:
+ case VK_RIGHT:
+ case VK_UP:
+ case VK_DOWN:
+ case VK_RETURN:
+ break;
+ default:
+ frame->editor()->insertText(kevent->text(), event);
+ }
+ event->setDefaultHandled();
+ return;
+ }
+
+ switch (kevent->windowsVirtualKeyCode()) {
+ case VK_BACK:
+ frame->editor()->deleteWithDirection(SelectionController::BACKWARD,
+ CharacterGranularity, false, true);
+ break;
+ case VK_DELETE:
+ frame->editor()->deleteWithDirection(SelectionController::FORWARD,
+ CharacterGranularity, false, true);
+ break;
+ case VK_LEFT:
+ frame->editor()->command("MoveLeft").execute();
+ break;
+ case VK_RIGHT:
+ frame->editor()->command("MoveRight").execute();
+ break;
+ case VK_UP:
+ frame->editor()->command("MoveUp").execute();
+ break;
+ case VK_DOWN:
+ frame->editor()->command("MoveDown").execute();
+ break;
+ case VK_RETURN:
+ frame->editor()->command("InsertLineBreak").execute();
+ default:
+ break;
+ }
+
+ event->setDefaultHandled();
+ }
+}
+
+void EditorClientWx::textFieldDidBeginEditing(Element*)
+{
+ notImplemented();
+}
+
+void EditorClientWx::textFieldDidEndEditing(Element*)
+{
+ notImplemented();
+}
+
+void EditorClientWx::textDidChangeInTextField(Element*)
+{
+ notImplemented();
+}
+
+bool EditorClientWx::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientWx::textWillBeDeletedInTextField(Element*)
+{
+ notImplemented();
+}
+
+void EditorClientWx::textDidChangeInTextArea(Element*)
+{
+ notImplemented();
+}
+
+void EditorClientWx::respondToChangedSelection()
+{
+ notImplemented();
+}
+
+void EditorClientWx::ignoreWordInSpellDocument(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientWx::learnWord(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientWx::checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength)
+{
+ notImplemented();
+}
+
+void EditorClientWx::checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength)
+{
+ notImplemented();
+}
+
+void EditorClientWx::updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail)
+{
+ notImplemented();
+}
+
+void EditorClientWx::updateSpellingUIWithMisspelledWord(const String&)
+{
+ notImplemented();
+}
+
+void EditorClientWx::showSpellingUI(bool show)
+{
+ notImplemented();
+}
+
+bool EditorClientWx::spellingUIIsShowing()
+{
+ notImplemented();
+ return false;
+}
+
+void EditorClientWx::getGuessesForWord(const String&, Vector<String>& guesses)
+{
+ notImplemented();
+}
+
+void EditorClientWx::setInputMethodState(bool enabled)
+{
+ notImplemented();
+}
+
+}
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.h b/WebKit/wx/WebKitSupport/EditorClientWx.h
new file mode 100644
index 0000000..51b820c
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EditorClientWx_h
+#define EditorClientWx_h
+
+#include "EditorClient.h"
+#include "Page.h"
+
+namespace WebCore {
+
+class EditorClientWx : public EditorClient {
+public:
+ virtual ~EditorClientWx();
+ void setPage(Page*);
+ virtual void pageDestroyed();
+
+ virtual bool shouldDeleteRange(Range*);
+ virtual bool shouldShowDeleteInterface(HTMLElement*);
+ virtual bool smartInsertDeleteEnabled();
+ virtual bool isContinuousSpellCheckingEnabled();
+ virtual void toggleContinuousSpellChecking();
+ virtual bool isGrammarCheckingEnabled();
+ virtual void toggleGrammarChecking();
+ virtual int spellCheckerDocumentTag();
+
+ virtual bool selectWordBeforeMenuEvent();
+ virtual bool isEditable();
+
+ virtual bool shouldBeginEditing(Range*);
+ virtual bool shouldEndEditing(Range*);
+ virtual bool shouldInsertNode(Node*, Range*,
+ EditorInsertAction);
+ virtual bool shouldInsertText(const String&, Range*,
+ EditorInsertAction);
+ virtual bool shouldApplyStyle(CSSStyleDeclaration*,
+ Range*);
+ virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
+ virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange,
+ EAffinity, bool stillSelecting);
+
+ virtual void didBeginEditing();
+ virtual void respondToChangedContents();
+ virtual void respondToChangedSelection();
+ virtual void didEndEditing();
+ virtual void didWriteSelectionToPasteboard();
+ virtual void didSetSelectionTypesForPasteboard();
+
+ virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
+ virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
+ virtual void clearUndoRedoOperations();
+
+ virtual bool canUndo() const;
+ virtual bool canRedo() const;
+
+ virtual void undo();
+ virtual void redo();
+
+ virtual void handleKeyboardEvent(KeyboardEvent*);
+ virtual void handleInputMethodKeydown(KeyboardEvent*);
+
+ virtual void textFieldDidBeginEditing(Element*);
+ virtual void textFieldDidEndEditing(Element*);
+ virtual void textDidChangeInTextField(Element*);
+ virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
+ virtual void textWillBeDeletedInTextField(Element*);
+ virtual void textDidChangeInTextArea(Element*);
+
+ virtual void ignoreWordInSpellDocument(const String&);
+ virtual void learnWord(const String&);
+ virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
+ virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
+ virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail);
+ virtual void updateSpellingUIWithMisspelledWord(const String&);
+ virtual void showSpellingUI(bool show);
+ virtual bool spellingUIIsShowing();
+ virtual void getGuessesForWord(const String&, Vector<String>& guesses);
+ virtual void setInputMethodState(bool enabled);
+
+private:
+ Page* m_page;
+};
+
+}
+
+#endif // EditorClientWx_h
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
new file mode 100644
index 0000000..685da65
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -0,0 +1,878 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FrameLoaderClientWx.h"
+
+#include "DocumentLoader.h"
+#include "Frame.h"
+#include "FrameLoaderTypes.h"
+#include "FrameView.h"
+#include "FrameTree.h"
+#include "HTMLFormElement.h"
+#include "HTMLFrameOwnerElement.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformString.h"
+#include "ProgressTracker.h"
+#include "RenderPart.h"
+#include "ResourceError.h"
+#include "ResourceResponse.h"
+
+#include <stdio.h>
+
+#include "WebView.h"
+#include "WebViewPrivate.h"
+
+namespace WebCore {
+
+inline int wxNavTypeFromWebNavType(NavigationType type){
+ if (type == NavigationTypeLinkClicked)
+ return wxWEBVIEW_NAV_LINK_CLICKED;
+
+ if (type == NavigationTypeFormSubmitted)
+ return wxWEBVIEW_NAV_FORM_SUBMITTED;
+
+ if (type == NavigationTypeBackForward)
+ return wxWEBVIEW_NAV_BACK_NEXT;
+
+ if (type == NavigationTypeReload)
+ return wxWEBVIEW_NAV_RELOAD;
+
+ if (type == NavigationTypeFormResubmitted)
+ return wxWEBVIEW_NAV_FORM_RESUBMITTED;
+
+ return wxWEBVIEW_NAV_OTHER;
+}
+
+FrameLoaderClientWx::FrameLoaderClientWx()
+ : RefCounted<FrameLoaderClientWx>(0)
+ , m_frame(0)
+{
+}
+
+
+FrameLoaderClientWx::~FrameLoaderClientWx()
+{
+}
+
+void FrameLoaderClientWx::setFrame(Frame *frame)
+{
+ m_frame = frame;
+}
+
+void FrameLoaderClientWx::setWebView(wxWebView *webview)
+{
+ m_webView = webview;
+}
+
+void FrameLoaderClientWx::detachFrameLoader()
+{
+ m_frame = 0;
+}
+
+void FrameLoaderClientWx::ref()
+{
+ RefCounted<FrameLoaderClientWx>::ref();
+}
+
+void FrameLoaderClientWx::deref()
+{
+ RefCounted<FrameLoaderClientWx>::deref();
+}
+
+bool FrameLoaderClientWx::hasWebView() const
+{
+ notImplemented();
+ return true;
+}
+
+bool FrameLoaderClientWx::hasBackForwardList() const
+{
+ notImplemented();
+ return true;
+}
+
+
+void FrameLoaderClientWx::resetBackForwardList()
+{
+ notImplemented();
+}
+
+
+bool FrameLoaderClientWx::provisionalItemIsTarget() const
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientWx::makeRepresentation(DocumentLoader*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::forceLayout()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::forceLayoutForNonHTML()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryForCommit()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryForBackForwardNavigation()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryForReload()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryForStandardLoad()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryForInternalLoad()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::updateHistoryAfterClientRedirect()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::setCopiesOnScroll()
+{
+ // apparently mac specific
+ notImplemented();
+}
+
+
+LoadErrorResetToken* FrameLoaderClientWx::tokenForLoadErrorReset()
+{
+ notImplemented();
+ return 0;
+}
+
+
+void FrameLoaderClientWx::resetAfterLoadError(LoadErrorResetToken*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::doNotResetAfterLoadError(LoadErrorResetToken*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::willCloseDocument()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::detachedFromParent2()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::detachedFromParent3()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::loadedFromCachedPage()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchDidHandleOnloadEvents()
+{
+ if (m_webView) {
+ wxWebViewLoadEvent wkEvent(m_webView);
+ wkEvent.SetState(wxWEBVIEW_LOAD_ONLOAD_HANDLED);
+ wkEvent.SetURL(m_frame->loader()->documentLoader()->request().url().string());
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+
+void FrameLoaderClientWx::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchDidCancelClientRedirect()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchWillPerformClientRedirect(const KURL&,
+ double interval,
+ double fireDate)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchDidChangeLocationWithinPage()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchWillClose()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchDidStartProvisionalLoad()
+{
+ if (m_webView) {
+ wxWebViewLoadEvent wkEvent(m_webView);
+ wkEvent.SetState(wxWEBVIEW_LOAD_NEGOTIATING);
+ wkEvent.SetURL(m_frame->loader()->provisionalDocumentLoader()->request().url().string());
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+
+void FrameLoaderClientWx::dispatchDidReceiveTitle(const String& title)
+{
+ if (m_webView) {
+ m_webView->SetPageTitle(title);
+ wxWebViewReceivedTitleEvent wkEvent(m_webView);
+ wkEvent.SetTitle(title);
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+
+void FrameLoaderClientWx::dispatchDidCommitLoad()
+{
+ if (m_webView) {
+ wxWebViewLoadEvent wkEvent(m_webView);
+ wkEvent.SetState(wxWEBVIEW_LOAD_TRANSFERRING);
+ wkEvent.SetURL(m_frame->loader()->documentLoader()->request().url().string());
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+void FrameLoaderClientWx::dispatchDidFinishDocumentLoad()
+{
+ if (m_webView) {
+ wxWebViewLoadEvent wkEvent(m_webView);
+ wkEvent.SetState(wxWEBVIEW_LOAD_DOC_COMPLETED);
+ wkEvent.SetURL(m_frame->loader()->url().string());
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+void FrameLoaderClientWx::dispatchDidFinishLoad()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchDidFirstLayout()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchShow()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::cancelPolicyCheck()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::dispatchWillSubmitForm(FramePolicyFunction function,
+ PassRefPtr<FormState>)
+{
+ // FIXME: Send an event to allow for alerts and cancellation
+ if (!m_frame)
+ return;
+ (m_frame->loader()->*function)(PolicyUse);
+}
+
+
+void FrameLoaderClientWx::dispatchDidLoadMainResource(DocumentLoader*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::revertToProvisionalState(DocumentLoader*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::postProgressStartedNotification()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::postProgressEstimateChangedNotification()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::postProgressFinishedNotification()
+{
+ if (m_webView) {
+ wxWebViewLoadEvent wkEvent(m_webView);
+ wkEvent.SetState(wxWEBVIEW_LOAD_DL_COMPLETED);
+ wkEvent.SetURL(m_frame->loader()->url().string());
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ }
+}
+
+void FrameLoaderClientWx::progressStarted()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::progressCompleted()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::setMainFrameDocumentReady(bool b)
+{
+ notImplemented();
+ // this is only interesting once we provide an external API for the DOM
+}
+
+
+void FrameLoaderClientWx::willChangeTitle(DocumentLoader*)
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::didChangeTitle(DocumentLoader *l)
+{
+ setTitle(l->title(), l->url());
+}
+
+
+void FrameLoaderClientWx::finishedLoading(DocumentLoader*)
+{
+ notImplemented();
+}
+
+
+bool FrameLoaderClientWx::canShowMIMEType(const String& MIMEType) const
+{
+ notImplemented();
+ return true;
+}
+
+
+bool FrameLoaderClientWx::representationExistsForURLScheme(const String& URLScheme) const
+{
+ notImplemented();
+ return false;
+}
+
+
+String FrameLoaderClientWx::generatedMIMETypeForURLScheme(const String& URLScheme) const
+{
+ notImplemented();
+ return String();
+}
+
+
+void FrameLoaderClientWx::frameLoadCompleted()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::saveViewStateToItem(HistoryItem*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::restoreViewState()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::restoreScrollPositionAndViewState()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::provisionalLoadStarted()
+{
+ notImplemented();
+}
+
+
+bool FrameLoaderClientWx::shouldTreatURLAsSameAsCurrent(const KURL&) const
+{
+ notImplemented();
+ return false;
+}
+
+
+void FrameLoaderClientWx::addHistoryItemForFragmentScroll()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::didFinishLoad()
+{
+ notImplemented();
+}
+
+
+void FrameLoaderClientWx::prepareForDataSourceReplacement()
+{
+ if (m_frame && m_frame->loader())
+ m_frame->loader()->detachChildren();
+}
+
+
+void FrameLoaderClientWx::setTitle(const String& title, const KURL&)
+{
+ notImplemented();
+}
+
+
+String FrameLoaderClientWx::userAgent(const KURL&)
+{
+ // FIXME: Use the new APIs introduced by the GTK port to fill in these values.
+ return String("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3");
+}
+
+void FrameLoaderClientWx::dispatchDidReceiveIcon()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::frameLoaderDestroyed()
+{
+ m_frame = 0;
+ delete this;
+}
+
+bool FrameLoaderClientWx::canHandleRequest(const WebCore::ResourceRequest&) const
+{
+ notImplemented();
+ return true;
+}
+
+void FrameLoaderClientWx::partClearedInBegin()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::updateGlobalHistory(const WebCore::KURL&)
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWx::shouldGoToHistoryItem(WebCore::HistoryItem*) const
+{
+ notImplemented();
+ return true;
+}
+
+void FrameLoaderClientWx::saveScrollPositionAndViewStateToItem(WebCore::HistoryItem*)
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWx::canCachePage() const
+{
+ return false;
+}
+
+void FrameLoaderClientWx::setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
+{
+ if (!m_frame)
+ return;
+ FrameLoader* fl = loader->frameLoader();
+ fl->setEncoding(m_response.textEncodingName(), false);
+ fl->addData(data, length);
+}
+
+WebCore::ResourceError FrameLoaderClientWx::cancelledError(const WebCore::ResourceRequest&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+WebCore::ResourceError FrameLoaderClientWx::blockedError(const ResourceRequest&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+WebCore::ResourceError FrameLoaderClientWx::cannotShowURLError(const WebCore::ResourceRequest&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+WebCore::ResourceError FrameLoaderClientWx::interruptForPolicyChangeError(const WebCore::ResourceRequest&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+WebCore::ResourceError FrameLoaderClientWx::cannotShowMIMETypeError(const WebCore::ResourceResponse&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+WebCore::ResourceError FrameLoaderClientWx::fileDoesNotExistError(const WebCore::ResourceResponse&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+bool FrameLoaderClientWx::shouldFallBack(const WebCore::ResourceError& error)
+{
+ notImplemented();
+ return false;
+}
+
+WTF::PassRefPtr<DocumentLoader> FrameLoaderClientWx::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
+{
+ return DocumentLoader::create(request, substituteData);
+}
+
+void FrameLoaderClientWx::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest& request, const ResourceResponse& response)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long id, const ResourceResponse& response)
+{
+ notImplemented();
+ m_response = response;
+ m_firstData = true;
+}
+
+void FrameLoaderClientWx::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long id, int length)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidFinishLoading(DocumentLoader*, unsigned long)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&)
+{
+ notImplemented();
+}
+
+bool FrameLoaderClientWx::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int)
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientWx::dispatchDidFailProvisionalLoad(const ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::dispatchDidFailLoad(const ResourceError&)
+{
+ notImplemented();
+}
+
+Frame* FrameLoaderClientWx::dispatchCreatePage()
+{
+ notImplemented();
+ return false;
+}
+
+void FrameLoaderClientWx::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& mimetype, const ResourceRequest& request)
+{
+ if (!m_frame)
+ return;
+
+ notImplemented();
+ (m_frame->loader()->*function)(PolicyUse);
+}
+
+void FrameLoaderClientWx::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&)
+{
+ if (!m_frame)
+ return;
+
+ notImplemented();
+ (m_frame->loader()->*function)(PolicyUse);
+}
+
+void FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>)
+{
+ if (!m_frame)
+ return;
+
+ if (m_webView) {
+ wxWebViewBeforeLoadEvent wkEvent(m_webView);
+ wkEvent.SetNavigationType(wxNavTypeFromWebNavType(action.type()));
+ wkEvent.SetURL(request.url().string());
+
+ m_webView->GetEventHandler()->ProcessEvent(wkEvent);
+ if (wkEvent.IsCancelled())
+ (m_frame->loader()->*function)(PolicyIgnore);
+ else
+ (m_frame->loader()->*function)(PolicyUse);
+
+ }
+}
+
+void FrameLoaderClientWx::dispatchUnableToImplementPolicy(const ResourceError&)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::startDownload(const ResourceRequest&)
+{
+ notImplemented();
+}
+
+PassRefPtr<Frame> FrameLoaderClientWx::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+{
+/*
+ FIXME: Temporarily disabling code for loading subframes. While most
+ (i)frames load and are destroyed properly, the iframe created by
+ google.com in its new homepage does not get destroyed when
+ document()->detach() is called, as other (i)frames do. It is destroyed on
+ app shutdown, but until that point, this 'in limbo' frame will do things
+ like steal keyboard focus and crash when clicked on. (On some platforms,
+ it is actually a visible object, even though it's not in a valid state.)
+
+ Since just about every user is probably going to test against Google at
+ some point, I'm disabling this functionality until I have time to track down
+ why it is not being destroyed.
+*/
+
+/*
+ wxWindow* parent = m_webView;
+
+ WebViewFrameData* data = new WebViewFrameData();
+ data->name = name;
+ data->ownerElement = ownerElement;
+ data->url = url;
+ data->referrer = referrer;
+ data->marginWidth = marginWidth;
+ data->marginHeight = marginHeight;
+
+ wxWebView* newWin = new wxWebView(parent, -1, wxDefaultPosition, wxDefaultSize, data);
+
+ RefPtr<Frame> childFrame = newWin->m_impl->frame;
+
+ // FIXME: All of the below should probably be moved over into WebCore
+ childFrame->tree()->setName(name);
+ m_frame->tree()->appendChild(childFrame);
+ // ### set override encoding if we have one
+
+ FrameLoadType loadType = m_frame->loader()->loadType();
+ FrameLoadType childLoadType = FrameLoadTypeInternal;
+
+ childFrame->loader()->load(url, referrer, childLoadType,
+ String(), 0, 0);
+
+ // The frame's onload handler may have removed it from the document.
+ if (!childFrame->tree()->parent())
+ return 0;
+
+ delete data;
+
+ return childFrame.get();
+*/
+ notImplemented();
+ return 0;
+}
+
+ObjectContentType FrameLoaderClientWx::objectContentType(const KURL& url, const String& mimeType)
+{
+ notImplemented();
+ return ObjectContentType();
+}
+
+Widget* FrameLoaderClientWx::createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually)
+{
+ notImplemented();
+ return 0;
+}
+
+void FrameLoaderClientWx::redirectDataToPlugin(Widget* pluginWidget)
+{
+ notImplemented();
+ return;
+}
+
+ResourceError FrameLoaderClientWx::pluginWillHandleLoadError(const ResourceResponse&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
+Widget* FrameLoaderClientWx::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
+ const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ notImplemented();
+ return 0;
+}
+
+String FrameLoaderClientWx::overrideMediaType() const
+{
+ notImplemented();
+ return String();
+}
+
+void FrameLoaderClientWx::windowObjectCleared()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::didPerformFirstNavigation() const
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::registerForIconNotification(bool listen)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::savePlatformDataToCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::transitionToCommittedFromCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::transitionToCommittedForNewPage()
+{
+ ASSERT(m_frame);
+ ASSERT(m_webView);
+
+ Page* page = m_frame->page();
+ ASSERT(page);
+
+ bool isMainFrame = m_frame == page->mainFrame();
+
+ m_frame->setView(0);
+
+ FrameView* frameView;
+ if (isMainFrame)
+ frameView = new FrameView(m_frame, IntRect(m_webView->GetRect()).size());
+ else
+ frameView = new FrameView(m_frame);
+
+ ASSERT(frameView);
+ m_frame->setView(frameView);
+ frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
+
+ frameView->setPlatformWidget(m_webView);
+
+ if (m_frame->ownerRenderer())
+ m_frame->ownerRenderer()->setWidget(frameView);
+
+ if (HTMLFrameOwnerElement* owner = m_frame->ownerElement())
+ m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode());
+}
+
+}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
new file mode 100644
index 0000000..3b525b1
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FrameLoaderClientWx_H
+#define FrameLoaderClientWx_H
+
+#include "FrameLoaderClient.h"
+#include "FrameLoader.h"
+#include "KURL.h"
+#include "RefCounted.h"
+#include "ResourceResponse.h"
+
+class wxWebView;
+
+namespace WebCore {
+
+ class AuthenticationChallenge;
+ class DocumentLoader;
+ class Element;
+ class FormState;
+ class NavigationAction;
+ class String;
+ class ResourceLoader;
+
+ struct LoadErrorResetToken;
+
+ class FrameLoaderClientWx : public FrameLoaderClient, public RefCounted<FrameLoaderClientWx> {
+ public:
+ FrameLoaderClientWx();
+ ~FrameLoaderClientWx();
+ void setFrame(Frame *frame);
+ void setWebView(wxWebView *webview);
+ virtual void detachFrameLoader();
+
+ virtual void ref();
+ virtual void deref();
+
+ virtual bool hasWebView() const; // mainly for assertions
+
+ virtual bool hasBackForwardList() const;
+ virtual void resetBackForwardList();
+
+ virtual bool provisionalItemIsTarget() const;
+
+ virtual void makeRepresentation(DocumentLoader*);
+ virtual void forceLayout();
+ virtual void forceLayoutForNonHTML();
+
+ virtual void updateHistoryForCommit();
+
+ virtual void updateHistoryForBackForwardNavigation();
+ virtual void updateHistoryForReload();
+ virtual void updateHistoryForStandardLoad();
+ virtual void updateHistoryForInternalLoad();
+
+ virtual void updateHistoryAfterClientRedirect();
+
+ virtual void setCopiesOnScroll();
+
+ virtual LoadErrorResetToken* tokenForLoadErrorReset();
+ virtual void resetAfterLoadError(LoadErrorResetToken*);
+ virtual void doNotResetAfterLoadError(LoadErrorResetToken*);
+
+ virtual void willCloseDocument();
+
+ virtual void detachedFromParent2();
+ virtual void detachedFromParent3();
+
+ virtual void loadedFromCachedPage();
+
+ virtual void frameLoaderDestroyed();
+ virtual bool canHandleRequest(const ResourceRequest&) const;
+
+ virtual void dispatchDidHandleOnloadEvents();
+ virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+ virtual void dispatchDidCancelClientRedirect();
+ virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate);
+ virtual void dispatchDidChangeLocationWithinPage();
+ virtual void dispatchWillClose();
+ virtual void dispatchDidReceiveIcon();
+ virtual void dispatchDidStartProvisionalLoad();
+ virtual void dispatchDidReceiveTitle(const String& title);
+ virtual void dispatchDidCommitLoad();
+ virtual void dispatchDidFinishDocumentLoad();
+ virtual void dispatchDidFinishLoad();
+ virtual void dispatchDidFirstLayout();
+
+ virtual void dispatchShow();
+ virtual void cancelPolicyCheck();
+
+ virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>);
+
+ virtual void dispatchDidLoadMainResource(DocumentLoader*);
+ virtual void revertToProvisionalState(DocumentLoader*);
+
+ virtual void postProgressStartedNotification();
+ virtual void postProgressEstimateChangedNotification();
+ virtual void postProgressFinishedNotification();
+
+ virtual void progressStarted();
+ virtual void progressCompleted();
+ virtual void setMainFrameDocumentReady(bool);
+ virtual void willChangeTitle(DocumentLoader*);
+ virtual void didChangeTitle(DocumentLoader*);
+ virtual void finishedLoading(DocumentLoader*);
+
+ virtual bool canShowMIMEType(const String& MIMEType) const;
+ virtual bool representationExistsForURLScheme(const String& URLScheme) const;
+ virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
+
+ virtual void frameLoadCompleted();
+ virtual void saveViewStateToItem(HistoryItem*);
+ virtual void restoreViewState();
+ virtual void restoreScrollPositionAndViewState();
+ virtual void provisionalLoadStarted();
+ virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const;
+ virtual void addHistoryItemForFragmentScroll();
+ virtual void didFinishLoad();
+ virtual void prepareForDataSourceReplacement();
+ virtual void setTitle(const String& title, const KURL&);
+
+ virtual String userAgent(const KURL&);
+
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
+
+ virtual void updateGlobalHistory(const KURL&);
+ virtual bool shouldGoToHistoryItem(HistoryItem*) const;
+ virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
+ virtual bool canCachePage() const;
+
+ virtual void setMainDocumentError(DocumentLoader*, const ResourceError&);
+ virtual void committedLoad(DocumentLoader*, const char*, int);
+ virtual ResourceError cancelledError(const ResourceRequest&);
+ virtual ResourceError blockedError(const ResourceRequest&);
+ virtual ResourceError cannotShowURLError(const ResourceRequest&);
+ virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&);
+ virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&);
+ virtual ResourceError fileDoesNotExistError(const ResourceResponse&);
+ virtual bool shouldFallBack(const ResourceError&);
+ virtual WTF::PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&);
+ virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
+
+ virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
+
+ virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&);
+ virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
+ virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
+ virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&);
+ virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int);
+ virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long);
+ virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&);
+
+ virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int);
+ virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
+ virtual void dispatchDidFailLoad(const ResourceError&);
+ virtual Frame* dispatchCreatePage();
+ virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String&, const ResourceRequest&);
+ virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&);
+ virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>);
+ virtual void dispatchUnableToImplementPolicy(const ResourceError&);
+
+ virtual void startDownload(const ResourceRequest&);
+
+ // FIXME: This should probably not be here, but it's needed for the tests currently
+ virtual void partClearedInBegin();
+
+ virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+ const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
+ virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) ;
+ virtual void redirectDataToPlugin(Widget* pluginWidget);
+ virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
+
+ virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);
+
+ virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
+ virtual String overrideMediaType() const;
+
+ virtual void windowObjectCleared();
+
+ virtual void didPerformFirstNavigation() const;
+
+ virtual void registerForIconNotification(bool listen = true);
+
+ private:
+ Frame *m_frame;
+ wxWebView *m_webView;
+ ResourceResponse m_response;
+ bool m_firstData;
+ };
+
+}
+
+#endif
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
new file mode 100644
index 0000000..9e87da6
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorClientWx.h"
+
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+InspectorClientWx::InspectorClientWx()
+{
+ notImplemented();
+}
+
+InspectorClientWx::~InspectorClientWx()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::inspectorDestroyed()
+{
+ notImplemented();
+}
+
+Page* InspectorClientWx::createPage()
+{
+ notImplemented();
+ return 0;
+}
+
+String InspectorClientWx::localizedStringsURL()
+{
+ notImplemented();
+ return String();
+}
+
+void InspectorClientWx::showWindow()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::closeWindow()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::attachWindow()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::detachWindow()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::setAttachedWindowHeight(unsigned height)
+{
+ notImplemented();
+}
+
+void InspectorClientWx::highlight(Node*)
+{
+ notImplemented();
+}
+
+void InspectorClientWx::hideHighlight()
+{
+ notImplemented();
+}
+
+void InspectorClientWx::inspectedURLChanged(const String& newURL)
+{
+ notImplemented();
+}
+
+void InspectorClientWx::populateSetting(const String& key, InspectorController::Setting& setting)
+{
+ notImplemented();
+}
+
+void InspectorClientWx::storeSetting(const String& key, const InspectorController::Setting& setting)
+{
+ notImplemented();
+}
+
+void InspectorClientWx::removeSetting(const String& key)
+{
+ notImplemented();
+}
+
+};
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.h b/WebKit/wx/WebKitSupport/InspectorClientWx.h
new file mode 100644
index 0000000..6dd05df
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorClientWx_h
+#define InspectorClientWx_h
+
+#include "InspectorClient.h"
+
+namespace WebCore {
+
+class Node;
+class Page;
+class String;
+
+class InspectorClientWx : public InspectorClient {
+public:
+ InspectorClientWx();
+ ~InspectorClientWx();
+
+ virtual void inspectorDestroyed();
+
+ virtual Page* createPage();
+
+ virtual String localizedStringsURL();
+
+ virtual void showWindow();
+ virtual void closeWindow();
+
+ virtual void attachWindow();
+ virtual void detachWindow();
+
+ virtual void setAttachedWindowHeight(unsigned height);
+
+ virtual void highlight(Node*);
+ virtual void hideHighlight();
+
+ virtual void inspectedURLChanged(const String& newURL);
+
+ virtual void populateSetting(const String& key, InspectorController::Setting&);
+ virtual void storeSetting(const String& key, const InspectorController::Setting&);
+ virtual void removeSetting(const String& key);
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorClient_h)
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
new file mode 100644
index 0000000..fb2164f
--- /dev/null
+++ b/WebKit/wx/WebView.cpp
@@ -0,0 +1,594 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CString.h"
+#include "Document.h"
+#include "Element.h"
+#include "Editor.h"
+#include "EventHandler.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "Logging.h"
+#include "markup.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformMouseEvent.h"
+#include "PlatformString.h"
+#include "PlatformWheelEvent.h"
+#include "RenderObject.h"
+#include "RenderView.h"
+#include "SelectionController.h"
+#include "Settings.h"
+#include "SubstituteData.h"
+
+#include "ChromeClientWx.h"
+#include "ContextMenuClientWx.h"
+#include "DragClientWx.h"
+#include "EditorClientWx.h"
+#include "FrameLoaderClientWx.h"
+#include "InspectorClientWx.h"
+
+#include "ScriptController.h"
+#include "JSDOMBinding.h"
+#include <runtime/JSValue.h>
+#include <kjs/ustring.h>
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "WebFrame.h"
+#include "WebView.h"
+#include "WebViewPrivate.h"
+
+#include <wx/defs.h>
+#include <wx/dcbuffer.h>
+
+#if defined(_MSC_VER)
+int rint(double val)
+{
+ return (int)(val < 0 ? val - 0.5 : val + 0.5);
+}
+#endif
+
+// ----------------------------------------------------------------------------
+// wxWebView Events
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewLoadEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_LOAD)
+
+wxWebViewLoadEvent::wxWebViewLoadEvent(wxWindow* win)
+{
+ SetEventType( wxEVT_WEBVIEW_LOAD);
+ SetEventObject( win );
+ if (win)
+ SetId(win->GetId());
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewBeforeLoadEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_BEFORE_LOAD)
+
+wxWebViewBeforeLoadEvent::wxWebViewBeforeLoadEvent(wxWindow* win)
+{
+ m_cancelled = false;
+ SetEventType(wxEVT_WEBVIEW_BEFORE_LOAD);
+ SetEventObject(win);
+ if (win)
+ SetId(win->GetId());
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewNewWindowEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_NEW_WINDOW)
+
+wxWebViewNewWindowEvent::wxWebViewNewWindowEvent(wxWindow* win)
+{
+ SetEventType(wxEVT_WEBVIEW_NEW_WINDOW);
+ SetEventObject(win);
+ if (win)
+ SetId(win->GetId());
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewRightClickEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_RIGHT_CLICK)
+
+wxWebViewRightClickEvent::wxWebViewRightClickEvent(wxWindow* win)
+{
+ SetEventType(wxEVT_WEBVIEW_RIGHT_CLICK);
+ SetEventObject(win);
+ if (win)
+ SetId(win->GetId());
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewConsoleMessageEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_CONSOLE_MESSAGE)
+
+wxWebViewConsoleMessageEvent::wxWebViewConsoleMessageEvent(wxWindow* win)
+{
+ SetEventType(wxEVT_WEBVIEW_CONSOLE_MESSAGE);
+ SetEventObject(win);
+ if (win)
+ SetId(win->GetId());
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebViewReceivedTitleEvent, wxCommandEvent)
+
+DEFINE_EVENT_TYPE(wxEVT_WEBVIEW_RECEIVED_TITLE)
+
+wxWebViewReceivedTitleEvent::wxWebViewReceivedTitleEvent(wxWindow* win)
+{
+ SetEventType(wxEVT_WEBVIEW_RECEIVED_TITLE);
+ SetEventObject(win);
+ if (win)
+ SetId(win->GetId());
+}
+
+//---------------------------------------------------------
+// DOM Element info data type
+//---------------------------------------------------------
+
+wxWebViewDOMElementInfo::wxWebViewDOMElementInfo() :
+ m_domElement(NULL),
+ m_isSelected(false),
+ m_text(wxEmptyString),
+ m_imageSrc(wxEmptyString),
+ m_link(wxEmptyString)
+{
+}
+
+BEGIN_EVENT_TABLE(wxWebView, wxWindow)
+ EVT_PAINT(wxWebView::OnPaint)
+ EVT_SIZE(wxWebView::OnSize)
+ EVT_MOUSE_EVENTS(wxWebView::OnMouseEvents)
+ EVT_KEY_DOWN(wxWebView::OnKeyEvents)
+ EVT_KEY_UP(wxWebView::OnKeyEvents)
+ EVT_CHAR(wxWebView::OnKeyEvents)
+ EVT_SET_FOCUS(wxWebView::OnSetFocus)
+ EVT_KILL_FOCUS(wxWebView::OnKillFocus)
+ EVT_ACTIVATE(wxWebView::OnActivate)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(wxWebView, wxWindow)
+
+const wxChar* wxWebViewNameStr = wxT("webView");
+
+wxWebView::wxWebView() :
+ m_textMagnifier(1.0),
+ m_isEditable(false),
+ m_isInitialized(false),
+ m_beingDestroyed(false),
+ m_title(wxEmptyString)
+{
+}
+
+wxWebView::wxWebView(wxWindow* parent, int id, const wxPoint& position,
+ const wxSize& size, long style, const wxString& name) :
+ m_textMagnifier(1.0),
+ m_isEditable(false),
+ m_isInitialized(false),
+ m_beingDestroyed(false),
+ m_title(wxEmptyString)
+{
+ Create(parent, id, position, size, style, name);
+}
+
+bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position,
+ const wxSize& size, long style, const wxString& name)
+{
+ if ( (style & wxBORDER_MASK) == 0)
+ style |= wxBORDER_NONE;
+ style |= wxHSCROLL | wxVSCROLL;
+
+ if (!wxWindow::Create(parent, id, position, size, style, name))
+ return false;
+
+// This is necessary because we are using SharedTimerWin.cpp on Windows,
+// due to a problem with exceptions getting eaten when using the callback
+// approach to timers (which wx itself uses).
+#if __WXMSW__
+ WebCore::Page::setInstanceHandle(wxGetInstance());
+#endif
+
+ // this helps reduce flicker on platforms like MSW
+ SetBackgroundStyle(wxBG_STYLE_CUSTOM);
+
+ m_impl = new WebViewPrivate();
+
+ WebCore::InitializeLoggingChannelsIfNecessary();
+ WebCore::HTMLFrameOwnerElement* parentFrame = 0;
+
+ WebCore::EditorClientWx* editorClient = new WebCore::EditorClientWx();
+ m_impl->page = new WebCore::Page(new WebCore::ChromeClientWx(this), new WebCore::ContextMenuClientWx(), editorClient, new WebCore::DragClientWx(), new WebCore::InspectorClientWx());
+ editorClient->setPage(m_impl->page);
+
+ m_mainFrame = new wxWebFrame(this);
+
+ // Default settings - we should have wxWebViewSettings class for this
+ // eventually
+ WebCore::Settings* settings = m_impl->page->settings();
+ settings->setLoadsImagesAutomatically(true);
+ settings->setDefaultFixedFontSize(13);
+ settings->setDefaultFontSize(16);
+ settings->setSerifFontFamily("Times New Roman");
+ settings->setFixedFontFamily("Courier New");
+ settings->setSansSerifFontFamily("Arial");
+ settings->setStandardFontFamily("Times New Roman");
+ settings->setJavaScriptEnabled(true);
+
+ m_isInitialized = true;
+
+ return true;
+}
+
+wxWebView::~wxWebView()
+{
+ m_beingDestroyed = true;
+
+ delete m_mainFrame;
+
+ delete m_impl->page;
+ m_impl->page = 0;
+}
+
+void wxWebView::Stop()
+{
+ if (m_mainFrame)
+ m_mainFrame->Stop();
+}
+
+void wxWebView::Reload()
+{
+ if (m_mainFrame)
+ m_mainFrame->Reload();
+}
+
+wxString wxWebView::GetPageSource()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetPageSource();
+
+ return wxEmptyString;
+}
+
+void wxWebView::SetPageSource(const wxString& source, const wxString& baseUrl)
+{
+ if (m_mainFrame)
+ m_mainFrame->SetPageSource(source, baseUrl);
+}
+
+wxString wxWebView::GetInnerText()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetInnerText();
+
+ return wxEmptyString;
+}
+
+wxString wxWebView::GetAsMarkup()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetAsMarkup();
+
+ return wxEmptyString;
+}
+
+wxString wxWebView::GetExternalRepresentation()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GetExternalRepresentation();
+
+ return wxEmptyString;
+}
+
+wxString wxWebView::RunScript(const wxString& javascript)
+{
+ if (m_mainFrame)
+ return m_mainFrame->RunScript(javascript);
+
+ return wxEmptyString;
+}
+
+void wxWebView::LoadURL(const wxString& url)
+{
+ if (m_mainFrame)
+ m_mainFrame->LoadURL(url);
+}
+
+bool wxWebView::GoBack()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GoBack();
+
+ return false;
+}
+
+bool wxWebView::GoForward()
+{
+ if (m_mainFrame)
+ return m_mainFrame->GoForward();
+
+ return false;
+}
+
+bool wxWebView::CanGoBack()
+{
+ if (m_mainFrame)
+ return m_mainFrame->CanGoBack();
+
+ return false;
+}
+
+bool wxWebView::CanGoForward()
+{
+ if (m_mainFrame)
+ return m_mainFrame->CanGoForward();
+
+ return false;
+}
+
+bool wxWebView::CanIncreaseTextSize() const
+{
+ if (m_mainFrame)
+ return m_mainFrame->CanIncreaseTextSize();
+
+ return false;
+}
+
+void wxWebView::IncreaseTextSize()
+{
+ if (m_mainFrame)
+ m_mainFrame->IncreaseTextSize();
+}
+
+bool wxWebView::CanDecreaseTextSize() const
+{
+ if (m_mainFrame)
+ m_mainFrame->CanDecreaseTextSize();
+
+ return false;
+}
+
+void wxWebView::DecreaseTextSize()
+{
+ if (m_mainFrame)
+ m_mainFrame->DecreaseTextSize();
+}
+
+void wxWebView::MakeEditable(bool enable)
+{
+ m_isEditable = enable;
+}
+
+
+/*
+ * Event forwarding functions to send events down to WebCore.
+ */
+
+void wxWebView::OnPaint(wxPaintEvent& event)
+{
+
+ if (m_beingDestroyed || !m_mainFrame)
+ return;
+
+ WebCore::Frame* frame = m_mainFrame->GetFrame();
+ if (!frame || !frame->view())
+ return;
+
+ wxAutoBufferedPaintDC dc(this);
+
+ if (IsShown() && frame->document()) {
+#if USE(WXGC)
+ wxGCDC gcdc(dc);
+#endif
+
+ if (dc.IsOk()) {
+ wxRect paintRect = GetUpdateRegion().GetBox();
+
+ WebCore::IntSize offset = frame->view()->scrollOffset();
+#if USE(WXGC)
+ gcdc.SetDeviceOrigin(-offset.width(), -offset.height());
+#endif
+ dc.SetDeviceOrigin(-offset.width(), -offset.height());
+ paintRect.Offset(offset.width(), offset.height());
+
+#if USE(WXGC)
+ WebCore::GraphicsContext* gc = new WebCore::GraphicsContext(&gcdc);
+#else
+ WebCore::GraphicsContext* gc = new WebCore::GraphicsContext((wxWindowDC*)&dc);
+#endif
+ if (gc && frame->contentRenderer()) {
+ if (frame->view()->needsLayout())
+ frame->view()->layout();
+
+ frame->view()->paintContents(gc, paintRect);
+ }
+ delete gc;
+ }
+ }
+}
+
+void wxWebView::OnSize(wxSizeEvent& event)
+{
+ if (m_isInitialized && m_mainFrame) {
+ WebCore::Frame* frame = m_mainFrame->GetFrame();
+ frame->sendResizeEvent();
+ frame->view()->layout();
+ frame->view()->adjustScrollbars();
+ }
+
+ event.Skip();
+}
+
+void wxWebView::OnMouseEvents(wxMouseEvent& event)
+{
+ event.Skip();
+
+ if (!m_mainFrame)
+ return;
+
+ WebCore::Frame* frame = m_mainFrame->GetFrame();
+ if (!frame || !frame->view())
+ return;
+
+ wxPoint globalPoint = ClientToScreen(event.GetPosition());
+
+ wxEventType type = event.GetEventType();
+
+ if (type == wxEVT_MOUSEWHEEL) {
+ WebCore::PlatformWheelEvent wkEvent(event, globalPoint);
+ frame->eventHandler()->handleWheelEvent(wkEvent);
+ return;
+ }
+
+ WebCore::PlatformMouseEvent wkEvent(event, globalPoint);
+
+ if (type == wxEVT_LEFT_DOWN || type == wxEVT_MIDDLE_DOWN || type == wxEVT_RIGHT_DOWN)
+ frame->eventHandler()->handleMousePressEvent(wkEvent);
+
+ else if (type == wxEVT_LEFT_UP || type == wxEVT_MIDDLE_UP || type == wxEVT_RIGHT_UP ||
+ type == wxEVT_LEFT_DCLICK || type == wxEVT_MIDDLE_DCLICK || type == wxEVT_RIGHT_DCLICK)
+ frame->eventHandler()->handleMouseReleaseEvent(wkEvent);
+
+ else if (type == wxEVT_MOTION)
+ frame->eventHandler()->mouseMoved(wkEvent);
+}
+
+bool wxWebView::CanCopy()
+{
+ if (m_mainFrame)
+ return m_mainFrame->CanCopy();
+
+ return false;
+}
+
+void wxWebView::Copy()
+{
+ if (m_mainFrame)
+ m_mainFrame->Copy();
+}
+
+bool wxWebView::CanCut()
+{
+ if (m_mainFrame)
+ m_mainFrame->CanCut();
+
+ return false;
+}
+
+void wxWebView::Cut()
+{
+ if (m_mainFrame)
+ m_mainFrame->Cut();
+}
+
+bool wxWebView::CanPaste()
+{
+ if (m_mainFrame)
+ m_mainFrame->CanPaste();
+
+ return false;
+}
+
+void wxWebView::Paste()
+{
+ if (m_mainFrame)
+ m_mainFrame->Paste();
+
+}
+
+void wxWebView::OnKeyEvents(wxKeyEvent& event)
+{
+ WebCore::Frame* frame = 0;
+ if (m_mainFrame)
+ frame = m_mainFrame->GetFrame();
+
+ if (frame && frame->view()) {
+ // WebCore doesn't handle these events itself, so we need to do
+ // it and not send the event down or else CTRL+C will erase the text
+ // and replace it with c.
+ if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('C'))
+ Copy();
+ else if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('X'))
+ Cut();
+ else if (event.CmdDown() && event.GetKeyCode() == static_cast<int>('V'))
+ Paste();
+ else {
+ WebCore::PlatformKeyboardEvent wkEvent(event);
+ if (wkEvent.type() == WebCore::PlatformKeyboardEvent::Char && wkEvent.altKey())
+ frame->eventHandler()->handleAccessKey(wkEvent);
+ else
+ frame->eventHandler()->keyEvent(wkEvent);
+ }
+ }
+
+ // make sure we get the character event.
+ if (event.GetEventType() != wxEVT_CHAR)
+ event.Skip();
+}
+
+void wxWebView::OnSetFocus(wxFocusEvent& event)
+{
+ WebCore::Frame* frame = 0;
+ if (m_mainFrame)
+ frame = m_mainFrame->GetFrame();
+
+ if (frame) {
+ m_impl->page->focusController()->setActive(true);
+ frame->selection()->setFocused(true);
+ }
+
+ event.Skip();
+}
+
+void wxWebView::OnKillFocus(wxFocusEvent& event)
+{
+ WebCore::Frame* frame = 0;
+ if (m_mainFrame)
+ frame = m_mainFrame->GetFrame();
+
+ if (frame) {
+ m_impl->page->focusController()->setActive(false);
+ frame->selection()->setFocused(false);
+ }
+ event.Skip();
+}
+
+void wxWebView::OnActivate(wxActivateEvent& event)
+{
+ if (m_impl->page)
+ m_impl->page->focusController()->setActive(event.GetActive());
+
+ event.Skip();
+}
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
new file mode 100644
index 0000000..b8fce63
--- /dev/null
+++ b/WebKit/wx/WebView.h
@@ -0,0 +1,412 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WXWEBVIEW_H
+#define WXWEBVIEW_H
+
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+class WebViewPrivate;
+class WebViewFrameData;
+class wxWebFrame;
+
+namespace WebCore {
+ class ChromeClientWx;
+ class FrameLoaderClientWx;
+}
+
+#ifndef SWIG
+
+#if WXMAKINGDLL_WEBKIT
+#define WXDLLIMPEXP_WEBKIT WXEXPORT
+#elif defined(WXUSINGDLL_WEBKIT)
+#define WXDLLIMPEXP_WEBKIT WXIMPORT
+#else
+#define WXDLLIMPEXP_WEBKIT
+#endif
+
+#else
+#define WXDLLIMPEXP_WEBKIT
+#endif // SWIG
+
+extern WXDLLIMPEXP_WEBKIT const wxChar* wxWebViewNameStr;
+
+class WXDLLIMPEXP_WEBKIT wxWebView : public wxWindow
+{
+ // ChromeClientWx needs to get the Page* stored by the wxWebView
+ // for the createWindow function.
+ friend class WebCore::ChromeClientWx;
+ friend class WebCore::FrameLoaderClientWx;
+
+public:
+ // ctor(s)
+#if SWIG
+ %pythonAppend wxWebView "self._setOORInfo(self)"
+ %pythonAppend wxWebView() ""
+#endif
+
+ wxWebView(wxWindow* parent, int id = wxID_ANY,
+ const wxPoint& point = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxWebViewNameStr); // For wxWebView internal data passing
+#if SWIG
+ %rename(PreWebView) wxWebView();
+#else
+ wxWebView();
+#endif
+
+ bool Create(wxWindow* parent, int id = wxID_ANY,
+ const wxPoint& point = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxWebViewNameStr); // For wxWebView internal data passing
+
+#ifndef SWIG
+ ~wxWebView();
+#endif
+
+ void LoadURL(const wxString& url);
+ bool GoBack();
+ bool GoForward();
+ void Stop();
+ void Reload();
+
+ bool CanGoBack();
+ bool CanGoForward();
+
+ bool CanCut();
+ bool CanCopy();
+ bool CanPaste();
+
+ void Cut();
+ void Copy();
+ void Paste();
+
+ //bool CanGetPageSource();
+ wxString GetPageSource();
+ void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString);
+
+ wxString GetInnerText();
+ wxString GetAsMarkup();
+ wxString GetExternalRepresentation();
+
+ wxString RunScript(const wxString& javascript);
+
+ bool CanIncreaseTextSize() const;
+ void IncreaseTextSize();
+ bool CanDecreaseTextSize() const;
+ void DecreaseTextSize();
+ void MakeEditable(bool enable);
+ bool IsEditable() const { return m_isEditable; }
+
+ wxString GetPageTitle() const { return m_title; }
+ void SetPageTitle(const wxString& title) { m_title = title; }
+
+ wxWebFrame* GetMainFrame() { return m_mainFrame; }
+
+protected:
+
+ // event handlers (these functions should _not_ be virtual)
+ void OnPaint(wxPaintEvent& event);
+ void OnSize(wxSizeEvent& event);
+ void OnMouseEvents(wxMouseEvent& event);
+ void OnKeyEvents(wxKeyEvent& event);
+ void OnSetFocus(wxFocusEvent& event);
+ void OnKillFocus(wxFocusEvent& event);
+ void OnActivate(wxActivateEvent& event);
+
+private:
+ // any class wishing to process wxWindows events must use this macro
+#ifndef SWIG
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(wxWebView)
+#endif
+ float m_textMagnifier;
+ bool m_isEditable;
+ bool m_isInitialized;
+ bool m_beingDestroyed;
+ WebViewPrivate* m_impl;
+ wxWebFrame* m_mainFrame;
+ wxString m_title;
+
+};
+
+// ----------------------------------------------------------------------------
+// Web Kit Events
+// ----------------------------------------------------------------------------
+
+enum {
+ wxWEBVIEW_LOAD_STARTED = 1,
+ wxWEBVIEW_LOAD_NEGOTIATING = 2,
+ wxWEBVIEW_LOAD_REDIRECTING = 4,
+ wxWEBVIEW_LOAD_TRANSFERRING = 8,
+ wxWEBVIEW_LOAD_STOPPED = 16,
+ wxWEBVIEW_LOAD_FAILED = 32,
+ wxWEBVIEW_LOAD_DL_COMPLETED = 64,
+ wxWEBVIEW_LOAD_DOC_COMPLETED = 128,
+ wxWEBVIEW_LOAD_ONLOAD_HANDLED = 256,
+ wxWEBVIEW_LOAD_WINDOW_OBJECT_CLEARED = 512
+};
+
+enum {
+ wxWEBVIEW_NAV_LINK_CLICKED = 1,
+ wxWEBVIEW_NAV_BACK_NEXT = 2,
+ wxWEBVIEW_NAV_FORM_SUBMITTED = 4,
+ wxWEBVIEW_NAV_RELOAD = 8,
+ wxWEBVIEW_NAV_FORM_RESUBMITTED = 16,
+ wxWEBVIEW_NAV_OTHER = 32
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewDOMElementInfo
+{
+public:
+ wxWebViewDOMElementInfo();
+
+ ~wxWebViewDOMElementInfo() { }
+
+ wxString GetTagName() const { return m_tagName; }
+ void SetTagName(const wxString& name) { m_tagName = name; }
+
+ bool IsSelected() const { return m_isSelected; }
+ void SetSelected(bool sel) { m_isSelected = sel; }
+
+ wxString GetText() const { return m_text; }
+ void SetText(const wxString& text) { m_text = text; }
+
+ wxString GetImageSrc() const { return m_imageSrc; }
+ void SetImageSrc(const wxString& src) { m_imageSrc = src; }
+
+ wxString GetLink() const { return m_link; }
+ void SetLink(const wxString& link) { m_link = link; }
+
+private:
+ void* m_domElement;
+ bool m_isSelected;
+ wxString m_tagName;
+ wxString m_text;
+ wxString m_imageSrc;
+ wxString m_link;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewBeforeLoadEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewBeforeLoadEvent )
+#endif
+
+public:
+ bool IsCancelled() const { return m_cancelled; }
+ void Cancel(bool cancel = true) { m_cancelled = cancel; }
+ wxString GetURL() const { return m_url; }
+ void SetURL(const wxString& url) { m_url = url; }
+ void SetNavigationType(int navType) { m_navType = navType; }
+ int GetNavigationType() const { return m_navType; }
+
+ wxWebViewBeforeLoadEvent( wxWindow* win = (wxWindow*) NULL );
+ wxEvent *Clone(void) const { return new wxWebViewBeforeLoadEvent(*this); }
+
+private:
+ bool m_cancelled;
+ wxString m_url;
+ int m_navType;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewLoadEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewLoadEvent )
+#endif
+
+public:
+ int GetState() const { return m_state; }
+ void SetState(const int state) { m_state = state; }
+ wxString GetURL() const { return m_url; }
+ void SetURL(const wxString& url) { m_url = url; }
+
+ wxWebViewLoadEvent( wxWindow* win = (wxWindow*) NULL );
+ wxEvent *Clone(void) const { return new wxWebViewLoadEvent(*this); }
+
+private:
+ int m_state;
+ wxString m_url;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewNewWindowEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewNewWindowEvent )
+#endif
+
+public:
+ wxString GetURL() const { return m_url; }
+ void SetURL(const wxString& url) { m_url = url; }
+ wxString GetTargetName() const { return m_targetName; }
+ void SetTargetName(const wxString& name) { m_targetName = name; }
+
+ wxWebViewNewWindowEvent( wxWindow* win = static_cast<wxWindow*>(NULL));
+ wxEvent *Clone(void) const { return new wxWebViewNewWindowEvent(*this); }
+
+private:
+ wxString m_url;
+ wxString m_targetName;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewRightClickEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewRightClickEvent )
+#endif
+
+public:
+ wxWebViewRightClickEvent( wxWindow* win = static_cast<wxWindow*>(NULL));
+ wxEvent *Clone(void) const { return new wxWebViewRightClickEvent(*this); }
+
+ wxWebViewDOMElementInfo GetInfo() const { return m_info; }
+ void SetInfo(wxWebViewDOMElementInfo info) { m_info = info; }
+
+ wxPoint GetPosition() const { return m_position; }
+ void SetPosition(wxPoint pos) { m_position = pos; }
+
+private:
+ wxWebViewDOMElementInfo m_info;
+ wxPoint m_position;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewConsoleMessageEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewConsoleMessageEvent )
+#endif
+
+public:
+ wxString GetMessage() const { return m_message; }
+ void SetMessage(const wxString& message) { m_message = message; }
+
+ unsigned int GetLineNumber() const { return m_lineNumber; }
+ void SetLineNumber(unsigned int lineNumber) { m_lineNumber = lineNumber; }
+
+ wxString GetSourceID() const { return m_sourceID; }
+ void SetSourceID(const wxString& sourceID) { m_sourceID = sourceID; }
+
+ wxWebViewConsoleMessageEvent( wxWindow* win = (wxWindow*) NULL );
+ wxEvent *Clone(void) const { return new wxWebViewConsoleMessageEvent(*this); }
+
+private:
+ unsigned int m_lineNumber;
+ wxString m_message;
+ wxString m_sourceID;
+};
+
+class WXDLLIMPEXP_WEBKIT wxWebViewReceivedTitleEvent : public wxCommandEvent
+{
+#ifndef SWIG
+ DECLARE_DYNAMIC_CLASS( wxWebViewReceivedTitleEvent )
+#endif
+
+public:
+ wxString GetTitle() const { return m_title; }
+ void SetTitle(const wxString& title) { m_title = title; }
+
+ wxWebViewReceivedTitleEvent( wxWindow* win = static_cast<wxWindow*>(NULL));
+ wxEvent *Clone(void) const { return new wxWebViewReceivedTitleEvent(*this); }
+
+private:
+ wxString m_title;
+};
+
+
+typedef void (wxEvtHandler::*wxWebViewLoadEventFunction)(wxWebViewLoadEvent&);
+typedef void (wxEvtHandler::*wxWebViewBeforeLoadEventFunction)(wxWebViewBeforeLoadEvent&);
+typedef void (wxEvtHandler::*wxWebViewNewWindowEventFunction)(wxWebViewNewWindowEvent&);
+typedef void (wxEvtHandler::*wxWebViewRightClickEventFunction)(wxWebViewRightClickEvent&);
+typedef void (wxEvtHandler::*wxWebViewConsoleMessageEventFunction)(wxWebViewConsoleMessageEvent&);
+typedef void (wxEvtHandler::*wxWebViewReceivedTitleEventFunction)(wxWebViewReceivedTitleEvent&);
+
+#ifndef SWIG
+BEGIN_DECLARE_EVENT_TYPES()
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_BEFORE_LOAD, wxID_ANY)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_LOAD, wxID_ANY)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_NEW_WINDOW, wxID_ANY)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_RIGHT_CLICK, wxID_ANY)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_CONSOLE_MESSAGE, wxID_ANY)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_RECEIVED_TITLE, wxID_ANY)
+END_DECLARE_EVENT_TYPES()
+#endif
+
+#define EVT_WEBVIEW_LOAD(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_LOAD, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewLoadEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#define EVT_WEBVIEW_BEFORE_LOAD(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_BEFORE_LOAD, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewBeforeLoadEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#define EVT_WEBVIEW_NEW_WINDOW(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_NEW_WINDOW, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewNewWindowEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#define EVT_WEBVIEW_RIGHT_CLICK(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_RIGHT_CLICK, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewRightClickEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#define EVT_WEBVIEW_CONSOLE_MESSAGE(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_CONSOLE_MESSAGE, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewConsoleMessageEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#define EVT_WEBVIEW_RECEIVED_TITLE(winid, func) \
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_RECEIVED_TITLE, \
+ winid, \
+ wxID_ANY, \
+ (wxObjectEventFunction) \
+ (wxWebViewReceivedTitleEventFunction) & func, \
+ static_cast<wxObject*>(NULL)),
+
+#endif // ifndef WXWEBVIEW_H
diff --git a/WebKit/wx/WebViewPrivate.h b/WebKit/wx/WebViewPrivate.h
new file mode 100644
index 0000000..2eef499
--- /dev/null
+++ b/WebKit/wx/WebViewPrivate.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WXWEBVIEWPRIVATE_H
+#define WXWEBVIEWPRIVATE_H
+
+
+#include "config.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "wtf/RefPtr.h"
+#include "KURL.h"
+
+class WebViewPrivate
+{
+public:
+ WebViewPrivate() :
+ frame(0),
+ page(0)
+ {}
+
+ WTF::RefPtr<WebCore::Frame> frame;
+ WebCore::Page* page;
+};
+
+class WebViewFrameData
+{
+public:
+ WebCore::KURL url;
+ WebCore::String name;
+ WebCore::HTMLFrameOwnerElement* ownerElement;
+
+ WebCore::String referrer;
+ bool allowsScrolling;
+ int marginWidth;
+ int marginHeight;
+};
+
+#endif
diff --git a/WebKit/wx/bindings/python/samples/simple.py b/WebKit/wx/bindings/python/samples/simple.py
new file mode 100644
index 0000000..2ebdf9c
--- /dev/null
+++ b/WebKit/wx/bindings/python/samples/simple.py
@@ -0,0 +1,162 @@
+#!/usr/bin/python
+
+# Copyright (C) 2007 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import wx
+import wx.webview
+
+class TestPanel(wx.Panel):
+ def __init__(self, parent, log, frame=None):
+ wx.Panel.__init__(
+ self, parent, -1,
+ style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE
+ )
+
+ self.log = log
+ self.current = "http://wxPython.org/"
+ self.frame = frame
+
+ if frame:
+ self.titleBase = frame.GetTitle()
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ btnSizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ self.webview = wx.webview.WebView(self, -1)
+
+
+ btn = wx.Button(self, -1, "Open", style=wx.BU_EXACTFIT)
+ self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn)
+ btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2)
+
+ btn = wx.Button(self, -1, "<--", style=wx.BU_EXACTFIT)
+ self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn)
+ btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2)
+
+ btn = wx.Button(self, -1, "-->", style=wx.BU_EXACTFIT)
+ self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn)
+ btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2)
+
+ btn = wx.Button(self, -1, "Stop", style=wx.BU_EXACTFIT)
+ self.Bind(wx.EVT_BUTTON, self.OnStopButton, btn)
+ btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2)
+
+ btn = wx.Button(self, -1, "Refresh", style=wx.BU_EXACTFIT)
+ self.Bind(wx.EVT_BUTTON, self.OnRefreshPageButton, btn)
+ btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2)
+
+ txt = wx.StaticText(self, -1, "Location:")
+ btnSizer.Add(txt, 0, wx.CENTER|wx.ALL, 2)
+
+ self.location = wx.ComboBox(
+ self, -1, "", style=wx.CB_DROPDOWN|wx.PROCESS_ENTER
+ )
+
+ self.Bind(wx.EVT_COMBOBOX, self.OnLocationSelect, self.location)
+ self.location.Bind(wx.EVT_KEY_UP, self.OnLocationKey)
+ self.location.Bind(wx.EVT_CHAR, self.IgnoreReturn)
+ btnSizer.Add(self.location, 1, wx.EXPAND|wx.ALL, 2)
+
+ sizer.Add(btnSizer, 0, wx.EXPAND)
+ sizer.Add(self.webview, 1, wx.EXPAND)
+
+ self.webview.LoadURL(self.current)
+ self.location.Append(self.current)
+
+ self.webview.Bind(wx.webview.EVT_WEBVIEW_STATE_CHANGED, self.OnStateChanged)
+
+ self.SetSizer(sizer)
+
+ def OnStateChanged(self, event):
+ statusbar = self.GetParent().GetStatusBar()
+ if statusbar:
+ if event.GetState() == wx.webview.WEBVIEW_STATE_NEGOTIATING:
+ statusbar.SetStatusText("Contacting " + event.GetURL())
+ elif event.GetState() == wx.webview.WEBVIEW_STATE_TRANSFERRING:
+ statusbar.SetStatusText("Loading " + event.GetURL())
+ elif event.GetState() == wx.webview.WEBVIEW_STATE_STOP:
+ statusbar.SetStatusText("")
+ self.location.SetValue(event.GetURL())
+ self.GetParent().SetTitle("wxWebView - " + self.webview.GetPageTitle())
+
+ def OnLocationKey(self, evt):
+ if evt.GetKeyCode() == wx.WXK_RETURN:
+ URL = self.location.GetValue()
+ self.location.Append(URL)
+ self.webview.LoadURL(URL)
+ else:
+ evt.Skip()
+
+ def IgnoreReturn(self, evt):
+ if evt.GetKeyCode() != wx.WXK_RETURN:
+ evt.Skip()
+
+ def OnLocationSelect(self, evt):
+ url = self.location.GetStringSelection()
+ self.webview.LoadURL(url)
+
+ def OnOpenButton(self, event):
+ dlg = wx.TextEntryDialog(self, "Open Location",
+ "Enter a full URL or local path",
+ self.current, wx.OK|wx.CANCEL)
+ dlg.CentreOnParent()
+
+ if dlg.ShowModal() == wx.ID_OK:
+ self.current = dlg.GetValue()
+ self.webview.LoadURL(self.current)
+
+ dlg.Destroy()
+
+ def OnPrevPageButton(self, event):
+ self.webview.GoBack()
+
+ def OnNextPageButton(self, event):
+ self.webview.GoForward()
+
+ def OnStopButton(self, evt):
+ self.webview.Stop()
+
+ def OnRefreshPageButton(self, evt):
+ self.webview.Reload()
+
+
+class wkFrame(wx.Frame):
+ def __init__(self):
+ wx.Frame.__init__(self, None, -1, "WebKit in wxPython!")
+
+ self.panel = TestPanel(self, -1)
+ self.panel.webview.LoadURL("http://www.wxwidgets.org/")
+ self.CreateStatusBar()
+
+class wkApp(wx.App):
+ def OnInit(self):
+ self.webFrame = wkFrame()
+ self.SetTopWindow(self.webFrame)
+ self.webFrame.Show()
+
+ return True
+
+app = wkApp(redirect=False)
+app.MainLoop()
diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i
new file mode 100644
index 0000000..e9926ad
--- /dev/null
+++ b/WebKit/wx/bindings/python/webview.i
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2007 Kevin Ollivier All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+%module webview
+
+%{
+#include "wx/wxPython/wxPython.h"
+#include "wx/wxPython/pyclasses.h"
+#include "WebView.h"
+#include "WebBrowserShell.h"
+%}
+
+//---------------------------------------------------------------------------
+
+%import core.i
+%import windows.i
+
+MustHaveApp(wxWebView);
+MustHaveApp(wxWebBrowserShell);
+
+%include WebView.h
+%include WebBrowserShell.h
+
+%constant wxEventType wxEVT_WEBVIEW_BEFORE_LOAD;
+%constant wxEventType wxEVT_WEBVIEW_LOAD;
+%constant wxEventType wxEVT_WEBVIEW_NEW_WINDOW;
+%constant wxEventType wxEVT_WEBVIEW_RIGHT_CLICK;
+%constant wxEventType wxEVT_WEBVIEW_CONSOLE_MESSAGE;
+%constant wxEventType wxEVT_WEBVIEW_RECEIVED_TITLE;
+
+%pythoncode {
+EVT_WEBVIEW_BEFORE_LOAD = wx.PyEventBinder( wxEVT_WEBVIEW_BEFORE_LOAD, 1 )
+EVT_WEBVIEW_LOAD = wx.PyEventBinder( wxEVT_WEBVIEW_LOAD, 1 )
+EVT_WEBVIEW_NEW_WINDOW = wx.PyEventBinder( wxEVT_WEBVIEW_NEW_WINDOW, 1 )
+EVT_WEBVIEW_RIGHT_CLICK = wx.PyEventBinder( wxEVT_WEBVIEW_RIGHT_CLICK, 1 )
+EVT_WEBVIEW_CONSOLE_MESSAGE = wx.PyEventBinder( wxEVT_WEBVIEW_CONSOLE_MESSAGE, 1 )
+EVT_WEBVIEW_RECEIVED_TITLE = wx.PyEventBinder( wxEVT_WEBVIEW_RECEIVED_TITLE, 1 )
+}
diff --git a/WebKit/wx/bindings/python/wxwebkit-py.bkl b/WebKit/wx/bindings/python/wxwebkit-py.bkl
new file mode 100644
index 0000000..d6c2f7a
--- /dev/null
+++ b/WebKit/wx/bindings/python/wxwebkit-py.bkl
@@ -0,0 +1,116 @@
+<?xml version="1.0" ?>
+<!--
+Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com>
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Bakefile for wxWebKit Python bindings.
+-->
+
+<makefile>
+ <set var="WX_UNICODE">1</set>
+ <set var="WX_SHARED">1</set>
+ <include file="../../wxwk-settings.bkl"/>
+
+ <!-- the WX_PYTHON option was added to presets/wx.bkl in 2.8.5, so define
+ it in case the presets/wx.bkl doesn't define it for us. -->
+ <if cond="not isdefined('WX_PYTHON')">
+ <set var="WX_PYTHON">1</set>
+ </if>
+
+ <if cond="not isdefined('PYTHON_VERSION')">
+ <option name="PYTHON_VERSION">
+ <values>24,25</values>
+ <default-value>25</default-value>
+ <description>
+ Python version we're building against.
+ </description>
+ </option>
+ </if>
+
+ <if cond="not isdefined('PYTHON_LIBDIR')">
+ <option name="PYTHON_LIBDIR" category="path">
+ <default-value>C:/Python25/Libs</default-value>
+ <description>
+ The directory containing the Python library to link against.
+ </description>
+ </option>
+ </if>
+
+ <module id="wxwebkit-python" template="wxwk,webcore,xml2,iconv,xslt,icu,jscore,curl,sqlite3,gtk,pthreads">
+ <!-- make sure we relink wxwebkit if either webcore or jscore change -->
+ <if cond="FORMAT=='gnu'">
+ <depends-on-file>$(WKOUTPUTDIR)/libjscore.a</depends-on-file>
+ <depends-on-file>$(WKOUTPUTDIR)/libwebcore-wx.a</depends-on-file>
+ </if>
+ <if cond="FORMAT=='msvc'">
+ <depends-on-file>$(WKOUTPUTDIR)/jscore.lib</depends-on-file>
+ <depends-on-file>$(WKOUTPUTDIR)/webcore-wx.lib</depends-on-file>
+ </if>
+ <runtime-libs>dynamic</runtime-libs>
+ <dllname>_webview</dllname>
+
+ <include>$(WK_ROOT)/WebCore/platform/wx</include>
+ <include>$(WK_ROOT)/WebCore/bridge/wx</include>
+ <include>$(WK_ROOT)/WebCore/page/wx</include>
+ <include>$(WK_ROOT)/WebKit/wx</include>
+ <include>$(WK_ROOT)/WebKit/wx/WebKitSupport</include>
+
+ <if cond="FORMAT=='gnu'">
+ <sys-lib>png</sys-lib>
+ <set var="MAC_FLAGS">
+ <if cond="WX_PORT=='mac'">-bundle -undefined dynamic_lookup</if>
+ </set>
+
+ <ldflags>$(MAC_FLAGS)</ldflags>
+ </if>
+ <if cond="FORMAT in ['msvc','msvs2005prj']">
+ <set var="PY_LIBNAME">
+ <if cond="PYTHON_VERSION=='24'">
+ python24
+ </if>
+ <if cond="PYTHON_VERSION=='25'">
+ python25
+ </if>
+ </set>
+ <sys-lib>libpng</sys-lib>
+ <sys-lib>$(PY_LIBNAME)</sys-lib>
+ <lib-path>$(WK_ROOT)/libpng</lib-path>
+ <lib-path>$(PYTHON_LIBDIR)</lib-path>
+ </if>
+
+ <sys-lib>wxwebkit</sys-lib>
+ <lib-path>$(WKOUTPUTDIR)</lib-path>
+
+ <define>SWIG_TYPE_TABLE=_wxPython_table</define>
+ <define>WXP_USE_THREAD=1</define>
+ <define>SWIG_PYTHON_OUTPUT_TUPLE</define>
+
+ <sources>
+ webview.cpp
+ </sources>
+ </module>
+
+</makefile>
diff --git a/WebKit/wx/dependencies.bkl b/WebKit/wx/dependencies.bkl
new file mode 100644
index 0000000..e9eedb4
--- /dev/null
+++ b/WebKit/wx/dependencies.bkl
@@ -0,0 +1,175 @@
+<?xml version="1.0" ?>
+<!--
+
+Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This file contains templates with settings for components used by JavaScriptCore
+and WebCore. Include this file to use these settings.
+
+-->
+
+
+<makefile>
+
+ <option name="SQLITE3_LIBS">
+ <default-value>$(DOLLAR)(shell pkg-config --libs sqlite3)</default-value>
+ </option>
+
+ <option name="SQLITE3_CFLAGS">
+ <default-value>$(DOLLAR)(shell pkg-config --cflags sqlite3)</default-value>
+ </option>
+
+ <template id="sqlite3">
+ <sys-lib>sqlite3</sys-lib>
+ <if cond="FORMAT=='gnu'">
+ <ldflags>$(SQLITE3_LIBS)</ldflags>
+ <cxxflags>$(SQLITE3_CFLAGS)</cxxflags>
+ </if>
+ <if cond="FORMAT in ['msvc','msvs2005prj']">
+ <include>$(WK_ROOT)/WebKitLibraries/win/include/SQLite</include>
+ </if>
+ </template>
+
+ <option name="CURL_LIBS">
+ <default-value>$(DOLLAR)(shell curl-config --libs)</default-value>
+ </option>
+
+ <option name="CURL_CFLAGS">
+ <default-value>$(DOLLAR)(shell curl-config --cflags)</default-value>
+ </option>
+
+ <template id="curl">
+ <if cond="FORMAT not in ['msvc', 'msvc2005prj']">
+ <ldflags>$(CURL_LIBS)</ldflags>
+ <cxxflags>$(CURL_CFLAGS)</cxxflags>
+ </if>
+ <if cond="FORMAT in ['msvc', 'msvs2005prj']">
+ <sys-lib>libcurl</sys-lib>
+ </if>
+ </template>
+
+ <option name="GTK_LIBS">
+ <default-value>$(DOLLAR)(shell pkg-config --libs gtk+-2.0)</default-value>
+ </option>
+
+ <option name="GTK_CFLAGS">
+ <default-value>$(DOLLAR)(shell pkg-config --cflags gtk+-2.0)</default-value>
+ </option>
+
+ <!-- GTK settings, for GTK ports - wx doesn't use these -->
+ <template id="gtk">
+ <if cond="FORMAT=='gnu'">
+ <ldflags>$(GTK_LIBS)</ldflags>
+ <cxxflags>$(GTK_CFLAGS)</cxxflags>
+ </if>
+
+ <!-- TODO: non-Cygwin Windows support for this? :) -->
+ </template>
+
+
+ <option name="XML2_LIBS">
+ <default-value>$(DOLLAR)(shell xml2-config --libs)</default-value>
+ </option>
+
+ <option name="XML2_CFLAGS">
+ <default-value>$(DOLLAR)(shell xml2-config --cflags)</default-value>
+ </option>
+
+ <!-- XML2 library settings -->
+ <template id="xml2">
+ <if cond="FORMAT=='gnu'">
+ <ldflags>$(XML2_LIBS)</ldflags>
+ <cxxflags>$(XML2_CFLAGS)</cxxflags>
+ </if>
+
+ <if cond="PLATFORM_WIN32=='1'">
+ <include>$(WK_ROOT)/WebKitLibraries/win/include</include>
+ <sys-lib>libxml2</sys-lib>
+ </if>
+ </template>
+
+
+ <option name="XSLT_LIBS">
+ <default-value>$(DOLLAR)(shell xslt-config --libs)</default-value>
+ </option>
+
+ <option name="XSLT_CFLAGS">
+ <default-value>$(DOLLAR)(shell xslt-config --cflags)</default-value>
+ </option>
+
+ <!-- XSLT library settings -->
+ <template id="xslt" template="xml2">
+ <if cond="FORMAT=='gnu'">
+ <ldflags>$(XSLT_LIBS)</ldflags>
+ <cxxflags>$(XSLT_CFLAGS)</cxxflags>
+ </if>
+
+ <if cond="PLATFORM_WIN32=='1'">
+ <include>$(WK_ROOT)/WebKitLibraries/win/include</include>
+ <sys-lib>libxslt</sys-lib>
+ </if>
+ </template>
+
+ <!-- IBM ICU settings -->
+ <template id="icu">
+ <if cond="FORMAT=='gnu'">
+ <!-- Mac includes ICU with the system, but doesn't include headers or
+ icu-config, so we have to hardcode settings there. -->
+ <set var="ICU_INCLUDE"><if cond="WX_PORT=='mac'">$(WK_ROOT)/JavaScriptCore/icu</if></set>
+ <set var="ICU_INCLUDE"><if cond="WX_PORT=='mac'">$(WK_ROOT)/WebCore/icu</if></set>
+ <set var="ICU_LIB"><if cond="WX_PORT=='mac'">icucore</if></set>
+ <set var="ICU_LDFLAGS"><if cond="WX_PORT=='gtk2'">$(DOLLAR)(shell icu-config --ldflags)</if></set>
+ <set var="ICU_CFLAGS"><if cond="WX_PORT=='gtk2'">$(DOLLAR)(shell icu-config --cppflags)</if></set>
+
+ <include>$(ICU_INCLUDE)</include>
+ <sys-lib>$(ICU_LIB)</sys-lib>
+ <ldflags>$(ICU_LDFLAGS)</ldflags>
+ <cxxflags>$(ICU_CFLAGS)</cxxflags>
+ </if>
+
+ <if cond="PLATFORM_WIN32=='1'">
+ <sys-lib>icuuc</sys-lib>
+ <sys-lib>icuin</sys-lib>
+ </if>
+ </template>
+
+
+ <template id="iconv">
+ </template>
+
+
+ <template id="pthreads">
+ <if cond="PLATFORM_WIN32=='1'">
+ <include>$(WK_ROOT)/WebKitLibraries/win/include/pthreads</include>
+ <sys-lib>pthreadVC2</sys-lib>
+ </if>
+ <if cond="FORMAT=='gnu'">
+ <sys-lib>pthread</sys-lib>
+ </if>
+ </template>
+
+</makefile>
diff --git a/WebKit/wx/presets/wxwebkit.bkl b/WebKit/wx/presets/wxwebkit.bkl
new file mode 100644
index 0000000..80ffd2f
--- /dev/null
+++ b/WebKit/wx/presets/wxwebkit.bkl
@@ -0,0 +1,144 @@
+<?xml version="1.0" ?>
+<!--
+
+Copyright (C) 2007 Kevin Ollivier. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This file contains templates with settings for components used by JavaScriptCore
+and WebCore. Include this file to use these settings.
+
+-->
+
+
+<makefile>
+ <if cond="not isdefined('WK_ROOT')">
+ <option name="WK_ROOT" category="path">
+ <default-value>$(DOLLAR)(WEBKIT_ROOT)</default-value>
+ <description>
+ The root directory containing WebKit sources
+ </description>
+ </option>
+ </if>
+ <if cond="not isdefined('WKOUTPUTDIR')">
+ <option name="WKOUTPUTDIR" category="path">
+ <default-value>$(DOLLAR)(WEBKITOUTPUTDIR)</default-value>
+ <description>
+ The root directory containing WebKit products
+ </description>
+ </option>
+ </if>
+
+ <if cond="not isdefined('WX_PORT')">
+ <if cond="FORMAT in ['msvc','msvs2005prj']">
+ <set var="WX_PORT_DEFAULT" overwrite="0">
+ msw
+ </set>
+ </if>
+ <if cond="not FORMAT in ['msvc','msvs2005prj']">
+ <set var="WX_PORT_DEFAULT" overwrite="0">
+ $(DOLLAR)(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 1)
+ </set>
+ </if>
+ <option name="WX_PORT">
+ <values>gtk2,msw,mac</values>
+ <default-value force="1">$(WX_PORT_DEFAULT)</default-value>
+ <description>
+ Port of the wx library to build against
+ </description>
+ </option>
+ </if>
+
+ <if cond="not isdefined('DEBUG')">
+ <option name="DEBUG">
+ <values>0,1</values>
+ <default-value>0</default-value>
+ <description>
+ Whether or not to build debug
+ </description>
+ </option>
+ </if>
+
+ <template id="jscore">
+ <if cond="FORMAT in ['msvc', 'msvs2005prj']">
+ <!-- MSVC chokes on #import, so don't use ForwardingHeaders... -->
+ <include>$(WK_ROOT)/JavaScriptCore/os-win32</include><!-- stdint.h is here -->
+ <include>$(WKOUTPUTDIR)</include>
+ </if>
+ </template>
+
+ <template id="webcore">
+ <if cond="FORMAT=='gnu'">
+ <!-- FIXME: we need proper configure checks -->
+ <define>HAVE_FUNC_ISNAN</define>
+ </if>
+
+ <if cond="PLATFORM_WIN32=='1'">
+ <include>$(WK_ROOT)/os-win32</include>
+ <define>HAVE_SYS_TIMEB_H=1</define>
+ <define>HAVE_FLOAT_H=1</define>
+ <define>HAVE_FUNC__FINITE=1</define>
+ </if>
+
+ <include>$(WKOUTPUTDIR)</include>
+ <include>$(WK_ROOT)/WebCore</include>
+ <include>$(WK_ROOT)/WebCore/DerivedSources/WebCore</include>
+ <include>$(WK_ROOT)/WebCore/bindings/js</include>
+ <include>$(WK_ROOT)/WebCore/bridge</include>
+ <include>$(WK_ROOT)/WebCore/css</include>
+ <include>$(WK_ROOT)/WebCore/dom</include>
+ <include>$(WK_ROOT)/WebCore/editing</include>
+ <include>$(WK_ROOT)/WebCore/history</include>
+ <include>$(WK_ROOT)/WebCore/html</include>
+ <include>$(WK_ROOT)/WebCore/inspector</include>
+ <include>$(WK_ROOT)/WebCore/loader</include>
+ <include>$(WK_ROOT)/WebCore/loader/icon</include>
+ <include>$(WK_ROOT)/WebCore/page</include>
+ <include>$(WK_ROOT)/WebCore/platform</include>
+ <include>$(WK_ROOT)/WebCore/platform/graphics</include>
+ <include>$(WK_ROOT)/WebCore/platform/image-decoders</include>
+ <include>$(WK_ROOT)/WebCore/platform/image-decoders/gif</include>
+ <include>$(WK_ROOT)/WebCore/platform/image-decoders/jpeg</include>
+ <include>$(WK_ROOT)/WebCore/platform/image-decoders/png</include>
+ <include>$(WK_ROOT)/WebCore/platform/image-decoders/zlib</include>
+ <include>$(WK_ROOT)/WebCore/platform/network</include>
+ <include>$(WK_ROOT)/WebCore/platform/network/curl</include>
+ <include>$(WK_ROOT)/WebCore/platform/sql</include>
+ <include>$(WK_ROOT)/WebCore/platform/text</include>
+ <include>$(WK_ROOT)/WebCore/rendering</include>
+ <include>$(WK_ROOT)/WebCore/rendering/style</include>
+ <include>$(WK_ROOT)/WebCore/storage</include>
+ <include>$(WK_ROOT)/WebCore/xml</include>
+
+ <include>$(WK_ROOT)/JavaScriptCore</include>
+ <include>$(WK_ROOT)/JavaScriptCore/kjs</include>
+ <include>$(WK_ROOT)/JavaScriptCore/pcre</include>
+ <include>$(WK_ROOT)/JavaScriptCore/profiler</include>
+ <include>$(WK_ROOT)/JavaScriptCore/runtime</include>
+ <include>$(WK_ROOT)/JavaScriptCore/VM</include>
+ <include>$(WK_ROOT)/JavaScriptCore/wtf</include>
+ </template>
+
+</makefile>
diff --git a/WebKit/wx/wxwebkit.bkl b/WebKit/wx/wxwebkit.bkl
new file mode 100644
index 0000000..ccf6752
--- /dev/null
+++ b/WebKit/wx/wxwebkit.bkl
@@ -0,0 +1,83 @@
+<?xml version="1.0" ?>
+<!--
+
+Copyright (C) 2007 Kevin Ollivier. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This file builds the wxWebKit library.
+
+-->
+
+<makefile>
+ <include file="wxwk-settings.bkl"/>
+
+ <dll id="wxwebkit-dynamic" template="wxwk,jscore,webcore,xml2,iconv,xslt,icu,curl,sqlite3,gtk,pthreads">
+ <!-- make sure we relink wxwebkit if either webcore or jscore change -->
+ <if cond="FORMAT=='gnu'">
+ <depends-on-file>$(WKOUTPUTDIR)/libjscore.a</depends-on-file>
+ <depends-on-file>$(WKOUTPUTDIR)/libwebcore-wx.a</depends-on-file>
+ </if>
+ <if cond="FORMAT=='msvc'">
+ <depends-on-file>$(WKOUTPUTDIR)/jscore.lib</depends-on-file>
+ <depends-on-file>$(WKOUTPUTDIR)/webcore-wx.lib</depends-on-file>
+ </if>
+ <runtime-libs>dynamic</runtime-libs>
+ <dllname>wxwebkit</dllname>
+ <libname>wxwebkit</libname>
+
+ <include>$(WK_ROOT)/WebCore/platform/graphics/wx</include>
+ <include>$(WK_ROOT)/WebCore/platform/wx</include>
+ <include>$(WK_ROOT)/WebCore/bridge/wx</include>
+ <include>$(WK_ROOT)/WebCore/page/wx</include>
+ <include>$(WK_ROOT)/WebKit/wx</include>
+ <include>$(WK_ROOT)/WebKit/wx/WebKitSupport</include>
+
+ <lib-path>$(WKOUTPUTDIR)</lib-path>
+ <sys-lib>webcore-wx</sys-lib>
+ <sys-lib>jscore</sys-lib>
+
+ <if cond="FORMAT in ['msvc','msvs2005prj']">
+ <sys-lib>winmm</sys-lib> <!-- for timeGetTime -->
+ <sys-lib>gdiplus</sys-lib>
+ <sys-lib>libpng</sys-lib>
+ <sys-lib>libjpeg</sys-lib>
+ </if>
+
+ <sources>
+ WebKitSupport/ChromeClientWx.cpp
+ WebKitSupport/ContextMenuClientWx.cpp
+ WebKitSupport/DragClientWx.cpp
+ WebKitSupport/EditorClientWx.cpp
+ WebKitSupport/FrameLoaderClientWx.cpp
+ WebKitSupport/InspectorClientWx.cpp
+
+ WebFrame.cpp
+ WebView.cpp
+ WebBrowserShell.cpp
+ </sources>
+ </dll>
+
+</makefile>
diff --git a/WebKit/wx/wxwk-settings.bkl b/WebKit/wx/wxwk-settings.bkl
new file mode 100644
index 0000000..4328576
--- /dev/null
+++ b/WebKit/wx/wxwk-settings.bkl
@@ -0,0 +1,101 @@
+<?xml version="1.0" ?>
+<!--
+Copyright (C) 2007 Kevin Ollivier All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+JavaScriptCore Bakefile project file.
+-->
+
+<makefile>
+ <set var="WX_UNICODE">1</set>
+ <set var="WX_SHARED">1</set>
+
+ <include file="presets/wx.bkl"/>
+ <include file="presets/wxwebkit.bkl"/>
+ <include file="dependencies.bkl"/>
+
+ <set var="BUILDDIR">obj-$(FORMAT)</set>
+ <!-- the WX_PYTHON option was added to presets/wx.bkl in 2.8.5, so define
+ it in case the presets/wx.bkl doesn't define it for us. -->
+
+ <if cond="not isdefined('WX_PYTHON')">
+ <set var="WX_PYTHON">0</set>
+ </if>
+
+ <template id="wxwk_build_settings">
+ <dirname>$(WKOUTPUTDIR)</dirname>
+ <warnings>default</warnings>
+ <cxx-rtti>on</cxx-rtti>
+ <cxx-exceptions>on</cxx-exceptions>
+ <define>BUILDING_WX__=1</define>
+ <define>ENABLE_DOM_STORAGE</define>
+ <define>
+ $(substituteFromDict(DEBUG,{'1':'','0':'NDEBUG'}))
+ </define>
+ <define>USE_SYSTEM_MALLOC</define>
+ <optimize>
+ $(substituteFromDict(DEBUG,{'1':'off','0':'speed'}))
+ </optimize>
+ <debug-info>
+ $(substituteFromDict(DEBUG,{'1':'on','0':'off'}))
+ </debug-info>
+ <if cond="FORMAT in ['msvc', 'msvs2005prj']">
+ <set var="DEBUG_RUNTIME">
+ <if cond="WX_PYTHON=='1' and WX_DEBUG=='0'">off</if>
+ <if cond="WX_PYTHON=='0' and WX_DEBUG=='0'">off</if>
+ <if cond="WX_PYTHON=='1' and WX_DEBUG=='1'">off</if>
+ <if cond="WX_PYTHON=='0' and WX_DEBUG=='1'">on</if>
+ </set>
+ <debug-runtime-libs>
+ $(DEBUG_RUNTIME)
+ </debug-runtime-libs>
+ </if>
+ <if cond="FORMAT=='gnu'">
+ <include>$(WK_ROOT)/WebKitLibraries/unix/include</include>
+ <lib-path>$(WK_ROOT)/WebKitLibraries/unix/lib</lib-path>
+ </if>
+ <if cond="FORMAT in ['msvc', 'msvs2005prj']">
+ <include>$(WK_ROOT)/WebKitLibraries/win/include</include>
+ <lib-path>$(WK_ROOT)/WebKitLibraries/win/lib</lib-path>
+ </if>
+ </template>
+ <template id="wxwk" template="wxwk_build_settings,wx">
+ <!--
+ since wx 2.8's libpng and libjpeg symbols get exported when using gcc/gnu make
+ we need to make sure our versions appear first, so that it will get the symbols
+ from the right place
+ -->
+ <if cond="FORMAT=='gnu'">
+ <ldflags>-ljpeg -lpng</ldflags>
+ </if>
+ <wx-lib>core</wx-lib>
+ <wx-lib>base</wx-lib>
+ <if cond="PLATFORM_WIN32=='1'">
+ <define>WXUSINGDLL=1</define>
+ </if>
+ </template>
+
+</makefile>