Implement wxWebView::GetVersionInfo() for macOS

Return the operating system version as the WebKit
version used by WKWebView is bound to the OS.
(Also works for iOS)
This commit is contained in:
Tobias Taschner
2021-02-07 22:14:18 +01:00
parent 334872e726
commit 8a9db461ff
2 changed files with 12 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ public:
long style = 0, long style = 0,
const wxString& name = wxASCII_STR(wxWebViewNameStr)) const wxString& name = wxASCII_STR(wxWebViewNameStr))
{ return new wxWebViewWebKit(parent, id, url, pos, size, style, name); } { return new wxWebViewWebKit(parent, id, url, pos, size, style, name); }
virtual wxVersionInfo GetVersionInfo() wxOVERRIDE;
}; };
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT

View File

@@ -87,6 +87,17 @@ wxEND_EVENT_TABLE()
@end @end
#endif // macOS 10.13+ #endif // macOS 10.13+
//-----------------------------------------------------------------------------
// wxWebViewFactoryWebKit
//-----------------------------------------------------------------------------
wxVersionInfo wxWebViewFactoryWebKit::GetVersionInfo()
{
int verMaj, verMin, verMicro;
wxGetOsVersion(&verMaj, &verMin, &verMicro);
return wxVersionInfo("WKWebView", verMaj, verMin, verMicro);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------