@end
+@interface WebViewUIDelegate : NSObject
+{
+ wxWebViewWebKit* webKitWindow;
+}
+
+- initWithWxWindow: (wxWebViewWebKit*)inWindow;
+
+@end
+
//We use a hash to map scheme names to wxWebViewHandler
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxWebViewHandler>, wxStringToWebHandlerMap);
[m_webView setPolicyDelegate:policyDelegate];
+ WebViewUIDelegate* uiDelegate =
+ [[WebViewUIDelegate alloc] initWithWxWindow: this];
+
+ [m_webView setUIDelegate:uiDelegate];
+
//Register our own class for custom scheme handling
[NSURLProtocol registerClass:[WebViewCustomProtocol class]];
{
WebViewLoadDelegate* loadDelegate = [m_webView frameLoadDelegate];
WebViewPolicyDelegate* policyDelegate = [m_webView policyDelegate];
+ WebViewUIDelegate* uiDelegate = [m_webView UIDelegate];
[m_webView setFrameLoadDelegate: nil];
[m_webView setPolicyDelegate: nil];
+ [m_webView setUIDelegate: nil];
if (loadDelegate)
[loadDelegate release];
if (policyDelegate)
[policyDelegate release];
+
+ if (uiDelegate)
+ [uiDelegate release];
}
// ----------------------------------------------------------------------------
@end
+
+@implementation WebViewUIDelegate
+
+- initWithWxWindow: (wxWebViewWebKit*)inWindow
+{
+ [super init];
+ webKitWindow = inWindow; // non retained
+ return self;
+}
+
+- (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView
+{
+ wxUnusedVar(sender);
+ wxUnusedVar(frameView);
+
+ webKitWindow->Print();
+}
+@end
+
#endif //wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT