aboutsummaryrefslogtreecommitdiffstats
path: root/surfaces/access.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-18 23:54:06 +0100
committereunhhu <[email protected]>2026-10-18 23:54:06 +0100
commita2ad1a7a9cd3e608f3fb4e5a694540a9cfef9c69 (patch)
treef40556ac45d36bb749ea64948f5e19659a882ee6 /surfaces/access.c
parentda79f1e2b8d49dabe2290f5d795f8809c8b15c0f (diff)
downloadvega-a2ad1a7a9cd3e608f3fb4e5a694540a9cfef9c69.tar.gz
vega-a2ad1a7a9cd3e608f3fb4e5a694540a9cfef9c69.zip
Size to the module what is the module's (Pure 027's 4f-3a): timers grow to its inputs, the focus marks to its views, the accessibility tree's children to their count; a table shows its first VEGA_COLUMNS (64) columns, Vega's own countHEADmaster
Diffstat (limited to 'surfaces/access.c')
-rw-r--r--surfaces/access.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/surfaces/access.c b/surfaces/access.c
index 24e3d00..a0255f3 100644
--- a/surfaces/access.c
+++ b/surfaces/access.c
@@ -162,13 +162,16 @@ static Object parent_of(const Object *o) {
}
static size_t index_in_parent(const VegaAccess *a, const Object *o) {
- Object parent = parent_of(o), kids[VEGA_PARTS + PURE_MODULE_INPUTS + 4];
+ Object parent = parent_of(o);
if (o->kind == ROW) return o->row;
if (o->kind == CELL) return o->column;
- size_t n = children(a, &parent, kids, sizeof(kids) / sizeof(*kids));
- for (size_t i = 0; i < n && i < sizeof(kids) / sizeof(*kids); ++i)
- if (kids[i].kind == o->kind && kids[i].part == o->part && kids[i].key == o->key) return i;
- return 0;
+ size_t n = children(a, &parent, NULL, 0), at = 0;
+ Object *kids = malloc((n + 1) * sizeof(*kids));
+ if (kids) n = children(a, &parent, kids, n);
+ for (size_t i = 0; kids && i < n; ++i)
+ if (kids[i].kind == o->kind && kids[i].part == o->part && kids[i].key == o->key) { at = i; break; }
+ free(kids);
+ return at;
}
static int role_of(const VegaAccess *a, const Object *o) {