Let named images through _accept_object_check_role 90/300590/1 accepted/tizen/unified/20231101.174514
authorArtur Świgoń <a.swigon@samsung.com>
Fri, 27 Oct 2023 11:27:06 +0000 (13:27 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Fri, 27 Oct 2023 11:27:06 +0000 (13:27 +0200)
Change-Id: I804042ecc1c44535ee780b56a9632ddcb40f1d4a

atk-adaptor/adaptors/accessible-adaptor.c

index a88f94e..f70058d 100644 (file)
@@ -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;
 }