From 0f84a1b0ada4835041d51a5fd398337b2caed416 Mon Sep 17 00:00:00 2001
From: Stefan Csomor <csomor@advancedconcepts.ch>
Date: Fri, 20 Jun 2014 08:14:46 +0000
Subject: [PATCH] using proper types for webkit variants, see #16329
---
docs/changes.txt | 1 +
include/wx/defs.h | 8 ++++++++
include/wx/html/webkit.h | 3 +--
include/wx/osx/webview_webkit.h | 2 +-
src/osx/webview_webkit.mm | 24 ++++++++++++------------
5 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/docs/changes.txt b/docs/changes.txt
index 8885427..00fe1b8 100644
a
|
b
|
wxMSW: |
615 | 615 | |
616 | 616 | wxOSX: |
617 | 617 | |
| 618 | - Compilation fix for wxWebView under 10.10. |
618 | 619 | - Fix conversion of wxBitmap to wxImage in 64 bit builds. |
619 | 620 | - Fix wxFileDialog::GetFilterIndex() for file open dialogs (phsilva). |
620 | 621 | |
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 397ddd7..b14ee41 100644
a
|
b
|
enum wxUpdateUI |
3169 | 3169 | DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); |
3170 | 3170 | DECLARE_WXCOCOA_OBJC_CLASS(NSSet); |
3171 | 3171 | DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); |
| 3172 | DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); |
3172 | 3173 | |
3173 | 3174 | typedef WX_UIWindow WXWindow; |
3174 | 3175 | typedef WX_UIView WXWidget; |
3175 | 3176 | typedef WX_EAGLContext WXGLContext; |
3176 | 3177 | typedef WX_NSString* WXGLPixelFormat; |
| 3178 | typedef WX_UIWebView OSXWebViewPtr; |
3177 | 3179 | |
3178 | 3180 | #endif |
3179 | 3181 | |
| 3182 | #if wxOSX_USE_COCOA_OR_CARBON |
| 3183 | DECLARE_WXCOCOA_OBJC_CLASS(WebView); |
| 3184 | typedef WX_WebView OSXWebViewPtr; |
| 3185 | #endif |
| 3186 | |
| 3187 | |
3180 | 3188 | #endif /* __WXMAC__ */ |
3181 | 3189 | |
3182 | 3190 | /* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ |
diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h
index 8700367..f805099 100644
a
|
b
|
|
18 | 18 | #endif |
19 | 19 | |
20 | 20 | #include "wx/control.h" |
21 | | DECLARE_WXCOCOA_OBJC_CLASS(WebView); |
22 | 21 | |
23 | 22 | // ---------------------------------------------------------------------------- |
24 | 23 | // Web Kit Control |
… |
… |
class WXDLLIMPEXP_CORE wxWebKitCtrl : public wxControl |
107 | 106 | wxString m_currentURL; |
108 | 107 | wxString m_pageTitle; |
109 | 108 | |
110 | | WX_WebView m_webView; |
| 109 | OSXWebViewPtr m_webView; |
111 | 110 | |
112 | 111 | // we may use this later to setup our own mouse events, |
113 | 112 | // so leave it in for now. |
diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h
index 803f8b0..438e532 100644
a
|
b
|
class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView |
158 | 158 | wxWindowID m_windowID; |
159 | 159 | wxString m_pageTitle; |
160 | 160 | |
161 | | wxObjCID m_webView; |
| 161 | OSXWebViewPtr m_webView; |
162 | 162 | |
163 | 163 | // we may use this later to setup our own mouse events, |
164 | 164 | // so leave it in for now. |
diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm
index ab75865..1ac60fe 100644
a
|
b
|
DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) |
296 | 296 | wxWebViewWebKit* webKitWindow; |
297 | 297 | } |
298 | 298 | |
299 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow; |
| 299 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow; |
300 | 300 | |
301 | 301 | @end |
302 | 302 | |
… |
… |
DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) |
305 | 305 | wxWebViewWebKit* webKitWindow; |
306 | 306 | } |
307 | 307 | |
308 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow; |
| 308 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow; |
309 | 309 | |
310 | 310 | @end |
311 | 311 | |
… |
… |
DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) |
314 | 314 | wxWebViewWebKit* webKitWindow; |
315 | 315 | } |
316 | 316 | |
317 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow; |
| 317 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow; |
318 | 318 | |
319 | 319 | @end |
320 | 320 | |
… |
… |
void wxWebViewWebKit::GoBack() |
442 | 442 | if ( !m_webView ) |
443 | 443 | return; |
444 | 444 | |
445 | | [(WebView*)m_webView goBack]; |
| 445 | [m_webView goBack]; |
446 | 446 | } |
447 | 447 | |
448 | 448 | void wxWebViewWebKit::GoForward() |
… |
… |
void wxWebViewWebKit::GoForward() |
450 | 450 | if ( !m_webView ) |
451 | 451 | return; |
452 | 452 | |
453 | | [(WebView*)m_webView goForward]; |
| 453 | [m_webView goForward]; |
454 | 454 | } |
455 | 455 | |
456 | 456 | void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags) |
… |
… |
void wxWebViewWebKit::Cut() |
849 | 849 | if ( !m_webView ) |
850 | 850 | return; |
851 | 851 | |
852 | | [(WebView*)m_webView cut:m_webView]; |
| 852 | [m_webView cut:m_webView]; |
853 | 853 | } |
854 | 854 | |
855 | 855 | void wxWebViewWebKit::Copy() |
… |
… |
void wxWebViewWebKit::Copy() |
857 | 857 | if ( !m_webView ) |
858 | 858 | return; |
859 | 859 | |
860 | | [(WebView*)m_webView copy:m_webView]; |
| 860 | [m_webView copy:m_webView]; |
861 | 861 | } |
862 | 862 | |
863 | 863 | void wxWebViewWebKit::Paste() |
… |
… |
void wxWebViewWebKit::Paste() |
865 | 865 | if ( !m_webView ) |
866 | 866 | return; |
867 | 867 | |
868 | | [(WebView*)m_webView paste:m_webView]; |
| 868 | [m_webView paste:m_webView]; |
869 | 869 | } |
870 | 870 | |
871 | 871 | void wxWebViewWebKit::DeleteSelection() |
… |
… |
void wxWebViewWebKit::DeleteSelection() |
873 | 873 | if ( !m_webView ) |
874 | 874 | return; |
875 | 875 | |
876 | | [(WebView*)m_webView deleteSelection]; |
| 876 | [m_webView deleteSelection]; |
877 | 877 | } |
878 | 878 | |
879 | 879 | bool wxWebViewWebKit::HasSelection() const |
… |
… |
void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) |
1007 | 1007 | |
1008 | 1008 | @implementation WebViewLoadDelegate |
1009 | 1009 | |
1010 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow |
| 1010 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow |
1011 | 1011 | { |
1012 | 1012 | [super init]; |
1013 | 1013 | webKitWindow = inWindow; // non retained |
… |
… |
wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) |
1197 | 1197 | |
1198 | 1198 | @implementation WebViewPolicyDelegate |
1199 | 1199 | |
1200 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow |
| 1200 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow |
1201 | 1201 | { |
1202 | 1202 | [super init]; |
1203 | 1203 | webKitWindow = inWindow; // non retained |
… |
… |
wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) |
1335 | 1335 | |
1336 | 1336 | @implementation WebViewUIDelegate |
1337 | 1337 | |
1338 | | - initWithWxWindow: (wxWebViewWebKit*)inWindow |
| 1338 | - (id)initWithWxWindow: (wxWebViewWebKit*)inWindow |
1339 | 1339 | { |
1340 | 1340 | [super init]; |
1341 | 1341 | webKitWindow = inWindow; // non retained |