Add wxWebView::IsBackendAvailable()
This allows to check if a specified backend has been registered before creation of a new instance
This commit is contained in:
@@ -151,6 +151,7 @@ public:
|
|||||||
|
|
||||||
static void RegisterFactory(const wxString& backend,
|
static void RegisterFactory(const wxString& backend,
|
||||||
wxSharedPtr<wxWebViewFactory> factory);
|
wxSharedPtr<wxWebViewFactory> factory);
|
||||||
|
static bool IsBackendAvailable(const wxString& backend);
|
||||||
|
|
||||||
// General methods
|
// General methods
|
||||||
virtual void EnableContextMenu(bool enable = true)
|
virtual void EnableContextMenu(bool enable = true)
|
||||||
|
@@ -427,6 +427,14 @@ public:
|
|||||||
static void RegisterFactory(const wxString& backend,
|
static void RegisterFactory(const wxString& backend,
|
||||||
wxSharedPtr<wxWebViewFactory> factory);
|
wxSharedPtr<wxWebViewFactory> factory);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allows to check if a specific backend is currently available
|
||||||
|
|
||||||
|
@since 3.1.4
|
||||||
|
*/
|
||||||
|
static bool IsBackendAvailable(const wxString& backend);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the title of the current web page, or its URL/path if title is not
|
Get the title of the current web page, or its URL/path if title is not
|
||||||
available.
|
available.
|
||||||
|
@@ -85,6 +85,13 @@ void wxWebView::RegisterFactory(const wxString& backend,
|
|||||||
m_factoryMap[backend] = factory;
|
m_factoryMap[backend] = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
bool wxWebView::IsBackendAvailable(const wxString& backend)
|
||||||
|
{
|
||||||
|
wxStringWebViewFactoryMap::iterator iter = FindFactory(backend);
|
||||||
|
return (iter != m_factoryMap.end());
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend)
|
wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user