Merge wxWebView JavaScript improvements branch

This is a squashed commit of the SOC2017_WEBVIEW_JS branch from
https://github.com/joseeloren/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/538
This commit is contained in:
Jose Lorenzo
2017-09-02 23:24:06 +01:00
committed by Vadim Zeitlin
parent 9f4f075034
commit af8f7f33c3
14 changed files with 757 additions and 49 deletions

View File

@@ -24,6 +24,7 @@
#include "wx/msw/webview_missing.h"
#include "wx/sharedptr.h"
#include "wx/vector.h"
#include "wx/msw/private.h"
struct IHTMLDocument2;
struct IHTMLElement;
@@ -35,6 +36,11 @@ class DocHostUIHandler;
class wxFindPointers;
class wxIInternetProtocol;
#define wxIE_EMULATION_LEVEL 8000
//Registry key where emulation level for programs are set
#define wxREGISTRY_IE_PATH wxT("SOFTWARE\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION")
class WXDLLIMPEXP_WEBVIEW wxWebViewIE : public wxWebView
{
public:
@@ -121,7 +127,7 @@ public:
virtual wxString GetSelectedSource() const wxOVERRIDE;
virtual void ClearSelection() wxOVERRIDE;
virtual void RunScript(const wxString& javascript) wxOVERRIDE;
virtual bool RunScript(const wxString& javascript, wxString* output = NULL) wxOVERRIDE;
//Virtual Filesystem Support
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) wxOVERRIDE;
@@ -143,6 +149,9 @@ public:
void onActiveXEvent(wxActiveXEvent& evt);
void onEraseBg(wxEraseEvent&) {}
//Establish EmulationLevel for RunScript IE
static bool MSWSetModernEmulationLevel(bool modernLevel = true);
wxDECLARE_EVENT_TABLE();
protected:
@@ -191,6 +200,9 @@ private:
//Toggles control features see INTERNETFEATURELIST for values.
bool EnableControlFeature(long flag, bool enable = true);
bool RunScriptInternal(wxVariant varJavascript,
wxAutomationObject* scriptAO, wxVariant* varResult);
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
};