]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/webview.cpp
Disable wxUSE_ENH_METAFILE for wxGTK builds.
[wxWidgets.git] / src / common / webview.cpp
index 81d042e94f4c7dd1803affca4ab596b27c68d497..4b2e7dc8ce36fe05d7771a1098d7964761f9121d 100644 (file)
@@ -44,12 +44,12 @@ extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendDefault[] = "wxWebVi
 wxIMPLEMENT_ABSTRACT_CLASS(wxWebView, wxControl);
 wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent, wxCommandEvent);
 
 wxIMPLEMENT_ABSTRACT_CLASS(wxWebView, wxControl);
 wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent, wxCommandEvent);
 
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_NAVIGATING, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_NAVIGATED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_LOADED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_ERROR, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_NEWWINDOW, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_WEBVIEW_TITLE_CHANGED, wxWebViewEvent );
 
 wxStringWebViewFactoryMap wxWebView::m_factoryMap;
 
 
 wxStringWebViewFactoryMap wxWebView::m_factoryMap;
 
@@ -89,9 +89,8 @@ void wxWebView::RegisterFactory(const wxString& backend,
 // static 
 wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend)
 {
 // static 
 wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend)
 {
-    // Initialise the map if needed
-    if(m_factoryMap.empty())
-        InitFactoryMap();
+    // Initialise the map, it checks internally for existing factories
+    InitFactoryMap();
 
     return m_factoryMap.find(backend);
 }
 
     return m_factoryMap.find(backend);
 }
@@ -100,10 +99,12 @@ wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backe
 void wxWebView::InitFactoryMap()
 {
 #ifdef __WXMSW__
 void wxWebView::InitFactoryMap()
 {
 #ifdef __WXMSW__
-    RegisterFactory(wxWebViewBackendIE, wxSharedPtr<wxWebViewFactory>
+    if(m_factoryMap.find(wxWebViewBackendIE) == m_factoryMap.end())
+        RegisterFactory(wxWebViewBackendIE, wxSharedPtr<wxWebViewFactory>
                                                    (new wxWebViewFactoryIE));
 #else
                                                    (new wxWebViewFactoryIE));
 #else
-    RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr<wxWebViewFactory>
+    if(m_factoryMap.find(wxWebViewBackendWebKit) == m_factoryMap.end())
+        RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr<wxWebViewFactory>
                                                        (new wxWebViewFactoryWebKit));
 #endif
 }
                                                        (new wxWebViewFactoryWebKit));
 #endif
 }