summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-14 14:51:26 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:43 +0300
commitb7fecf3139745b7dbbba0b9e38adf7d8d297484e (patch)
tree16174a5abc3e8ffe96b8ce801b872eea4314b70c
parente4e229e3a6d8f26cf8955b900db9de14c8d86e86 (diff)
Remove data variable from widget item.
Now, data is stored in Eo layer via eo_key_data_set/get. Two macros have been added to facilitate access.
-rw-r--r--src/lib/elc_fileselector.c2
-rw-r--r--src/lib/elc_hoversel.c4
-rw-r--r--src/lib/elc_multibuttonentry.c7
-rw-r--r--src/lib/elc_popup.c4
-rw-r--r--src/lib/elm_diskselector.c18
-rw-r--r--src/lib/elm_flipselector.c4
-rw-r--r--src/lib/elm_gengrid.c14
-rw-r--r--src/lib/elm_genlist.c14
-rw-r--r--src/lib/elm_index.c13
-rw-r--r--src/lib/elm_list.c4
-rw-r--r--src/lib/elm_menu.c8
-rw-r--r--src/lib/elm_object_item.h19
-rw-r--r--src/lib/elm_slideshow.c4
-rw-r--r--src/lib/elm_toolbar.c16
-rw-r--r--src/lib/elm_widget.c44
-rw-r--r--src/lib/elm_widget.h10
-rw-r--r--src/lib/elm_widget_item.eo21
17 files changed, 92 insertions, 114 deletions
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 689b361c8..2402c4ae7 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -1098,7 +1098,7 @@ _on_text_activated(void *data,
1098 Elm_Object_Item *item = elm_genlist_first_item_get(sd->files_view); 1098 Elm_Object_Item *item = elm_genlist_first_item_get(sd->files_view);
1099 while (item) 1099 while (item)
1100 { 1100 {
1101 const char *item_path = eo_do(item, elm_wdg_item_data_get()); 1101 const char *item_path = WIDGET_ITEM_DATA_GET(item);
1102 if (!strcmp(item_path, path)) 1102 if (!strcmp(item_path, path))
1103 { 1103 {
1104 elm_genlist_item_selected_set(item, EINA_TRUE); 1104 elm_genlist_item_selected_set(item, EINA_TRUE);
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 636e08e85..d436a4b83 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -111,7 +111,7 @@ _on_item_clicked(void *data,
111 Elm_Hoversel_Item_Data *item = data; 111 Elm_Hoversel_Item_Data *item = data;
112 Evas_Object *obj2 = WIDGET(item); 112 Evas_Object *obj2 = WIDGET(item);
113 113
114 if (item->func) item->func((void *)item->base->data, obj2, EO_OBJ(item)); 114 if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(item)), obj2, EO_OBJ(item));
115 evas_object_smart_callback_call(obj2, SIG_SELECTED, EO_OBJ(item)); 115 evas_object_smart_callback_call(obj2, SIG_SELECTED, EO_OBJ(item));
116 elm_hoversel_hover_end(obj2); 116 elm_hoversel_hover_end(obj2);
117} 117}
@@ -470,7 +470,7 @@ _elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *sd, const char *label, const
470 item->icon_file = eina_stringshare_add(icon_file); 470 item->icon_file = eina_stringshare_add(icon_file);
471 item->icon_type = icon_type; 471 item->icon_type = icon_type;
472 item->func = func; 472 item->func = func;
473 item->base->data = data; 473 WIDGET_ITEM_DATA_SET(EO_OBJ(item), data);
474 474
475 sd->items = eina_list_append(sd->items, eo_item); 475 sd->items = eina_list_append(sd->items, eo_item);
476 476
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 7e533fa47..82fe345de 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -703,8 +703,9 @@ _button_item_add(Elm_Multibuttonentry_Data *sd,
703 evas_object_show(btn); 703 evas_object_show(btn);
704 704
705 // append item list 705 // append item list
706 eo_item = eo_add(ELM_MULTIBUTTONENTRY_ITEM_CLASS, obj, elm_wdg_item_data_set(data)); 706 eo_item = eo_add(ELM_MULTIBUTTONENTRY_ITEM_CLASS, obj);
707 if (!eo_item) return NULL; 707 if (!eo_item) return NULL;
708 WIDGET_ITEM_DATA_SET(eo_item, data);
708 709
709 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item); 710 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
710 711
@@ -1832,14 +1833,14 @@ _elm_multibuttonentry_item_next_get(Eo *eo_it,
1832EINA_DEPRECATED EAPI void * 1833EINA_DEPRECATED EAPI void *
1833elm_multibuttonentry_item_data_get(const Elm_Object_Item *it) 1834elm_multibuttonentry_item_data_get(const Elm_Object_Item *it)
1834{ 1835{
1835 return eo_do(it, elm_wdg_item_data_get()); 1836 return (void *)WIDGET_ITEM_DATA_GET(it);
1836} 1837}
1837 1838
1838EINA_DEPRECATED EAPI void 1839EINA_DEPRECATED EAPI void
1839elm_multibuttonentry_item_data_set(Elm_Object_Item *it, 1840elm_multibuttonentry_item_data_set(Elm_Object_Item *it,
1840 void *data) 1841 void *data)
1841{ 1842{
1842 eo_do(it, elm_wdg_item_data_set(data)); 1843 WIDGET_ITEM_DATA_SET(it, data);
1843} 1844}
1844 1845
1845EOLIAN static void 1846EOLIAN static void
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index 5fd5e849e..62b36508c 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -630,7 +630,7 @@ _item_select_cb(void *data,
630 630
631 if (!it || it->disabled) return; 631 if (!it || it->disabled) return;
632 if (it->func) 632 if (it->func)
633 it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it)); 633 it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it));
634} 634}
635 635
636static void 636static void
@@ -1664,7 +1664,7 @@ _elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Obje
1664 _list_add(obj); 1664 _list_add(obj);
1665 1665
1666 it->func = func; 1666 it->func = func;
1667 it->base->data = data; 1667 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
1668 1668
1669 _item_new(it); 1669 _item_new(it);
1670 _item_icon_set(it, icon); 1670 _item_icon_set(it, icon);
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index 0ff4831c1..5e34b6248 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -92,7 +92,7 @@ _item_select(Elm_Diskselector_Item_Data *it)
92 sd->selected_item = it; 92 sd->selected_item = it;
93 _selected_item_indicate(sd->selected_item); 93 _selected_item_indicate(sd->selected_item);
94 94
95 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it)); 95 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it));
96 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, EO_OBJ(it)); 96 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, EO_OBJ(it));
97} 97}
98 98
@@ -590,7 +590,7 @@ _item_click_cb(void *data,
590 _selected_item_indicate(sd->selected_item); 590 _selected_item_indicate(sd->selected_item);
591 } 591 }
592 592
593 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it)); 593 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it));
594 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, EO_OBJ(it)); 594 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, EO_OBJ(it));
595} 595}
596 596
@@ -648,7 +648,7 @@ _item_new(Evas_Object *obj,
648 648
649 it->label = eina_stringshare_add(label); 649 it->label = eina_stringshare_add(label);
650 it->func = func; 650 it->func = func;
651 it->base->data = data; 651 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
652 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 652 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
653 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item", 653 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item",
654 elm_widget_style_get(obj)); 654 elm_widget_style_get(obj));
@@ -1174,7 +1174,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1174 { 1174 {
1175 sd->first = _item_new 1175 sd->first = _item_new
1176 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1176 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1177 it->base->data); 1177 WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1178 sd->first->node = it->node; 1178 sd->first->node = it->node;
1179 sd->r_items = eina_list_append(sd->r_items, sd->first); 1179 sd->r_items = eina_list_append(sd->r_items, sd->first);
1180 } 1180 }
@@ -1187,7 +1187,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1187 { 1187 {
1188 sd->second = _item_new 1188 sd->second = _item_new
1189 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1189 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1190 it->base->data); 1190 WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1191 sd->second->node = it->node; 1191 sd->second->node = it->node;
1192 sd->r_items = eina_list_append(sd->r_items, sd->second); 1192 sd->r_items = eina_list_append(sd->r_items, sd->second);
1193 } 1193 }
@@ -1200,7 +1200,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1200 if (!it) it = dit; 1200 if (!it) it = dit;
1201 temp_it = _item_new 1201 temp_it = _item_new
1202 (WIDGET(it), _icon_duplicate 1202 (WIDGET(it), _icon_duplicate
1203 (it->icon), it->label, it->func, it->base->data); 1203 (it->icon), it->label, it->func, WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1204 sd->over_items = eina_list_append(sd->over_items, temp_it); 1204 sd->over_items = eina_list_append(sd->over_items, temp_it);
1205 sd->r_items = eina_list_append(sd->r_items, temp_it); 1205 sd->r_items = eina_list_append(sd->r_items, temp_it);
1206 } 1206 }
@@ -1212,7 +1212,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1212 { 1212 {
1213 sd->last = _item_new 1213 sd->last = _item_new
1214 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1214 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1215 it->base->data); 1215 WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1216 sd->last->node = it->node; 1216 sd->last->node = it->node;
1217 sd->r_items = eina_list_prepend(sd->r_items, sd->last); 1217 sd->r_items = eina_list_prepend(sd->r_items, sd->last);
1218 } 1218 }
@@ -1224,7 +1224,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1224 { 1224 {
1225 sd->s_last = _item_new 1225 sd->s_last = _item_new
1226 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func, 1226 (WIDGET(it), _icon_duplicate(it->icon), it->label, it->func,
1227 it->base->data); 1227 WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1228 sd->s_last->node = it->node; 1228 sd->s_last->node = it->node;
1229 sd->r_items = eina_list_prepend(sd->r_items, sd->s_last); 1229 sd->r_items = eina_list_prepend(sd->r_items, sd->s_last);
1230 } 1230 }
@@ -1236,7 +1236,7 @@ _round_items_add(Elm_Diskselector_Data *sd)
1236 if (!it) it = dit; 1236 if (!it) it = dit;
1237 temp_it = _item_new 1237 temp_it = _item_new
1238 (WIDGET(it), _icon_duplicate 1238 (WIDGET(it), _icon_duplicate
1239 (it->icon), it->label, it->func, it->base->data); 1239 (it->icon), it->label, it->func, WIDGET_ITEM_DATA_GET(EO_OBJ(it)));
1240 sd->under_items = eina_list_append(sd->under_items, temp_it); 1240 sd->under_items = eina_list_append(sd->under_items, temp_it);
1241 sd->r_items = eina_list_prepend(sd->r_items, temp_it); 1241 sd->r_items = eina_list_prepend(sd->r_items, temp_it);
1242 } 1242 }
diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c
index 1bec1d26e..82c9d1247 100644
--- a/src/lib/elm_flipselector.c
+++ b/src/lib/elm_flipselector.c
@@ -280,7 +280,7 @@ _on_item_changed(Elm_Flipselector_Data *sd)
280 if (sd->deleting) return; 280 if (sd->deleting) return;
281 281
282 if (item->func) 282 if (item->func)
283 item->func((void *)item->base->data, WIDGET(item), eo_item); 283 item->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(item)), WIDGET(item), eo_item);
284 if (!item->deleted) 284 if (!item->deleted)
285 evas_object_smart_callback_call 285 evas_object_smart_callback_call
286 (sd->obj, SIG_SELECTED, eo_item); 286 (sd->obj, SIG_SELECTED, eo_item);
@@ -374,7 +374,7 @@ _item_new(Evas_Object *obj,
374 374
375 it->label = eina_stringshare_add_length(label, len); 375 it->label = eina_stringshare_add_length(label, len);
376 it->func = func; 376 it->func = func;
377 it->base->data = data; 377 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
378 378
379 /* TODO: no view here, but if one desires general contents in the 379 /* TODO: no view here, but if one desires general contents in the
380 * future... */ 380 * future... */
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 4215f3f9d..a49ab8c4e 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -148,7 +148,7 @@ _elm_gengrid_search_by_text_item_get(Eo *obj EINA_UNUSED,
148 EINA_INLIST_FOREACH(start, it) 148 EINA_INLIST_FOREACH(start, it)
149 { 149 {
150 if (!it->itc->func.text_get) continue; 150 if (!it->itc->func.text_get) continue;
151 str = it->itc->func.text_get((void *)it->base->data, 151 str = it->itc->func.text_get((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)),
152 WIDGET(it), part_name); 152 WIDGET(it), part_name);
153 if (!str) continue; 153 if (!str) continue;
154 if (!fnmatch(pattern, str, fnflags)) 154 if (!fnmatch(pattern, str, fnflags))
@@ -767,7 +767,7 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
767 EINA_LIST_FOREACH(it->texts, l, key) 767 EINA_LIST_FOREACH(it->texts, l, key)
768 { 768 {
769 char *s = it->itc->func.text_get 769 char *s = it->itc->func.text_get
770 ((void *)it->base->data, WIDGET(it), key); 770 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
771 return s; 771 return s;
772 } 772 }
773 } 773 }
@@ -871,7 +871,7 @@ _item_realize(Elm_Gen_Item *it)
871 EINA_LIST_FOREACH(it->texts, l, key) 871 EINA_LIST_FOREACH(it->texts, l, key)
872 { 872 {
873 char *s = it->itc->func.text_get 873 char *s = it->itc->func.text_get
874 ((void *)it->base->data, WIDGET(it), key); 874 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
875 if (s) 875 if (s)
876 { 876 {
877 edje_object_part_text_escaped_set(VIEW(it), key, s); 877 edje_object_part_text_escaped_set(VIEW(it), key, s);
@@ -890,7 +890,7 @@ _item_realize(Elm_Gen_Item *it)
890 (edje_object_data_get(VIEW(it), "contents")); 890 (edje_object_data_get(VIEW(it), "contents"));
891 EINA_LIST_FOREACH(it->contents, l, key) 891 EINA_LIST_FOREACH(it->contents, l, key)
892 { 892 {
893 ic = it->itc->func.content_get((void *)it->base->data, WIDGET(it), key); 893 ic = it->itc->func.content_get((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
894 if (ic) 894 if (ic)
895 { 895 {
896 it->content_objs = eina_list_append(it->content_objs, ic); 896 it->content_objs = eina_list_append(it->content_objs, ic);
@@ -911,7 +911,7 @@ _item_realize(Elm_Gen_Item *it)
911 EINA_LIST_FOREACH(it->states, l, key) 911 EINA_LIST_FOREACH(it->states, l, key)
912 { 912 {
913 Eina_Bool on = it->itc->func.state_get 913 Eina_Bool on = it->itc->func.state_get
914 ((void *)it->base->data, WIDGET(it), l->data); 914 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), l->data);
915 if (on) 915 if (on)
916 { 916 {
917 snprintf(buf, sizeof(buf), "elm,state,%s,active", key); 917 snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
@@ -3171,7 +3171,7 @@ _elm_gengrid_item_del_not_serious(Elm_Gen_Item *it)
3171 sd->last_focused_item = NULL; 3171 sd->last_focused_item = NULL;
3172 3172
3173 if (it->itc->func.del) 3173 if (it->itc->func.del)
3174 it->itc->func.del((void *)it->base->data, WIDGET(it)); 3174 it->itc->func.del((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it));
3175} 3175}
3176 3176
3177static void 3177static void
@@ -3517,7 +3517,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd,
3517 it->itc = itc; 3517 it->itc = itc;
3518 elm_gengrid_item_class_ref((Elm_Gengrid_Item_Class *)itc); 3518 elm_gengrid_item_class_ref((Elm_Gengrid_Item_Class *)itc);
3519 3519
3520 it->base->data = data; 3520 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
3521 it->parent = NULL; 3521 it->parent = NULL;
3522 it->func.func = func; 3522 it->func.func = func;
3523 it->func.data = func_data; 3523 it->func.data = func_data;
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 97f83b4bc..b4b6c0f18 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -286,7 +286,7 @@ _item_text_realize(Elm_Gen_Item *it,
286 continue; 286 continue;
287 287
288 char *s = it->itc->func.text_get 288 char *s = it->itc->func.text_get
289 ((void *)it->base->data, WIDGET(it), key); 289 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
290 290
291 if (s) 291 if (s)
292 { 292 {
@@ -327,7 +327,7 @@ _item_content_realize(Elm_Gen_Item *it,
327 327
328 if (it->itc->func.content_get) 328 if (it->itc->func.content_get)
329 ic = it->itc->func.content_get 329 ic = it->itc->func.content_get
330 ((void *)it->base->data, WIDGET(it), key); 330 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
331 if (ic) 331 if (ic)
332 { 332 {
333 res = eina_list_append(res, ic); 333 res = eina_list_append(res, ic);
@@ -364,7 +364,7 @@ _item_state_realize(Elm_Gen_Item *it,
364 continue; 364 continue;
365 365
366 Eina_Bool on = it->itc->func.state_get 366 Eina_Bool on = it->itc->func.state_get
367 ((void *)it->base->data, WIDGET(it), key); 367 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
368 368
369 if (on) 369 if (on)
370 { 370 {
@@ -1497,7 +1497,7 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
1497 EINA_LIST_FOREACH(it->texts, l, key) 1497 EINA_LIST_FOREACH(it->texts, l, key)
1498 { 1498 {
1499 char *s = it->itc->func.text_get 1499 char *s = it->itc->func.text_get
1500 ((void *)it->base->data, WIDGET(it), key); 1500 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
1501 1501
1502 if (s) 1502 if (s)
1503 { 1503 {
@@ -3386,7 +3386,7 @@ _elm_genlist_item_del_not_serious(Elm_Gen_Item *it)
3386 sd->last_selected_item = NULL; 3386 sd->last_selected_item = NULL;
3387 3387
3388 if (it->itc->func.del) 3388 if (it->itc->func.del)
3389 it->itc->func.del((void *)it->base->data, WIDGET(it)); 3389 it->itc->func.del((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it));
3390} 3390}
3391 3391
3392static void 3392static void
@@ -5807,7 +5807,7 @@ _elm_genlist_item_new(Elm_Genlist_Data *sd,
5807 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc); 5807 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
5808 5808
5809 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent); 5809 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
5810 it->base->data = data; 5810 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
5811 it->parent = parent; 5811 it->parent = parent;
5812 it->func.func = func; 5812 it->func.func = func;
5813 it->func.data = func_data; 5813 it->func.data = func_data;
@@ -7625,7 +7625,7 @@ _elm_genlist_search_by_text_item_get(Eo *obj EINA_UNUSED,
7625 EINA_INLIST_FOREACH(start, it) 7625 EINA_INLIST_FOREACH(start, it)
7626 { 7626 {
7627 if (!it->itc->func.text_get) continue; 7627 if (!it->itc->func.text_get) continue;
7628 str = it->itc->func.text_get((void *)it->base->data, WIDGET(it), part_name); 7628 str = it->itc->func.text_get((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), part_name);
7629 if (!str) continue; 7629 if (!str) continue;
7630 if (!fnmatch(pattern, str, fnflags)) 7630 if (!fnmatch(pattern, str, fnflags))
7631 { 7631 {
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index 3797b1670..b789d8246 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -461,7 +461,7 @@ _item_new(Evas_Object *obj,
461 461
462 if (letter) it->letter = eina_stringshare_add(letter); 462 if (letter) it->letter = eina_stringshare_add(letter);
463 it->func = func; 463 it->func = func;
464 it->base->data = data; 464 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
465 it->level = sd->level; 465 it->level = sd->level;
466 466
467 return eo_item; 467 return eo_item;
@@ -479,7 +479,7 @@ _item_find(Evas_Object *obj,
479 EINA_LIST_FOREACH(sd->items, l, eo_item) 479 EINA_LIST_FOREACH(sd->items, l, eo_item)
480 { 480 {
481 ELM_INDEX_ITEM_DATA_GET(eo_item, it); 481 ELM_INDEX_ITEM_DATA_GET(eo_item, it);
482 if (it->base->data == data) return it; 482 if (WIDGET_ITEM_DATA_GET(EO_OBJ(it)) == data) return it;
483 } 483 }
484 return NULL; 484 return NULL;
485} 485}
@@ -751,7 +751,7 @@ _on_mouse_up(void *data,
751 eo_id_item = eo_item; 751 eo_id_item = eo_item;
752 ELM_INDEX_ITEM_DATA_GET(eo_id_item, id_item); 752 ELM_INDEX_ITEM_DATA_GET(eo_id_item, id_item);
753 if (id_item->func) 753 if (id_item->func)
754 id_item->func((void *)id_item->base->data, WIDGET(id_item), eo_id_item); 754 id_item->func((void *)WIDGET_ITEM_DATA_GET(eo_id_item), WIDGET(id_item), eo_id_item);
755 } 755 }
756 if (!sd->autohide_disabled) 756 if (!sd->autohide_disabled)
757 elm_layout_signal_emit(data, "elm,state,inactive", "elm"); 757 elm_layout_signal_emit(data, "elm,state,inactive", "elm");
@@ -1337,10 +1337,9 @@ _elm_index_item_sorted_insert(Eo *obj, Elm_Index_Data *sd, const char *letter, E
1337 else 1337 else
1338 { 1338 {
1339 Elm_Object_Item *eo_p_it = eina_list_data_get(lnear); 1339 Elm_Object_Item *eo_p_it = eina_list_data_get(lnear);
1340 ELM_INDEX_ITEM_DATA_GET(eo_p_it, p_it); 1340 const void *item_data = WIDGET_ITEM_DATA_GET(eo_item);
1341 ELM_INDEX_ITEM_DATA_GET(eo_item, it); 1341 if (cmp_data_func(WIDGET_ITEM_DATA_GET(eo_p_it), item_data) >= 0)
1342 if (cmp_data_func(p_it->base->data, it->base->data) >= 0) 1342 WIDGET_ITEM_DATA_SET(eo_p_it, item_data);
1343 p_it->base->data = it->base->data;
1344 eo_do(eo_item, elm_wdg_item_del()); 1343 eo_do(eo_item, elm_wdg_item_del());
1345 eo_item = NULL; 1344 eo_item = NULL;
1346 } 1345 }
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index a56e40988..7d1bd9e07 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1402,7 +1402,7 @@ call:
1402 evas_object_ref(obj); 1402 evas_object_ref(obj);
1403 _elm_list_walk(sd); 1403 _elm_list_walk(sd);
1404 1404
1405 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it)); 1405 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it));
1406 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it)); 1406 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it));
1407 sd->last_selected_item = it; 1407 sd->last_selected_item = it;
1408 1408
@@ -2185,7 +2185,7 @@ _item_new(Evas_Object *obj,
2185 it->icon = icon; 2185 it->icon = icon;
2186 it->end = end; 2186 it->end = end;
2187 it->func = func; 2187 it->func = func;
2188 it->base->data = data; 2188 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
2189 2189
2190 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 2190 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
2191 2191
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index cabe5af49..2c6093e52 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -443,7 +443,7 @@ void
443_elm_dbus_menu_item_select_cb(Elm_Object_Item *obj_item) 443_elm_dbus_menu_item_select_cb(Elm_Object_Item *obj_item)
444{ 444{
445 ELM_MENU_ITEM_DATA_GET(obj_item, item); 445 ELM_MENU_ITEM_DATA_GET(obj_item, item);
446 if (item->func) item->func((void *)(item->base->data), WIDGET(item), obj_item); 446 if (item->func) item->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(item))), WIDGET(item), obj_item);
447} 447}
448 448
449static void 449static void
@@ -461,7 +461,7 @@ _menu_item_select_cb(void *data,
461 } 461 }
462 else _menu_hide(WIDGET(item), NULL, NULL); 462 else _menu_hide(WIDGET(item), NULL, NULL);
463 463
464 if (item->func) item->func((void *)(item->base->data), WIDGET(item), EO_OBJ(item)); 464 if (item->func) item->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(item))), WIDGET(item), EO_OBJ(item));
465} 465}
466 466
467static void 467static void
@@ -893,7 +893,7 @@ _item_clone(Evas_Object *obj,
893 item->icon_str, 893 item->icon_str,
894 item->label, 894 item->label,
895 item->func, 895 item->func,
896 item->base->data); 896 WIDGET_ITEM_DATA_GET(EO_OBJ(item)));
897 897
898 Eina_Bool disabled = eo_do(eo_item, elm_wdg_item_disabled_get()); 898 Eina_Bool disabled = eo_do(eo_item, elm_wdg_item_disabled_get());
899 eo_do(new_item, elm_wdg_item_disabled_set(disabled)); 899 eo_do(new_item, elm_wdg_item_disabled_set(disabled));
@@ -991,7 +991,7 @@ _elm_menu_item_add(Eo *obj, Elm_Menu_Data *sd, Elm_Object_Item *parent, const ch
991 991
992 ELM_MENU_ITEM_DATA_GET(eo_item, it); 992 ELM_MENU_ITEM_DATA_GET(eo_item, it);
993 993
994 it->base->data = data; 994 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
995 it->func = func; 995 it->func = func;
996 it->parent = eo_data_scope_get(parent, ELM_MENU_ITEM_CLASS); 996 it->parent = eo_data_scope_get(parent, ELM_MENU_ITEM_CLASS);
997 it->content = icon_obj; 997 it->content = icon_obj;
diff --git a/src/lib/elm_object_item.h b/src/lib/elm_object_item.h
index 10555388e..f4ed72d7d 100644
--- a/src/lib/elm_object_item.h
+++ b/src/lib/elm_object_item.h
@@ -56,3 +56,22 @@ typedef void (*Elm_Object_Item_Signal_Cb)(void *data, Elm_Objec
56 56
57#define elm_object_item_domain_text_translatable_set(it, domain, translatable) elm_object_item_domain_part_text_translatable_set((it), NULL, (domain), (translatable)) 57#define elm_object_item_domain_text_translatable_set(it, domain, translatable) elm_object_item_domain_part_text_translatable_set((it), NULL, (domain), (translatable))
58 58
59/**
60 * Get the data associated with an object item
61 * @param it The Elementary object item
62 * @return The data associated with @p it
63 *
64 * @note Every elm_object_item supports this API
65 * @ingroup General
66 */
67EAPI void *elm_object_item_data_get(const Elm_Object_Item *it);
68
69/**
70 * Set the data associated with an object item
71 * @param it The Elementary object item
72 * @param data The data to be associated with @p it
73 *
74 * @note Every elm_object_item supports this API
75 * @ingroup General
76 */
77EAPI void elm_object_item_data_set(Elm_Object_Item *it, void *data);
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index f1186d27d..4eaf7e918 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -417,7 +417,7 @@ _elm_slideshow_item_add(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Slideshow_Ite
417 417
418 item->itc = itc; 418 item->itc = itc;
419 item->l = eina_list_append(item->l, eo_item); 419 item->l = eina_list_append(item->l, eo_item);
420 eo_do(eo_item, elm_wdg_item_data_set(data)); 420 WIDGET_ITEM_DATA_SET(eo_item, data);
421 421
422 sd->items = eina_list_merge(sd->items, item->l); 422 sd->items = eina_list_merge(sd->items, item->l);
423 423
@@ -438,7 +438,7 @@ _elm_slideshow_item_sorted_insert(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Sli
438 438
439 item->itc = itc; 439 item->itc = itc;
440 item->l = eina_list_append(item->l, eo_item); 440 item->l = eina_list_append(item->l, eo_item);
441 eo_do(eo_item, elm_wdg_item_data_set(data)); 441 WIDGET_ITEM_DATA_SET(eo_item, data);
442 442
443 sd->items = eina_list_sorted_merge(sd->items, item->l, func); 443 sd->items = eina_list_sorted_merge(sd->items, item->l, func);
444 444
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index e86784b6b..f0b495247 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -213,7 +213,7 @@ _elm_toolbar_item_menu_cb(void *data,
213{ 213{
214 Elm_Toolbar_Item_Data *it = data; 214 Elm_Toolbar_Item_Data *it = data;
215 215
216 if (it->func) it->func((void *)(it->base->data), WIDGET(it), EO_OBJ(it)); 216 if (it->func) it->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(it))), WIDGET(it), EO_OBJ(it));
217} 217}
218 218
219static void 219static void
@@ -1110,7 +1110,7 @@ _item_select(Elm_Toolbar_Item_Data *it)
1110 1110
1111 if ((!sel) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS)) 1111 if ((!sel) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS))
1112 { 1112 {
1113 if (it->func) it->func((void *)(it->base->data), WIDGET(it), EO_OBJ(it)); 1113 if (it->func) it->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(it))), WIDGET(it), EO_OBJ(it));
1114 } 1114 }
1115 evas_object_smart_callback_call(obj, SIG_CLICKED, EO_OBJ(it)); 1115 evas_object_smart_callback_call(obj, SIG_CLICKED, EO_OBJ(it));
1116 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it)); 1116 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it));
@@ -2322,7 +2322,7 @@ _item_new(Evas_Object *obj,
2322 it->func = func; 2322 it->func = func;
2323 it->separator = EINA_FALSE; 2323 it->separator = EINA_FALSE;
2324 it->object = NULL; 2324 it->object = NULL;
2325 it->base->data = data; 2325 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
2326 2326
2327 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 2327 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
2328 evas_object_data_set(VIEW(it), "item", it); 2328 evas_object_data_set(VIEW(it), "item", it);
@@ -3490,7 +3490,7 @@ _elm_toolbar_item_menu_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3490} 3490}
3491 3491
3492EOLIAN static Elm_Toolbar_Item_State * 3492EOLIAN static Elm_Toolbar_Item_State *
3493_elm_toolbar_item_state_add(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, 3493_elm_toolbar_item_state_add(Eo *eo_item, Elm_Toolbar_Item_Data *item,
3494 const char *icon, 3494 const char *icon,
3495 const char *label, 3495 const char *label,
3496 Evas_Smart_Cb func, 3496 Evas_Smart_Cb func,
@@ -3509,7 +3509,7 @@ _elm_toolbar_item_state_add(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item
3509 { 3509 {
3510 it_state = _item_state_new 3510 it_state = _item_state_new
3511 (item->label, item->icon_str, item->icon, item->func, 3511 (item->label, item->icon_str, item->icon, item->func,
3512 item->base->data); 3512 WIDGET_ITEM_DATA_GET(EO_OBJ(item)));
3513 item->states = eina_list_append(item->states, it_state); 3513 item->states = eina_list_append(item->states, it_state);
3514 item->current_state = item->states; 3514 item->current_state = item->states;
3515 } 3515 }
@@ -3527,7 +3527,7 @@ _elm_toolbar_item_state_add(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item
3527 it_state = _item_state_new(label, icon, icon_obj, func, data); 3527 it_state = _item_state_new(label, icon, icon_obj, func, data);
3528 item->states = eina_list_append(item->states, it_state); 3528 item->states = eina_list_append(item->states, it_state);
3529 item->func = _elm_toolbar_item_state_cb; 3529 item->func = _elm_toolbar_item_state_cb;
3530 item->base->data = NULL; 3530 WIDGET_ITEM_DATA_SET(eo_item, NULL);
3531 3531
3532 return it_state; 3532 return it_state;
3533 3533
@@ -3543,7 +3543,7 @@ error_state_add:
3543} 3543}
3544 3544
3545EOLIAN static Eina_Bool 3545EOLIAN static Eina_Bool
3546_elm_toolbar_item_state_del(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, 3546_elm_toolbar_item_state_del(Eo *eo_item, Elm_Toolbar_Item_Data *item,
3547 Elm_Toolbar_Item_State *state) 3547 Elm_Toolbar_Item_State *state)
3548{ 3548{
3549 Elm_Toolbar_Item_State *it_state; 3549 Elm_Toolbar_Item_State *it_state;
@@ -3569,7 +3569,7 @@ _elm_toolbar_item_state_del(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item
3569 if (item->states && !eina_list_next(item->states)) 3569 if (item->states && !eina_list_next(item->states))
3570 { 3570 {
3571 it_state = eina_list_data_get(item->states); 3571 it_state = eina_list_data_get(item->states);
3572 item->base->data = it_state->data; 3572 WIDGET_ITEM_DATA_SET(eo_item, it_state->data);
3573 item->func = it_state->func; 3573 item->func = it_state->func;
3574 eina_stringshare_del(it_state->label); 3574 eina_stringshare_del(it_state->label);
3575 eina_stringshare_del(it_state->icon_str); 3575 eina_stringshare_del(it_state->icon_str);
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index cba645372..c7a7796a2 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -4296,47 +4296,17 @@ _elm_widget_item_widget_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
4296 return item->widget; 4296 return item->widget;
4297} 4297}
4298 4298
4299/**
4300 * @internal
4301 *
4302 * Set user-data in this item.
4303 *
4304 * User data may be used to identify this item or just store any
4305 * application data. It is automatically given as the first parameter
4306 * of the deletion notify callback.
4307 *
4308 * @param item a valid #Elm_Widget_Item to store data in.
4309 * @param data user data to store.
4310 * @see elm_widget_item_del_cb_set() convenience macro.
4311 * @ingroup Widget
4312 */
4313EOLIAN static void
4314_elm_widget_item_data_set(Eo *eo_item EINA_UNUSED,
4315 Elm_Widget_Item_Data *item,
4316 const void *data)
4317{
4318 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
4319 ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
4320 4299
4321 if ((item->data) && (item->data != data)) 4300EAPI void
4322 DBG("Replacing item %p data %p with %p", item, item->data, data); 4301elm_object_item_data_set(Elm_Object_Item *it, void *data)
4323 item->data = data; 4302{
4303 WIDGET_ITEM_DATA_SET(it, data);
4324} 4304}
4325 4305
4326/** 4306EAPI void *
4327 * @internal 4307elm_object_item_data_get(const Elm_Object_Item *it)
4328 *
4329 * Retrieves user-data of this item.
4330 *
4331 * @param item a valid #Elm_Widget_Item to get data from.
4332 * @see elm_widget_item_data_set()
4333 * @ingroup Widget
4334 */
4335EOLIAN static void *
4336_elm_widget_item_data_get(Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
4337{ 4308{
4338 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL); 4309 return (void *) WIDGET_ITEM_DATA_GET(it);
4339 return (void *)item->data;
4340} 4310}
4341 4311
4342EOLIAN static void 4312EOLIAN static void
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index d4aa5aca3..48561cec9 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -571,6 +571,16 @@ struct _Elm_Widget_Item_Signal_Data
571 void *data; 571 void *data;
572}; 572};
573 573
574#define WIDGET_ITEM_DATA_GET(eo_obj) \
575 ({ \
576 eo_do(eo_obj, eo_key_data_get("__elm_widget_item_data")); \
577 })
578
579#define WIDGET_ITEM_DATA_SET(eo_obj, data) \
580{ \
581 eo_do(eo_obj, eo_key_data_set("__elm_widget_item_data", data, NULL)); \
582}
583
574struct _Elm_Widget_Item_Data 584struct _Elm_Widget_Item_Data
575{ 585{
576/* ef1 ~~ efl, el3 ~~ elm */ 586/* ef1 ~~ efl, el3 ~~ elm */
diff --git a/src/lib/elm_widget_item.eo b/src/lib/elm_widget_item.eo
index 7d47fe866..1c6de725c 100644
--- a/src/lib/elm_widget_item.eo
+++ b/src/lib/elm_widget_item.eo
@@ -3,27 +3,6 @@ class Elm_Widget_Item(Eo.Base)
3 eo_prefix: elm_wdg_item; 3 eo_prefix: elm_wdg_item;
4 legacy_prefix: elm_object_item; 4 legacy_prefix: elm_object_item;
5 properties { 5 properties {
6 data {
7 get {
8 /**
9 Get the data associated with an object item
10
11 @note Every elm_object_item supports this API
12 @ingroup General
13 */
14 }
15 set {
16 /**
17 Set the data associated with an object item
18
19 @note Every elm_object_item supports this API
20 @ingroup General
21 */
22 }
23 values {
24 void *data @const_set; /*@ The data associated with the item */
25 }
26 }
27 tooltip_window_mode { 6 tooltip_window_mode {
28 get { 7 get {
29 /** 8 /**