From d04ef61f197ab8f85ab9dd75089616be54197139 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Fri, 27 Oct 2023 13:27:06 +0200 Subject: [PATCH] Let named images through _accept_object_check_role Change-Id: I804042ecc1c44535ee780b56a9632ddcb40f1d4a --- atk-adaptor/adaptors/accessible-adaptor.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/atk-adaptor/adaptors/accessible-adaptor.c b/atk-adaptor/adaptors/accessible-adaptor.c index a88f94e..f70058d 100644 --- a/atk-adaptor/adaptors/accessible-adaptor.c +++ b/atk-adaptor/adaptors/accessible-adaptor.c @@ -60,6 +60,7 @@ typedef struct accessibility_navigation_pointer_table { unsigned char (*object_contains)(struct accessibility_navigation_pointer_table *t, void *ptr, int x, int y, unsigned char coordinates_are_screen_based); unsigned char (*object_is_proxy)(struct accessibility_navigation_pointer_table *t, void *ptr); void (*get_children)(struct accessibility_navigation_pointer_table *t, void *ptr, vector *v); + unsigned char (*object_has_name)(struct accessibility_navigation_pointer_table *t, void *ptr); } accessibility_navigation_pointer_table; static vector vector_init(void) @@ -114,12 +115,13 @@ static unsigned char _accept_object_check_role(accessibility_navigation_pointer_ AtspiRole role = CALL(object_get_role, obj); switch (role) { + case ATSPI_ROLE_IMAGE: + return CALL(object_has_name, obj); case ATSPI_ROLE_APPLICATION: case ATSPI_ROLE_FILLER: case ATSPI_ROLE_SCROLL_PANE: case ATSPI_ROLE_SPLIT_PANE: case ATSPI_ROLE_WINDOW: - case ATSPI_ROLE_IMAGE: case ATSPI_ROLE_LIST: case ATSPI_ROLE_ICON: case ATSPI_ROLE_TOOL_BAR: @@ -593,7 +595,16 @@ void _get_children_impl(accessibility_navigation_pointer_table *table, void *ptr vector_resize(v, index); } +unsigned char _object_has_name_impl(accessibility_navigation_pointer_table *table, void *ptr) +{ + MARK_AS_UNUSED(table); + AtkObject *obj = (AtkObject*)ptr; + g_return_val_if_fail (ATK_IS_OBJECT (ptr), 0); + + const gchar *name = atk_object_get_name(obj); + return (unsigned char)(name != NULL && name[0] != '\0'); +} @@ -611,6 +622,7 @@ accessibility_navigation_pointer_table construct_accessibility_navigation_pointe INIT(object_contains); INIT(object_is_proxy); INIT(get_children); + INIT(object_has_name); #undef INIT return table; } -- 2.7.4