elm_widget_sub_object_add(WIDGET(it), content);
if (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get()))
elm_widget_disabled_set(content, EINA_TRUE);
+
+ if (_elm_config->atspi_mode && eo_isa(content, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN))
+ eo_do(content, elm_interface_atspi_accessible_parent_set(EO_OBJ(it)));
}
}
}
ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, obj);
+ if (_elm_config->atspi_mode)
+ {
+ elm_interface_atspi_accessible_added(EO_OBJ(it));
+ elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
+ }
+
return EO_OBJ(it);
}
ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, obj);
+ if (_elm_config->atspi_mode)
+ {
+ elm_interface_atspi_accessible_added(EO_OBJ(it));
+ elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
+ }
+
return EO_OBJ(it);
}
snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
edje_object_signal_emit(target, buf, "elm");
+
+ if (_elm_config->atspi_mode)
+ eo_do(content, elm_interface_atspi_accessible_parent_set(EO_OBJ(it)));
}
}
}
obj);
}
+ if (_elm_config->atspi_mode)
+ {
+ if (it->end) eo_do(it->end, elm_interface_atspi_accessible_parent_set(eo_it));
+ if (it->icon) eo_do(it->icon, elm_interface_atspi_accessible_parent_set(eo_it));
+ elm_interface_atspi_accessible_added(eo_it);
+ }
+
return it;
}
_resizing_eval_item(it);
if ((!sd->items) && (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS))
_item_select(it);
+
+ if (_elm_config->atspi_mode)
+ {
+ eo_do(icon_obj, elm_interface_atspi_accessible_parent_set(eo_it));
+ eo_do(VIEW(it), elm_interface_atspi_accessible_parent_set(eo_it));
+ elm_interface_atspi_accessible_added(eo_it);
+ }
+
return it;
}
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#include <Elementary.h>
#include "elm_suite.h"
+#include "elm_test_helper.h"
START_TEST (elm_atspi_role_get)
}
END_TEST
+// Temporary commnted since gengrid fields_update function do not call content callbacks
+// (different behaviour then genlist - which calls)
+#if 0
+static Evas_Object *content;
+
+static Evas_Object *
+gl_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
+{
+ content = elm_button_add(obj);
+ evas_object_show(content);
+ return content;
+}
+
+/**
+ * Validate if gengrid implementation properly reset AT-SPI parent to Elm_Gengrid_Item
+ * from Elm_Gengrid
+ */
+START_TEST(elm_atspi_children_parent)
+{
+ elm_init(1, NULL);
+ elm_config_atspi_mode_set(EINA_TRUE);
+ static Elm_Gengrid_Item_Class itc;
+
+ Evas_Object *win = elm_win_add(NULL, "gengrid", ELM_WIN_BASIC);
+ evas_object_resize(win, 100, 100);
+ Evas_Object *gengrid = elm_gengrid_add(win);
+ evas_object_resize(gengrid, 100, 100);
+
+ Elm_Interface_Atspi_Accessible *parent;
+ content = NULL;
+
+ itc.item_style = "default";
+ itc.func.content_get = gl_content_get;
+
+ evas_object_show(win);
+ evas_object_show(gengrid);
+
+ Elm_Object_Item *it = elm_gengrid_item_append(gengrid, &itc, NULL, NULL, NULL);
+ elm_gengrid_item_fields_update(it, "*.", ELM_GENGRID_ITEM_FIELD_CONTENT);
+
+ ck_assert(content != NULL);
+ eo_do(content, parent = elm_interface_atspi_accessible_parent_get());
+ ck_assert(it == parent);
+
+ elm_shutdown();
+}
+END_TEST
+#endif
+
void elm_test_gengrid(TCase *tc)
{
- tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_atspi_role_get);
+#if 0
+ tcase_add_test(tc, elm_atspi_children_parent);
+#endif
}
static Eo *current;
static int counter;
static Elm_Atspi_Event_Children_Changed_Data ev_data;
+Evas_Object *content;
+
void test_init(void)
{
}
END_TEST
+static Evas_Object *
+gl_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
+{
+ content = elm_button_add(obj);
+ return content;
+}
+
+/**
+ * Validate if genlist implementation properly reset AT-SPI parent to Elm_Genlist_Item
+ * from Elm_Genlist
+ */
+START_TEST(elm_atspi_children_parent)
+{
+ test_init();
+
+ evas_object_show(genlist);
+
+ Elm_Object_Item *it;
+ Elm_Interface_Atspi_Accessible *parent;
+ content = NULL;
+
+ itc.item_style = "default";
+ itc.func.content_get = gl_content_get;
+
+ it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_gengrid_item_fields_update(it, "*.", ELM_GENGRID_ITEM_FIELD_CONTENT);
+
+ ck_assert(content != NULL);
+ eo_do(content, parent = elm_interface_atspi_accessible_parent_get());
+ ck_assert(it == parent);
+
+ elm_shutdown();
+}
+END_TEST
+
void elm_test_genlist(TCase *tc)
{
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_atspi_children_events_add);
tcase_add_test(tc, elm_atspi_children_events_del1);
tcase_add_test(tc, elm_atspi_children_events_del2);
+ tcase_add_test(tc, elm_atspi_children_parent);
}
}
END_TEST
+
+/**
+ * Validate if genlist implementation properly reset parent to Elm_Genlist_Item
+ * from Elm_Genlist
+ */
+START_TEST(elm_atspi_children_parent)
+{
+ Elm_Interface_Atspi_Accessible *parent;
+
+ elm_init(1, NULL);
+ Evas_Object *win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
+
+ Evas_Object *icon = elm_icon_add(win);
+ Evas_Object *end = elm_icon_add(win);
+
+ Evas_Object *list = elm_list_add(win);
+ Elm_Object_Item *it = elm_list_item_append(list, "First Element", icon, end, NULL, NULL);
+
+ evas_object_show(list);
+
+ eo_do(icon, parent = elm_interface_atspi_accessible_parent_get());
+ ck_assert(it == parent);
+
+ eo_do(end, parent = elm_interface_atspi_accessible_parent_get());
+ ck_assert(it == parent);
+
+ elm_shutdown();
+}
+END_TEST
+
void elm_test_list(TCase *tc)
{
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_list_atspi_selection_clear);
tcase_add_test(tc, elm_list_atspi_selection_child_deselect);
#endif
+ tcase_add_test(tc, elm_atspi_children_parent);
}