diff --git a/include/wx/defs.h b/include/wx/defs.h index 6cf2bcae0e..9e7353c76a 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -3090,14 +3090,22 @@ DECLARE_WXCOCOA_OBJC_CLASS(UIImage); DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); DECLARE_WXCOCOA_OBJC_CLASS(NSSet); DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); +DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); typedef WX_UIWindow WXWindow; typedef WX_UIView WXWidget; typedef WX_EAGLContext WXGLContext; typedef WX_NSString* WXGLPixelFormat; +typedef WX_UIWebView OSXWebViewPtr; #endif +#if wxOSX_USE_COCOA_OR_CARBON +DECLARE_WXCOCOA_OBJC_CLASS(WebView); +typedef WX_WebView OSXWebViewPtr; +#endif + + #endif /* __WXMAC__ */ /* 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 87003672b4..f8050996e4 100644 --- a/include/wx/html/webkit.h +++ b/include/wx/html/webkit.h @@ -18,7 +18,6 @@ #endif #include "wx/control.h" -DECLARE_WXCOCOA_OBJC_CLASS(WebView); // ---------------------------------------------------------------------------- // Web Kit Control @@ -107,7 +106,7 @@ private: wxString m_currentURL; wxString m_pageTitle; - WX_WebView m_webView; + OSXWebViewPtr m_webView; // we may use this later to setup our own mouse events, // so leave it in for now. diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 1661e84480..12ce268685 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -157,7 +157,7 @@ private: wxWindowID m_windowID; wxString m_pageTitle; - wxObjCID m_webView; + OSXWebViewPtr m_webView; // we may use this later to setup our own mouse events, // so leave it in for now. diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index e09c9fe74e..e6544ebb3b 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -40,15 +40,6 @@ // using native types to get compile errors and warnings -#if wxOSX_USE_COCOA_OR_CARBON -typedef WebView OSXWebView; -#elif wxOSX_USE_IPHONE -typedef UIWebView OSXWebView; -#else -#error "unsupport OSX variant" -#endif - - #define DEBUG_WEBKIT_SIZING 0 // ---------------------------------------------------------------------------- @@ -467,7 +458,7 @@ void wxWebViewWebKit::GoBack() if ( !m_webView ) return; - [(OSXWebView*)m_webView goBack]; + [m_webView goBack]; } void wxWebViewWebKit::GoForward() @@ -475,7 +466,7 @@ void wxWebViewWebKit::GoForward() if ( !m_webView ) return; - [(OSXWebView*)m_webView goForward]; + [m_webView goForward]; } void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags) @@ -874,7 +865,7 @@ void wxWebViewWebKit::Cut() if ( !m_webView ) return; - [(OSXWebView*)m_webView cut:m_webView]; + [m_webView cut:m_webView]; } void wxWebViewWebKit::Copy() @@ -882,7 +873,7 @@ void wxWebViewWebKit::Copy() if ( !m_webView ) return; - [(OSXWebView*)m_webView copy:m_webView]; + [m_webView copy:m_webView]; } void wxWebViewWebKit::Paste() @@ -890,7 +881,7 @@ void wxWebViewWebKit::Paste() if ( !m_webView ) return; - [(OSXWebView*)m_webView paste:m_webView]; + [m_webView paste:m_webView]; } void wxWebViewWebKit::DeleteSelection() @@ -898,7 +889,7 @@ void wxWebViewWebKit::DeleteSelection() if ( !m_webView ) return; - [(OSXWebView*)m_webView deleteSelection]; + [m_webView deleteSelection]; } bool wxWebViewWebKit::HasSelection() const