Fix compilation errors under OSX.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-07-26 11:44:03 +00:00
parent 906c935a80
commit b132a83bff
2 changed files with 17 additions and 31 deletions

View File

@@ -15,7 +15,7 @@
#include "wx/setup.h" #include "wx/setup.h"
#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__)) //#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__))
#include "wx/control.h" #include "wx/control.h"
#include "wx/webview.h" #include "wx/webview.h"
@@ -80,9 +80,9 @@ public:
virtual void ClearHistory() {} virtual void ClearHistory() {}
virtual void EnableHistory(bool enable = true) {} virtual void EnableHistory(bool enable = true) {}
virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory()
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >() } { return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }
virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory() virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory()
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >() } { return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }
virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) {} virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) {}
//Undo / redo functionality //Undo / redo functionality
@@ -105,7 +105,7 @@ public:
//Selection //Selection
virtual void DeleteSelection(); virtual void DeleteSelection();
virtual bool HasSelection() { return false }; virtual bool HasSelection() { return false; };
virtual void SelectAll() {}; virtual void SelectAll() {};
virtual wxString GetSelectedText(); virtual wxString GetSelectedText();
virtual wxString GetSelectedSource() { return ""; } virtual wxString GetSelectedSource() { return ""; }
@@ -158,8 +158,14 @@ private:
void* m_webKitCtrlEventHandler; void* m_webKitCtrlEventHandler;
//It should be WebView*, but WebView is an Objective-C class //It should be WebView*, but WebView is an Objective-C class
//TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. //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_ #endif // _WX_WEBKIT_H_

View File

@@ -21,7 +21,7 @@
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#if wxHAVE_WEB_BACKEND_OSX_WEBKIT //#if wxHAVE_WEB_BACKEND_OSX_WEBKIT
#ifdef __WXCOCOA__ #ifdef __WXCOCOA__
#include "wx/cocoa/autorelease.h" #include "wx/cocoa/autorelease.h"
@@ -323,25 +323,6 @@ inline NSString* wxNSStringWithWxString(const wxString &wxstring)
#endif // wxUSE_UNICODE #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 @interface MyFrameLoadMonitor : NSObject
{ {
wxWebViewWebKit* webKitWindow; wxWebViewWebKit* webKitWindow;
@@ -411,7 +392,6 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
if(m_parent) m_parent->CocoaAddChild(this); if(m_parent) m_parent->CocoaAddChild(this);
SetInitialFrameRect(pos,sizeInstance); SetInitialFrameRect(pos,sizeInstance);
#else #else
m_macIsUserPane = false;
wxControl::Create(parent, winID, pos, size, style, wxDefaultValidator, name); wxControl::Create(parent, winID, pos, size, style, wxDefaultValidator, name);
#if wxOSX_USE_CARBON #if wxOSX_USE_CARBON
@@ -735,7 +715,7 @@ wxString wxWebViewWebKit::GetSelectedText()
void wxWebViewWebKit::RunScript(const wxString& javascript) void wxWebViewWebKit::RunScript(const wxString& javascript)
{ {
if ( !m_webView ) if ( !m_webView )
return wxEmptyString; return;
[[m_webView windowScriptObject] evaluateWebScript: [[m_webView windowScriptObject] evaluateWebScript:
(NSString*)wxNSStringWithWxString( javascript )]; (NSString*)wxNSStringWithWxString( javascript )];
@@ -932,7 +912,7 @@ void wxWebViewWebKit::Cut()
if ( !m_webView ) if ( !m_webView )
return; return;
[(WebView*)m_webView cut]; [(WebView*)m_webView cut:m_webView];
} }
void wxWebViewWebKit::Copy() void wxWebViewWebKit::Copy()
@@ -940,7 +920,7 @@ void wxWebViewWebKit::Copy()
if ( !m_webView ) if ( !m_webView )
return; return;
[(WebView*)m_webView copy]; [(WebView*)m_webView copy:m_webView];
} }
void wxWebViewWebKit::Paste() void wxWebViewWebKit::Paste()
@@ -948,7 +928,7 @@ void wxWebViewWebKit::Paste()
if ( !m_webView ) if ( !m_webView )
return; return;
[(WebView*)m_webView paste]; [(WebView*)m_webView paste:m_webView];
} }
void wxWebViewWebKit::DeleteSelection() void wxWebViewWebKit::DeleteSelection()
@@ -1216,4 +1196,4 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebNavigationError* out)
} }
@end @end
#endif //wxHAVE_WEB_BACKEND_OSX_WEBKIT //#endif //wxHAVE_WEB_BACKEND_OSX_WEBKIT