mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
Merge branch 'wxwebviewieimpl' of https://github.com/MaartenBent/wxWidgets
Actually allow using wxWebVieWIE-specific methods for setting the emulation level. Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of the private headers from it, which was in turn achieved by moving all the implementation details into a private class. See https://github.com/wxWidgets/wxWidgets/pull/1647
This commit is contained in:
+2
-5
@@ -2260,11 +2260,8 @@ COND_PLATFORM_WIN32_1_GTK_PLATFORM_HDR = \
|
||||
@COND_TOOLKIT_GTK@WEBVIEW_HDR_PLATFORM = \
|
||||
@COND_TOOLKIT_GTK@ wx/gtk/webviewhistoryitem_webkit.h \
|
||||
@COND_TOOLKIT_GTK@ wx/gtk/webview_webkit.h
|
||||
COND_TOOLKIT_MSW_WEBVIEW_HDR_PLATFORM = \
|
||||
wx/msw/webviewhistoryitem_ie.h \
|
||||
wx/msw/webview_ie.h \
|
||||
wx/msw/webview_missing.h
|
||||
@COND_TOOLKIT_MSW@WEBVIEW_HDR_PLATFORM = $(COND_TOOLKIT_MSW_WEBVIEW_HDR_PLATFORM)
|
||||
@COND_TOOLKIT_MSW@WEBVIEW_HDR_PLATFORM = \
|
||||
@COND_TOOLKIT_MSW@ wx/msw/webviewhistoryitem_ie.h wx/msw/webview_ie.h
|
||||
@COND_TOOLKIT_COCOA@OPENGL_HDR_PLATFORM = wx/cocoa/glcanvas.h
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_@OPENGL_HDR_PLATFORM \
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_@ = wx/gtk1/glcanvas.h wx/unix/glx11.h
|
||||
|
||||
@@ -3034,7 +3034,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
<if cond="TOOLKIT=='MSW'">
|
||||
wx/msw/webviewhistoryitem_ie.h
|
||||
wx/msw/webview_ie.h
|
||||
wx/msw/webview_missing.h
|
||||
</if>
|
||||
<if cond="TOOLKIT=='GTK'">
|
||||
wx/gtk/webviewhistoryitem_webkit.h
|
||||
|
||||
@@ -2844,7 +2844,6 @@ set(WEBVIEW_CMN_SRC
|
||||
set(WEBVIEW_MSW_HDR
|
||||
wx/msw/webviewhistoryitem_ie.h
|
||||
wx/msw/webview_ie.h
|
||||
wx/msw/webview_missing.h
|
||||
)
|
||||
|
||||
set(WEBVIEW_CMN_HDR
|
||||
|
||||
@@ -2794,7 +2794,6 @@ WEBVIEW_CMN_SRC =
|
||||
WEBVIEW_MSW_HDR =
|
||||
wx/msw/webviewhistoryitem_ie.h
|
||||
wx/msw/webview_ie.h
|
||||
wx/msw/webview_missing.h
|
||||
WEBVIEW_CMN_HDR =
|
||||
wx/webview.h
|
||||
wx/webviewarchivehandler.h
|
||||
|
||||
@@ -1796,9 +1796,6 @@
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h">
|
||||
</File>
|
||||
|
||||
@@ -424,9 +424,6 @@
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h">
|
||||
</File>
|
||||
|
||||
@@ -2897,10 +2897,6 @@
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h"
|
||||
>
|
||||
|
||||
@@ -1068,10 +1068,6 @@
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h"
|
||||
>
|
||||
|
||||
@@ -2893,10 +2893,6 @@
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h"
|
||||
>
|
||||
|
||||
@@ -1064,10 +1064,6 @@
|
||||
RelativePath="..\..\include\wx\msw\webview_ie.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webview_missing.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\wx\msw\webviewhistoryitem_ie.h"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: include/wx/msw/private/webview_ie.h
|
||||
// Purpose: wxMSW IE wxWebView backend private classes
|
||||
// Author: Marianne Gagnon
|
||||
// Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef wxWebViewIE_PRIVATE_H
|
||||
#define wxWebViewIE_PRIVATE_H
|
||||
|
||||
#include "wx/msw/ole/automtn.h"
|
||||
#include "wx/msw/private/comptr.h"
|
||||
#include "wx/msw/private/webview_missing.h"
|
||||
|
||||
class ClassFactory;
|
||||
class wxIEContainer;
|
||||
class DocHostUIHandler;
|
||||
class wxFindPointers;
|
||||
|
||||
class wxWebViewIEImpl
|
||||
{
|
||||
public:
|
||||
explicit wxWebViewIEImpl(wxWebViewIE* webview);
|
||||
~wxWebViewIEImpl();
|
||||
|
||||
bool Create();
|
||||
|
||||
wxWebViewIE* m_webview;
|
||||
|
||||
wxIEContainer* m_container;
|
||||
wxAutomationObject m_ie;
|
||||
IWebBrowser2* m_webBrowser;
|
||||
wxCOMPtr<DocHostUIHandler> m_uiHandler;
|
||||
|
||||
//We store the current zoom type;
|
||||
wxWebViewZoomType m_zoomType;
|
||||
|
||||
/** The "Busy" property of IWebBrowser2 does not always return busy when
|
||||
* we'd want it to; this variable may be set to true in cases where the
|
||||
* Busy property is false but should be true.
|
||||
*/
|
||||
bool m_isBusy;
|
||||
//We manage our own history, the history list contains the history items
|
||||
//which are added as documentcomplete events arrive, unless we are loading
|
||||
//an item from the history. The position is stored as an int, and reflects
|
||||
//where we are in the history list.
|
||||
wxVector<wxSharedPtr<wxWebViewHistoryItem> > m_historyList;
|
||||
wxVector<ClassFactory*> m_factories;
|
||||
int m_historyPosition;
|
||||
bool m_historyLoadingFromList;
|
||||
bool m_historyEnabled;
|
||||
|
||||
//We store find flag, results and position.
|
||||
wxVector<wxFindPointers> m_findPointers;
|
||||
int m_findFlags;
|
||||
wxString m_findText;
|
||||
int m_findPosition;
|
||||
|
||||
//Generic helper functions
|
||||
bool CanExecCommand(wxString command) const;
|
||||
void ExecCommand(wxString command);
|
||||
wxCOMPtr<IHTMLDocument2> GetDocument() const;
|
||||
bool IsElementVisible(wxCOMPtr<IHTMLElement> elm);
|
||||
//Find helper functions.
|
||||
long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT);
|
||||
void FindInternal(const wxString& text, int flags, int internal_flag);
|
||||
long FindNext(int direction = 1);
|
||||
void FindClear();
|
||||
//Toggles control features see INTERNETFEATURELIST for values.
|
||||
bool EnableControlFeature(long flag, bool enable = true);
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxWebViewIEImpl);
|
||||
};
|
||||
|
||||
class VirtualProtocol : public wxIInternetProtocol
|
||||
{
|
||||
protected:
|
||||
wxIInternetProtocolSink* m_protocolSink;
|
||||
wxString m_html;
|
||||
VOID * fileP;
|
||||
|
||||
wxFSFile* m_file;
|
||||
wxSharedPtr<wxWebViewHandler> m_handler;
|
||||
|
||||
public:
|
||||
VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler);
|
||||
virtual ~VirtualProtocol() {}
|
||||
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
//IInternetProtocolRoot
|
||||
HRESULT STDMETHODCALLTYPE Abort(HRESULT WXUNUSED(hrReason),
|
||||
DWORD WXUNUSED(dwOptions)) wxOVERRIDE
|
||||
{ return E_NOTIMPL; }
|
||||
HRESULT STDMETHODCALLTYPE Continue(wxPROTOCOLDATA *WXUNUSED(pProtocolData)) wxOVERRIDE
|
||||
{ return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Resume() wxOVERRIDE { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Start(LPCWSTR szUrl,
|
||||
wxIInternetProtocolSink *pOIProtSink,
|
||||
wxIInternetBindInfo *pOIBindInfo,
|
||||
DWORD grfPI,
|
||||
HANDLE_PTR dwReserved) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE Suspend() wxOVERRIDE { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Terminate(DWORD WXUNUSED(dwOptions)) wxOVERRIDE { return S_OK; }
|
||||
|
||||
//IInternetProtocol
|
||||
HRESULT STDMETHODCALLTYPE LockRequest(DWORD WXUNUSED(dwOptions)) wxOVERRIDE
|
||||
{ return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER WXUNUSED(dlibMove),
|
||||
DWORD WXUNUSED(dwOrigin),
|
||||
ULARGE_INTEGER* WXUNUSED(plibNewPosition)) wxOVERRIDE
|
||||
{ return E_FAIL; }
|
||||
HRESULT STDMETHODCALLTYPE UnlockRequest() wxOVERRIDE { return S_OK; }
|
||||
};
|
||||
|
||||
class ClassFactory : public IClassFactory
|
||||
{
|
||||
public:
|
||||
ClassFactory(wxSharedPtr<wxWebViewHandler> handler) : m_handler(handler)
|
||||
{ AddRef(); }
|
||||
virtual ~ClassFactory() {}
|
||||
|
||||
wxString GetName() { return m_handler->GetName(); }
|
||||
|
||||
//IClassFactory
|
||||
HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown* pUnkOuter,
|
||||
REFIID riid, void** ppvObject) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock) wxOVERRIDE;
|
||||
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
private:
|
||||
wxSharedPtr<wxWebViewHandler> m_handler;
|
||||
};
|
||||
|
||||
class wxIEContainer : public wxActiveXContainer
|
||||
{
|
||||
public:
|
||||
wxIEContainer(wxWindow *parent, REFIID iid, IUnknown *pUnk, DocHostUIHandler* uiHandler = NULL);
|
||||
virtual ~wxIEContainer();
|
||||
virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc) wxOVERRIDE;
|
||||
private:
|
||||
DocHostUIHandler* m_uiHandler;
|
||||
};
|
||||
|
||||
class DocHostUIHandler : public wxIDocHostUIHandler
|
||||
{
|
||||
public:
|
||||
DocHostUIHandler(wxWebView* browser) { m_browser = browser; }
|
||||
virtual ~DocHostUIHandler() {}
|
||||
|
||||
virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt,
|
||||
IUnknown *pcmdtReserved,
|
||||
IDispatch *pdispReserved) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetHostInfo(DOCHOSTUIINFO *pInfo) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL ShowUI(DWORD dwID,
|
||||
IOleInPlaceActiveObject *pActiveObject,
|
||||
IOleCommandTarget *pCommandTarget,
|
||||
IOleInPlaceFrame *pFrame,
|
||||
IOleInPlaceUIWindow *pDoc) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL HideUI(void) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL UpdateUI(void) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL EnableModeless(BOOL fEnable) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL OnDocWindowActivate(BOOL fActivate) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL OnFrameWindowActivate(BOOL fActivate) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL ResizeBorder(LPCRECT prcBorder,
|
||||
IOleInPlaceUIWindow *pUIWindow,
|
||||
BOOL fRameWindow) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL TranslateAccelerator(LPMSG lpMsg,
|
||||
const GUID *pguidCmdGroup,
|
||||
DWORD nCmdID) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetOptionKeyPath(LPOLESTR *pchKey,
|
||||
DWORD dw) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetDropTarget(IDropTarget *pDropTarget,
|
||||
IDropTarget **ppDropTarget) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetExternal(IDispatch **ppDispatch) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL TranslateUrl(DWORD dwTranslate,
|
||||
OLECHAR *pchURLIn,
|
||||
OLECHAR **ppchURLOut) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL FilterDataObject(IDataObject *pDO,
|
||||
IDataObject **ppDORet) wxOVERRIDE;
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
private:
|
||||
wxWebView* m_browser;
|
||||
};
|
||||
|
||||
class wxFindPointers
|
||||
{
|
||||
public:
|
||||
wxFindPointers(wxIMarkupPointer *ptrBegin, wxIMarkupPointer *ptrEnd)
|
||||
{
|
||||
begin = ptrBegin;
|
||||
end = ptrEnd;
|
||||
}
|
||||
//The two markup pointers.
|
||||
wxIMarkupPointer *begin, *end;
|
||||
};
|
||||
|
||||
#endif // wxWebViewIE_PRIVATE_H
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: include/wx/msw/webview_missing.h
|
||||
// Name: include/wx/msw/private/webview_missing.h
|
||||
// Purpose: Definitions / classes commonly missing used by wxWebViewIE
|
||||
// Author: Steven Lamerton
|
||||
// Copyright: (c) 2012 Steven Lamerton
|
||||
+3
-203
@@ -13,28 +13,10 @@
|
||||
|
||||
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE && defined(__WXMSW__)
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/webview.h"
|
||||
#include "wx/msw/ole/automtn.h"
|
||||
#include "wx/msw/ole/activex.h"
|
||||
#include "wx/msw/ole/oleutils.h"
|
||||
#include "wx/msw/private/comptr.h"
|
||||
#include "wx/msw/wrapwin.h"
|
||||
#include "wx/msw/missing.h"
|
||||
#include "wx/msw/webview_missing.h"
|
||||
#include "wx/sharedptr.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
struct IHTMLDocument2;
|
||||
struct IHTMLElement;
|
||||
struct IMarkupPointer;
|
||||
class wxFSFile;
|
||||
class ClassFactory;
|
||||
class wxIEContainer;
|
||||
class DocHostUIHandler;
|
||||
class wxFindPointers;
|
||||
class wxIInternetProtocol;
|
||||
class wxWebViewIEImpl;
|
||||
|
||||
// Note that the highest emulation level may be used even when the
|
||||
// corresponding browser version is not installed.
|
||||
@@ -152,7 +134,7 @@ public:
|
||||
//Virtual Filesystem Support
|
||||
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) wxOVERRIDE;
|
||||
|
||||
virtual void* GetNativeBackend() const wxOVERRIDE { return m_webBrowser; }
|
||||
virtual void* GetNativeBackend() const wxOVERRIDE;
|
||||
|
||||
// ---- IE-specific methods
|
||||
|
||||
@@ -189,46 +171,7 @@ protected:
|
||||
virtual void DoSetPage(const wxString& html, const wxString& baseUrl) wxOVERRIDE;
|
||||
|
||||
private:
|
||||
wxIEContainer* m_container;
|
||||
wxAutomationObject m_ie;
|
||||
IWebBrowser2* m_webBrowser;
|
||||
wxCOMPtr<DocHostUIHandler> m_uiHandler;
|
||||
|
||||
//We store the current zoom type;
|
||||
wxWebViewZoomType m_zoomType;
|
||||
|
||||
/** The "Busy" property of IWebBrowser2 does not always return busy when
|
||||
* we'd want it to; this variable may be set to true in cases where the
|
||||
* Busy property is false but should be true.
|
||||
*/
|
||||
bool m_isBusy;
|
||||
//We manage our own history, the history list contains the history items
|
||||
//which are added as documentcomplete events arrive, unless we are loading
|
||||
//an item from the history. The position is stored as an int, and reflects
|
||||
//where we are in the history list.
|
||||
wxVector<wxSharedPtr<wxWebViewHistoryItem> > m_historyList;
|
||||
wxVector<ClassFactory*> m_factories;
|
||||
int m_historyPosition;
|
||||
bool m_historyLoadingFromList;
|
||||
bool m_historyEnabled;
|
||||
|
||||
//We store find flag, results and position.
|
||||
wxVector<wxFindPointers> m_findPointers;
|
||||
int m_findFlags;
|
||||
wxString m_findText;
|
||||
int m_findPosition;
|
||||
|
||||
//Generic helper functions
|
||||
bool CanExecCommand(wxString command) const;
|
||||
void ExecCommand(wxString command);
|
||||
wxCOMPtr<IHTMLDocument2> GetDocument() const;
|
||||
bool IsElementVisible(wxCOMPtr<IHTMLElement> elm);
|
||||
//Find helper functions.
|
||||
void FindInternal(const wxString& text, int flags, int internal_flag);
|
||||
long FindNext(int direction = 1);
|
||||
void FindClear();
|
||||
//Toggles control features see INTERNETFEATURELIST for values.
|
||||
bool EnableControlFeature(long flag, bool enable = true);
|
||||
wxWebViewIEImpl* m_impl;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
|
||||
};
|
||||
@@ -247,149 +190,6 @@ public:
|
||||
{ return new wxWebViewIE(parent, id, url, pos, size, style, name); }
|
||||
};
|
||||
|
||||
class VirtualProtocol : public wxIInternetProtocol
|
||||
{
|
||||
protected:
|
||||
wxIInternetProtocolSink* m_protocolSink;
|
||||
wxString m_html;
|
||||
VOID * fileP;
|
||||
|
||||
wxFSFile* m_file;
|
||||
wxSharedPtr<wxWebViewHandler> m_handler;
|
||||
|
||||
public:
|
||||
VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler);
|
||||
virtual ~VirtualProtocol() {}
|
||||
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
//IInternetProtocolRoot
|
||||
HRESULT STDMETHODCALLTYPE Abort(HRESULT WXUNUSED(hrReason),
|
||||
DWORD WXUNUSED(dwOptions)) wxOVERRIDE
|
||||
{ return E_NOTIMPL; }
|
||||
HRESULT STDMETHODCALLTYPE Continue(wxPROTOCOLDATA *WXUNUSED(pProtocolData)) wxOVERRIDE
|
||||
{ return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Resume() wxOVERRIDE { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Start(LPCWSTR szUrl,
|
||||
wxIInternetProtocolSink *pOIProtSink,
|
||||
wxIInternetBindInfo *pOIBindInfo,
|
||||
DWORD grfPI,
|
||||
HANDLE_PTR dwReserved) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE Suspend() wxOVERRIDE { return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Terminate(DWORD WXUNUSED(dwOptions)) wxOVERRIDE { return S_OK; }
|
||||
|
||||
//IInternetProtocol
|
||||
HRESULT STDMETHODCALLTYPE LockRequest(DWORD WXUNUSED(dwOptions)) wxOVERRIDE
|
||||
{ return S_OK; }
|
||||
HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER WXUNUSED(dlibMove),
|
||||
DWORD WXUNUSED(dwOrigin),
|
||||
ULARGE_INTEGER* WXUNUSED(plibNewPosition)) wxOVERRIDE
|
||||
{ return E_FAIL; }
|
||||
HRESULT STDMETHODCALLTYPE UnlockRequest() wxOVERRIDE { return S_OK; }
|
||||
};
|
||||
|
||||
class ClassFactory : public IClassFactory
|
||||
{
|
||||
public:
|
||||
ClassFactory(wxSharedPtr<wxWebViewHandler> handler) : m_handler(handler)
|
||||
{ AddRef(); }
|
||||
virtual ~ClassFactory() {}
|
||||
|
||||
wxString GetName() { return m_handler->GetName(); }
|
||||
|
||||
//IClassFactory
|
||||
HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown* pUnkOuter,
|
||||
REFIID riid, void** ppvObject) wxOVERRIDE;
|
||||
HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock) wxOVERRIDE;
|
||||
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
private:
|
||||
wxSharedPtr<wxWebViewHandler> m_handler;
|
||||
};
|
||||
|
||||
class wxIEContainer : public wxActiveXContainer
|
||||
{
|
||||
public:
|
||||
wxIEContainer(wxWindow *parent, REFIID iid, IUnknown *pUnk, DocHostUIHandler* uiHandler = NULL);
|
||||
virtual ~wxIEContainer();
|
||||
virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc) wxOVERRIDE;
|
||||
private:
|
||||
DocHostUIHandler* m_uiHandler;
|
||||
};
|
||||
|
||||
class DocHostUIHandler : public wxIDocHostUIHandler
|
||||
{
|
||||
public:
|
||||
DocHostUIHandler(wxWebView* browser) { m_browser = browser; }
|
||||
virtual ~DocHostUIHandler() {}
|
||||
|
||||
virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt,
|
||||
IUnknown *pcmdtReserved,
|
||||
IDispatch *pdispReserved) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetHostInfo(DOCHOSTUIINFO *pInfo) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL ShowUI(DWORD dwID,
|
||||
IOleInPlaceActiveObject *pActiveObject,
|
||||
IOleCommandTarget *pCommandTarget,
|
||||
IOleInPlaceFrame *pFrame,
|
||||
IOleInPlaceUIWindow *pDoc) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL HideUI(void) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL UpdateUI(void) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL EnableModeless(BOOL fEnable) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL OnDocWindowActivate(BOOL fActivate) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL OnFrameWindowActivate(BOOL fActivate) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL ResizeBorder(LPCRECT prcBorder,
|
||||
IOleInPlaceUIWindow *pUIWindow,
|
||||
BOOL fRameWindow) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL TranslateAccelerator(LPMSG lpMsg,
|
||||
const GUID *pguidCmdGroup,
|
||||
DWORD nCmdID) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetOptionKeyPath(LPOLESTR *pchKey,
|
||||
DWORD dw) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetDropTarget(IDropTarget *pDropTarget,
|
||||
IDropTarget **ppDropTarget) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL GetExternal(IDispatch **ppDispatch) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL TranslateUrl(DWORD dwTranslate,
|
||||
OLECHAR *pchURLIn,
|
||||
OLECHAR **ppchURLOut) wxOVERRIDE;
|
||||
|
||||
virtual HRESULT wxSTDCALL FilterDataObject(IDataObject *pDO,
|
||||
IDataObject **ppDORet) wxOVERRIDE;
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
private:
|
||||
wxWebView* m_browser;
|
||||
};
|
||||
|
||||
class wxFindPointers
|
||||
{
|
||||
public:
|
||||
wxFindPointers(wxIMarkupPointer *ptrBegin, wxIMarkupPointer *ptrEnd)
|
||||
{
|
||||
begin = ptrBegin;
|
||||
end = ptrEnd;
|
||||
}
|
||||
//The two markup pointers.
|
||||
wxIMarkupPointer *begin, *end;
|
||||
};
|
||||
|
||||
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE && defined(__WXMSW__)
|
||||
|
||||
#endif // wxWebViewIE_H
|
||||
|
||||
+67
-50
@@ -267,6 +267,7 @@ public:
|
||||
@section descriptions Backend Descriptions
|
||||
|
||||
@par wxWEBVIEW_BACKEND_IE (MSW)
|
||||
@anchor wxWEBVIEW_BACKEND_IE
|
||||
|
||||
The IE backend uses Microsoft's Trident rendering engine, specifically the
|
||||
version used by the locally installed copy of Internet Explorer. As such it
|
||||
@@ -514,56 +515,6 @@ public:
|
||||
*/
|
||||
virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
|
||||
|
||||
/**
|
||||
Sets emulation level.
|
||||
|
||||
This function is useful to change the emulation level of
|
||||
the system browser control used for wxWebView implementation under
|
||||
MSW, rather than using the currently default, IE7-compatible, level.
|
||||
|
||||
Please notice that this function works by modifying the per-user part
|
||||
of MSW registry, which has several implications: first, it is
|
||||
sufficient to call it only once (per user) as the changes done by it
|
||||
are persistent and, second, if you do not want them to be persistent,
|
||||
you need to call it with @c wxWEBVIEWIE_EMU_DEFAULT argument explicitly.
|
||||
|
||||
In particular, this function should be called to allow RunScript() to
|
||||
work for JavaScript code returning arbitrary objects, which is not
|
||||
supported at the default emulation level.
|
||||
|
||||
If set to a level higher than installed version, the highest available
|
||||
level will be used instead. @c wxWEBVIEWIE_EMU_IE11 is recommended for
|
||||
best performance and experience.
|
||||
|
||||
This function is MSW-specific and doesn't exist under other platforms.
|
||||
|
||||
See https://msdn.microsoft.com/en-us/library/ee330730#browser_emulation
|
||||
for more information about browser control emulation levels.
|
||||
|
||||
@param level the target emulation level
|
||||
@return @true on success, @false on failure (a warning message is also
|
||||
logged in the latter case).
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
static bool MSWSetEmulationLevel(wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11);
|
||||
|
||||
/**
|
||||
@deprecated
|
||||
This function is kept mostly for backwards compatibility.
|
||||
|
||||
Please explicitly specify emulation level with MSWSetEmulationLevel().
|
||||
|
||||
@param modernLevel @true to set level to IE8, synonym for @c wxWEBVIEWIE_EMU_IE8.
|
||||
@false to reset the emulation level to its default,
|
||||
synonym for @c wxWEBVIEWIE_EMU_DEFAULT.
|
||||
@return @true on success, @false on failure (a warning message is also
|
||||
logged in the latter case).
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
static bool MSWSetModernEmulationLevel(bool modernLevel = true);
|
||||
|
||||
/**
|
||||
Runs the given JavaScript code.
|
||||
|
||||
@@ -904,6 +855,72 @@ public:
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxWebViewIE
|
||||
|
||||
wxWebView using IE backend, see @ref wxWEBVIEW_BACKEND_IE.
|
||||
|
||||
@onlyfor{wxmsw}
|
||||
@since 2.9.3
|
||||
@library{wxwebview}
|
||||
@category{ctrl,webview}
|
||||
@see wxWebView
|
||||
*/
|
||||
class wxWebViewIE : public wxWebView
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Sets emulation level.
|
||||
|
||||
This function is useful to change the emulation level of
|
||||
the system browser control used for wxWebView implementation under
|
||||
MSW, rather than using the currently default, IE7-compatible, level.
|
||||
|
||||
Please notice that this function works by modifying the per-user part
|
||||
of MSW registry, which has several implications: first, it is
|
||||
sufficient to call it only once (per user) as the changes done by it
|
||||
are persistent and, second, if you do not want them to be persistent,
|
||||
you need to call it with @c wxWEBVIEWIE_EMU_DEFAULT argument explicitly.
|
||||
|
||||
In particular, this function should be called to allow RunScript() to
|
||||
work for JavaScript code returning arbitrary objects, which is not
|
||||
supported at the default emulation level.
|
||||
|
||||
If set to a level higher than installed version, the highest available
|
||||
level will be used instead. @c wxWEBVIEWIE_EMU_IE11 is recommended for
|
||||
best performance and experience.
|
||||
|
||||
This function is MSW-specific and doesn't exist under other platforms.
|
||||
|
||||
See https://msdn.microsoft.com/en-us/library/ee330730#browser_emulation
|
||||
for more information about browser control emulation levels.
|
||||
|
||||
@param level the target emulation level
|
||||
@return @true on success, @false on failure (a warning message is also
|
||||
logged in the latter case).
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
static bool MSWSetEmulationLevel(wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11);
|
||||
|
||||
/**
|
||||
@deprecated
|
||||
This function is kept mostly for backwards compatibility.
|
||||
|
||||
Please explicitly specify emulation level with MSWSetEmulationLevel().
|
||||
|
||||
@param modernLevel @true to set level to IE8, synonym for @c wxWEBVIEWIE_EMU_IE8.
|
||||
@false to reset the emulation level to its default,
|
||||
synonym for @c wxWEBVIEWIE_EMU_DEFAULT.
|
||||
@return @true on success, @false on failure (a warning message is also
|
||||
logged in the latter case).
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
static bool MSWSetModernEmulationLevel(bool modernLevel = true);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxWebViewEvent
|
||||
|
||||
+138
-110
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user