More of the previous commit; now builds.

This commit is contained in:
Pietro Gagliardi 2015-02-12 23:47:32 -05:00
parent e63729d866
commit 65f8a31d5c
1 changed files with 44 additions and 20 deletions

View File

@ -6,7 +6,7 @@ struct tableAcc {
struct table *t; struct table *t;
IAccessible *std; IAccessible *std;
TODOTYPE role; LONG role;
intptr_t row; intptr_t row;
intptr_t column; intptr_t column;
}; };
@ -94,21 +94,22 @@ static HRESULT STDMETHODCALLTYPE tableAccget_accParent(IAccessible *this, IDispa
static HRESULT STDMETHODCALLTYPE tableAccget_accChildCount(IAccessible *this, long *pcountChildren) static HRESULT STDMETHODCALLTYPE tableAccget_accChildCount(IAccessible *this, long *pcountChildren)
{ {
// TODO if (pcountChildren == NULL)
return DISP_E_MEMBERNOTFOUND; // TODO really?
return E_POINTER;
// TODO check pcountChildren
switch (TA->role) { switch (TA->role) {
case ROLE_SYSTEM_TABLE: case ROLE_SYSTEM_TABLE:
// TODO +1? // TODO +1?
pcountChildren->xxxx = t->count; *pcountChildren = (long) (TA->t->count);
return xxxx; return S_OK;
case ROLE_SYSTEM_ROW: case ROLE_SYSTEM_ROW:
// TODO what to do about row 0 if +1? // TODO what to do about row 0 if +1?
pcountChildren->xxxx = t->nColumns; *pcountChildren = (long) (TA->t->nColumns);
return xxxx; return S_OK;
} }
// TODO // TODO really?
*pcountChildren = 0;
return S_OK;
} }
static HRESULT STDMETHODCALLTYPE tableAccget_accChild(IAccessible *this, VARIANT varChild, IDispatch **ppdispChild) static HRESULT STDMETHODCALLTYPE tableAccget_accChild(IAccessible *this, VARIANT varChild, IDispatch **ppdispChild)
@ -149,20 +150,43 @@ static HRESULT STDMETHODCALLTYPE tableAccget_accDescription(IAccessible *this, V
static HRESULT STDMETHODCALLTYPE tableAccget_accRole(IAccessible *this, VARIANT varChild, VARIANT *pvarRole) static HRESULT STDMETHODCALLTYPE tableAccget_accRole(IAccessible *this, VARIANT varChild, VARIANT *pvarRole)
{ {
xxxxx cid; LONG cid;
// TODO if (pvarRole == NULL)
return DISP_E_MEMBERNOTFOUND; // TODO really?
return E_POINTER;
// TODO check pvarRole if (varChild.vt != VT_I4)
// TODO check varChild goto invalid;
cid = varChild.xxxx; cid = varChild.lVal;
if (cid == CHILDID_SELF) { if (cid == CHILDID_SELF) {
pvarRole->xxx = TA->role; pvarRole->vt = VT_I4;
return xxxx; pvarRole->lVal = TA->role;
return S_OK;
} }
cid--; cid--;
// TODO process cid if (cid < 0)
goto invalid;
switch (TA->role) {
case ROLE_SYSTEM_TABLE:
// TODO +1?
if (cid >= TA->t->count)
goto invalid;
pvarRole->vt = VT_I4;
pvarRole->lVal = ROLE_SYSTEM_ROW;
return S_OK;
case ROLE_SYSTEM_ROW:
// TODO what to do about row 0 if +1?
if (cid >= TA->t->nColumns)
goto invalid;
pvarRole->vt = VT_I4;
pvarRole->lVal = ROLE_SYSTEM_CELL;
return S_OK;
}
// TODO CELL?
// otherwise, fall through
invalid:
pvarRole->vt = VT_EMPTY;
return E_INVALIDARG;
} }
static HRESULT STDMETHODCALLTYPE tableAccget_accState(IAccessible *this, VARIANT varChild, VARIANT *pvarState) static HRESULT STDMETHODCALLTYPE tableAccget_accState(IAccessible *this, VARIANT varChild, VARIANT *pvarState)