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"
#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<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory()
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >() }
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }
virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory()
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >() }
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }
virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> 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_

View File

@@ -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