X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d156af3247c862e51a7c62f569a3fd302052a42..3e1db65507361f69f37b1f66de319a1c9bf5fca8:/src/osx/webview_webkit.mm diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 0d0e0e72e3..598f63391e 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -14,8 +14,8 @@ #include "wx/osx/webview_webkit.h" -#if wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \ - || defined(__WXOSX_CARBON__)) +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \ + || defined(__WXOSX_CARBON__)) // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -557,7 +557,7 @@ void wxWebViewWebKit::Print() { [op setShowsPrintPanel: showPrompt]; // in my tests, the progress bar always freezes and it stops the whole - // print operation. do not turn this to true unless there is a + // print operation. do not turn this to true unless there is a // workaround for the bug. [op setShowsProgressPanel: false]; } @@ -648,7 +648,7 @@ void wxWebViewWebKit::RunScript(const wxString& javascript) void wxWebViewWebKit::OnSize(wxSizeEvent &event) { -#if defined(__WXMAC_) && wxOSX_USE_CARBON +#if defined(__WXMAC__) && wxOSX_USE_CARBON // This is a nasty hack because WebKit seems to lose its position when it is // embedded in a control that is not itself the content view for a TLW. // I put it in OnSize because these calcs are not perfect, and in fact are @@ -1086,7 +1086,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) *out = wxWEB_NAV_ERR_USER_CANCELLED; break; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 case NSURLErrorCannotDecodeRawData: case NSURLErrorCannotDecodeContentData: case NSURLErrorCannotParseResponse: @@ -1182,7 +1182,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) webKitWindow->GetId(), webKitWindow->GetCurrentURL(), target); - + event.SetString(wxStringWithNSString(title)); if (webKitWindow && webKitWindow->GetEventHandler()) @@ -1228,7 +1228,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) } } -- (void)webView:(WebView *)sender +- (void)webView:(WebView *)sender decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName @@ -1285,18 +1285,18 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[request URL] MIMEType:wxNSStringWithWxString(file->GetMimeType()) - expectedContentLength:length + expectedContentLength:length textEncodingName:nil]; - + //Load the data, we malloc it so it is tidied up properly void* buffer = malloc(length); file->GetStream()->Read(buffer, length); NSData *data = [[NSData alloc] initWithBytesNoCopy:buffer length:length]; - + id client = [self client]; //We do not support caching anything yet - [client URLProtocol:self didReceiveResponse:response + [client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; //Set the data @@ -1315,4 +1315,4 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) @end -#endif //wxUSE_WEBVIEW_WEBKIT +#endif //wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT