summaryrefslogtreecommitdiff
path: root/wintable/accessibility.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-02-14 10:39:26 -0500
committerPietro Gagliardi <[email protected]>2015-02-14 10:39:26 -0500
commit32b09d5cb74df1611daf544370db440a2a66e276 (patch)
tree1cb027a0df83e674a46d7c8e074318512c20bbd0 /wintable/accessibility.h
parent1d4e5e81d5841c02ee2e90a7f91b4042f95c5fd9 (diff)
More accessibility utility definitions.
Diffstat (limited to 'wintable/accessibility.h')
-rw-r--r--wintable/accessibility.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/wintable/accessibility.h b/wintable/accessibility.h
index e880efe..5e45256 100644
--- a/wintable/accessibility.h
+++ b/wintable/accessibility.h
@@ -5,7 +5,7 @@ typedef struct tableAccWhat tableAccWhat;
struct tableAccWhat {
LONG role;
intptr_t row;
- intptr_t col;
+ intptr_t column;
};
struct tableAcc {
@@ -16,6 +16,10 @@ struct tableAcc {
tableAccWhat what;
};
+// called after each allocation
+// TODO really be a forward declaration?
+static void initAcc(struct tableAcc *acc, struct table *t, 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)
@@ -245,25 +249,30 @@ static const IAccessibleVtbl tableAccVtbl = {
.put_accValue = tableAccput_accValue,
};
-static struct tableAcc *newTableAcc(struct table *t)
+static void initAcc(struct tableAcc *acc, struct table *t, LONG role, intptr_t row, intptr_t column)
{
- struct tableAcc *ta;
HRESULT hr;
IAccessible *std;
- ta = (struct tableAcc *) tableAlloc(sizeof (struct tableAcc), "error creating Table accessibility object");
- ta->vtbl = &tableAccVtbl;
- // TODO
- IAccessible_AddRef((IAccessible *) ta);
- ta->t = t;
+ acc->vtbl = &tableAccVtbl;
+ acc->refcount = 1;
+ acc->t = t;
hr = CreateStdAccessibleObject(t->hwnd, OBJID_CLIENT, &IID_IAccessible, (void *) (&std));
if (hr != S_OK)
// TODO panichresult
panic("error creating standard accessible object for Table");
- ta->std = std;
- ta->role = ROLE_SYSTEM_TABLE;
- ta->row = -1;
- ta->column = -1;
+ acc->std = std;
+ acc->what.role = role;
+ acc->what.row = row;
+ acc->what.column = column;
+}
+
+static struct tableAcc *newTableAcc(struct table *t)
+{
+ struct tableAcc *ta;
+
+ ta = (struct tableAcc *) tableAlloc(sizeof (struct tableAcc), "error creating Table accessibility object");
+ initAcc(ta, t, ROLE_SYSTEM_TABLE, -1, -1);
return ta;
}