#include <oleauto.h>
#include <oleacc.h>
-#include <winable.h>
#include "wx/msw/ole/oleutils.h"
wxVariant m_variant; // List of further variants
int m_nCurrent; // Current enum position
- DECLARE_NO_COPY_CLASS(wxIEnumVARIANT)
+ wxDECLARE_NO_COPY_CLASS(wxIEnumVARIANT);
};
// ----------------------------------------------------------------------------
public:
wxIAccessible(wxAccessible *pAccessible);
+ // Called to indicate object should prepare to be deleted.
+ void Quiesce();
+
DECLARE_IUNKNOWN_METHODS;
// IAccessible
private:
wxAccessible *m_pAccessible; // pointer to C++ class we belong to
+ bool m_bQuiescing; // Object is to be deleted
- DECLARE_NO_COPY_CLASS(wxIAccessible)
+ wxDECLARE_NO_COPY_CLASS(wxIAccessible);
};
// ============================================================================
wxASSERT( pAccessible != NULL );
m_pAccessible = pAccessible;
+ m_bQuiescing = false;
+}
+
+// Called to indicate object should prepare to be deleted.
+
+void wxIAccessible::Quiesce()
+{
+ m_bQuiescing = true;
+ m_pAccessible = NULL;
}
// Retrieves the child element or child object at a given point on the screen.
STDMETHODIMP wxIAccessible::accHitTest(long xLeft, long yLeft, VARIANT* pVarID)
{
wxLogTrace(wxT("access"), wxT("accHitTest"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::accLocation ( long* pxLeft, long* pyTop, long* pcxWidth, long* pcyHeight, VARIANT varID)
{
wxLogTrace(wxT("access"), wxT("accLocation"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::accNavigate ( long navDir, VARIANT varStart, VARIANT* pVarEnd)
{
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
wxLogTrace(wxT("access"), wxString(wxT("accNavigate for ")) + m_pAccessible->GetWindow()->GetClassInfo()->GetClassName());
STDMETHODIMP wxIAccessible::get_accChild ( VARIANT varChildID, IDispatch** ppDispChild)
{
wxLogTrace(wxT("access"), wxT("get_accChild"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accChildCount ( long* pCountChildren)
{
wxLogTrace(wxT("access"), wxT("get_accChildCount"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accParent ( IDispatch** ppDispParent)
{
wxLogTrace(wxT("access"), wxT("get_accParent"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::accDoDefaultAction(VARIANT varID)
{
wxLogTrace(wxT("access"), wxT("accDoDefaultAction"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accDefaultAction ( VARIANT varID, BSTR* pszDefaultAction)
{
wxLogTrace(wxT("access"), wxT("get_accDefaultAction"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accDescription ( VARIANT varID, BSTR* pszDescription)
{
wxLogTrace(wxT("access"), wxT("get_accDescription"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accHelp ( VARIANT varID, BSTR* pszHelp)
{
wxLogTrace(wxT("access"), wxT("get_accHelp"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accHelpTopic ( BSTR* pszHelpFile, VARIANT varChild, long* pidTopic)
{
wxLogTrace(wxT("access"), wxT("get_accHelpTopic"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
wxLogTrace(wxT("access"), wxT("get_accKeyboardShortcut"));
*pszKeyboardShortcut = NULL;
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
wxLogTrace(wxT("access"), wxT("get_accName"));
*pszName = NULL;
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accRole ( VARIANT varID, VARIANT* pVarRole)
{
wxLogTrace(wxT("access"), wxT("get_accRole"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accState ( VARIANT varID, VARIANT* pVarState)
{
wxLogTrace(wxT("access"), wxT("get_accState"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accValue ( VARIANT varID, BSTR* pszValue)
{
wxLogTrace(wxT("access"), wxT("get_accValue"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::accSelect ( long flagsSelect, VARIANT varID )
{
wxLogTrace(wxT("access"), wxT("get_accSelect"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
STDMETHODIMP wxIAccessible::get_accFocus ( VARIANT* pVarID)
{
wxLogTrace(wxT("access"), wxT("get_accFocus"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
{
#if wxUSE_VARIANT
wxLogTrace(wxT("access"), wxT("get_accSelection"));
- wxASSERT (m_pAccessible != NULL);
+ wxASSERT( ( m_pAccessible != NULL ) || ( m_bQuiescing == true ) );
if (!m_pAccessible)
return E_FAIL;
wxAccessible::~wxAccessible()
{
+ m_pIAccessible->Quiesce();
m_pIAccessible->Release();
if (m_pIAccessibleStd)
((IAccessible*)m_pIAccessibleStd)->Release();
{
switch (wxrole)
{
+ case wxROLE_NONE:
+ return 0;
case wxROLE_SYSTEM_ALERT:
return ROLE_SYSTEM_ALERT;
case wxROLE_SYSTEM_ANIMATION: