From 6052b048467f392f4eb9fb5b268cae15e94691d5 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 28 Sep 2026 13:25:21 +0100 Subject: Speak AT-SPI2 on the accessibility bus from the display, over Vega's own D-Bus vega display --access joins the accessibility bus as AT-SPI2 objects for screen readers such as Orca, with no toolkit, ATK or libdbus: dbus.c speaks the D-Bus wire format (EXTERNAL authentication, headers, aligned bodies, calls, replies, signals). The tree follows what the say surface says: a heading, a label per field, a list box per list whose items know their place and which is selected and focused, tables, the entry, the keys as buttons; answers come from the app when asked, one object has the focus, and focus moves are said as events. Assistive technology can act too: Selection focuses a row, Action presses a key. The live loop now draws only when something changed, so a screen reader's questions no longer cost frames. The check walks the tree with gdbus on a private session bus with at-spi-bus-launcher, and follows the focus through keys, Selection, Action and the events. --- surfaces/vega.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'surfaces/vega.h') diff --git a/surfaces/vega.h b/surfaces/vega.h index cd6b1ee..9f30ee4 100644 --- a/surfaces/vega.h +++ b/surfaces/vega.h @@ -139,6 +139,28 @@ void vega_pixels(const VegaGrid *, VegaFace *, uint32_t *out, size_t stride); /* width x height of out in the background's colour. */ void vega_pixels_clear(uint32_t *out, size_t stride, unsigned width, unsigned height); +/* Accessibility on Linux desktops (access.c): the screen as AT-SPI2 objects + * on the accessibility bus, for screen readers. The surface that hosts it + * says whether the user is typing and what, presses keys for assistive + * technology, and hears when that changed the app. */ +typedef struct { + void *context; + bool (*typing)(void *); + const char *(*typed)(void *, size_t *length); + bool (*press)(void *, const char *key); + void (*changed)(void *); +} VegaAccessHost; +typedef struct VegaAccess VegaAccess; +/* Join the accessibility bus; NULL (with why) when there is none. */ +VegaAccess *vega_access_open(PureApp *, const VegaScreen *, const VegaAccessHost *, char *error, size_t error_size); +int vega_access_fd(const VegaAccess *); +/* Answer what assistive technology asked (the fd is readable); false when + * the bus is gone. */ +bool vega_access_read(VegaAccess *); +/* After the app changed: the focus that moved, as events. */ +void vega_access_changed(VegaAccess *); +void vega_access_close(VegaAccess *); + /* A display through KMS: the first connected connector (or, with writeback, * a writeback connector: the frames come back to memory, so no screen is * needed to check them), its preferred mode or width x height. */ -- cgit v1.2.3