From d50ebd947ce33ec026a566bdbce5c7ee01457c98 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Oct 2020 11:33:38 -0400 Subject: a11y: Add bounds change api Add a way for GTK to pass bounds change information to the AT context. --- gtk/gtkaccessible.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gtk/gtkaccessible.c') diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c index 582cdf08fd..bef2ced14e 100644 --- a/gtk/gtkaccessible.c +++ b/gtk/gtkaccessible.c @@ -699,6 +699,33 @@ gtk_accessible_get_platform_state (GtkAccessible *self, return GTK_ACCESSIBLE_GET_IFACE (self)->get_platform_state (self, state); } +/* + * gtk_accessible_bounds_changed: + * @self: a #GtkAccessible + * + * This function can be used to inform ATs that an + * accessibles bounds (ie its screen extents) have + * changed. + * + * Note that the bounds are not included in this API. + * AT backends should use widget API to obtain them. + */ +void +gtk_accessible_bounds_changed (GtkAccessible *self) +{ + GtkATContext *context; + + if (GTK_IS_WIDGET (self) && + gtk_widget_get_root (GTK_WIDGET (self)) == NULL) + return; + + context = gtk_accessible_get_at_context (self); + if (context == NULL) + return; + + gtk_at_context_bounds_changed (context); +} + /* * gtk_accessible_should_present: * @self: a #GtkAccessible -- cgit v1.2.1