summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2016-11-10 10:58:41 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-11-10 11:11:48 +0900
commite648f1e85e2d1be78bc2cb6a2b2aa87227bcfe89 (patch)
treeae2351dab937b907f0d7ad961213f239149b2b76
parent7917fa4ebfad0c02e9b054c3b6f0108fc8ec759f (diff)
[elementary][atspi] change accessible description to char* from const char*
Summary: The accessible name is char*, this could confuse API user. If we provide user callback to get description, an user would return allocated string. The usage of elm_interface_atspi_description_get/set should be same with elm_interface_atspi_name_get/set Reviewers: lukasz.stanislawski, cedric, raster Reviewed By: raster Subscribers: stanluk, jpeg Differential Revision: https://phab.enlightenment.org/D4378
-rw-r--r--src/lib/elementary/efl_ui_text.c6
-rw-r--r--src/lib/elementary/efl_ui_win.c6
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c6
-rw-r--r--src/lib/elementary/elm_atspi_app_object.c4
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c15
-rw-r--r--src/lib/elementary/elm_entry.c6
-rw-r--r--src/lib/elementary/elm_gengrid.c13
-rw-r--r--src/lib/elementary/elm_genlist.c13
-rw-r--r--src/lib/elementary/elm_index.c6
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.c18
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.eo2
-rw-r--r--src/lib/elementary/elm_list.c6
-rw-r--r--src/lib/elementary/elm_menu.c6
-rw-r--r--src/lib/elementary/elm_spinner.c6
-rw-r--r--src/lib/elementary/elm_toolbar.c6
-rw-r--r--src/lib/elementary/elm_widget.c16
-rw-r--r--src/lib/elementary/elm_widget.h2
-rw-r--r--src/tests/elementary/elm_test_atspi.c11
18 files changed, 74 insertions, 74 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 7e8fabb785..2cf59ab005 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -4808,14 +4808,14 @@ _efl_ui_text_elm_interface_atspi_accessible_state_set_get(Eo *obj, Efl_Ui_Text_D
4808 return ret; 4808 return ret;
4809} 4809}
4810 4810
4811EOLIAN static char* 4811EOLIAN static const char*
4812_efl_ui_text_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Text_Data *pd) 4812_efl_ui_text_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Text_Data *pd)
4813{ 4813{
4814 char *name; 4814 const char *name;
4815 name = elm_interface_atspi_accessible_name_get(efl_super(obj, EFL_UI_TEXT_CLASS)); 4815 name = elm_interface_atspi_accessible_name_get(efl_super(obj, EFL_UI_TEXT_CLASS));
4816 if (name && strncmp("", name, 1)) return name; 4816 if (name && strncmp("", name, 1)) return name;
4817 const char *ret = edje_object_part_text_get(pd->entry_edje, "elm.guide"); 4817 const char *ret = edje_object_part_text_get(pd->entry_edje, "elm.guide");
4818 return ret ? strdup(ret) : NULL; 4818 return ret;
4819} 4819}
4820 4820
4821EOLIAN static Efl_Canvas_Text_Cursor * 4821EOLIAN static Efl_Canvas_Text_Cursor *
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 2686e5c9d2..3ad9322c98 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6205,14 +6205,14 @@ _efl_ui_win_elm_interface_atspi_accessible_state_set_get(Eo *obj, Efl_Ui_Win_Dat
6205 return ret; 6205 return ret;
6206} 6206}
6207 6207
6208EOLIAN static char* 6208EOLIAN static const char*
6209_efl_ui_win_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED) 6209_efl_ui_win_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
6210{ 6210{
6211 char *ret; 6211 const char *ret;
6212 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, EFL_UI_WIN_CLASS)); 6212 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, EFL_UI_WIN_CLASS));
6213 if (ret) return ret; 6213 if (ret) return ret;
6214 const char *name = elm_win_title_get(obj); 6214 const char *name = elm_win_title_get(obj);
6215 return name ? strdup(name) : NULL; 6215 return name;
6216} 6216}
6217 6217
6218EOLIAN static Eina_Bool 6218EOLIAN static Eina_Bool
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index fb76690785..f9a10b3469 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -2047,15 +2047,15 @@ _elm_multibuttonentry_elm_interface_atspi_accessible_children_get(Eo *obj, Elm_M
2047 return eina_list_merge(eina_list_clone(sd->items), ret); 2047 return eina_list_merge(eina_list_clone(sd->items), ret);
2048} 2048}
2049 2049
2050EOLIAN static char* 2050EOLIAN static const char*
2051_elm_multibuttonentry_item_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Multibuttonentry_Item_Data *item) 2051_elm_multibuttonentry_item_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Multibuttonentry_Item_Data *item)
2052{ 2052{
2053 char *ret; 2053 const char *ret;
2054 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_MULTIBUTTONENTRY_ITEM_CLASS)); 2054 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_MULTIBUTTONENTRY_ITEM_CLASS));
2055 if (ret) return ret; 2055 if (ret) return ret;
2056 2056
2057 const char *txt = elm_object_part_text_get(VIEW(item), "elm.btn.text"); 2057 const char *txt = elm_object_part_text_get(VIEW(item), "elm.btn.text");
2058 return txt ? strdup(txt) : NULL; 2058 return txt;
2059} 2059}
2060 2060
2061static Eina_Bool 2061static Eina_Bool
diff --git a/src/lib/elementary/elm_atspi_app_object.c b/src/lib/elementary/elm_atspi_app_object.c
index bf44597157..2b905523fa 100644
--- a/src/lib/elementary/elm_atspi_app_object.c
+++ b/src/lib/elementary/elm_atspi_app_object.c
@@ -44,12 +44,12 @@ _elm_atspi_app_object_elm_interface_atspi_accessible_children_get(Eo *obj EINA_U
44 return accs; 44 return accs;
45} 45}
46 46
47EOLIAN static char* 47EOLIAN static const char*
48_elm_atspi_app_object_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED) 48_elm_atspi_app_object_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Atspi_App_Object_Data *_pd EINA_UNUSED)
49{ 49{
50 const char *ret; 50 const char *ret;
51 ret = elm_app_name_get(); 51 ret = elm_app_name_get();
52 return ret ? strdup(ret) : NULL; 52 return ret;
53} 53}
54 54
55EOLIAN static const char* 55EOLIAN static const char*
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index 880a338055..7d004cd23e 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -2075,12 +2075,10 @@ _accessible_property_get(const Eldbus_Service_Interface *interface, const char *
2075 2075
2076 if (!strcmp(property, "Name")) 2076 if (!strcmp(property, "Name"))
2077 { 2077 {
2078 char *ret2; 2078 ret = elm_interface_atspi_accessible_name_get(obj);
2079 ret2 = elm_interface_atspi_accessible_name_get(obj); 2079 if (!ret)
2080 if (!ret2) 2080 ret = "";
2081 ret2 = strdup(""); 2081 eldbus_message_iter_basic_append(iter, 's', ret);
2082 eldbus_message_iter_basic_append(iter, 's', ret2);
2083 free(ret2);
2084 return EINA_TRUE; 2082 return EINA_TRUE;
2085 } 2083 }
2086 else if (!strcmp(property, "Description")) 2084 else if (!strcmp(property, "Description"))
@@ -3191,13 +3189,12 @@ _cache_item_reference_append_cb(Eo *bridge, Eo *data, Eldbus_Message_Iter *iter_
3191 _iter_interfaces_append(iter_struct, data); 3189 _iter_interfaces_append(iter_struct, data);
3192 3190
3193 /* Marshall name */ 3191 /* Marshall name */
3194 char *name = NULL; 3192 const char *name = NULL;
3195 name = elm_interface_atspi_accessible_name_get(data); 3193 name = elm_interface_atspi_accessible_name_get(data);
3196 if (!name) 3194 if (!name)
3197 name = strdup(""); 3195 name = "";
3198 3196
3199 eldbus_message_iter_basic_append(iter_struct, 's', name); 3197 eldbus_message_iter_basic_append(iter_struct, 's', name);
3200 free(name);
3201 3198
3202 /* Marshall role */ 3199 /* Marshall role */
3203 eldbus_message_iter_basic_append(iter_struct, 'u', role); 3200 eldbus_message_iter_basic_append(iter_struct, 'u', role);
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 49fdac8eb5..0af5d8cbe3 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -5983,14 +5983,14 @@ _elm_entry_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Entry_Data
5983 return ret; 5983 return ret;
5984} 5984}
5985 5985
5986EOLIAN static char* 5986EOLIAN static const char*
5987_elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Entry_Data *sd) 5987_elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Entry_Data *sd)
5988{ 5988{
5989 char *name; 5989 const char *name;
5990 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_ENTRY_CLASS)); 5990 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_ENTRY_CLASS));
5991 if (name && strncmp("", name, 1)) return name; 5991 if (name && strncmp("", name, 1)) return name;
5992 const char *ret = edje_object_part_text_get(sd->entry_edje, "elm.guide"); 5992 const char *ret = edje_object_part_text_get(sd->entry_edje, "elm.guide");
5993 return ret ? strdup(ret) : NULL; 5993 return ret;
5994} 5994}
5995 5995
5996/* Efl.Part begin */ 5996/* Efl.Part begin */
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 768d6b2936..4329685320 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -5773,11 +5773,12 @@ _elm_gengrid_item_elm_interface_atspi_accessible_state_set_get(Eo *eo_it, Elm_Ge
5773 return ret; 5773 return ret;
5774} 5774}
5775 5775
5776EOLIAN char* 5776EOLIAN const char*
5777_elm_gengrid_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Item *it) 5777_elm_gengrid_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Item *it)
5778{ 5778{
5779 char *ret; 5779 const char *ret;
5780 Eina_Strbuf *buf; 5780 Eina_Strbuf *buf;
5781 char *accessible_name;
5781 5782
5782 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS)); 5783 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_GENGRID_ITEM_CLASS));
5783 if (ret) return ret; 5784 if (ret) return ret;
@@ -5811,9 +5812,13 @@ _elm_gengrid_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Ite
5811 } 5812 }
5812 } 5813 }
5813 5814
5814 ret = eina_strbuf_string_steal(buf); 5815 accessible_name = eina_strbuf_string_steal(buf);
5815 eina_strbuf_free(buf); 5816 eina_strbuf_free(buf);
5816 return ret; 5817
5818 eina_stringshare_del(it->base->accessible_name);
5819 it->base->accessible_name = eina_stringshare_add(accessible_name);
5820 free(accessible_name);
5821 return it->base->accessible_name;
5817} 5822}
5818 5823
5819EAPI Elm_Object_Item * 5824EAPI Elm_Object_Item *
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 856441e455..ba727ed10c 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -8221,11 +8221,12 @@ _elm_genlist_item_elm_interface_atspi_accessible_state_set_get(Eo *eo_it, Elm_Ge
8221 return ret; 8221 return ret;
8222} 8222}
8223 8223
8224EOLIAN char* 8224EOLIAN const char*
8225_elm_genlist_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Item *it) 8225_elm_genlist_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Item *it)
8226{ 8226{
8227 char *ret; 8227 const char *ret;
8228 Eina_Strbuf *buf; 8228 Eina_Strbuf *buf;
8229 char *accessible_name;
8229 8230
8230 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS)); 8231 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_GENLIST_ITEM_CLASS));
8231 if (ret) return ret; 8232 if (ret) return ret;
@@ -8257,9 +8258,13 @@ _elm_genlist_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Gen_Ite
8257 } 8258 }
8258 } 8259 }
8259 8260
8260 ret = eina_strbuf_string_steal(buf); 8261 accessible_name = eina_strbuf_string_steal(buf);
8261 eina_strbuf_free(buf); 8262 eina_strbuf_free(buf);
8262 return ret; 8263
8264 eina_stringshare_del(it->base->accessible_name);
8265 it->base->accessible_name = eina_stringshare_add(accessible_name);
8266 free(accessible_name);
8267 return it->base->accessible_name;
8263} 8268}
8264 8269
8265EOLIAN static void 8270EOLIAN static void
diff --git a/src/lib/elementary/elm_index.c b/src/lib/elementary/elm_index.c
index beb0563f14..428a5138ae 100644
--- a/src/lib/elementary/elm_index.c
+++ b/src/lib/elementary/elm_index.c
@@ -1741,14 +1741,14 @@ _elm_index_elm_interface_atspi_accessible_children_get(Eo *obj, Elm_Index_Data *
1741 return eina_list_merge(eina_list_clone(data->items), ret); 1741 return eina_list_merge(eina_list_clone(data->items), ret);
1742} 1742}
1743 1743
1744EOLIAN static char* 1744EOLIAN static const char*
1745_elm_index_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Index_Item_Data *data) 1745_elm_index_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Index_Item_Data *data)
1746{ 1746{
1747 char *name; 1747 const char *name;
1748 name = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_INDEX_ITEM_CLASS)); 1748 name = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_INDEX_ITEM_CLASS));
1749 if (name) return name; 1749 if (name) return name;
1750 1750
1751 return data->letter ? strdup(data->letter) : NULL; 1751 return data->letter;
1752} 1752}
1753 1753
1754EOLIAN static const Elm_Atspi_Action* 1754EOLIAN static const Elm_Atspi_Action*
diff --git a/src/lib/elementary/elm_interface_atspi_accessible.c b/src/lib/elementary/elm_interface_atspi_accessible.c
index 9f576aa7d7..22afbaabeb 100644
--- a/src/lib/elementary/elm_interface_atspi_accessible.c
+++ b/src/lib/elementary/elm_interface_atspi_accessible.c
@@ -224,26 +224,18 @@ _elm_interface_atspi_accessible_role_name_get(Eo *obj EINA_UNUSED, Elm_Interface
224 return role > ELM_ATSPI_ROLE_LAST_DEFINED ? "" : Atspi_Name[role]; 224 return role > ELM_ATSPI_ROLE_LAST_DEFINED ? "" : Atspi_Name[role];
225} 225}
226 226
227EOLIAN char * 227EOLIAN const char *
228_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd) 228_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
229{ 229{
230 if (pd->name)
231 {
232#ifdef ENABLE_NLS 230#ifdef ENABLE_NLS
233 if (pd->translation_domain) 231 if (pd->translation_domain)
234 return strdup(dgettext(pd->translation_domain, pd->name)); 232 return dgettext(pd->translation_domain, pd->name);
235 else
236 return strdup(pd->name);
237#else
238 return strdup(pd->name);
239#endif 233#endif
240 } 234 return pd->name;
241
242 return NULL;
243} 235}
244 236
245EOLIAN static void 237EOLIAN static void
246_elm_interface_atspi_accessible_name_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd, char *val) 238_elm_interface_atspi_accessible_name_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd, const char *val)
247{ 239{
248 eina_stringshare_replace(&pd->name, val); 240 eina_stringshare_replace(&pd->name, val);
249} 241}
diff --git a/src/lib/elementary/elm_interface_atspi_accessible.eo b/src/lib/elementary/elm_interface_atspi_accessible.eo
index 3a746e723f..15a0c5ad10 100644
--- a/src/lib/elementary/elm_interface_atspi_accessible.eo
+++ b/src/lib/elementary/elm_interface_atspi_accessible.eo
@@ -256,7 +256,7 @@ mixin Elm.Interface.Atspi_Accessible ()
256 set { 256 set {
257 } 257 }
258 values { 258 values {
259 name: ptr(char); [[Object name]] 259 name: string; [[Object name]]
260 } 260 }
261 } 261 }
262 @property relation_set @protected { 262 @property relation_set @protected {
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c
index 8f2ca840f8..710c5cb07e 100644
--- a/src/lib/elementary/elm_list.c
+++ b/src/lib/elementary/elm_list.c
@@ -2144,13 +2144,13 @@ _elm_list_item_elm_interface_atspi_accessible_state_set_get(Eo *eo_it, Elm_List_
2144 return ret; 2144 return ret;
2145} 2145}
2146 2146
2147EOLIAN static char* 2147EOLIAN static const char*
2148_elm_list_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_List_Item_Data *data) 2148_elm_list_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_List_Item_Data *data)
2149{ 2149{
2150 char *ret; 2150 const char *ret;
2151 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS)); 2151 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_it, ELM_LIST_ITEM_CLASS));
2152 if (ret) return ret; 2152 if (ret) return ret;
2153 return data->label ? strdup(data->label) : NULL; 2153 return data->label;
2154} 2154}
2155 2155
2156static char * 2156static char *
diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c
index a58600050e..5127ef09da 100644
--- a/src/lib/elementary/elm_menu.c
+++ b/src/lib/elementary/elm_menu.c
@@ -1304,13 +1304,13 @@ _elm_menu_item_elm_interface_atspi_accessible_role_get(Eo *obj EINA_UNUSED, Elm_
1304 return sd->submenu.items ? ELM_ATSPI_ROLE_MENU : ELM_ATSPI_ROLE_MENU_ITEM; 1304 return sd->submenu.items ? ELM_ATSPI_ROLE_MENU : ELM_ATSPI_ROLE_MENU_ITEM;
1305} 1305}
1306 1306
1307EOLIAN static char* 1307EOLIAN static const char*
1308_elm_menu_item_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Menu_Item_Data *sd) 1308_elm_menu_item_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Menu_Item_Data *sd)
1309{ 1309{
1310 char *ret; 1310 const char *ret;
1311 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_MENU_ITEM_CLASS)); 1311 ret = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_MENU_ITEM_CLASS));
1312 if (ret) return ret; 1312 if (ret) return ret;
1313 return sd->label ? strdup(sd->label) : NULL; 1313 return sd->label;
1314} 1314}
1315 1315
1316EOLIAN static Elm_Atspi_State_Set 1316EOLIAN static Elm_Atspi_State_Set
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index 9e7b0552d0..78b12e6cc0 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -1736,14 +1736,14 @@ _elm_spinner_elm_interface_atspi_value_increment_get(Eo *obj EINA_UNUSED, Elm_Sp
1736 return sd->step; 1736 return sd->step;
1737} 1737}
1738 1738
1739EOLIAN static char* 1739EOLIAN static const char*
1740_elm_spinner_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED) 1740_elm_spinner_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Spinner_Data *sd EINA_UNUSED)
1741{ 1741{
1742 char *name; 1742 const char *name;
1743 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_SPINNER_CLASS)); 1743 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_SPINNER_CLASS));
1744 if (name) return name; 1744 if (name) return name;
1745 const char *ret = elm_layout_text_get(obj, "elm.text"); 1745 const char *ret = elm_layout_text_get(obj, "elm.text");
1746 return ret ? strdup(ret) : NULL; 1746 return ret;
1747} 1747}
1748 1748
1749// A11Y Accessibility - END 1749// A11Y Accessibility - END
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index e9bbc9f02b..4f70b47eda 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -3966,13 +3966,13 @@ _elm_toolbar_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3966 (WIDGET(item), x, y, w, h); 3966 (WIDGET(item), x, y, w, h);
3967} 3967}
3968 3968
3969EOLIAN static char* 3969EOLIAN static const char*
3970_elm_toolbar_item_elm_interface_atspi_accessible_name_get(Eo *eo_item, Elm_Toolbar_Item_Data *item) 3970_elm_toolbar_item_elm_interface_atspi_accessible_name_get(Eo *eo_item, Elm_Toolbar_Item_Data *item)
3971{ 3971{
3972 char *ret; 3972 const char *ret;
3973 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS)); 3973 ret = elm_interface_atspi_accessible_name_get(efl_super(eo_item, ELM_TOOLBAR_ITEM_CLASS));
3974 if (ret) return ret; 3974 if (ret) return ret;
3975 return item->label ? strdup(item->label) : NULL; 3975 return item->label;
3976} 3976}
3977 3977
3978EOLIAN static Elm_Atspi_State_Set 3978EOLIAN static Elm_Atspi_State_Set
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 2c9f8ed367..f7f2def23f 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -482,6 +482,7 @@ _elm_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
482 _if_focused_revert(obj, EINA_TRUE); 482 _if_focused_revert(obj, EINA_TRUE);
483 elm_widget_focus_custom_chain_unset(obj); 483 elm_widget_focus_custom_chain_unset(obj);
484 eina_stringshare_del(sd->access_info); 484 eina_stringshare_del(sd->access_info);
485 eina_stringshare_del(sd->accessible_name);
485 evas_object_smart_data_set(obj, NULL); 486 evas_object_smart_data_set(obj, NULL);
486} 487}
487 488
@@ -4576,6 +4577,7 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
4576 evas_object_del(item->view); 4577 evas_object_del(item->view);
4577 4578
4578 eina_stringshare_del(item->access_info); 4579 eina_stringshare_del(item->access_info);
4580 eina_stringshare_del(item->accessible_name);
4579 4581
4580 while (item->signals) 4582 while (item->signals)
4581 _elm_widget_item_signal_callback_list_get(item, item->signals); 4583 _elm_widget_item_signal_callback_list_get(item, item->signals);
@@ -5939,11 +5941,11 @@ _elm_widget_elm_interface_atspi_component_focus_grab(Eo *obj, Elm_Widget_Smart_D
5939 return EINA_FALSE; 5941 return EINA_FALSE;
5940} 5942}
5941 5943
5942EOLIAN static char* 5944EOLIAN static const char*
5943_elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED) 5945_elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
5944{ 5946{
5945 const char *ret; 5947 const char *ret, *name;
5946 char *name; 5948 char *accessible_name;
5947 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_WIDGET_CLASS)); 5949 name = elm_interface_atspi_accessible_name_get(efl_super(obj, ELM_WIDGET_CLASS));
5948 5950
5949 if (name) return name; 5951 if (name) return name;
@@ -5951,7 +5953,11 @@ _elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Wid
5951 ret = elm_object_text_get(obj); 5953 ret = elm_object_text_get(obj);
5952 if (!ret) return NULL; 5954 if (!ret) return NULL;
5953 5955
5954 return _elm_util_mkup_to_text(ret); 5956 accessible_name = _elm_util_mkup_to_text(ret);
5957 eina_stringshare_del(_pd->accessible_name);
5958 _pd->accessible_name = eina_stringshare_add(accessible_name);
5959 free(accessible_name);
5960 return _pd->accessible_name;
5955} 5961}
5956 5962
5957EOLIAN static Eina_List* 5963EOLIAN static Eina_List*
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 28b35492d0..8115111345 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -410,6 +410,7 @@ typedef struct _Elm_Widget_Smart_Data
410 const char *style; 410 const char *style;
411 const char *focus_highlight_style; /**< custom focus style for a widget */ 411 const char *focus_highlight_style; /**< custom focus style for a widget */
412 const char *access_info; 412 const char *access_info;
413 const char *accessible_name;
413 unsigned int focus_order; 414 unsigned int focus_order;
414 Eina_Bool focus_order_on_calc; 415 Eina_Bool focus_order_on_calc;
415 416
@@ -603,6 +604,7 @@ struct _Elm_Widget_Item_Data
603 604
604 Evas_Object *access_obj; 605 Evas_Object *access_obj;
605 const char *access_info; 606 const char *access_info;
607 const char *accessible_name;
606 Eina_List *access_order; 608 Eina_List *access_order;
607 Eina_Inlist *translate_strings; 609 Eina_Inlist *translate_strings;
608 Eina_List *signals; 610 Eina_List *signals;
diff --git a/src/tests/elementary/elm_test_atspi.c b/src/tests/elementary/elm_test_atspi.c
index 630febc9c1..8f9e043870 100644
--- a/src/tests/elementary/elm_test_atspi.c
+++ b/src/tests/elementary/elm_test_atspi.c
@@ -51,7 +51,7 @@ START_TEST (elm_atspi_name_get)
51 elm_init(0, NULL); 51 elm_init(0, NULL);
52 generate_app(); 52 generate_app();
53 53
54 char *name; 54 const char *name;
55 55
56 name = elm_interface_atspi_accessible_name_get(g_btn); 56 name = elm_interface_atspi_accessible_name_get(g_btn);
57 57
@@ -59,8 +59,6 @@ START_TEST (elm_atspi_name_get)
59 ck_assert(0); 59 ck_assert(0);
60 } 60 }
61 61
62 free(name);
63
64 // Set name with additional text tags 62 // Set name with additional text tags
65 elm_object_text_set(g_btn, "Some<br>text"); 63 elm_object_text_set(g_btn, "Some<br>text");
66 64
@@ -70,7 +68,6 @@ START_TEST (elm_atspi_name_get)
70 ck_assert(name != NULL); 68 ck_assert(name != NULL);
71 ck_assert_str_eq(name, "Some\ntext"); 69 ck_assert_str_eq(name, "Some\ntext");
72 70
73 free(name);
74 elm_shutdown(); 71 elm_shutdown();
75} 72}
76END_TEST 73END_TEST
@@ -80,7 +77,7 @@ START_TEST (elm_atspi_name_set)
80 elm_init(0, NULL); 77 elm_init(0, NULL);
81 generate_app(); 78 generate_app();
82 79
83 char *name; 80 const char *name;
84 81
85 elm_object_text_set(g_btn, "Other text"); 82 elm_object_text_set(g_btn, "Other text");
86 elm_interface_atspi_accessible_name_set(g_btn, "Test name"); 83 elm_interface_atspi_accessible_name_set(g_btn, "Test name");
@@ -90,16 +87,12 @@ START_TEST (elm_atspi_name_set)
90 ck_assert(name != NULL); 87 ck_assert(name != NULL);
91 ck_assert_str_eq(name, "Test name"); 88 ck_assert_str_eq(name, "Test name");
92 89
93 free(name);
94
95 elm_interface_atspi_accessible_name_set(g_btn, NULL); 90 elm_interface_atspi_accessible_name_set(g_btn, NULL);
96 name = elm_interface_atspi_accessible_name_get(g_btn); 91 name = elm_interface_atspi_accessible_name_get(g_btn);
97 92
98 ck_assert(name != NULL); 93 ck_assert(name != NULL);
99 ck_assert_str_eq(name, "Other text"); 94 ck_assert_str_eq(name, "Other text");
100 95
101 free(name);
102
103 elm_shutdown(); 96 elm_shutdown();
104} 97}
105END_TEST 98END_TEST