Started the real accessibility implementation. Utility functions and role system for now.
This commit is contained in:
parent
3e654bf959
commit
1d4e5e81d5
|
@ -1,16 +1,52 @@
|
||||||
// 24 december 2014
|
// 24 december 2014
|
||||||
|
|
||||||
|
typedef struct tableAccWhat tableAccWhat;
|
||||||
|
|
||||||
|
struct tableAccWhat {
|
||||||
|
LONG role;
|
||||||
|
intptr_t row;
|
||||||
|
intptr_t col;
|
||||||
|
};
|
||||||
|
|
||||||
struct tableAcc {
|
struct tableAcc {
|
||||||
const IAccessibleVtbl *vtbl;
|
const IAccessibleVtbl *vtbl;
|
||||||
ULONG refcount;
|
ULONG refcount;
|
||||||
struct table *t;
|
struct table *t;
|
||||||
IAccessible *std;
|
IAccessible *std;
|
||||||
|
tableAccWhat what;
|
||||||
LONG role;
|
|
||||||
intptr_t row;
|
|
||||||
intptr_t column;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// common validation for accessibility functions that take varChild
|
||||||
|
// also normalizes what as if varChild == CHILDID_SELF
|
||||||
|
static HRESULT normalizeWhat(struct tableAcc *ta, VARIANT varChild, tableAccWhat *what)
|
||||||
|
{
|
||||||
|
LONG cid;
|
||||||
|
|
||||||
|
if (varChild.vt != VT_I4)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
cid = varChild.lVal;
|
||||||
|
if (cid == CHILDID_SELF)
|
||||||
|
return S_OK;
|
||||||
|
cid--;
|
||||||
|
if (cid < 0)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
switch (what->role) {
|
||||||
|
case ROLE_SYSTEM_TABLE:
|
||||||
|
// TODO +1?
|
||||||
|
if (cid >= ta->t->count)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
what->role = ROLE_SYSTEM_ROW;
|
||||||
|
what->row = (intptr_t) cid;
|
||||||
|
what->column = -1;
|
||||||
|
break;
|
||||||
|
case ROLE_SYSTEM_ROW:
|
||||||
|
case ROLE_SYSTEM_CELL:
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
#define TA ((struct tableAcc *) this)
|
#define TA ((struct tableAcc *) this)
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE tableAccQueryInterface(IAccessible *this, REFIID riid, void **ppvObject)
|
static HRESULT STDMETHODCALLTYPE tableAccQueryInterface(IAccessible *this, REFIID riid, void **ppvObject)
|
||||||
|
|
Loading…
Reference in New Issue