return true;
}
+wxWebViewIE::~wxWebViewIE()
+{
+ for(unsigned int i = 0; i < m_factories.size(); i++)
+ {
+ m_factories[i]->Release();
+ }
+}
void wxWebViewIE::LoadURL(const wxString& url)
{
wxWebViewZoom wxWebViewIE::GetZoom() const
{
- if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
- return GetIEOpticalZoom();
- else if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT)
- return GetIETextZoom();
- else
- wxFAIL;
+ switch( m_zoomType )
+ {
+ case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
+ return GetIEOpticalZoom();
+ case wxWEB_VIEW_ZOOM_TYPE_TEXT:
+ return GetIETextZoom();
+ default:
+ wxFAIL;
+ }
//Dummy return to stop compiler warnings
return wxWEB_VIEW_ZOOM_MEDIUM;
void wxWebViewIE::SetZoom(wxWebViewZoom zoom)
{
- if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
- SetIEOpticalZoom(zoom);
- else if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT)
- SetIETextZoom(zoom);
- else
- wxFAIL;
+ switch( m_zoomType )
+ {
+ case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
+ SetIEOpticalZoom(zoom);
+ break;
+ case wxWEB_VIEW_ZOOM_TYPE_TEXT:
+ SetIETextZoom(zoom);
+ break;
+ default:
+ wxFAIL;
+ }
}
void wxWebViewIE::SetIETextZoom(wxWebViewZoom level)
V_VT(&zoomVariant) = VT_I4;
V_I4(&zoomVariant) = level;
- HRESULT result = m_webBrowser->ExecWB(OLECMDID_ZOOM,
- OLECMDEXECOPT_DONTPROMPTUSER,
- &zoomVariant, NULL);
+#if wxDEBUG_LEVEL
+ HRESULT result =
+#endif
+ m_webBrowser->ExecWB(OLECMDID_ZOOM,
+ OLECMDEXECOPT_DONTPROMPTUSER,
+ &zoomVariant, NULL);
wxASSERT(result == S_OK);
}
VariantInit (&zoomVariant);
V_VT(&zoomVariant) = VT_I4;
- HRESULT result = m_webBrowser->ExecWB(OLECMDID_ZOOM,
- OLECMDEXECOPT_DONTPROMPTUSER,
- NULL, &zoomVariant);
+#if wxDEBUG_LEVEL
+ HRESULT result =
+#endif
+ m_webBrowser->ExecWB(OLECMDID_ZOOM,
+ OLECMDEXECOPT_DONTPROMPTUSER,
+ NULL, &zoomVariant);
wxASSERT(result == S_OK);
//We can safely cast here as we know that the range matches our enum
wxFAIL;
}
- HRESULT result = m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
- OLECMDEXECOPT_DODEFAULT,
- &zoomVariant,
- NULL);
+#if wxDEBUG_LEVEL
+ HRESULT result =
+#endif
+ m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
+ OLECMDEXECOPT_DODEFAULT,
+ &zoomVariant,
+ NULL);
wxASSERT(result == S_OK);
}
VariantInit (&zoomVariant);
V_VT(&zoomVariant) = VT_I4;
- HRESULT result = m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
- OLECMDEXECOPT_DODEFAULT, NULL,
- &zoomVariant);
+#if wxDEBUG_LEVEL
+ HRESULT result =
+#endif
+ m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
+ OLECMDEXECOPT_DODEFAULT, NULL,
+ &zoomVariant);
wxASSERT(result == S_OK);
const int zoom = V_I4(&zoomVariant);
{
// FIXME: the wxWidgets docs do not really document what the return
// parameter of PutProperty is
- const bool success = m_ie.PutProperty("Offline", (offline ?
- VARIANT_TRUE :
- VARIANT_FALSE));
+#if wxDEBUG_LEVEL
+ const bool success =
+#endif
+ m_ie.PutProperty("Offline", (offline ?
+ VARIANT_TRUE :
+ VARIANT_FALSE));
wxASSERT(success);
}
void wxWebViewIE::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
{
-#ifndef __MINGW32__
wxDynamicLibrary urlMon(wxT("urlmon.dll"));
if(urlMon.HasSymbol(wxT("CoInternetGetSession")))
{
{
wxFAIL_MSG("Could not register protocol");
}
+ m_factories.push_back(cf);
}
else
{
wxFAIL_MSG("urlmon does not contain CoInternetGetSession");
}
-#endif
}
bool wxWebViewIE::CanExecCommand(wxString command) const
evt.Skip();
}
-#ifndef __MINGW32__
-
VirtualProtocol::VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler)
{
m_refCount = 0;
}
-#endif // __MINGW32__
-
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_IE