Ticket #48317: patch-webkit-variants-proper-types.diff

File patch-webkit-variants-proper-types.diff, 5.7 KB (added by mdeaudelin (Mathieu Deaudelin-Lemay), 9 years ago)

Patch from http://trac.wxwidgets.org/ticket/16329

  • docs/changes.txt

    From 0f84a1b0ada4835041d51a5fd398337b2caed416 Mon Sep 17 00:00:00 2001
    From: Stefan Csomor <csomor@advancedconcepts.ch>
    Date: Fri, 20 Jun 2014 08:14:46 +0000
    Subject: [PATCH] using proper types for webkit variants, see #16329
    
    ---
     docs/changes.txt                |  1 +
     include/wx/defs.h               |  8 ++++++++
     include/wx/html/webkit.h        |  3 +--
     include/wx/osx/webview_webkit.h |  2 +-
     src/osx/webview_webkit.mm       | 24 ++++++++++++------------
     5 files changed, 23 insertions(+), 15 deletions(-)
    
    diff --git a/docs/changes.txt b/docs/changes.txt
    index 8885427..00fe1b8 100644
    a b wxMSW: 
    615615
    616616wxOSX:
    617617
     618- Compilation fix for wxWebView under 10.10.
    618619- Fix conversion of wxBitmap to wxImage in 64 bit builds.
    619620- Fix wxFileDialog::GetFilterIndex() for file open dialogs (phsilva).
    620621
  • include/wx/defs.h

    diff --git a/include/wx/defs.h b/include/wx/defs.h
    index 397ddd7..b14ee41 100644
    a b enum wxUpdateUI 
    31693169DECLARE_WXCOCOA_OBJC_CLASS(UIEvent);
    31703170DECLARE_WXCOCOA_OBJC_CLASS(NSSet);
    31713171DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext);
     3172DECLARE_WXCOCOA_OBJC_CLASS(UIWebView);
    31723173
    31733174typedef WX_UIWindow WXWindow;
    31743175typedef WX_UIView WXWidget;
    31753176typedef WX_EAGLContext WXGLContext;
    31763177typedef WX_NSString* WXGLPixelFormat;
     3178typedef WX_UIWebView OSXWebViewPtr;
    31773179
    31783180#endif
    31793181
     3182#if wxOSX_USE_COCOA_OR_CARBON
     3183DECLARE_WXCOCOA_OBJC_CLASS(WebView);
     3184typedef WX_WebView OSXWebViewPtr;
     3185#endif
     3186
     3187
    31803188#endif /* __WXMAC__ */
    31813189
    31823190/* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */
  • include/wx/html/webkit.h

    diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h
    index 8700367..f805099 100644
    a b  
    1818#endif
    1919
    2020#include "wx/control.h"
    21 DECLARE_WXCOCOA_OBJC_CLASS(WebView);
    2221
    2322// ----------------------------------------------------------------------------
    2423// Web Kit Control
    class WXDLLIMPEXP_CORE wxWebKitCtrl : public wxControl 
    107106    wxString m_currentURL;
    108107    wxString m_pageTitle;
    109108
    110     WX_WebView m_webView;
     109    OSXWebViewPtr m_webView;
    111110
    112111    // we may use this later to setup our own mouse events,
    113112    // so leave it in for now.
  • include/wx/osx/webview_webkit.h

    diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h
    index 803f8b0..438e532 100644
    a b class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView 
    158158    wxWindowID m_windowID;
    159159    wxString m_pageTitle;
    160160
    161     wxObjCID m_webView;
     161    OSXWebViewPtr m_webView;
    162162
    163163    // we may use this later to setup our own mouse events,
    164164    // so leave it in for now.
  • src/osx/webview_webkit.mm

    diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm
    index ab75865..1ac60fe 100644
    a b DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) 
    296296    wxWebViewWebKit* webKitWindow;
    297297}
    298298
    299 - initWithWxWindow: (wxWebViewWebKit*)inWindow;
     299- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow;
    300300
    301301@end
    302302
    DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) 
    305305    wxWebViewWebKit* webKitWindow;
    306306}
    307307
    308 - initWithWxWindow: (wxWebViewWebKit*)inWindow;
     308- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow;
    309309
    310310@end
    311311
    DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebViewWebKitEventHandler ) 
    314314    wxWebViewWebKit* webKitWindow;
    315315}
    316316
    317 - initWithWxWindow: (wxWebViewWebKit*)inWindow;
     317- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow;
    318318
    319319@end
    320320
    void wxWebViewWebKit::GoBack() 
    442442    if ( !m_webView )
    443443        return;
    444444
    445     [(WebView*)m_webView goBack];
     445    [m_webView goBack];
    446446}
    447447
    448448void wxWebViewWebKit::GoForward()
    void wxWebViewWebKit::GoForward() 
    450450    if ( !m_webView )
    451451        return;
    452452
    453     [(WebView*)m_webView goForward];
     453    [m_webView goForward];
    454454}
    455455
    456456void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags)
    void wxWebViewWebKit::Cut() 
    849849    if ( !m_webView )
    850850        return;
    851851
    852     [(WebView*)m_webView cut:m_webView];
     852    [m_webView cut:m_webView];
    853853}
    854854
    855855void wxWebViewWebKit::Copy()
    void wxWebViewWebKit::Copy() 
    857857    if ( !m_webView )
    858858        return;
    859859
    860     [(WebView*)m_webView copy:m_webView];
     860    [m_webView copy:m_webView];
    861861}
    862862
    863863void wxWebViewWebKit::Paste()
    void wxWebViewWebKit::Paste() 
    865865    if ( !m_webView )
    866866        return;
    867867
    868     [(WebView*)m_webView paste:m_webView];
     868    [m_webView paste:m_webView];
    869869}
    870870
    871871void wxWebViewWebKit::DeleteSelection()
    void wxWebViewWebKit::DeleteSelection() 
    873873    if ( !m_webView )
    874874        return;
    875875
    876     [(WebView*)m_webView deleteSelection];
     876    [m_webView deleteSelection];
    877877}
    878878
    879879bool wxWebViewWebKit::HasSelection() const
    void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) 
    10071007
    10081008@implementation WebViewLoadDelegate
    10091009
    1010 - initWithWxWindow: (wxWebViewWebKit*)inWindow
     1010- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow
    10111011{
    10121012    [super init];
    10131013    webKitWindow = inWindow;    // non retained
    wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) 
    11971197
    11981198@implementation WebViewPolicyDelegate
    11991199
    1200 - initWithWxWindow: (wxWebViewWebKit*)inWindow
     1200- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow
    12011201{
    12021202    [super init];
    12031203    webKitWindow = inWindow;    // non retained
    wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) 
    13351335
    13361336@implementation WebViewUIDelegate
    13371337
    1338 - initWithWxWindow: (wxWebViewWebKit*)inWindow
     1338- (id)initWithWxWindow: (wxWebViewWebKit*)inWindow
    13391339{
    13401340    [super init];
    13411341    webKitWindow = inWindow;    // non retained