From b132a83bffa4f9855fb02c7c82d48cee33a69b1a Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Tue, 26 Jul 2011 11:44:03 +0000 Subject: [PATCH] Fix compilation errors under OSX. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/webview_webkit.h | 16 +++++++++++----- src/osx/webview_webkit.mm | 32 ++++++-------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 975bee5ec7..311aff84d8 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -15,7 +15,7 @@ #include "wx/setup.h" -#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__)) +//#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__)) #include "wx/control.h" #include "wx/webview.h" @@ -80,9 +80,9 @@ public: virtual void ClearHistory() {} virtual void EnableHistory(bool enable = true) {} virtual wxVector > GetBackwardHistory() - { return wxVector >() } + { return wxVector >(); } virtual wxVector > GetForwardHistory() - { return wxVector >() } + { return wxVector >(); } virtual void LoadHistoryItem(wxSharedPtr item) {} //Undo / redo functionality @@ -105,7 +105,7 @@ public: //Selection virtual void DeleteSelection(); - virtual bool HasSelection() { return false }; + virtual bool HasSelection() { return false; }; virtual void SelectAll() {}; virtual wxString GetSelectedText(); virtual wxString GetSelectedSource() { return ""; } @@ -158,8 +158,14 @@ private: void* m_webKitCtrlEventHandler; //It should be WebView*, but WebView is an Objective-C class //TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. + +#if wxOSX_USE_CARBON + wxMacControl *m_peer; +#else + wxWidgetCocoaImpl *m_peer; +#endif }; -#endif // wxUSE_WEBKIT +//#endif // wxUSE_WEBKIT #endif // _WX_WEBKIT_H_ diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index ec49602552..daae499d70 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -21,7 +21,7 @@ #include "wx/wx.h" #endif -#if wxHAVE_WEB_BACKEND_OSX_WEBKIT +//#if wxHAVE_WEB_BACKEND_OSX_WEBKIT #ifdef __WXCOCOA__ #include "wx/cocoa/autorelease.h" @@ -323,25 +323,6 @@ inline NSString* wxNSStringWithWxString(const wxString &wxstring) #endif // wxUSE_UNICODE } -inline int wxNavTypeFromWebNavType(int type){ - if (type == WebNavigationTypeLinkClicked) - return wxWEBKIT_NAV_LINK_CLICKED; - - if (type == WebNavigationTypeFormSubmitted) - return wxWEBKIT_NAV_FORM_SUBMITTED; - - if (type == WebNavigationTypeBackForward) - return wxWEBKIT_NAV_BACK_NEXT; - - if (type == WebNavigationTypeReload) - return wxWEBKIT_NAV_RELOAD; - - if (type == WebNavigationTypeFormResubmitted) - return wxWEBKIT_NAV_FORM_RESUBMITTED; - - return wxWEBKIT_NAV_OTHER; -} - @interface MyFrameLoadMonitor : NSObject { wxWebViewWebKit* webKitWindow; @@ -411,7 +392,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent, if(m_parent) m_parent->CocoaAddChild(this); SetInitialFrameRect(pos,sizeInstance); #else - m_macIsUserPane = false; wxControl::Create(parent, winID, pos, size, style, wxDefaultValidator, name); #if wxOSX_USE_CARBON @@ -735,7 +715,7 @@ wxString wxWebViewWebKit::GetSelectedText() void wxWebViewWebKit::RunScript(const wxString& javascript) { if ( !m_webView ) - return wxEmptyString; + return; [[m_webView windowScriptObject] evaluateWebScript: (NSString*)wxNSStringWithWxString( javascript )]; @@ -932,7 +912,7 @@ void wxWebViewWebKit::Cut() if ( !m_webView ) return; - [(WebView*)m_webView cut]; + [(WebView*)m_webView cut:m_webView]; } void wxWebViewWebKit::Copy() @@ -940,7 +920,7 @@ void wxWebViewWebKit::Copy() if ( !m_webView ) return; - [(WebView*)m_webView copy]; + [(WebView*)m_webView copy:m_webView]; } void wxWebViewWebKit::Paste() @@ -948,7 +928,7 @@ void wxWebViewWebKit::Paste() if ( !m_webView ) return; - [(WebView*)m_webView paste]; + [(WebView*)m_webView paste:m_webView]; } void wxWebViewWebKit::DeleteSelection() @@ -1216,4 +1196,4 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebNavigationError* out) } @end -#endif //wxHAVE_WEB_BACKEND_OSX_WEBKIT +//#endif //wxHAVE_WEB_BACKEND_OSX_WEBKIT -- 2.45.2