From bad241bd931170282c5f4cff9c4aec0980a72530 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 17 Feb 2015 10:35:36 -0500 Subject: [PATCH] "Implemented" get_accName(). --- wintable/accessibility.h | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/wintable/accessibility.h b/wintable/accessibility.h index 81c4589..32a0fa2 100644 --- a/wintable/accessibility.h +++ b/wintable/accessibility.h @@ -273,19 +273,33 @@ static HRESULT STDMETHODCALLTYPE tableAccget_accChild(IAccessible *this, VARIANT static HRESULT STDMETHODCALLTYPE tableAccget_accName(IAccessible *this, VARIANT varChild, BSTR *pszName) { -printf("get_accName() t %p std %p\n", TA->t, TA->std); - if (TA->t == NULL || TA->std == NULL) { -printf("returning RPC_E_DISCONNECTED\n"); - // TODO set values on error + HRESULT hr; + tableAccWhat what; + + if (pszName == NULL) + return E_POINTER; + *pszName = NULL; + if (TA->t == NULL || TA->std == NULL) return RPC_E_DISCONNECTED; + what = TA->what; + hr = normalizeWhat(TA, varChild, &what); + if (hr != S_OK) + return hr; + switch (what.role) { + case ROLE_SYSTEM_TABLE: + // defer to standard accessible object + return IAccessible_get_accName(TA->std, varChild, pszName); + case ROLE_SYSTEM_ROW: + // TODO + return S_FALSE; + case ROLE_SYSTEM_CELL: + // TODO + return S_FALSE; } -printf("running main function\n"); -//TODO -if (pszName == NULL) -return E_POINTER; -*pszName = SysAllocString(L"accessible table"); -return S_OK; - return IAccessible_get_accName(TA->std, varChild, pszName); + // TODO actually do this right + // TODO un-GetLastError() this + panic("impossible blah blah blah TODO write this"); + return E_FAIL; } static HRESULT STDMETHODCALLTYPE tableAccget_accValue(IAccessible *this, VARIANT varChild, BSTR *pszValue)