]> git.saurik.com Git - wxWidgets.git/commitdiff
Add new definitions required by MinGW for webview. Re-enable custom schemes as a...
authorSteve Lamerton <steve.lamerton@gmail.com>
Sun, 2 Oct 2011 16:20:15 +0000 (16:20 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Sun, 2 Oct 2011 16:20:15 +0000 (16:20 +0000)
See #13509

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/missing.h
include/wx/msw/webview_ie.h
interface/wx/webview.h
src/msw/webview_ie.cpp

index 392d05679dcb65e908ea9be34d0bed4933e6ceb7..f42a31ca1fb9648d3c7c4e5ee3e7c9a42519d4e6 100644 (file)
@@ -577,6 +577,130 @@ typedef enum CommandStateChangeConstants {
 
 #ifndef DISPID_NEWWINDOW3
 #define DISPID_NEWWINDOW3 273
+#endif
+
+//We need to check if we are using MinGW which doesn't inlcude the urlmon
+//defintions as opposed to MinGW-64 which does
+
+#ifdef __MINGW32__
+#include <_mingw.h>
+#endif
+
+//Definitions from w64 mingw-runtime package, in the public domain
+//Used by webview
+#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+
+EXTERN_C const IID CLSID_FileProtocol;
+
+DEFINE_GUID(IID_IInternetProtocolRoot,0x79eac9e3,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb);
+DEFINE_GUID(IID_IInternetProtocol,0x79eac9e4,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb);
+
+typedef enum __MIDL_IBindStatusCallback_0006 
+{
+    BSCF_FIRSTDATANOTIFICATION = 0x1,
+    BSCF_INTERMEDIATEDATANOTIFICATION = 0x2,
+    BSCF_LASTDATANOTIFICATION = 0x4,
+    BSCF_DATAFULLYAVAILABLE = 0x8,
+    BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
+}   BSCF;
+
+typedef struct _tagPROTOCOLDATA
+{
+    DWORD grfFlags;
+    DWORD dwState;
+    LPVOID pData;
+    ULONG cbData;
+}   PROTOCOLDATA;
+
+typedef struct _tagBINDINFO
+{
+    ULONG cbSize;
+    LPWSTR szExtraInfo;
+    STGMEDIUM stgmedData;
+    DWORD grfBindInfoF;
+    DWORD dwBindVerb;
+    LPWSTR szCustomVerb;
+    DWORD cbstgmedData;
+    DWORD dwOptions;
+    DWORD dwOptionsFlags;
+    DWORD dwCodePage;
+    SECURITY_ATTRIBUTES securityAttributes;
+    IID iid;
+    IUnknown *pUnk;
+    DWORD dwReserved;
+}   BINDINFO;
+
+
+struct IInternetBindInfo : public IUnknown
+{
+public:
+    virtual HRESULT WINAPI GetBindInfo(DWORD *grfBINDF,BINDINFO *pbindinfo) = 0;
+    virtual HRESULT WINAPI GetBindString(ULONG ulStringType,LPOLESTR *ppwzStr,
+                                         ULONG cEl,ULONG *pcElFetched) = 0;
+};
+
+struct IInternetProtocolSink : public IUnknown
+{
+public:
+    virtual HRESULT WINAPI Switch(PROTOCOLDATA *pProtocolData) = 0;
+    virtual HRESULT WINAPI ReportProgress(ULONG ulStatusCode,
+                                          LPCWSTR szStatusText) = 0;
+    virtual HRESULT WINAPI ReportData(DWORD grfBSCF,ULONG ulProgress,
+                                      ULONG ulProgressMax) = 0;
+    virtual HRESULT WINAPI ReportResult(HRESULT hrResult,DWORD dwError,
+                                        LPCWSTR szResult) = 0;
+};
+
+struct IInternetProtocolRoot : public IUnknown
+{
+public:
+    virtual HRESULT WINAPI Start(LPCWSTR szUrl,IInternetProtocolSink *pOIProtSink,
+                                 IInternetBindInfo *pOIBindInfo,DWORD grfPI,
+                                 HANDLE_PTR dwReserved) = 0;
+    virtual HRESULT WINAPI Continue(PROTOCOLDATA *pProtocolData) = 0;
+    virtual HRESULT WINAPI Abort(HRESULT hrReason,DWORD dwOptions) = 0;
+    virtual HRESULT WINAPI Terminate(DWORD dwOptions) = 0;
+    virtual HRESULT WINAPI Suspend(void) = 0;
+    virtual HRESULT WINAPI Resume(void) = 0;
+};
+
+struct IInternetProtocol : public IInternetProtocolRoot
+{
+public:
+    virtual HRESULT WINAPI Read(void *pv,ULONG cb,ULONG *pcbRead) = 0;
+    virtual HRESULT WINAPI Seek(LARGE_INTEGER dlibMove,DWORD dwOrigin,
+                                ULARGE_INTEGER *plibNewPosition) = 0;
+    virtual HRESULT WINAPI LockRequest(DWORD dwOptions) = 0;
+    virtual HRESULT WINAPI UnlockRequest(void) = 0;
+};
+
+struct IInternetSession : public IUnknown
+{
+  public:
+    virtual HRESULT WINAPI RegisterNameSpace(IClassFactory *pCF,REFCLSID rclsid,
+                                             LPCWSTR pwzProtocol,
+                                             ULONG cPatterns,
+                                             const LPCWSTR *ppwzPatterns,
+                                             DWORD dwReserved) = 0;
+    virtual HRESULT WINAPI UnregisterNameSpace(IClassFactory *pCF,
+                                               LPCWSTR pszProtocol) = 0;
+    virtual HRESULT WINAPI RegisterMimeFilter(IClassFactory *pCF,
+                                              REFCLSID rclsid,
+                                              LPCWSTR pwzType) = 0;
+    virtual HRESULT WINAPI UnregisterMimeFilter(IClassFactory *pCF,
+                                                LPCWSTR pwzType) = 0;
+    virtual HRESULT WINAPI CreateBinding(LPBC pBC,LPCWSTR szUrl,
+                                         IUnknown *pUnkOuter,IUnknown **ppUnk,
+                                         IInternetProtocol **ppOInetProt,
+                                         DWORD dwOption) = 0;
+    virtual HRESULT WINAPI SetSessionOption(DWORD dwOption,LPVOID pBuffer,
+                                            DWORD dwBufferLength,
+                                            DWORD dwReserved) = 0;
+    virtual HRESULT WINAPI GetSessionOption(DWORD dwOption,LPVOID pBuffer,
+                                            DWORD *pdwBufferLength,
+                                            DWORD dwReserved) = 0;
+};
+
 #endif
 
  /*
index 9da57a36fbcea77e5b2c0e114351a49c0a7681f9..407174b0e5efad39665503c062253fc0e323dcb5 100644 (file)
@@ -161,8 +161,6 @@ private:
     wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
 };
 
-#ifndef __MINGW32__
-
 class VirtualProtocol : public IInternetProtocol
 {
 protected:
@@ -227,8 +225,6 @@ private:
     wxSharedPtr<wxWebViewHandler> m_handler;
 };
 
-#endif // __MINGW32__
-
 #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE && defined(__WXMSW__)
 
 #endif // wxWebViewIE_H
index 2a837de1c136d67ade34c054b50084e6fa14ed79..94d3c68bb1147d920a9bf9ea14ffceda9097630e 100644 (file)
@@ -171,8 +171,7 @@ public:
     changed with a registry setting, see 
     <a href="http://msdn.microsoft.com/en-us/library/ee330730%28v=vs.85%29.aspx#browser_emulation">
     this</a> article for more information. This backend has full support for
-    custom schemes and virtual file systems, except when compiling under MinGW 
-    where they are disabled.
+    custom schemes and virtual file systems.
     
     @par wxWEB_VIEW_WEBKIT (GTK)
     
index 0a6a6402326a31fff3eb94608b88ac21a48eae9c..8374dc87b87588e4b9d4d8629f4185350b548ee6 100644 (file)
@@ -665,7 +665,6 @@ void wxWebViewIE::RunScript(const wxString& javascript)
 
 void wxWebViewIE::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
 {
-#ifndef __MINGW32__
     wxDynamicLibrary urlMon(wxT("urlmon.dll"));
     if(urlMon.HasSymbol(wxT("CoInternetGetSession")))
     {
@@ -690,7 +689,6 @@ void wxWebViewIE::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
     {
         wxFAIL_MSG("urlmon does not contain CoInternetGetSession");
     }
-#endif
 }
 
 bool wxWebViewIE::CanExecCommand(wxString command) const
@@ -977,8 +975,6 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt)
     evt.Skip();
 }
 
-#ifndef __MINGW32__
-
 VirtualProtocol::VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler)
 {
     m_refCount = 0;
@@ -1148,6 +1144,4 @@ ULONG ClassFactory::Release(void)
 
 } 
 
-#endif // __MINGW32__
-
 #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE