if (item->atspi_custom_relations)
elm_atspi_relation_set_free(&item->atspi_custom_relations);
+ //TIZEN_ONLY(20150731) : add i18n support for name and description
+ if (item->atspi_translation_domain)
+ eina_stringshare_del(item->atspi_translation_domain);
+ ///
+
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
eo_do_super(eo_item, ELM_WIDGET_ITEM_CLASS, eo_destructor());
eina_stringshare_del(sd->name);
///
+ //TIZEN_ONLY(20150731) : add i18n support for name and description
+ if (sd->atspi_translation_domain)
+ eina_stringshare_del(sd->atspi_translation_domain);
+ ///
+
eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor());
sd->on_destroy = EINA_FALSE;
const char *ret;
//TIZEN_ONLY(20150717) add widget name setter
if (_pd->name)
- return strdup(_pd->name);
+ {
+#ifdef HAVE_GETTEXT
+ if (_pd->atspi_translation_domain)
+ return strdup(dgettext(_pd->atspi_translation_domain, _pd->name));
+ else
+ return strdup(_pd->name);
+#else
+ return strdup(_pd->name);
+#endif
+ }
///
ret = elm_object_text_get(obj);
_elm_widget_item_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd EINA_UNUSED)
{
if (_pd->name)
- return strdup(_pd->name);
+ {
+#ifdef HAVE_GETTEXT
+ if (_pd->atspi_translation_domain)
+ return strdup(dgettext(_pd->atspi_translation_domain, _pd->name));
+ else
+ return strdup(_pd->name);
+#else
+ return strdup(_pd->name);
+#endif
+ }
+ ///
return NULL;
}
///
-//TIZEN_ONLY(20160329): widget: sort accessible children spatially (d940068e1f7cc5cfc6208245a1fb0e92f1a813d4)
static int _sort_vertically(const void *data1, const void *data2)
{
Evas_Coord y1, y2;
}
///////////////////////////////////
+//TIZEN_ONLY(20150731) : add i18n support for name and description
+EOLIAN static void
+_elm_widget_elm_interface_atspi_accessible_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, const char *domain)
+{
+ eina_stringshare_replace(&_pd->atspi_translation_domain, domain);
+}
+
+EOLIAN static const char*
+_elm_widget_elm_interface_atspi_accessible_translation_domain_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
+{
+ return _pd->atspi_translation_domain;
+}
+
+EOLIAN static void
+_elm_widget_item_elm_interface_atspi_accessible_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd, const char *domain)
+{
+ eina_stringshare_replace(&_pd->atspi_translation_domain, domain);
+}
+
+EOLIAN static const char*
+_elm_widget_item_elm_interface_atspi_accessible_translation_domain_get(Eo *obj EINA_UNUSED, Elm_Widget_Item_Data *_pd)
+{
+ return _pd->atspi_translation_domain;
+}
+///
+
#include "elm_widget_item.eo.c"
#include "elm_widget.eo.c"
}
END_TEST
-<<<<<<< HEAD
/* Initial value of translation domain should be NULL */
START_TEST (elm_atspi_translation_domain_get)
{
elm_init(0, NULL);
generate_app();
-=======
-START_TEST (elm_atspi_elm_widget_custom_relations)
-{
->>>>>>> 876f95b... atspi: add new APIs for setting atspi relationship.
Elm_Atspi_Relation_Set set;
Elm_Atspi_Relation *rel, *rel_to, *rel_from;
Eina_List *l;
-<<<<<<< HEAD
eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_TO, g_bg));
eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_FROM, g_win));
eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
-=======
- elm_init(0, NULL);
- generate_app2();
-
- eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
- ck_assert(set == NULL);
-
- eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_TO, g_lbl));
- eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_FROM, g_win));
-
- eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
->>>>>>> 876f95b... atspi: add new APIs for setting atspi relationship.
ck_assert(set != NULL);
ck_assert(eina_list_count(set) >= 2);
rel_to = rel_from = NULL;
EINA_LIST_FOREACH(set, l, rel)
-<<<<<<< HEAD
{
if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO)
rel_to = rel;
eo_do(g_btn, elm_interface_atspi_accessible_relationship_remove(ELM_ATSPI_RELATION_FLOWS_TO, g_bg));
eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
-=======
- {
- if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO)
- rel_to = rel;
- if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM)
- rel_from = rel;
- }
-
- ck_assert(rel_to != NULL);
- ck_assert(rel_from != NULL);
- ck_assert(eina_list_data_find(rel_to->objects, g_lbl) != NULL);
- ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
-
- elm_atspi_relation_set_free(&set);
-
- eo_do(g_btn, elm_interface_atspi_accessible_relationship_remove(ELM_ATSPI_RELATION_FLOWS_TO, g_lbl));
- eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
->>>>>>> 876f95b... atspi: add new APIs for setting atspi relationship.
ck_assert(set != NULL);
ck_assert(eina_list_count(set) >= 1);
rel_to = rel_from = NULL;
EINA_LIST_FOREACH(set, l, rel)
-<<<<<<< HEAD
{
if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO)
rel_to = rel;
}
elm_atspi_relation_set_free(set);
-=======
+ elm_shutdown();
+}
+END_TEST
+
+START_TEST (elm_atspi_elm_widget_custom_relations)
+{
+ Elm_Atspi_Relation_Set set;
+ Elm_Atspi_Relation *rel, *rel_to, *rel_from;
+ Eina_List *l;
+
+ elm_init(0, NULL);
+ generate_app2();
+
+ eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
+ ck_assert(set == NULL);
+
+ eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_TO, g_lbl));
+ eo_do(g_btn, elm_interface_atspi_accessible_relationship_append(ELM_ATSPI_RELATION_FLOWS_FROM, g_win));
+
+ eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
+ ck_assert(set != NULL);
+ ck_assert(eina_list_count(set) >= 2);
+
+ rel_to = rel_from = NULL;
+ EINA_LIST_FOREACH(set, l, rel)
+ {
+ if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO)
+ rel_to = rel;
+ if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM)
+ rel_from = rel;
+ }
+
+ ck_assert(rel_to != NULL);
+ ck_assert(rel_from != NULL);
+ ck_assert(eina_list_data_find(rel_to->objects, g_lbl) != NULL);
+ ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL);
+
+ elm_atspi_relation_set_free(&set);
+
+ eo_do(g_btn, elm_interface_atspi_accessible_relationship_remove(ELM_ATSPI_RELATION_FLOWS_TO, g_lbl));
+ eo_do(g_btn, set = elm_interface_atspi_accessible_relation_set_get());
+ ck_assert(set != NULL);
+ ck_assert(eina_list_count(set) >= 1);
+
+ rel_to = rel_from = NULL;
+ EINA_LIST_FOREACH(set, l, rel)
{
if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO)
ck_assert(EINA_FALSE);
elm_atspi_relation_set_free(&set);
->>>>>>> 876f95b... atspi: add new APIs for setting atspi relationship.
elm_shutdown();
}
END_TEST
+//TIZEN_ONLY(20150731) : add i18n support for name and description
+START_TEST (elm_atspi_elm_widget_translation_domain)
+{
+ elm_init(0, NULL);
+ generate_app();
+ const char *domain;
+
+ // Initially domain shuld not be set
+ eo_do(g_btn, domain = elm_interface_atspi_accessible_translation_domain_get());
+ ck_assert(domain == NULL);
+
+ eo_do(g_btn, elm_interface_atspi_accessible_translation_domain_set("Test domain"));
+
+ eo_do(g_btn, domain = elm_interface_atspi_accessible_translation_domain_get());
+ ck_assert(domain != NULL);
+ ck_assert_str_eq(domain, "Test domain");
+
+ eo_do(g_btn, elm_interface_atspi_accessible_translation_domain_set(NULL));
+
+ eo_do(g_btn, domain = elm_interface_atspi_accessible_translation_domain_get());
+ ck_assert(domain == NULL);
+
+ elm_shutdown();
+}
+END_TEST
+///
+
void elm_test_atspi(TCase *tc)
{
tcase_add_test(tc, elm_atspi_app_obj_name_get);
tcase_add_test(tc, elm_atspi_description_get);
tcase_add_test(tc, elm_atspi_children_and_parent);
tcase_add_test(tc, elm_atspi_children_and_parent2);
-<<<<<<< HEAD
tcase_add_test(tc, elm_atspi_translation_domain_get);
tcase_add_test(tc, elm_atspi_translation_domain_set);
tcase_add_test(tc, elm_atspi_relationship_append);
tcase_add_test(tc, elm_atspi_relationship_remove);
tcase_add_test(tc, elm_atspi_relationships_clear);
-=======
tcase_add_test(tc, elm_atspi_elm_widget_custom_relations);
->>>>>>> 876f95b... atspi: add new APIs for setting atspi relationship.
+ //TIZEN_ONLY(20150731) : add i18n support for name and description
+ tcase_add_test(tc, elm_atspi_elm_widget_translation_domain);
+ ///
}