#ifdef __WXCOCOA__
#include "wx/cocoa/autorelease.h"
#else
-#include "wx/mac/uma.h"
+#include "wx/osx/uma.h"
#include <Carbon/Carbon.h>
#include <WebKit/WebKit.h>
#include <WebKit/HIWebView.h>
SetId(win->GetId());
}
+
+IMPLEMENT_DYNAMIC_CLASS( wxWebKitNewWindowEvent, wxCommandEvent )
+
+DEFINE_EVENT_TYPE( wxEVT_WEBKIT_NEW_WINDOW )
+
+wxWebKitNewWindowEvent::wxWebKitNewWindowEvent( wxWindow* win )
+{
+ SetEventType( wxEVT_WEBKIT_NEW_WINDOW);
+ SetEventObject( win );
+ SetId(win->GetId());
+}
+
+
+
//---------------------------------------------------------
// helper functions for NSString<->wxString conversion
//---------------------------------------------------------
wxWindow* tlw = MacGetTopLevelWindow();
- NSRect frame = [m_webView frame];
- NSRect bounds = [m_webView bounds];
+ NSRect frame = [(WebView*)m_webView frame];
+ NSRect bounds = [(WebView*)m_webView bounds];
#if DEBUG_WEBKIT_SIZING
fprintf(stderr,"Carbon window x=%d, y=%d, width=%d, height=%d\n", GetPosition().x, GetPosition().y, GetSize().x, GetSize().y);
frame.origin.x = x;
frame.origin.y = y;
- [m_webView setFrame:frame];
+ [(WebView*)m_webView setFrame:frame];
if (IsShown())
[(WebView*)m_webView display];
[listener use];
}
+- (void)webView:(WebView *)sender decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id < WebPolicyDecisionListener >)listener
+{
+ wxWebKitNewWindowEvent thisEvent(webKitWindow);
+
+ NSString *url = [[request URL] absoluteString];
+ thisEvent.SetURL( wxStringWithNSString( url ) );
+ thisEvent.SetTargetName( wxStringWithNSString( frameName ) );
+
+ if (webKitWindow && webKitWindow->GetEventHandler())
+ webKitWindow->GetEventHandler()->ProcessEvent(thisEvent);
+
+ [listener use];
+}
@end
#endif //wxUSE_WEBKIT