summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-08-12 11:37:24 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commitbb92dcfd56bf160dc314fb3e3758705fa81a8be5 (patch)
tree9a8df76f361cda8e51f7576140823581cf4bc33b
parentda2848e67c773375c0fa8cca9a3ccf9d5666aaad (diff)
Porting to Eo: Elm List Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elm_list.c596
-rw-r--r--src/lib/elm_list_common.h122
-rw-r--r--src/lib/elm_list_item.eo170
-rw-r--r--src/lib/elm_widget_list.h28
5 files changed, 530 insertions, 397 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 72a1dac10..fcd12a689 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -871,7 +871,9 @@ BUILT_SOURCES = \
871 elm_genlist_item.eo.c \ 871 elm_genlist_item.eo.c \
872 elm_genlist_item.eo.h \ 872 elm_genlist_item.eo.h \
873 elm_gengrid_item.eo.c \ 873 elm_gengrid_item.eo.c \
874 elm_gengrid_item.eo.h 874 elm_gengrid_item.eo.h \
875 elm_list_item.eo.c \
876 elm_list_item.eo.h
875 877
876elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 878elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
877elementaryeolianfiles_DATA = \ 879elementaryeolianfiles_DATA = \
@@ -979,7 +981,8 @@ elementaryeolianfiles_DATA = \
979 elm_multibuttonentry_item.eo \ 981 elm_multibuttonentry_item.eo \
980 elm_naviframe_item.eo \ 982 elm_naviframe_item.eo \
981 elm_genlist_item.eo \ 983 elm_genlist_item.eo \
982 elm_gengrid_item.eo 984 elm_gengrid_item.eo \
985 elm_list_item.eo
983 986
984EXTRA_DIST += ${elementaryeolianfiles_DATA} 987EXTRA_DIST += ${elementaryeolianfiles_DATA}
985 988
@@ -1087,6 +1090,7 @@ nodist_includesunstable_HEADERS = \
1087 elm_naviframe_item.eo.h \ 1090 elm_naviframe_item.eo.h \
1088 elm_genlist_item.eo.h \ 1091 elm_genlist_item.eo.h \
1089 elm_gengrid_item.eo.h \ 1092 elm_gengrid_item.eo.h \
1093 elm_list_item.eo.h \
1090 elm_ctxpopup_item.eo.h \ 1094 elm_ctxpopup_item.eo.h \
1091 elm_slideshow_item.eo.h \ 1095 elm_slideshow_item.eo.h \
1092 elm_layout.eo.legacy.h \ 1096 elm_layout.eo.legacy.h \
@@ -1165,7 +1169,8 @@ nodist_includesunstable_HEADERS = \
1165 elm_multibuttonentry_item.eo.legacy.h \ 1169 elm_multibuttonentry_item.eo.legacy.h \
1166 elm_naviframe_item.eo.legacy.h \ 1170 elm_naviframe_item.eo.legacy.h \
1167 elm_genlist_item.eo.legacy.h \ 1171 elm_genlist_item.eo.legacy.h \
1168 elm_gengrid_item.eo.legacy.h 1172 elm_gengrid_item.eo.legacy.h \
1173 elm_list_item.eo.legacy.h
1169 1174
1170if HAVE_CXX11 1175if HAVE_CXX11
1171 1176
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 5b40333b0..aea1e79d2 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#define ELM_WIDGET_ITEM_PROTECTED
5#include <Elementary.h> 6#include <Elementary.h>
6 7
7#include "elm_priv.h" 8#include "elm_priv.h"
@@ -16,6 +17,8 @@
16#include "elm_interface_atspi_widget_action.h" 17#include "elm_interface_atspi_widget_action.h"
17#include "elm_interface_atspi_widget_action.eo.h" 18#include "elm_interface_atspi_widget_action.eo.h"
18 19
20#include "elm_list_item.eo.h"
21
19#define MY_CLASS ELM_LIST_CLASS 22#define MY_CLASS ELM_LIST_CLASS
20 23
21#define MY_CLASS_NAME "Elm_List" 24#define MY_CLASS_NAME "Elm_List"
@@ -79,7 +82,7 @@ static const Elm_Action key_actions[] = {
79}; 82};
80 83
81static Eina_Bool 84static Eina_Bool
82_is_no_select(Elm_List_Item *it) 85_is_no_select(Elm_List_Item_Data *it)
83{ 86{
84 ELM_LIST_DATA_GET_FROM_ITEM(it, sd); 87 ELM_LIST_DATA_GET_FROM_ITEM(it, sd);
85 88
@@ -90,15 +93,15 @@ _is_no_select(Elm_List_Item *it)
90} 93}
91 94
92static inline void 95static inline void
93_elm_list_item_free(Elm_List_Item *it) 96_elm_list_item_free(Elm_List_Item_Data *it)
94{ 97{
95 ELM_LIST_DATA_GET_FROM_ITEM(it, sd); 98 ELM_LIST_DATA_GET_FROM_ITEM(it, sd);
96 99
97 if (sd->focused_item == (Elm_Object_Item *)it) 100 if (sd->focused_item == it)
98 sd->focused_item = NULL; 101 sd->focused_item = NULL;
99 if (sd->last_focused_item == (Elm_Object_Item *)it) 102 if (sd->last_focused_item == it)
100 sd->last_focused_item = NULL; 103 sd->last_focused_item = NULL;
101 if (sd->last_selected_item == (Elm_Object_Item *)it) 104 if (sd->last_selected_item == it)
102 sd->last_selected_item = NULL; 105 sd->last_selected_item = NULL;
103 106
104 107
@@ -136,7 +139,7 @@ _item_multi_select_up(Elm_List_Data *sd)
136 if (!sd->selected) return EINA_FALSE; 139 if (!sd->selected) return EINA_FALSE;
137 if (!sd->multi) return EINA_FALSE; 140 if (!sd->multi) return EINA_FALSE;
138 141
139 prev = elm_list_item_prev(sd->last_selected_item); 142 prev = elm_list_item_prev(EO_OBJ(sd->last_selected_item));
140 while (prev) 143 while (prev)
141 { 144 {
142 if (!elm_object_item_disabled_get(prev)) break; 145 if (!elm_object_item_disabled_get(prev)) break;
@@ -146,8 +149,8 @@ _item_multi_select_up(Elm_List_Data *sd)
146 149
147 if (elm_list_item_selected_get(prev)) 150 if (elm_list_item_selected_get(prev))
148 { 151 {
149 elm_list_item_selected_set(sd->last_selected_item, EINA_FALSE); 152 elm_list_item_selected_set(EO_OBJ(sd->last_selected_item), EINA_FALSE);
150 sd->last_selected_item = prev; 153 sd->last_selected_item = eo_data_scope_get((Eo *)prev, ELM_LIST_ITEM_CLASS);
151 } 154 }
152 else 155 else
153 { 156 {
@@ -164,7 +167,7 @@ _item_multi_select_down(Elm_List_Data *sd)
164 if (!sd->selected) return EINA_FALSE; 167 if (!sd->selected) return EINA_FALSE;
165 if (!sd->multi) return EINA_FALSE; 168 if (!sd->multi) return EINA_FALSE;
166 169
167 next = elm_list_item_next(sd->last_selected_item); 170 next = elm_list_item_next(EO_OBJ(sd->last_selected_item));
168 while (next) 171 while (next)
169 { 172 {
170 if (!elm_object_item_disabled_get(next)) break; 173 if (!elm_object_item_disabled_get(next)) break;
@@ -174,8 +177,8 @@ _item_multi_select_down(Elm_List_Data *sd)
174 177
175 if (elm_list_item_selected_get(next)) 178 if (elm_list_item_selected_get(next))
176 { 179 {
177 elm_list_item_selected_set(sd->last_selected_item, EINA_FALSE); 180 elm_list_item_selected_set(EO_OBJ(sd->last_selected_item), EINA_FALSE);
178 sd->last_selected_item = next; 181 sd->last_selected_item = eo_data_scope_get((Eo *)next, ELM_LIST_ITEM_CLASS);
179 } 182 }
180 else 183 else
181 { 184 {
@@ -204,7 +207,7 @@ _item_single_select_up(Elm_List_Data *sd)
204 if (!sd->selected) 207 if (!sd->selected)
205 prev = eina_list_data_get(eina_list_last(sd->items)); 208 prev = eina_list_data_get(eina_list_last(sd->items));
206 else 209 else
207 prev = elm_list_item_prev(sd->last_selected_item); 210 prev = elm_list_item_prev(EO_OBJ(sd->last_selected_item));
208 211
209 while (prev) 212 while (prev)
210 { 213 {
@@ -229,7 +232,7 @@ _item_single_select_down(Elm_List_Data *sd)
229 if (!sd->selected) 232 if (!sd->selected)
230 next = eina_list_data_get(sd->items); 233 next = eina_list_data_get(sd->items);
231 else 234 else
232 next = elm_list_item_next(sd->last_selected_item); 235 next = elm_list_item_next(EO_OBJ(sd->last_selected_item));
233 236
234 while (next) 237 while (next)
235 { 238 {
@@ -247,7 +250,7 @@ _item_single_select_down(Elm_List_Data *sd)
247} 250}
248 251
249static Eina_Bool 252static Eina_Bool
250_elm_list_item_content_focus_set(Elm_List_Item *it, Elm_Focus_Direction dir, 253_elm_list_item_content_focus_set(Elm_List_Item_Data *it, Elm_Focus_Direction dir,
251 Eina_Bool h_mode) 254 Eina_Bool h_mode)
252{ 255{
253 if (!it) return EINA_FALSE; 256 if (!it) return EINA_FALSE;
@@ -305,13 +308,13 @@ _elm_list_item_content_focus_set(Elm_List_Item *it, Elm_Focus_Direction dir,
305 return EINA_TRUE; 308 return EINA_TRUE;
306} 309}
307 310
308static Elm_List_Item * 311static Elm_List_Item_Data *
309_next_item_get(Elm_List_Data *sd, Elm_List_Item *cur_it, Elm_Focus_Direction dir) 312_next_item_get(Elm_List_Data *sd, Elm_List_Item_Data *cur_it, Elm_Focus_Direction dir)
310{ 313{
311 Eina_List *list = NULL; 314 Eina_List *list = NULL;
312 Elm_List_Item *it = NULL; 315 Elm_List_Item_Data *it = NULL;
313 316
314 list = eina_list_data_find_list(sd->items, cur_it); 317 list = eina_list_data_find_list(sd->items, EO_OBJ(cur_it));
315 if (!list) return it; 318 if (!list) return it;
316 if ((!sd->h_mode && (dir == ELM_FOCUS_UP)) || 319 if ((!sd->h_mode && (dir == ELM_FOCUS_UP)) ||
317 ((sd->h_mode) && (dir == ELM_FOCUS_LEFT))) 320 ((sd->h_mode) && (dir == ELM_FOCUS_LEFT)))
@@ -327,20 +330,20 @@ static Eina_Bool
327_item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir) 330_item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir)
328{ 331{
329 ELM_LIST_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE); 332 ELM_LIST_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
330 Elm_List_Item *it = NULL; 333 Elm_List_Item_Data *it = NULL;
331 334
332 if (sd->focused_item) 335 if (sd->focused_item)
333 it = _next_item_get(sd, (Elm_List_Item *)sd->focused_item, dir); 336 it = _next_item_get(sd, sd->focused_item, dir);
334 337
335 while (it && 338 while (it &&
336 elm_object_item_disabled_get((Elm_Object_Item *)it)) 339 elm_object_item_disabled_get(EO_OBJ(it)))
337 { 340 {
338 it = _next_item_get(sd, it, dir); 341 it = _next_item_get(sd, it, dir);
339 } 342 }
340 343
341 if (it) 344 if (it)
342 { 345 {
343 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 346 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
344 return EINA_TRUE; 347 return EINA_TRUE;
345 } 348 }
346 349
@@ -350,7 +353,7 @@ _item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir)
350static Eina_Bool 353static Eina_Bool
351_elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool multi) 354_elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool multi)
352{ 355{
353 Elm_List_Item *it = NULL; 356 Elm_Object_Item *eo_it = NULL;
354 ELM_LIST_DATA_GET(obj, sd); 357 ELM_LIST_DATA_GET(obj, sd);
355 Eina_Bool ret = EINA_FALSE; 358 Eina_Bool ret = EINA_FALSE;
356 Evas_Coord v = 0; 359 Evas_Coord v = 0;
@@ -358,7 +361,8 @@ _elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir,
358 Eina_Bool focus_only = EINA_FALSE; 361 Eina_Bool focus_only = EINA_FALSE;
359 362
360 // check if the content can get the focus by direction key 363 // check if the content can get the focus by direction key
361 it = (Elm_List_Item *)elm_object_focused_item_get(obj); 364 eo_it = elm_object_focused_item_get(obj);
365 ELM_LIST_ITEM_DATA_GET(eo_it, it);
362 if (_elm_list_item_content_focus_set(it, dir, sd->h_mode)) 366 if (_elm_list_item_content_focus_set(it, dir, sd->h_mode))
363 return EINA_TRUE; 367 return EINA_TRUE;
364 368
@@ -435,14 +439,15 @@ _elm_list_elm_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction dir,
435 else 439 else
436 { 440 {
437 if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_UP)) 441 if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_UP))
438 it = (Elm_List_Item *)elm_list_last_item_get(obj); 442 eo_it = elm_list_last_item_get(obj);
439 else 443 else
440 it = (Elm_List_Item *)elm_list_first_item_get(obj); 444 eo_it = elm_list_first_item_get(obj);
445 it = eo_data_scope_get((Eo *)eo_it, ELM_LIST_ITEM_CLASS);
441 446
442 if (focus_only) 447 if (focus_only)
443 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 448 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
444 else 449 else
445 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 450 elm_list_item_selected_set(EO_OBJ(it), EINA_TRUE);
446 } 451 }
447 return EINA_TRUE; 452 return EINA_TRUE;
448 } 453 }
@@ -465,7 +470,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
465 Evas_Coord step_y = 0; 470 Evas_Coord step_y = 0;
466 Evas_Coord page_x = 0; 471 Evas_Coord page_x = 0;
467 Evas_Coord page_y = 0; 472 Evas_Coord page_y = 0;
468 Elm_List_Item *it = NULL; 473 Elm_Object_Item *it = NULL;
469 474
470 eo_do(obj, 475 eo_do(obj,
471 elm_interface_scrollable_content_pos_get(&x, &y), 476 elm_interface_scrollable_content_pos_get(&x, &y),
@@ -536,7 +541,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
536 it = eina_list_data_get(sd->items); 541 it = eina_list_data_get(sd->items);
537 if (it) 542 if (it)
538 { 543 {
539 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 544 elm_list_item_selected_set(it, EINA_TRUE);
540 return EINA_TRUE; 545 return EINA_TRUE;
541 } 546 }
542 else 547 else
@@ -547,7 +552,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
547 it = eina_list_data_get(eina_list_last(sd->items)); 552 it = eina_list_data_get(eina_list_last(sd->items));
548 if (it) 553 if (it)
549 { 554 {
550 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 555 elm_list_item_selected_set(it, EINA_TRUE);
551 return EINA_TRUE; 556 return EINA_TRUE;
552 } 557 }
553 else 558 else
@@ -596,15 +601,19 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
596static Eina_Bool _key_action_select(Evas_Object *obj, const char *params EINA_UNUSED) 601static Eina_Bool _key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
597{ 602{
598 ELM_LIST_DATA_GET(obj, sd); 603 ELM_LIST_DATA_GET(obj, sd);
599 Elm_List_Item *it = NULL; 604 Elm_Object_Item *eo_it = NULL;
600 605
601 if (!_elm_config->item_select_on_focus_disable && 606 if (!_elm_config->item_select_on_focus_disable &&
602 (!sd->multi) && (sd->selected)) 607 (!sd->multi) && (sd->selected))
603 it = (Elm_List_Item *)elm_list_selected_item_get(obj); 608 eo_it = elm_list_selected_item_get(obj);
604 else 609 else
605 it = (Elm_List_Item *)elm_object_focused_item_get(obj); 610 eo_it = elm_object_focused_item_get(obj);
606 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 611 elm_list_item_selected_set(eo_it, EINA_TRUE);
607 if (it) evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); 612 if (eo_it)
613 {
614 ELM_LIST_ITEM_DATA_GET(eo_it, it);
615 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, EO_OBJ(it));
616 }
608 617
609 return EINA_TRUE; 618 return EINA_TRUE;
610} 619}
@@ -637,11 +646,11 @@ _elm_list_elm_widget_event(Eo *obj, Elm_List_Data *sd, Evas_Object *src, Evas_Ca
637EOLIAN static Eina_Bool 646EOLIAN static Eina_Bool
638_elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd) 647_elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
639{ 648{
640 Elm_List_Item *it; 649 Elm_Object_Item *it;
641 Eina_List *l; 650 Eina_List *l;
642 651
643 EINA_LIST_FOREACH(sd->items, l, it) 652 EINA_LIST_FOREACH(sd->items, l, it)
644 elm_widget_item_translate(it); 653 eo_do((Eo *)it, elm_wdg_item_translate());
645 654
646 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 655 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
647 656
@@ -651,7 +660,7 @@ _elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
651static void 660static void
652_elm_list_deletions_process(Elm_List_Data *sd) 661_elm_list_deletions_process(Elm_List_Data *sd)
653{ 662{
654 Elm_List_Item *it; 663 Elm_List_Item_Data *it;
655 664
656 sd->walking++; // avoid nested deletion and also _sub_del() items_fix 665 sd->walking++; // avoid nested deletion and also _sub_del() items_fix
657 666
@@ -661,7 +670,7 @@ _elm_list_deletions_process(Elm_List_Data *sd)
661 670
662 /* issuing free because of "locking" item del pre hook */ 671 /* issuing free because of "locking" item del pre hook */
663 _elm_list_item_free(it); 672 _elm_list_item_free(it);
664 elm_widget_item_free(it); 673 eo_del((Eo *)EO_OBJ(it));
665 } 674 }
666 675
667 sd->walking--; 676 sd->walking--;
@@ -805,7 +814,7 @@ _items_fix(Evas_Object *obj)
805{ 814{
806 Evas_Coord minw[2] = { 0, 0 }, minh[2] = { 0, 0 }; 815 Evas_Coord minw[2] = { 0, 0 }, minh[2] = { 0, 0 };
807 const Eina_List *l; 816 const Eina_List *l;
808 Elm_List_Item *it; 817 Elm_Object_Item *eo_it;
809 Evas_Coord mw, mh; 818 Evas_Coord mw, mh;
810 int i, redo = 0; 819 int i, redo = 0;
811 820
@@ -832,8 +841,9 @@ _items_fix(Evas_Object *obj)
832 evas_object_ref(obj); 841 evas_object_ref(obj);
833 _elm_list_walk(sd); // watch out "return" before unwalk! 842 _elm_list_walk(sd); // watch out "return" before unwalk!
834 843
835 EINA_LIST_FOREACH(sd->items, l, it) 844 EINA_LIST_FOREACH(sd->items, l, eo_it)
836 { 845 {
846 ELM_LIST_ITEM_DATA_GET(eo_it, it);
837 if (it->deleted) continue; 847 if (it->deleted) continue;
838 if (it->icon) 848 if (it->icon)
839 { 849 {
@@ -860,8 +870,9 @@ _items_fix(Evas_Object *obj)
860 } 870 }
861 871
862 i = 0; 872 i = 0;
863 EINA_LIST_FOREACH(sd->items, l, it) 873 EINA_LIST_FOREACH(sd->items, l, eo_it)
864 { 874 {
875 ELM_LIST_ITEM_DATA_GET(eo_it, it);
865 if (it->deleted) 876 if (it->deleted)
866 continue; 877 continue;
867 878
@@ -905,7 +916,7 @@ _items_fix(Evas_Object *obj)
905 { 916 {
906 edje_object_part_text_escaped_set 917 edje_object_part_text_escaped_set
907 (VIEW(it), "elm.text", it->label); 918 (VIEW(it), "elm.text", it->label);
908 elm_widget_item_part_text_custom_update(it); 919 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_part_text_custom_update());
909 920
910 if ((!it->icon) && (minh[0] > 0)) 921 if ((!it->icon) && (minh[0] > 0))
911 { 922 {
@@ -999,7 +1010,7 @@ _items_fix(Evas_Object *obj)
999 if ((select_raise) && (!strcmp(select_raise, "on"))) 1010 if ((select_raise) && (!strcmp(select_raise, "on")))
1000 evas_object_raise(VIEW(it)); 1011 evas_object_raise(VIEW(it));
1001 } 1012 }
1002 if (it->base.disabled) 1013 if (it->base->disabled)
1003 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); 1014 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
1004 1015
1005 it->fixed = EINA_TRUE; 1016 it->fixed = EINA_TRUE;
@@ -1073,21 +1084,24 @@ static void
1073_mirrored_set(Evas_Object *obj, 1084_mirrored_set(Evas_Object *obj,
1074 Eina_Bool rtl) 1085 Eina_Bool rtl)
1075{ 1086{
1076 Elm_List_Item *it; 1087 Elm_Object_Item *eo_it;
1077 Eina_List *n; 1088 Eina_List *n;
1078 1089
1079 ELM_LIST_DATA_GET(obj, sd); 1090 ELM_LIST_DATA_GET(obj, sd);
1080 1091
1081 eo_do(obj, elm_interface_scrollable_mirrored_set(rtl)); 1092 eo_do(obj, elm_interface_scrollable_mirrored_set(rtl));
1082 1093
1083 EINA_LIST_FOREACH(sd->items, n, it) 1094 EINA_LIST_FOREACH(sd->items, n, eo_it)
1084 edje_object_mirrored_set(VIEW(it), rtl); 1095 {
1096 ELM_LIST_ITEM_DATA_GET(eo_it, it);
1097 edje_object_mirrored_set(VIEW(it), rtl);
1098 }
1085} 1099}
1086 1100
1087EOLIAN static Eina_Bool 1101EOLIAN static Eina_Bool
1088_elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd) 1102_elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
1089{ 1103{
1090 Elm_List_Item *it; 1104 Elm_Object_Item *eo_it;
1091 Eina_List *n; 1105 Eina_List *n;
1092 1106
1093 Eina_Bool int_ret = EINA_FALSE; 1107 Eina_Bool int_ret = EINA_FALSE;
@@ -1096,8 +1110,9 @@ _elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
1096 1110
1097 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 1111 _mirrored_set(obj, elm_widget_mirrored_get(obj));
1098 1112
1099 EINA_LIST_FOREACH(sd->items, n, it) 1113 EINA_LIST_FOREACH(sd->items, n, eo_it)
1100 { 1114 {
1115 ELM_LIST_ITEM_DATA_GET(eo_it, it);
1101 edje_object_scale_set 1116 edje_object_scale_set
1102 (VIEW(it), elm_widget_scale_get(obj) * elm_config_scale_get()); 1117 (VIEW(it), elm_widget_scale_get(obj) * elm_config_scale_get());
1103 it->fixed = EINA_FALSE; 1118 it->fixed = EINA_FALSE;
@@ -1111,14 +1126,14 @@ _elm_list_elm_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
1111} 1126}
1112 1127
1113static void 1128static void
1114_elm_list_item_focused(Elm_List_Item *it) 1129_elm_list_item_focused(Elm_List_Item_Data *it)
1115{ 1130{
1116 ELM_LIST_DATA_GET_FROM_ITEM(it, sd); 1131 ELM_LIST_DATA_GET_FROM_ITEM(it, sd);
1117 Evas_Coord x, y, w, h, sx, sy, sw, sh; 1132 Evas_Coord x, y, w, h, sx, sy, sw, sh;
1118 const char *focus_raise; 1133 const char *focus_raise;
1119 1134
1120 if ((!sd) || _is_no_select(it) || 1135 if ((!sd) || _is_no_select(it) ||
1121 (it == (Elm_List_Item *)sd->focused_item)) 1136 (it == sd->focused_item))
1122 return; 1137 return;
1123 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h); 1138 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
1124 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh); 1139 evas_object_geometry_get(sd->hit_rect, &sx, &sy, &sw, &sh);
@@ -1127,16 +1142,16 @@ _elm_list_item_focused(Elm_List_Item *it)
1127 switch (_elm_config->focus_autoscroll_mode) 1142 switch (_elm_config->focus_autoscroll_mode)
1128 { 1143 {
1129 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW: 1144 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
1130 elm_list_item_show((Elm_Object_Item *)it); 1145 elm_list_item_show(EO_OBJ(it));
1131 break; 1146 break;
1132 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN: 1147 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
1133 elm_list_item_bring_in((Elm_Object_Item *)it); 1148 elm_list_item_bring_in(EO_OBJ(it));
1134 break; 1149 break;
1135 default: 1150 default:
1136 break; 1151 break;
1137 } 1152 }
1138 } 1153 }
1139 sd->focused_item = (Elm_Object_Item *)it; 1154 sd->focused_item = it;
1140 if (elm_widget_focus_highlight_enabled_get(WIDGET(it))) 1155 if (elm_widget_focus_highlight_enabled_get(WIDGET(it)))
1141 { 1156 {
1142 edje_object_signal_emit 1157 edje_object_signal_emit
@@ -1146,17 +1161,17 @@ _elm_list_item_focused(Elm_List_Item *it)
1146 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 1161 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1147 evas_object_raise(VIEW(it)); 1162 evas_object_raise(VIEW(it));
1148 evas_object_smart_callback_call 1163 evas_object_smart_callback_call
1149 (WIDGET(it), SIG_ITEM_FOCUSED, it); 1164 (WIDGET(it), SIG_ITEM_FOCUSED, EO_OBJ(it));
1150} 1165}
1151 1166
1152static void 1167static void
1153_elm_list_item_unfocused(Elm_List_Item *it) 1168_elm_list_item_unfocused(Elm_List_Item_Data *it)
1154{ 1169{
1155 Evas_Object *obj = WIDGET(it); 1170 Evas_Object *obj = WIDGET(it);
1156 ELM_LIST_DATA_GET(obj, sd); 1171 ELM_LIST_DATA_GET(obj, sd);
1157 1172
1158 if ((!sd) || (!sd->focused_item) || 1173 if ((!sd) || (!sd->focused_item) ||
1159 (it != (Elm_List_Item *)sd->focused_item)) 1174 (it != sd->focused_item))
1160 return; 1175 return;
1161 1176
1162 if (_is_no_select(it)) 1177 if (_is_no_select(it))
@@ -1169,7 +1184,7 @@ _elm_list_item_unfocused(Elm_List_Item *it)
1169 } 1184 }
1170 1185
1171 sd->focused_item = NULL; 1186 sd->focused_item = NULL;
1172 evas_object_smart_callback_call(obj, SIG_ITEM_UNFOCUSED, it); 1187 evas_object_smart_callback_call(obj, SIG_ITEM_UNFOCUSED, EO_OBJ(it));
1173} 1188}
1174 1189
1175/* 1190/*
@@ -1178,14 +1193,14 @@ _elm_list_item_unfocused(Elm_List_Item *it)
1178 * Or this searches other items and checks the nearest fully visible item 1193 * Or this searches other items and checks the nearest fully visible item
1179 * according to the given item's position. 1194 * according to the given item's position.
1180 */ 1195 */
1181static Elm_Object_Item * 1196static Elm_List_Item_Data *
1182_elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it) 1197_elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_List_Item_Data *it)
1183{ 1198{
1184 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // list viewport geometry 1199 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // list viewport geometry
1185 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry 1200 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry
1186 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry 1201 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry
1187 Eina_List *item_list = NULL; 1202 Eina_List *item_list = NULL;
1188 Elm_Object_Item *item = NULL; 1203 Elm_List_Item_Data *item = NULL;
1189 ELM_LIST_DATA_GET(obj, sd); 1204 ELM_LIST_DATA_GET(obj, sd);
1190 Eina_Bool search_next = EINA_FALSE; 1205 Eina_Bool search_next = EINA_FALSE;
1191 1206
@@ -1194,11 +1209,11 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
1194 evas_object_geometry_get(obj, &vx, &vy, &vw, &vh); 1209 evas_object_geometry_get(obj, &vx, &vy, &vw, &vh);
1195 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih); 1210 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih);
1196 1211
1197 item_list = eina_list_data_find_list(sd->items, it); 1212 item_list = eina_list_data_find_list(sd->items, EO_OBJ(it));
1198 1213
1199 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) 1214 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih))
1200 { 1215 {
1201 if (!elm_object_item_disabled_get(it)) 1216 if (!elm_object_item_disabled_get(EO_OBJ(it)))
1202 return it; 1217 return it;
1203 else 1218 else
1204 search_next = EINA_TRUE; 1219 search_next = EINA_TRUE;
@@ -1213,7 +1228,7 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
1213 item = eina_list_data_get(item_list); 1228 item = eina_list_data_get(item_list);
1214 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 1229 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
1215 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 1230 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
1216 !elm_object_item_disabled_get(item)) 1231 !elm_object_item_disabled_get(EO_OBJ(item)))
1217 return item; 1232 return item;
1218 } 1233 }
1219 } 1234 }
@@ -1224,7 +1239,7 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
1224 item = eina_list_data_get(item_list); 1239 item = eina_list_data_get(item_list);
1225 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 1240 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
1226 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 1241 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
1227 !elm_object_item_disabled_get(item)) 1242 !elm_object_item_disabled_get(EO_OBJ(item)))
1228 return item; 1243 return item;
1229 } 1244 }
1230 } 1245 }
@@ -1235,14 +1250,17 @@ EOLIAN static Eina_Bool
1235_elm_list_elm_widget_on_focus(Eo *obj, Elm_List_Data *sd) 1250_elm_list_elm_widget_on_focus(Eo *obj, Elm_List_Data *sd)
1236{ 1251{
1237 Eina_Bool int_ret = EINA_FALSE; 1252 Eina_Bool int_ret = EINA_FALSE;
1238 Elm_Object_Item *it = NULL; 1253 Elm_List_Item_Data *it = NULL;
1239 Eina_Bool is_sel = EINA_FALSE; 1254 Eina_Bool is_sel = EINA_FALSE;
1240 1255
1241 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus()); 1256 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
1242 if (!int_ret) return EINA_FALSE; 1257 if (!int_ret) return EINA_FALSE;
1243 1258
1244 if (elm_widget_focus_get(obj) && sd->selected && !sd->last_selected_item) 1259 if (elm_widget_focus_get(obj) && sd->selected && !sd->last_selected_item)
1245 sd->last_selected_item = eina_list_data_get(sd->selected); 1260 {
1261 Elm_Object_Item *sel = eina_list_data_get(sd->selected);
1262 sd->last_selected_item = eo_data_scope_get((Eo *)sel, ELM_LIST_ITEM_CLASS);
1263 }
1246 1264
1247 if (!sd->items) return EINA_FALSE; 1265 if (!sd->items) return EINA_FALSE;
1248 1266
@@ -1255,7 +1273,8 @@ _elm_list_elm_widget_on_focus(Eo *obj, Elm_List_Data *sd)
1255 else if (_elm_config->first_item_focus_on_first_focus_in && 1273 else if (_elm_config->first_item_focus_on_first_focus_in &&
1256 elm_widget_focus_highlight_enabled_get(obj)) 1274 elm_widget_focus_highlight_enabled_get(obj))
1257 { 1275 {
1258 it = elm_list_first_item_get(obj); 1276 Elm_Object_Item *eo_it = elm_list_first_item_get(obj);
1277 it = eo_data_scope_get((Eo *)eo_it, ELM_LIST_ITEM_CLASS);
1259 is_sel = EINA_TRUE; 1278 is_sel = EINA_TRUE;
1260 } 1279 }
1261 1280
@@ -1265,9 +1284,9 @@ _elm_list_elm_widget_on_focus(Eo *obj, Elm_List_Data *sd)
1265 if (it) 1284 if (it)
1266 { 1285 {
1267 if (!_elm_config->item_select_on_focus_disable && is_sel) 1286 if (!_elm_config->item_select_on_focus_disable && is_sel)
1268 elm_list_item_selected_set(it, EINA_TRUE); 1287 elm_list_item_selected_set(EO_OBJ(it), EINA_TRUE);
1269 else 1288 else
1270 elm_object_item_focus_set(it, EINA_TRUE); 1289 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
1271 } 1290 }
1272 } 1291 }
1273 } 1292 }
@@ -1275,7 +1294,7 @@ _elm_list_elm_widget_on_focus(Eo *obj, Elm_List_Data *sd)
1275 { 1294 {
1276 sd->last_focused_item = sd->focused_item; 1295 sd->last_focused_item = sd->focused_item;
1277 if (sd->focused_item) 1296 if (sd->focused_item)
1278 _elm_list_item_unfocused((Elm_List_Item *)sd->focused_item); 1297 _elm_list_item_unfocused(sd->focused_item);
1279 } 1298 }
1280 return EINA_TRUE; 1299 return EINA_TRUE;
1281} 1300}
@@ -1284,7 +1303,7 @@ EOLIAN static Eina_Bool
1284_elm_list_elm_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Object *sobj) 1303_elm_list_elm_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Object *sobj)
1285{ 1304{
1286 const Eina_List *l; 1305 const Eina_List *l;
1287 Elm_List_Item *it; 1306 Elm_Object_Item *eo_it;
1288 1307
1289 Eina_Bool int_ret = EINA_FALSE; 1308 Eina_Bool int_ret = EINA_FALSE;
1290 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj)); 1309 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
@@ -1292,8 +1311,9 @@ _elm_list_elm_widget_sub_object_del(Eo *obj, Elm_List_Data *sd, Evas_Object *sob
1292 1311
1293 if ((sobj == sd->box) || (sobj == obj)) goto end; 1312 if ((sobj == sd->box) || (sobj == obj)) goto end;
1294 1313
1295 EINA_LIST_FOREACH(sd->items, l, it) 1314 EINA_LIST_FOREACH(sd->items, l, eo_it)
1296 { 1315 {
1316 ELM_LIST_ITEM_DATA_GET(eo_it, it);
1297 if ((sobj == it->icon) || (sobj == it->end)) 1317 if ((sobj == it->icon) || (sobj == it->end))
1298 { 1318 {
1299 if (it->icon == sobj) it->icon = NULL; 1319 if (it->icon == sobj) it->icon = NULL;
@@ -1317,7 +1337,7 @@ end:
1317} 1337}
1318 1338
1319static void 1339static void
1320_item_highlight(Elm_List_Item *it) 1340_item_highlight(Elm_List_Item_Data *it)
1321{ 1341{
1322 Evas_Object *obj; 1342 Evas_Object *obj;
1323 const char *select_raise; 1343 const char *select_raise;
@@ -1327,14 +1347,14 @@ _item_highlight(Elm_List_Item *it)
1327 ELM_LIST_DATA_GET(obj, sd); 1347 ELM_LIST_DATA_GET(obj, sd);
1328 1348
1329 if (_is_no_select(it) || 1349 if (_is_no_select(it) ||
1330 (it->highlighted) || (it->base.disabled)) 1350 (it->highlighted) || (it->base->disabled))
1331 return; 1351 return;
1332 1352
1333 evas_object_ref(obj); 1353 evas_object_ref(obj);
1334 _elm_list_walk(sd); 1354 _elm_list_walk(sd);
1335 1355
1336 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 1356 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
1337 evas_object_smart_callback_call(obj, SIG_HIGHLIGHTED, it); 1357 evas_object_smart_callback_call(obj, SIG_HIGHLIGHTED, EO_OBJ(it));
1338 select_raise = edje_object_data_get(VIEW(it), "selectraise"); 1358 select_raise = edje_object_data_get(VIEW(it), "selectraise");
1339 if ((select_raise) && (!strcmp(select_raise, "on"))) 1359 if ((select_raise) && (!strcmp(select_raise, "on")))
1340 evas_object_raise(VIEW(it)); 1360 evas_object_raise(VIEW(it));
@@ -1344,7 +1364,7 @@ _item_highlight(Elm_List_Item *it)
1344} 1364}
1345 1365
1346static void 1366static void
1347_item_select(Elm_List_Item *it) 1367_item_select(Elm_List_Item_Data *it)
1348{ 1368{
1349 Evas_Object *obj; 1369 Evas_Object *obj;
1350 1370
@@ -1352,7 +1372,7 @@ _item_select(Elm_List_Item *it)
1352 obj = WIDGET(it); 1372 obj = WIDGET(it);
1353 ELM_LIST_DATA_GET(obj, sd); 1373 ELM_LIST_DATA_GET(obj, sd);
1354 1374
1355 if (it->base.disabled || _is_no_select(it)) 1375 if (it->base->disabled || _is_no_select(it))
1356 return; 1376 return;
1357 if (!sd->focus_on_selection_enabled) 1377 if (!sd->focus_on_selection_enabled)
1358 { 1378 {
@@ -1378,22 +1398,22 @@ _item_select(Elm_List_Item *it)
1378 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode); 1398 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode);
1379 1399
1380 it->selected = EINA_TRUE; 1400 it->selected = EINA_TRUE;
1381 sd->selected = eina_list_append(sd->selected, it); 1401 sd->selected = eina_list_append(sd->selected, EO_OBJ(it));
1382 1402
1383call: 1403call:
1384 evas_object_ref(obj); 1404 evas_object_ref(obj);
1385 _elm_list_walk(sd); 1405 _elm_list_walk(sd);
1386 1406
1387 if (it->func) it->func((void *)it->base.data, WIDGET(it), it); 1407 if (it->func) it->func((void *)it->base->data, WIDGET(it), EO_OBJ(it));
1388 evas_object_smart_callback_call(obj, SIG_SELECTED, it); 1408 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it));
1389 sd->last_selected_item = (Elm_Object_Item *)it; 1409 sd->last_selected_item = it;
1390 1410
1391 _elm_list_unwalk(obj, sd); 1411 _elm_list_unwalk(obj, sd);
1392 evas_object_unref(obj); 1412 evas_object_unref(obj);
1393} 1413}
1394 1414
1395static void 1415static void
1396_item_unhighlight(Elm_List_Item *it) 1416_item_unhighlight(Elm_List_Item_Data *it)
1397{ 1417{
1398 Evas_Object *obj; 1418 Evas_Object *obj;
1399 const char *stacking, *select_raise; 1419 const char *stacking, *select_raise;
@@ -1402,7 +1422,7 @@ _item_unhighlight(Elm_List_Item *it)
1402 obj = WIDGET(it); 1422 obj = WIDGET(it);
1403 ELM_LIST_DATA_GET(obj, sd); 1423 ELM_LIST_DATA_GET(obj, sd);
1404 1424
1405// if ((!it->highlighted) || (it->base.disabled) || 1425// if ((!it->highlighted) || (it->base->disabled) ||
1406// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return; 1426// (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) return;
1407 if (!it->highlighted) return; 1427 if (!it->highlighted) return;
1408 1428
@@ -1410,7 +1430,7 @@ _item_unhighlight(Elm_List_Item *it)
1410 _elm_list_walk(sd); 1430 _elm_list_walk(sd);
1411 1431
1412 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); 1432 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
1413 evas_object_smart_callback_call(obj, SIG_UNHIGHLIGHTED, it); 1433 evas_object_smart_callback_call(obj, SIG_UNHIGHLIGHTED, EO_OBJ(it));
1414 stacking = edje_object_data_get(VIEW(it), "stacking"); 1434 stacking = edje_object_data_get(VIEW(it), "stacking");
1415 select_raise = edje_object_data_get(VIEW(it), "selectraise"); 1435 select_raise = edje_object_data_get(VIEW(it), "selectraise");
1416 if ((select_raise) && (!strcmp(select_raise, "on"))) 1436 if ((select_raise) && (!strcmp(select_raise, "on")))
@@ -1425,7 +1445,7 @@ _item_unhighlight(Elm_List_Item *it)
1425} 1445}
1426 1446
1427static void 1447static void
1428_item_unselect(Elm_List_Item *it) 1448_item_unselect(Elm_List_Item_Data *it)
1429{ 1449{
1430 Evas_Object *obj; 1450 Evas_Object *obj;
1431 1451
@@ -1433,7 +1453,7 @@ _item_unselect(Elm_List_Item *it)
1433 obj = WIDGET(it); 1453 obj = WIDGET(it);
1434 ELM_LIST_DATA_GET(obj, sd); 1454 ELM_LIST_DATA_GET(obj, sd);
1435 1455
1436// if (it->base.disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)) 1456// if (it->base->disabled || (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))
1437// return; 1457// return;
1438 1458
1439 evas_object_ref(obj); 1459 evas_object_ref(obj);
@@ -1448,10 +1468,10 @@ _item_unselect(Elm_List_Item *it)
1448 if (it->selected) 1468 if (it->selected)
1449 { 1469 {
1450 it->selected = EINA_FALSE; 1470 it->selected = EINA_FALSE;
1451 sd->selected = eina_list_remove(sd->selected, it); 1471 sd->selected = eina_list_remove(sd->selected, EO_OBJ(it));
1452 if (!(it->base.disabled || 1472 if (!(it->base->disabled ||
1453 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE))) 1473 (sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE)))
1454 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it); 1474 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, EO_OBJ(it));
1455 } 1475 }
1456 1476
1457 _elm_list_unwalk(obj, sd); 1477 _elm_list_unwalk(obj, sd);
@@ -1461,7 +1481,7 @@ _item_unselect(Elm_List_Item *it)
1461static Eina_Bool 1481static Eina_Bool
1462_swipe_cancel(void *data) 1482_swipe_cancel(void *data)
1463{ 1483{
1464 Elm_List_Item *it = data; 1484 Elm_List_Item_Data *it = data;
1465 1485
1466 ELM_LIST_ITEM_CHECK_OR_RETURN(it, ECORE_CALLBACK_CANCEL); 1486 ELM_LIST_ITEM_CHECK_OR_RETURN(it, ECORE_CALLBACK_CANCEL);
1467 ELM_LIST_DATA_GET_FROM_ITEM(it, sd); 1487 ELM_LIST_DATA_GET_FROM_ITEM(it, sd);
@@ -1503,7 +1523,7 @@ _edge_bottom_cb(Evas_Object *obj,
1503static Eina_Bool 1523static Eina_Bool
1504_long_press_cb(void *data) 1524_long_press_cb(void *data)
1505{ 1525{
1506 Elm_List_Item *it = data; 1526 Elm_List_Item_Data *it = data;
1507 Evas_Object *obj; 1527 Evas_Object *obj;
1508 1528
1509 ELM_LIST_ITEM_CHECK_OR_RETURN(it, ECORE_CALLBACK_CANCEL); 1529 ELM_LIST_ITEM_CHECK_OR_RETURN(it, ECORE_CALLBACK_CANCEL);
@@ -1511,17 +1531,17 @@ _long_press_cb(void *data)
1511 ELM_LIST_DATA_GET(obj, sd); 1531 ELM_LIST_DATA_GET(obj, sd);
1512 1532
1513 it->long_timer = NULL; 1533 it->long_timer = NULL;
1514 if (it->base.disabled) goto end; 1534 if (it->base->disabled) goto end;
1515 1535
1516 sd->longpressed = EINA_TRUE; 1536 sd->longpressed = EINA_TRUE;
1517 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it); 1537 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, EO_OBJ(it));
1518 1538
1519end: 1539end:
1520 return ECORE_CALLBACK_CANCEL; 1540 return ECORE_CALLBACK_CANCEL;
1521} 1541}
1522 1542
1523static void 1543static void
1524_swipe_do(Elm_List_Item *it) 1544_swipe_do(Elm_List_Item_Data *it)
1525{ 1545{
1526 int i, sum = 0; 1546 int i, sum = 0;
1527 1547
@@ -1538,7 +1558,7 @@ _swipe_do(Elm_List_Item *it)
1538 sum /= sd->movements; 1558 sum /= sd->movements;
1539 if (abs(sum - sd->history[0].x) <= 10) return; 1559 if (abs(sum - sd->history[0].x) <= 10) return;
1540 1560
1541 evas_object_smart_callback_call(WIDGET(it), SIG_SWIPE, it); 1561 evas_object_smart_callback_call(WIDGET(it), SIG_SWIPE, EO_OBJ(it));
1542} 1562}
1543 1563
1544static void 1564static void
@@ -1547,9 +1567,10 @@ _mouse_in_cb(void *data,
1547 Evas_Object *o EINA_UNUSED, 1567 Evas_Object *o EINA_UNUSED,
1548 void *event_info EINA_UNUSED) 1568 void *event_info EINA_UNUSED)
1549{ 1569{
1550 if (!elm_object_item_disabled_get(data) && 1570 Elm_List_Item_Data *it = data;
1571 if (!elm_object_item_disabled_get(EO_OBJ(it)) &&
1551 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN)) 1572 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN))
1552 elm_object_item_focus_set(data, EINA_TRUE); 1573 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
1553} 1574}
1554 1575
1555static void 1576static void
@@ -1559,7 +1580,7 @@ _mouse_move_cb(void *data,
1559 void *event_info) 1580 void *event_info)
1560{ 1581{
1561 Evas_Object *obj; 1582 Evas_Object *obj;
1562 Elm_List_Item *it = data; 1583 Elm_List_Item_Data *it = data;
1563 Evas_Event_Mouse_Move *ev = event_info; 1584 Evas_Event_Mouse_Move *ev = event_info;
1564 1585
1565 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 1586 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
@@ -1604,7 +1625,7 @@ _mouse_down_cb(void *data,
1604 void *event_info) 1625 void *event_info)
1605{ 1626{
1606 Evas_Event_Mouse_Down *ev = event_info; 1627 Evas_Event_Mouse_Down *ev = event_info;
1607 Elm_List_Item *it = data; 1628 Elm_List_Item_Data *it = data;
1608 Evas_Object *obj; 1629 Evas_Object *obj;
1609 1630
1610 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 1631 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
@@ -1633,8 +1654,8 @@ _mouse_down_cb(void *data,
1633 /* Always call the callbacks last - the user may delete our context! */ 1654 /* Always call the callbacks last - the user may delete our context! */
1634 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 1655 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
1635 { 1656 {
1636 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it); 1657 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, EO_OBJ(it));
1637 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); 1658 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, EO_OBJ(it));
1638 } 1659 }
1639 sd->swipe = EINA_FALSE; 1660 sd->swipe = EINA_FALSE;
1640 sd->movements = 0; 1661 sd->movements = 0;
@@ -1650,7 +1671,7 @@ _mouse_up_cb(void *data,
1650 void *event_info) 1671 void *event_info)
1651{ 1672{
1652 Evas_Object *obj; 1673 Evas_Object *obj;
1653 Elm_List_Item *it = data; 1674 Elm_List_Item_Data *it = data;
1654 Evas_Event_Mouse_Up *ev = event_info; 1675 Evas_Event_Mouse_Up *ev = event_info;
1655 1676
1656 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 1677 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
@@ -1682,15 +1703,15 @@ _mouse_up_cb(void *data,
1682 return; 1703 return;
1683 } 1704 }
1684 1705
1685 if (it->base.disabled) 1706 if (it->base->disabled)
1686 return; 1707 return;
1687 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 1708 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
1688 1709
1689 evas_object_ref(obj); 1710 evas_object_ref(obj);
1690 _elm_list_walk(sd); 1711 _elm_list_walk(sd);
1691 1712
1692 if (sd->focused_item != (Elm_Object_Item *)it) 1713 if (sd->focused_item != it)
1693 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 1714 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
1694 1715
1695 if (sd->multi && 1716 if (sd->multi &&
1696 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) || 1717 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
@@ -1713,7 +1734,8 @@ _mouse_up_cb(void *data,
1713 { 1734 {
1714 while (sd->selected) 1735 while (sd->selected)
1715 { 1736 {
1716 Elm_List_Item *it2 = sd->selected->data; 1737 Elm_Object_Item *eo_it2 = sd->selected->data;
1738 ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
1717 sd->selected = eina_list_remove_list 1739 sd->selected = eina_list_remove_list
1718 (sd->selected, sd->selected); 1740 (sd->selected, sd->selected);
1719 _item_unhighlight(it2); 1741 _item_unhighlight(it2);
@@ -1725,11 +1747,12 @@ _mouse_up_cb(void *data,
1725 else 1747 else
1726 { 1748 {
1727 const Eina_List *l, *l_next; 1749 const Eina_List *l, *l_next;
1728 Elm_List_Item *it2; 1750 Elm_Object_Item *eo_it2;
1729 1751
1730 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2) 1752 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, eo_it2)
1731 if (it2 != it) 1753 if (eo_it2 != EO_OBJ(it))
1732 { 1754 {
1755 ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
1733 _item_unhighlight(it2); 1756 _item_unhighlight(it2);
1734 _item_unselect(it2); 1757 _item_unselect(it2);
1735 } 1758 }
@@ -1752,11 +1775,11 @@ _elm_list_looping_left_cb(void *data,
1752 1775
1753 ELM_LIST_DATA_GET(list, sd); 1776 ELM_LIST_DATA_GET(list, sd);
1754 1777
1755 Elm_List_Item *it = (Elm_List_Item *)elm_list_last_item_get(list); 1778 Elm_Object_Item *it = elm_list_last_item_get(list);
1756 if (!_elm_config->item_select_on_focus_disable) 1779 if (!_elm_config->item_select_on_focus_disable)
1757 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 1780 elm_list_item_selected_set(it, EINA_TRUE);
1758 else 1781 else
1759 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 1782 elm_object_item_focus_set(it, EINA_TRUE);
1760 elm_layout_signal_emit(list, "elm,action,looping,left,end", "elm"); 1783 elm_layout_signal_emit(list, "elm,action,looping,left,end", "elm");
1761 sd->item_looping_on = EINA_FALSE; 1784 sd->item_looping_on = EINA_FALSE;
1762} 1785}
@@ -1771,11 +1794,11 @@ _elm_list_looping_right_cb(void *data,
1771 1794
1772 ELM_LIST_DATA_GET(list, sd); 1795 ELM_LIST_DATA_GET(list, sd);
1773 1796
1774 Elm_List_Item *it = (Elm_List_Item *)elm_list_first_item_get(list); 1797 Elm_Object_Item *it = elm_list_first_item_get(list);
1775 if (!_elm_config->item_select_on_focus_disable) 1798 if (!_elm_config->item_select_on_focus_disable)
1776 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 1799 elm_list_item_selected_set(it, EINA_TRUE);
1777 else 1800 else
1778 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 1801 elm_object_item_focus_set(it, EINA_TRUE);
1779 elm_layout_signal_emit(list, "elm,action,looping,right,end", "elm"); 1802 elm_layout_signal_emit(list, "elm,action,looping,right,end", "elm");
1780 sd->item_looping_on = EINA_FALSE; 1803 sd->item_looping_on = EINA_FALSE;
1781} 1804}
@@ -1790,11 +1813,11 @@ _elm_list_looping_up_cb(void *data,
1790 1813
1791 ELM_LIST_DATA_GET(list, sd); 1814 ELM_LIST_DATA_GET(list, sd);
1792 1815
1793 Elm_List_Item *it = (Elm_List_Item *)elm_list_last_item_get(list); 1816 Elm_Object_Item *it = elm_list_last_item_get(list);
1794 if (!_elm_config->item_select_on_focus_disable) 1817 if (!_elm_config->item_select_on_focus_disable)
1795 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 1818 elm_list_item_selected_set(it, EINA_TRUE);
1796 else 1819 else
1797 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 1820 elm_object_item_focus_set(it, EINA_TRUE);
1798 elm_layout_signal_emit(list, "elm,action,looping,up,end", "elm"); 1821 elm_layout_signal_emit(list, "elm,action,looping,up,end", "elm");
1799 sd->item_looping_on = EINA_FALSE; 1822 sd->item_looping_on = EINA_FALSE;
1800} 1823}
@@ -1809,34 +1832,31 @@ _elm_list_looping_down_cb(void *data,
1809 1832
1810 ELM_LIST_DATA_GET(list, sd); 1833 ELM_LIST_DATA_GET(list, sd);
1811 1834
1812 Elm_List_Item *it = (Elm_List_Item *)elm_list_first_item_get(list); 1835 Elm_Object_Item *it = elm_list_first_item_get(list);
1813 if (!_elm_config->item_select_on_focus_disable) 1836 if (!_elm_config->item_select_on_focus_disable)
1814 elm_list_item_selected_set((Elm_Object_Item *)it, EINA_TRUE); 1837 elm_list_item_selected_set(it, EINA_TRUE);
1815 else 1838 else
1816 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 1839 elm_object_item_focus_set(it, EINA_TRUE);
1817 elm_layout_signal_emit(list, "elm,action,looping,down,end", "elm"); 1840 elm_layout_signal_emit(list, "elm,action,looping,down,end", "elm");
1818 sd->item_looping_on = EINA_FALSE; 1841 sd->item_looping_on = EINA_FALSE;
1819} 1842}
1820 1843
1821static void 1844EOLIAN static void
1822_item_disable_hook(Elm_Object_Item *it) 1845_elm_list_item_elm_widget_item_disable(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
1823{ 1846{
1824 Elm_List_Item *item = (Elm_List_Item *)it;
1825
1826 _item_unhighlight(item); 1847 _item_unhighlight(item);
1827 _item_unselect(item); 1848 _item_unselect(item);
1828 if (item->base.disabled) 1849 if (item->base->disabled)
1829 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm"); 1850 edje_object_signal_emit(VIEW(item), "elm,state,disabled", "elm");
1830 else 1851 else
1831 edje_object_signal_emit(VIEW(item), "elm,state,enabled", "elm"); 1852 edje_object_signal_emit(VIEW(item), "elm,state,enabled", "elm");
1832} 1853}
1833 1854
1834static void 1855EOLIAN static void
1835_item_content_set_hook(Elm_Object_Item *it, 1856_elm_list_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
1836 const char *part, 1857 const char *part,
1837 Evas_Object *content) 1858 Evas_Object *content)
1838{ 1859{
1839 Elm_List_Item *item = (Elm_List_Item *)it;
1840 Evas_Object **icon_p = NULL; 1860 Evas_Object **icon_p = NULL;
1841 Eina_Bool dummy = EINA_FALSE; 1861 Eina_Bool dummy = EINA_FALSE;
1842 1862
@@ -1878,12 +1898,10 @@ _item_content_set_hook(Elm_Object_Item *it,
1878 } 1898 }
1879} 1899}
1880 1900
1881static Evas_Object * 1901EOLIAN static Evas_Object *
1882_item_content_get_hook(const Elm_Object_Item *it, 1902_elm_list_item_elm_widget_item_part_content_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
1883 const char *part) 1903 const char *part)
1884{ 1904{
1885 Elm_List_Item *item = (Elm_List_Item *)it;
1886
1887 if ((!part) || (!strcmp(part, "start"))) 1905 if ((!part) || (!strcmp(part, "start")))
1888 { 1906 {
1889 if (item->dummy_icon) return NULL; 1907 if (item->dummy_icon) return NULL;
@@ -1898,38 +1916,34 @@ _item_content_get_hook(const Elm_Object_Item *it,
1898 return NULL; 1916 return NULL;
1899} 1917}
1900 1918
1901static Evas_Object * 1919EOLIAN static Evas_Object *
1902_item_content_unset_hook(const Elm_Object_Item *it, 1920_elm_list_item_elm_widget_item_part_content_unset(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *item,
1903 const char *part) 1921 const char *part)
1904{ 1922{
1905 Elm_List_Item *item = (Elm_List_Item *)it;
1906
1907 if ((!part) || (!strcmp(part, "start"))) 1923 if ((!part) || (!strcmp(part, "start")))
1908 { 1924 {
1909 Evas_Object *obj = item->icon; 1925 Evas_Object *obj = item->icon;
1910 _item_content_set_hook((Elm_Object_Item *)it, part, NULL); 1926 eo_do(eo_it, elm_wdg_item_part_content_set(part, NULL));
1911 return obj; 1927 return obj;
1912 } 1928 }
1913 else if (!strcmp(part, "end")) 1929 else if (!strcmp(part, "end"))
1914 { 1930 {
1915 Evas_Object *obj = item->end; 1931 Evas_Object *obj = item->end;
1916 _item_content_set_hook((Elm_Object_Item *)it, part, NULL); 1932 eo_do(eo_it, elm_wdg_item_part_content_set(part, NULL));
1917 return obj; 1933 return obj;
1918 } 1934 }
1919 1935
1920 return NULL; 1936 return NULL;
1921} 1937}
1922 1938
1923static void 1939EOLIAN static void
1924_item_text_set_hook(Elm_Object_Item *it, 1940_elm_list_item_elm_widget_item_part_text_set(Eo *eo_list_it, Elm_List_Item_Data *list_it,
1925 const char *part, 1941 const char *part,
1926 const char *text) 1942 const char *text)
1927{ 1943{
1928 Elm_List_Item *list_it = (Elm_List_Item *)it;
1929
1930 if (part && strcmp(part, "default")) 1944 if (part && strcmp(part, "default"))
1931 { 1945 {
1932 elm_widget_item_part_text_custom_set(list_it, part, text); 1946 eo_do(eo_list_it, elm_wdg_item_part_text_custom_set(part, text));
1933 edje_object_part_text_escaped_set(VIEW(list_it), part, text); 1947 edje_object_part_text_escaped_set(VIEW(list_it), part, text);
1934 return; 1948 return;
1935 } 1949 }
@@ -1938,13 +1952,13 @@ _item_text_set_hook(Elm_Object_Item *it,
1938 edje_object_part_text_escaped_set(VIEW(list_it), "elm.text", text); 1952 edje_object_part_text_escaped_set(VIEW(list_it), "elm.text", text);
1939} 1953}
1940 1954
1941static const char * 1955EOLIAN static const char *
1942_item_text_get_hook(const Elm_Object_Item *it, 1956_elm_list_item_elm_widget_item_part_text_get(Eo *eo_it, Elm_List_Item_Data *it,
1943 const char *part) 1957 const char *part)
1944{ 1958{
1945 if (part && strcmp(part, "default")) 1959 if (part && strcmp(part, "default"))
1946 return elm_widget_item_part_text_custom_get(it, part); 1960 return eo_do(eo_it, elm_wdg_item_part_text_custom_get(part));
1947 return ((Elm_List_Item *)it)->label; 1961 return it->label;
1948} 1962}
1949 1963
1950/* FIXME: this _item_del_pre_hook is never been called at all! 1964/* FIXME: this _item_del_pre_hook is never been called at all!
@@ -1953,11 +1967,10 @@ _item_text_get_hook(const Elm_Object_Item *it,
1953 2. elm_widget_item_del() should be called instead of the combination of 1967 2. elm_widget_item_del() should be called instead of the combination of
1954 _elm_list_item_free() + elm_widget_item_free() 1968 _elm_list_item_free() + elm_widget_item_free()
1955 */ 1969 */
1956static Eina_Bool 1970EOLIAN static Eina_Bool
1957_item_del_pre_hook(Elm_Object_Item *it) 1971_elm_list_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
1958{ 1972{
1959 Evas_Object *obj = WIDGET(it); 1973 Evas_Object *obj = WIDGET(item);
1960 Elm_List_Item *item = (Elm_List_Item *)it;
1961 1974
1962 ELM_LIST_DATA_GET(obj, sd); 1975 ELM_LIST_DATA_GET(obj, sd);
1963 1976
@@ -1988,18 +2001,16 @@ _item_del_pre_hook(Elm_Object_Item *it)
1988 return EINA_TRUE; 2001 return EINA_TRUE;
1989} 2002}
1990 2003
1991static void 2004EOLIAN static void _elm_list_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it,
1992_item_signal_emit_hook(Elm_Object_Item *it,
1993 const char *emission, 2005 const char *emission,
1994 const char *source) 2006 const char *source)
1995{ 2007{
1996 edje_object_signal_emit(VIEW(it), emission, source); 2008 edje_object_signal_emit(VIEW(it), emission, source);
1997} 2009}
1998 2010
1999static void 2011EOLIAN static void
2000_item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused) 2012_elm_list_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it, Eina_Bool focused)
2001{ 2013{
2002 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
2003 Evas_Object *obj = WIDGET(it); 2014 Evas_Object *obj = WIDGET(it);
2004 ELM_LIST_DATA_GET(obj, sd); 2015 ELM_LIST_DATA_GET(obj, sd);
2005 2016
@@ -2011,20 +2022,20 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
2011 if (it != sd->focused_item) 2022 if (it != sd->focused_item)
2012 { 2023 {
2013 if (sd->focused_item) 2024 if (sd->focused_item)
2014 _elm_list_item_unfocused((Elm_List_Item *)sd->focused_item); 2025 _elm_list_item_unfocused(sd->focused_item);
2015 _elm_list_item_focused((Elm_List_Item *)it); 2026 _elm_list_item_focused(it);
2016 } 2027 }
2017 } 2028 }
2018 else 2029 else
2019 { 2030 {
2020 if (it) 2031 if (it)
2021 _elm_list_item_unfocused((Elm_List_Item *)it); 2032 _elm_list_item_unfocused(it);
2022 } 2033 }
2023 _elm_widget_focus_highlight_start(obj); 2034 _elm_widget_focus_highlight_start(obj);
2024} 2035}
2025 2036
2026static Eina_Bool 2037EOLIAN static Eina_Bool
2027_item_focus_get_hook(Elm_Object_Item *it) 2038_elm_list_item_elm_widget_item_focus_get(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
2028{ 2039{
2029 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 2040 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
2030 Evas_Object *obj = WIDGET(it); 2041 Evas_Object *obj = WIDGET(it);
@@ -2039,7 +2050,7 @@ _item_focus_get_hook(Elm_Object_Item *it)
2039static char * 2050static char *
2040_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) 2051_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
2041{ 2052{
2042 Elm_List_Item *it = (Elm_List_Item *)data; 2053 Elm_List_Item_Data *it = (Elm_List_Item_Data *)data;
2043 const char *txt = NULL; 2054 const char *txt = NULL;
2044 if (!it) return NULL; 2055 if (!it) return NULL;
2045 2056
@@ -2052,10 +2063,10 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
2052static char * 2063static char *
2053_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED) 2064_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
2054{ 2065{
2055 Elm_List_Item *it = (Elm_List_Item *)data; 2066 Elm_List_Item_Data *it = (Elm_List_Item_Data *)data;
2056 if (!it) return NULL; 2067 if (!it) return NULL;
2057 2068
2058 if (it->base.disabled) 2069 if (it->base->disabled)
2059 return strdup(E_("State: Disabled")); 2070 return strdup(E_("State: Disabled"));
2060 2071
2061 return NULL; 2072 return NULL;
@@ -2073,12 +2084,11 @@ _access_on_highlight_cb(void *data)
2073static void 2084static void
2074_access_activate_cb(void *data EINA_UNUSED, 2085_access_activate_cb(void *data EINA_UNUSED,
2075 Evas_Object *part_obj EINA_UNUSED, 2086 Evas_Object *part_obj EINA_UNUSED,
2076 Elm_Object_Item *item) 2087 Elm_Object_Item *eo_it)
2077{ 2088{
2078 Elm_List_Item *it;
2079 Evas_Object *obj; 2089 Evas_Object *obj;
2080 2090
2081 it = (Elm_List_Item *)item; 2091 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2082 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 2092 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
2083 2093
2084 obj = WIDGET(it); 2094 obj = WIDGET(it);
@@ -2106,8 +2116,10 @@ _access_activate_cb(void *data EINA_UNUSED,
2106 { 2116 {
2107 while (sd->selected) 2117 while (sd->selected)
2108 { 2118 {
2109 _item_unhighlight(sd->selected->data); 2119 Elm_Object_Item *eo_sel = sd->selected->data;
2110 _item_unselect(sd->selected->data); 2120 ELM_LIST_ITEM_DATA_GET(eo_sel, sel);
2121 _item_unhighlight(sel);
2122 _item_unselect(sel);
2111 } 2123 }
2112 _item_highlight(it); 2124 _item_highlight(it);
2113 _item_select(it); 2125 _item_select(it);
@@ -2115,11 +2127,12 @@ _access_activate_cb(void *data EINA_UNUSED,
2115 else 2127 else
2116 { 2128 {
2117 const Eina_List *l, *l_next; 2129 const Eina_List *l, *l_next;
2118 Elm_List_Item *it2; 2130 Elm_Object_Item *eo_it2;
2119 2131
2120 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, it2) 2132 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, eo_it2)
2121 if (it2 != it) 2133 if (eo_it2 != EO_OBJ(it))
2122 { 2134 {
2135 ELM_LIST_ITEM_DATA_GET(eo_it2, it2);
2123 _item_unhighlight(it2); 2136 _item_unhighlight(it2);
2124 _item_unselect(it2); 2137 _item_unselect(it2);
2125 } 2138 }
@@ -2133,25 +2146,32 @@ _access_activate_cb(void *data EINA_UNUSED,
2133} 2146}
2134 2147
2135static void 2148static void
2136_access_widget_item_register(Elm_List_Item *it, Eina_Bool is_access) 2149_access_widget_item_register(Elm_List_Item_Data *it, Eina_Bool is_access)
2137{ 2150{
2138 Elm_Access_Info *ai; 2151 Elm_Access_Info *ai;
2139 2152
2140 if (!is_access) _elm_access_widget_item_unregister((Elm_Widget_Item_Data *)it); 2153 if (!is_access) _elm_access_widget_item_unregister(it->base);
2141 else 2154 else
2142 { 2155 {
2143 _elm_access_widget_item_register((Elm_Widget_Item_Data *)it); 2156 _elm_access_widget_item_register(it->base);
2144 2157
2145 ai = _elm_access_info_get(it->base.access_obj); 2158 ai = _elm_access_info_get(it->base->access_obj);
2146 2159
2147 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it); 2160 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
2148 _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it); 2161 _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, it);
2149 _elm_access_on_highlight_hook_set(ai, _access_on_highlight_cb, it); 2162 _elm_access_on_highlight_hook_set(ai, _access_on_highlight_cb, EO_OBJ(it));
2150 _elm_access_activate_callback_set(ai, _access_activate_cb, it); 2163 _elm_access_activate_callback_set(ai, _access_activate_cb, EO_OBJ(it));
2151 } 2164 }
2152} 2165}
2153 2166
2154static Elm_List_Item * 2167EOLIAN static void
2168_elm_list_item_eo_base_constructor(Eo *eo_it, Elm_List_Item_Data *it)
2169{
2170 eo_do_super(eo_it, ELM_LIST_ITEM_CLASS, eo_constructor());
2171 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
2172}
2173
2174static Elm_List_Item_Data *
2155_item_new(Evas_Object *obj, 2175_item_new(Evas_Object *obj,
2156 const char *label, 2176 const char *label,
2157 Evas_Object *icon, 2177 Evas_Object *icon,
@@ -2159,14 +2179,15 @@ _item_new(Evas_Object *obj,
2159 Evas_Smart_Cb func, 2179 Evas_Smart_Cb func,
2160 const void *data) 2180 const void *data)
2161{ 2181{
2162 Elm_List_Item *it; 2182 Eo *eo_it = eo_add(ELM_LIST_ITEM_CLASS, obj);
2183 if (!eo_it) return NULL;
2184 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2163 2185
2164 it = elm_widget_item_new(obj, Elm_List_Item);
2165 it->label = eina_stringshare_add(label); 2186 it->label = eina_stringshare_add(label);
2166 it->icon = icon; 2187 it->icon = icon;
2167 it->end = end; 2188 it->end = end;
2168 it->func = func; 2189 it->func = func;
2169 it->base.data = data; 2190 it->base->data = data;
2170 2191
2171 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 2192 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
2172 2193
@@ -2203,17 +2224,6 @@ _item_new(Evas_Object *obj,
2203 obj); 2224 obj);
2204 } 2225 }
2205 2226
2206 elm_widget_item_disable_hook_set(it, _item_disable_hook);
2207 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
2208 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
2209 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
2210 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
2211 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
2212 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
2213 elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
2214 elm_widget_item_focus_set_hook_set(it, _item_focus_set_hook);
2215 elm_widget_item_focus_get_hook_set(it, _item_focus_get_hook);
2216
2217 return it; 2227 return it;
2218} 2228}
2219 2229
@@ -2245,13 +2255,14 @@ _elm_list_elm_widget_focus_next(Eo *obj, Elm_List_Data *sd, Elm_Focus_Direction
2245{ 2255{
2246 Eina_List *items = NULL; 2256 Eina_List *items = NULL;
2247 Eina_List *elist = NULL; 2257 Eina_List *elist = NULL;
2248 Elm_List_Item *it; 2258 Elm_Object_Item *eo_it;
2249 2259
2250 if (_elm_config->access_mode != ELM_ACCESS_MODE_ON) return EINA_FALSE; 2260 if (_elm_config->access_mode != ELM_ACCESS_MODE_ON) return EINA_FALSE;
2251 2261
2252 EINA_LIST_FOREACH(sd->items, elist, it) 2262 EINA_LIST_FOREACH(sd->items, elist, eo_it)
2253 { 2263 {
2254 items = eina_list_append(items, it->base.access_obj); 2264 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2265 items = eina_list_append(items, it->base->access_obj);
2255 if (it->icon) items = eina_list_append(items, it->icon); 2266 if (it->icon) items = eina_list_append(items, it->icon);
2256 if (it->end) items = eina_list_append(items, it->end); 2267 if (it->end) items = eina_list_append(items, it->end);
2257 } 2268 }
@@ -2330,14 +2341,15 @@ EOLIAN static void
2330_elm_list_evas_object_smart_del(Eo *obj, Elm_List_Data *sd) 2341_elm_list_evas_object_smart_del(Eo *obj, Elm_List_Data *sd)
2331{ 2342{
2332 const Eina_List *l; 2343 const Eina_List *l;
2333 Elm_List_Item *it; 2344 Elm_Object_Item *eo_it;
2334 2345
2335 if (sd->walking) 2346 if (sd->walking)
2336 ERR("ERROR: list deleted while walking.\n"); 2347 ERR("ERROR: list deleted while walking.\n");
2337 2348
2338 sd->delete_me = EINA_TRUE; 2349 sd->delete_me = EINA_TRUE;
2339 EINA_LIST_FOREACH(sd->items, l, it) 2350 EINA_LIST_FOREACH(sd->items, l, eo_it)
2340 { 2351 {
2352 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2341 if (it->icon) 2353 if (it->icon)
2342 evas_object_event_callback_del 2354 evas_object_event_callback_del
2343 (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 2355 (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
@@ -2356,11 +2368,12 @@ _elm_list_evas_object_smart_del(Eo *obj, Elm_List_Data *sd)
2356 2368
2357 _elm_list_walk(sd); 2369 _elm_list_walk(sd);
2358 2370
2359 EINA_LIST_FREE(sd->items, it) 2371 EINA_LIST_FREE(sd->items, eo_it)
2360 { 2372 {
2373 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2361 /* issuing free because of "locking" item del pre hook */ 2374 /* issuing free because of "locking" item del pre hook */
2362 _elm_list_item_free(it); 2375 _elm_list_item_free(it);
2363 elm_widget_item_free(it); 2376 eo_del((Eo *)EO_OBJ(it));
2364 } 2377 }
2365 2378
2366 _elm_list_unwalk(obj, sd); 2379 _elm_list_unwalk(obj, sd);
@@ -2402,11 +2415,14 @@ EOLIAN static void
2402_elm_list_elm_widget_access(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bool acs) 2415_elm_list_elm_widget_access(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Eina_Bool acs)
2403{ 2416{
2404 Eina_List *elist = NULL; 2417 Eina_List *elist = NULL;
2405 Elm_List_Item *it; 2418 Elm_Object_Item *eo_it;
2406 _elm_list_smart_focus_next_enable = acs; 2419 _elm_list_smart_focus_next_enable = acs;
2407 2420
2408 EINA_LIST_FOREACH(sd->items, elist, it) 2421 EINA_LIST_FOREACH(sd->items, elist, eo_it)
2409 _access_widget_item_register(it, _elm_list_smart_focus_next_enable); 2422 {
2423 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2424 _access_widget_item_register(it, _elm_list_smart_focus_next_enable);
2425 }
2410} 2426}
2411 2427
2412EAPI Evas_Object * 2428EAPI Evas_Object *
@@ -2581,7 +2597,7 @@ elm_list_scroller_policy_get(const Evas_Object *obj,
2581EOLIAN static void 2597EOLIAN static void
2582_elm_list_clear(Eo *obj, Elm_List_Data *sd) 2598_elm_list_clear(Eo *obj, Elm_List_Data *sd)
2583{ 2599{
2584 Elm_List_Item *it; 2600 Elm_Object_Item *eo_it;
2585 2601
2586 if (!sd->items) return; 2602 if (!sd->items) return;
2587 2603
@@ -2591,8 +2607,9 @@ _elm_list_clear(Eo *obj, Elm_List_Data *sd)
2591 { 2607 {
2592 Eina_List *n; 2608 Eina_List *n;
2593 2609
2594 EINA_LIST_FOREACH(sd->items, n, it) 2610 EINA_LIST_FOREACH(sd->items, n, eo_it)
2595 { 2611 {
2612 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2596 if (it->deleted) continue; 2613 if (it->deleted) continue;
2597 it->deleted = EINA_TRUE; 2614 it->deleted = EINA_TRUE;
2598 sd->to_delete = eina_list_append(sd->to_delete, it); 2615 sd->to_delete = eina_list_append(sd->to_delete, it);
@@ -2604,11 +2621,12 @@ _elm_list_clear(Eo *obj, Elm_List_Data *sd)
2604 2621
2605 _elm_list_walk(sd); 2622 _elm_list_walk(sd);
2606 2623
2607 EINA_LIST_FREE(sd->items, it) 2624 EINA_LIST_FREE(sd->items, eo_it)
2608 { 2625 {
2626 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2609 /* issuing free because of "locking" item del pre hook */ 2627 /* issuing free because of "locking" item del pre hook */
2610 _elm_list_item_free(it); 2628 _elm_list_item_free(it);
2611 elm_widget_item_free(it); 2629 eo_del((Eo *)EO_OBJ(it));
2612 } 2630 }
2613 2631
2614 _elm_list_unwalk(obj, sd); 2632 _elm_list_unwalk(obj, sd);
@@ -2641,77 +2659,77 @@ _elm_list_selected_items_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
2641EOLIAN static Elm_Object_Item* 2659EOLIAN static Elm_Object_Item*
2642_elm_list_item_append(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) 2660_elm_list_item_append(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
2643{ 2661{
2644 Elm_List_Item *it; 2662 Elm_List_Item_Data *it;
2645 2663
2646 it = _item_new(obj, label, icon, end, func, data); 2664 it = _item_new(obj, label, icon, end, func, data);
2647 2665
2648 sd->items = eina_list_append(sd->items, it); 2666 sd->items = eina_list_append(sd->items, EO_OBJ(it));
2649 it->node = eina_list_last(sd->items); 2667 it->node = eina_list_last(sd->items);
2650 elm_box_pack_end(sd->box, VIEW(it)); 2668 elm_box_pack_end(sd->box, VIEW(it));
2651 2669
2652 return (Elm_Object_Item *)it; 2670 return EO_OBJ(it);
2653} 2671}
2654 2672
2655EOLIAN static Elm_Object_Item* 2673EOLIAN static Elm_Object_Item*
2656_elm_list_item_prepend(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) 2674_elm_list_item_prepend(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
2657{ 2675{
2658 Elm_List_Item *it; 2676 Elm_List_Item_Data *it;
2659 2677
2660 it = _item_new(obj, label, icon, end, func, data); 2678 it = _item_new(obj, label, icon, end, func, data);
2661 2679
2662 sd->items = eina_list_prepend(sd->items, it); 2680 sd->items = eina_list_prepend(sd->items, EO_OBJ(it));
2663 it->node = sd->items; 2681 it->node = sd->items;
2664 elm_box_pack_start(sd->box, VIEW(it)); 2682 elm_box_pack_start(sd->box, VIEW(it));
2665 2683
2666 return (Elm_Object_Item *)it; 2684 return EO_OBJ(it);
2667} 2685}
2668 2686
2669EOLIAN static Elm_Object_Item* 2687EOLIAN static Elm_Object_Item*
2670_elm_list_item_insert_before(Eo *obj, Elm_List_Data *sd, Elm_Object_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) 2688_elm_list_item_insert_before(Eo *obj, Elm_List_Data *sd, Elm_Object_Item *eo_before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
2671{ 2689{
2672 Elm_List_Item *it, *before_it; 2690 Elm_List_Item_Data *it;
2691 ELM_LIST_ITEM_DATA_GET(eo_before, before_it);
2673 2692
2674 ELM_LIST_ITEM_CHECK_OR_RETURN(before, NULL); 2693 ELM_LIST_ITEM_CHECK_OR_RETURN(before_it, NULL);
2675 2694
2676 before_it = (Elm_List_Item *)before;
2677 if (!before_it->node) return NULL; 2695 if (!before_it->node) return NULL;
2678 2696
2679 it = _item_new(obj, label, icon, end, func, data); 2697 it = _item_new(obj, label, icon, end, func, data);
2680 sd->items = eina_list_prepend_relative_list(sd->items, it, before_it->node); 2698 sd->items = eina_list_prepend_relative_list(sd->items, EO_OBJ(it), before_it->node);
2681 it->node = before_it->node->prev; 2699 it->node = before_it->node->prev;
2682 elm_box_pack_before(sd->box, VIEW(it), VIEW(before_it)); 2700 elm_box_pack_before(sd->box, VIEW(it), VIEW(before_it));
2683 2701
2684 return (Elm_Object_Item *)it; 2702 return EO_OBJ(it);
2685} 2703}
2686 2704
2687EOLIAN static Elm_Object_Item* 2705EOLIAN static Elm_Object_Item*
2688_elm_list_item_insert_after(Eo *obj, Elm_List_Data *sd, Elm_Object_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) 2706_elm_list_item_insert_after(Eo *obj, Elm_List_Data *sd, Elm_Object_Item *eo_after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
2689{ 2707{
2690 Elm_List_Item *it, *after_it; 2708 Elm_List_Item_Data *it;
2709 ELM_LIST_ITEM_DATA_GET(eo_after, after_it);
2691 2710
2692 ELM_LIST_ITEM_CHECK_OR_RETURN(after, NULL); 2711 ELM_LIST_ITEM_CHECK_OR_RETURN(after_it, NULL);
2693 2712
2694 after_it = (Elm_List_Item *)after;
2695 if (!after_it->node) return NULL; 2713 if (!after_it->node) return NULL;
2696 2714
2697 it = _item_new(obj, label, icon, end, func, data); 2715 it = _item_new(obj, label, icon, end, func, data);
2698 sd->items = eina_list_append_relative_list(sd->items, it, after_it->node); 2716 sd->items = eina_list_append_relative_list(sd->items, EO_OBJ(it), after_it->node);
2699 it->node = after_it->node->next; 2717 it->node = after_it->node->next;
2700 elm_box_pack_after(sd->box, VIEW(it), VIEW(after_it)); 2718 elm_box_pack_after(sd->box, VIEW(it), VIEW(after_it));
2701 2719
2702 return (Elm_Object_Item *)it; 2720 return EO_OBJ(it);
2703} 2721}
2704 2722
2705EOLIAN static Elm_Object_Item* 2723EOLIAN static Elm_Object_Item*
2706_elm_list_item_sorted_insert(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func) 2724_elm_list_item_sorted_insert(Eo *obj, Elm_List_Data *sd, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func)
2707{ 2725{
2708 Eina_List *l; 2726 Eina_List *l;
2709 Elm_List_Item *it; 2727 Elm_List_Item_Data *it;
2710 2728
2711 it = _item_new(obj, label, icon, end, func, data); 2729 it = _item_new(obj, label, icon, end, func, data);
2712 2730
2713 sd->items = eina_list_sorted_insert(sd->items, cmp_func, it); 2731 sd->items = eina_list_sorted_insert(sd->items, cmp_func, EO_OBJ(it));
2714 l = eina_list_data_find_list(sd->items, it); 2732 l = eina_list_data_find_list(sd->items, EO_OBJ(it));
2715 l = eina_list_next(l); 2733 l = eina_list_next(l);
2716 if (!l) 2734 if (!l)
2717 { 2735 {
@@ -2720,41 +2738,61 @@ _elm_list_item_sorted_insert(Eo *obj, Elm_List_Data *sd, const char *label, Evas
2720 } 2738 }
2721 else 2739 else
2722 { 2740 {
2723 Elm_List_Item *before = eina_list_data_get(l); 2741 Elm_Object_Item *eo_before = eina_list_data_get(l);
2742 ELM_LIST_ITEM_DATA_GET(eo_before, before);
2724 2743
2725 it->node = before->node->prev; 2744 it->node = before->node->prev;
2726 elm_box_pack_before(sd->box, VIEW(it), VIEW(before)); 2745 elm_box_pack_before(sd->box, VIEW(it), VIEW(before));
2727 } 2746 }
2728 2747
2729 return (Elm_Object_Item *)it; 2748 return EO_OBJ(it);
2730} 2749}
2731 2750
2732EAPI void 2751EAPI void
2733elm_list_item_separator_set(Elm_Object_Item *it, 2752elm_list_item_separator_set(Elm_Object_Item *it,
2734 Eina_Bool setting) 2753 Eina_Bool setting)
2735{ 2754{
2755 eo_do((Eo *)it, elm_obj_list_item_separator_set(setting));
2756}
2757
2758EOLIAN static void
2759_elm_list_item_separator_set(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it,
2760 Eina_Bool setting)
2761{
2736 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 2762 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
2737 2763
2738 ((Elm_List_Item *)it)->is_separator = !!setting; 2764 it->is_separator = !!setting;
2739} 2765}
2740 2766
2741EAPI Eina_Bool 2767EAPI Eina_Bool
2742elm_list_item_separator_get(const Elm_Object_Item *it) 2768elm_list_item_separator_get(const Elm_Object_Item *it)
2743{ 2769{
2770 return eo_do((Eo *)it, elm_obj_list_item_separator_get());
2771}
2772
2773EOLIAN static Eina_Bool
2774_elm_list_item_separator_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
2775{
2744 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 2776 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
2745 2777
2746 return ((Elm_List_Item *)it)->is_separator; 2778 return it->is_separator;
2747} 2779}
2748 2780
2749EAPI void 2781EAPI void
2750elm_list_item_selected_set(Elm_Object_Item *it, 2782elm_list_item_selected_set(Elm_Object_Item *it,
2751 Eina_Bool selected) 2783 Eina_Bool selected)
2752{ 2784{
2753 Elm_List_Item *item = (Elm_List_Item *)it; 2785 eo_do((Eo *)it, elm_obj_list_item_selected_set(selected));
2786}
2787
2788EOLIAN static void
2789_elm_list_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item,
2790 Eina_Bool selected)
2791{
2754 Evas_Object *obj; 2792 Evas_Object *obj;
2755 2793
2756 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 2794 ELM_LIST_ITEM_CHECK_OR_RETURN(item);
2757 obj = WIDGET(it); 2795 obj = WIDGET(item);
2758 ELM_LIST_DATA_GET(obj, sd); 2796 ELM_LIST_DATA_GET(obj, sd);
2759 2797
2760 selected = !!selected; 2798 selected = !!selected;
@@ -2769,12 +2807,14 @@ elm_list_item_selected_set(Elm_Object_Item *it,
2769 { 2807 {
2770 while (sd->selected) 2808 while (sd->selected)
2771 { 2809 {
2772 _item_unhighlight(sd->selected->data); 2810 Elm_Object_Item *eo_sel = sd->selected->data;
2773 _item_unselect(sd->selected->data); 2811 ELM_LIST_ITEM_DATA_GET(eo_sel, sel);
2812 _item_unhighlight(sel);
2813 _item_unselect(sel);
2774 } 2814 }
2775 } 2815 }
2776 _item_highlight(item); 2816 _item_highlight(item);
2777 elm_object_item_focus_set((Elm_Object_Item *)item, EINA_TRUE); 2817 elm_object_item_focus_set(EO_OBJ(item), EINA_TRUE);
2778 _item_select(item); 2818 _item_select(item);
2779 } 2819 }
2780 else 2820 else
@@ -2790,14 +2830,26 @@ elm_list_item_selected_set(Elm_Object_Item *it,
2790EAPI Eina_Bool 2830EAPI Eina_Bool
2791elm_list_item_selected_get(const Elm_Object_Item *it) 2831elm_list_item_selected_get(const Elm_Object_Item *it)
2792{ 2832{
2833 return eo_do((Eo *)it, elm_obj_list_item_selected_get());
2834}
2835
2836EOLIAN static Eina_Bool
2837_elm_list_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *it)
2838{
2793 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 2839 ELM_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
2794 2840
2795 return ((Elm_List_Item *)it)->selected; 2841 return it->selected;
2796} 2842}
2797 2843
2798EAPI void 2844EAPI void
2799elm_list_item_show(Elm_Object_Item *it) 2845elm_list_item_show(Elm_Object_Item *it)
2800{ 2846{
2847 eo_do((Eo *)it, elm_obj_list_item_show());
2848}
2849
2850EOLIAN static void
2851_elm_list_item_show(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
2852{
2801 Evas_Coord bx, by, bw, bh; 2853 Evas_Coord bx, by, bw, bh;
2802 Evas_Coord x, y, w, h; 2854 Evas_Coord x, y, w, h;
2803 2855
@@ -2816,6 +2868,12 @@ elm_list_item_show(Elm_Object_Item *it)
2816EAPI void 2868EAPI void
2817elm_list_item_bring_in(Elm_Object_Item *it) 2869elm_list_item_bring_in(Elm_Object_Item *it)
2818{ 2870{
2871 eo_do((Eo *)it, elm_obj_list_item_bring_in());
2872}
2873
2874EOLIAN static void
2875_elm_list_item_bring_in(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
2876{
2819 Evas_Coord bx, by, bw, bh; 2877 Evas_Coord bx, by, bw, bh;
2820 Evas_Coord x, y, w, h; 2878 Evas_Coord x, y, w, h;
2821 2879
@@ -2834,6 +2892,12 @@ elm_list_item_bring_in(Elm_Object_Item *it)
2834EAPI Evas_Object * 2892EAPI Evas_Object *
2835elm_list_item_object_get(const Elm_Object_Item *it) 2893elm_list_item_object_get(const Elm_Object_Item *it)
2836{ 2894{
2895 return eo_do((Eo *)it, elm_obj_list_item_object_get());
2896}
2897
2898EOLIAN static Evas_Object *
2899_elm_list_item_object_get(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *it)
2900{
2837 ELM_LIST_ITEM_CHECK_OR_RETURN(it, NULL); 2901 ELM_LIST_ITEM_CHECK_OR_RETURN(it, NULL);
2838 2902
2839 return VIEW(it); 2903 return VIEW(it);
@@ -2842,49 +2906,60 @@ elm_list_item_object_get(const Elm_Object_Item *it)
2842EAPI Elm_Object_Item * 2906EAPI Elm_Object_Item *
2843elm_list_item_prev(const Elm_Object_Item *it) 2907elm_list_item_prev(const Elm_Object_Item *it)
2844{ 2908{
2845 Elm_List_Item *item = (Elm_List_Item *)it; 2909 return eo_do((Eo *)it, elm_obj_list_item_prev_get());
2846 2910}
2847 ELM_LIST_ITEM_CHECK_OR_RETURN(it, NULL);
2848 2911
2849 if (item->node->prev) return item->node->prev->data; 2912EOLIAN static Elm_Object_Item *
2850 else return NULL; 2913_elm_list_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
2914{
2915 if (item->node->prev)
2916 return item->node->prev->data;
2917 return NULL;
2851} 2918}
2852 2919
2853EAPI Elm_Object_Item * 2920EAPI Elm_Object_Item *
2854elm_list_item_next(const Elm_Object_Item *it) 2921elm_list_item_next(const Elm_Object_Item *it)
2855{ 2922{
2856 Elm_List_Item *item = (Elm_List_Item *)it; 2923 return eo_do((Eo *)it, elm_obj_list_item_next_get());
2857 2924}
2858 ELM_LIST_ITEM_CHECK_OR_RETURN(it, NULL);
2859 2925
2860 if (item->node->next) return item->node->next->data; 2926EOLIAN static Elm_Object_Item *
2861 else return NULL; 2927_elm_list_item_next_get(Eo *eo_item EINA_UNUSED, Elm_List_Item_Data *item)
2928{
2929 if (item->node->next)
2930 return item->node->next->data;
2931 return NULL;
2862} 2932}
2863 2933
2864EOLIAN static Elm_Object_Item* 2934EOLIAN static Elm_Object_Item*
2865_elm_list_first_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd) 2935_elm_list_first_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
2866{ 2936{
2867 if (!sd->items) return NULL; 2937 if (!sd->items) return NULL;
2868 else return eina_list_data_get(sd->items); 2938 else
2939 return eina_list_data_get(sd->items);
2940 return NULL;
2869} 2941}
2870 2942
2871EOLIAN static Elm_Object_Item* 2943EOLIAN static Elm_Object_Item*
2872_elm_list_last_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd) 2944_elm_list_last_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
2873{ 2945{
2874 if (!sd->items) return NULL; 2946 if (!sd->items) return NULL;
2875 else return eina_list_data_get(eina_list_last(sd->items)); 2947 else
2948 return eina_list_data_get(eina_list_last(sd->items));
2949 return NULL;
2876} 2950}
2877 2951
2878EOLIAN static Elm_Object_Item* 2952EOLIAN static Elm_Object_Item*
2879_elm_list_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Evas_Coord x, Evas_Coord y, int *posret) 2953_elm_list_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Evas_Coord x, Evas_Coord y, int *posret)
2880{ 2954{
2881 Eina_List *l; 2955 Eina_List *l;
2882 Elm_List_Item *it; 2956 Elm_Object_Item *eo_it;
2883 Evas_Coord lasty; 2957 Evas_Coord lasty;
2884 evas_object_geometry_get(sd->hit_rect, &lasty, NULL, NULL, NULL); 2958 evas_object_geometry_get(sd->hit_rect, &lasty, NULL, NULL, NULL);
2885 2959
2886 EINA_LIST_FOREACH(sd->items, l, it) 2960 EINA_LIST_FOREACH(sd->items, l, eo_it)
2887 { 2961 {
2962 ELM_LIST_ITEM_DATA_GET(eo_it, it);
2888 Evas_Coord itx, ity; 2963 Evas_Coord itx, ity;
2889 Evas_Object *vit = VIEW(it); 2964 Evas_Object *vit = VIEW(it);
2890 Evas_Coord vx, vy, vw, vh; 2965 Evas_Coord vx, vy, vw, vh;
@@ -2903,7 +2978,7 @@ _elm_list_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Evas_Coord x, E
2903 else *posret = 0; 2978 else *posret = 0;
2904 } 2979 }
2905 2980
2906 return (Elm_Object_Item *) it; 2981 return EO_OBJ(it);
2907 } 2982 }
2908 2983
2909 lasty = ity + vh; 2984 lasty = ity + vh;
@@ -2931,7 +3006,7 @@ _elm_list_focus_on_selection_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
2931} 3006}
2932 3007
2933static void 3008static void
2934_elm_list_item_coordinates_adjust(Elm_List_Item *it, 3009_elm_list_item_coordinates_adjust(Elm_List_Item_Data *it,
2935 Evas_Coord *x, 3010 Evas_Coord *x,
2936 Evas_Coord *y, 3011 Evas_Coord *y,
2937 Evas_Coord *w, 3012 Evas_Coord *w,
@@ -2970,7 +3045,7 @@ _elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_
2970{ 3045{
2971 if (sd->focused_item) 3046 if (sd->focused_item)
2972 { 3047 {
2973 _elm_list_item_coordinates_adjust((Elm_List_Item *)sd->focused_item, x, y, w, h); 3048 _elm_list_item_coordinates_adjust(sd->focused_item, x, y, w, h);
2974 elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), x, y, w, h); 3049 elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), x, y, w, h);
2975 } 3050 }
2976} 3051}
@@ -2978,7 +3053,7 @@ _elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_
2978EOLIAN static Elm_Object_Item* 3053EOLIAN static Elm_Object_Item*
2979_elm_list_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd) 3054_elm_list_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
2980{ 3055{
2981 return sd->focused_item; 3056 return sd->focused_item?EO_OBJ(sd->focused_item):NULL;
2982} 3057}
2983 3058
2984EOLIAN static void 3059EOLIAN static void
@@ -3025,3 +3100,4 @@ _elm_list_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED,
3025 return &atspi_actions[0]; 3100 return &atspi_actions[0];
3026} 3101}
3027#include "elm_list.eo.c" 3102#include "elm_list.eo.c"
3103#include "elm_list_item.eo.c"
diff --git a/src/lib/elm_list_common.h b/src/lib/elm_list_common.h
index 97a610f17..ce9ac2a84 100644
--- a/src/lib/elm_list_common.h
+++ b/src/lib/elm_list_common.h
@@ -21,143 +21,21 @@ typedef enum
21 ELM_LIST_LAST /**< Indicates error if returned by elm_list_mode_get() */ 21 ELM_LIST_LAST /**< Indicates error if returned by elm_list_mode_get() */
22} Elm_List_Mode; 22} Elm_List_Mode;
23 23
24/**
25 * Set the selected state of an item.
26 *
27 * @param it The list item
28 * @param selected The selected state
29 *
30 * This sets the selected state of the given item @p it.
31 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
32 *
33 * If a new item is selected the previously selected will be unselected,
34 * unless multiple selection is enabled with elm_list_multi_select_set().
35 * Previously selected item can be get with function
36 * elm_list_selected_item_get().
37 *
38 * Selected items will be highlighted.
39 *
40 * @see elm_list_item_selected_get()
41 * @see elm_list_selected_item_get()
42 * @see elm_list_multi_select_set()
43 *
44 * @ingroup List
45 */
46EAPI void elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); 24EAPI void elm_list_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
47 25
48/*
49 * Get whether the @p item is selected or not.
50 *
51 * @param it The list item.
52 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
53 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
54 *
55 * @see elm_list_selected_item_set() for details.
56 * @see elm_list_item_selected_get()
57 *
58 * @ingroup List
59 */
60EAPI Eina_Bool elm_list_item_selected_get(const Elm_Object_Item *it); 26EAPI Eina_Bool elm_list_item_selected_get(const Elm_Object_Item *it);
61 27
62/**
63 * Set or unset item as a separator.
64 *
65 * @param it The list item.
66 * @param setting @c EINA_TRUE to set item @p it as separator or
67 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
68 *
69 * Items aren't set as separator by default.
70 *
71 * If set as separator it will display separator theme, so won't display
72 * icons or label.
73 *
74 * @see elm_list_item_separator_get()
75 *
76 * @ingroup List
77 */
78EAPI void elm_list_item_separator_set(Elm_Object_Item *it, Eina_Bool setting); 28EAPI void elm_list_item_separator_set(Elm_Object_Item *it, Eina_Bool setting);
79 29
80/**
81 * Get a value whether item is a separator or not.
82 *
83 * @see elm_list_item_separator_set() for details.
84 *
85 * @param it The list item.
86 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
87 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
88 *
89 * @ingroup List
90 */
91EAPI Eina_Bool elm_list_item_separator_get(const Elm_Object_Item *it); 30EAPI Eina_Bool elm_list_item_separator_get(const Elm_Object_Item *it);
92 31
93/**
94 * Show @p item in the list view.
95 *
96 * @param it The list item to be shown.
97 *
98 * It won't animate list until item is visible. If such behavior is wanted,
99 * use elm_list_bring_in() instead.
100 *
101 * @ingroup List
102 */
103EAPI void elm_list_item_show(Elm_Object_Item *it); 32EAPI void elm_list_item_show(Elm_Object_Item *it);
104 33
105/**
106 * Bring in the given item to list view.
107 *
108 * @param it The item.
109 *
110 * This causes list to jump to the given item @p item and show it
111 * (by scrolling), if it is not fully visible.
112 *
113 * This may use animation to do so and take a period of time.
114 *
115 * If animation isn't wanted, elm_list_item_show() can be used.
116 *
117 * @ingroup List
118 */
119EAPI void elm_list_item_bring_in(Elm_Object_Item *it); 34EAPI void elm_list_item_bring_in(Elm_Object_Item *it);
120 35
121/**
122 * Get the real Evas(Edje) object created to implement the view of a given
123 * list @p item.
124 *
125 * @param it The list item
126 * @return The base Edje object associated with @p it.
127 *
128 * Base object is the @c Evas_Object that represents that item.
129 *
130 * @ingroup List
131 */
132EAPI Evas_Object *elm_list_item_object_get(const Elm_Object_Item *it); 36EAPI Evas_Object *elm_list_item_object_get(const Elm_Object_Item *it);
133 37
134/**
135 * Get the item before @p it in list.
136 *
137 * @param it The list item.
138 * @return The item before @p it, or @c NULL if none or on failure.
139 *
140 * @note If it is the first item, @c NULL will be returned.
141 *
142 * @see elm_list_item_append()
143 * @see elm_list_items_get()
144 *
145 * @ingroup List
146 */
147EAPI Elm_Object_Item *elm_list_item_prev(const Elm_Object_Item *it); 38EAPI Elm_Object_Item *elm_list_item_prev(const Elm_Object_Item *it);
148 39
149/**
150 * Get the item after @p it in list.
151 *
152 * @param it The list item.
153 * @return The item after @p it, or @c NULL if none or on failure.
154 *
155 * @note If it is the last item, @c NULL will be returned.
156 *
157 * @see elm_list_item_append()
158 * @see elm_list_items_get()
159 *
160 * @ingroup List
161 */
162EAPI Elm_Object_Item *elm_list_item_next(const Elm_Object_Item *it); 40EAPI Elm_Object_Item *elm_list_item_next(const Elm_Object_Item *it);
163 41
diff --git a/src/lib/elm_list_item.eo b/src/lib/elm_list_item.eo
new file mode 100644
index 000000000..94628d358
--- /dev/null
+++ b/src/lib/elm_list_item.eo
@@ -0,0 +1,170 @@
1class Elm_List_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_list_item;
5 properties {
6 separator {
7 get {
8 /*@
9 Get a value whether item is a separator or not.
10
11 @see elm_list_item_separator_set() for details.
12
13 @ingroup List
14 */
15 }
16 set {
17 /*@
18 Set or unset item as a separator.
19
20 Items aren't set as separator by default.
21
22 If set as separator it will display separator theme, so won't display
23 icons or label.
24
25 @see elm_list_item_separator_get()
26
27 @ingroup List
28 */
29 }
30 values {
31 Eina_Bool setting; /*@ @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
32 indicates it's not. */
33 }
34 }
35 selected {
36 get {
37 /*
38 Get whether the @p item is selected or not.
39
40 @see elm_list_selected_item_set() for details.
41 @see elm_list_item_selected_get()
42
43 @ingroup List
44 */
45 }
46 set {
47 /*@
48 Set the selected state of an item.
49
50 This sets the selected state of the given item @p it.
51 @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
52
53 If a new item is selected the previously selected will be unselected,
54 unless multiple selection is enabled with elm_list_multi_select_set().
55 Previously selected item can be get with function
56 elm_list_selected_item_get().
57
58 Selected items will be highlighted.
59
60 @see elm_list_item_selected_get()
61 @see elm_list_selected_item_get()
62 @see elm_list_multi_select_set()
63
64 @ingroup List
65 */
66 }
67 values {
68 Eina_Bool selected; /*@ the selected state (@c EINA_TRUE selected, @c EINA_FALSE not selected) */
69 }
70 }
71 object {
72 get {
73 /*@
74 Get the real Evas(Edje) object created to implement the view of a given
75 list @p item.
76
77 Base object is the @c Evas_Object that represents that item.
78
79 @ingroup List
80 */
81 }
82 values {
83 Evas_Object *obj; /*@ The base Edje object associated with @p it. */
84 }
85 }
86 prev {
87 get {
88 /*@
89 Get the item before @p it in list.
90
91 @note If it is the first item, @c NULL will be returned.
92
93 @see elm_list_item_append()
94 @see elm_list_items_get()
95
96 @ingroup List
97 */
98 /*legacy: elm_list_item_prev;*/
99 }
100 values {
101 Elm_Object_Item *item; /*@ The item before @p it, or @c NULL if none or on failure. */
102 }
103 }
104 next {
105 get {
106 /*@
107 Get the item after @p it in list.
108
109 @note If it is the last item, @c NULL will be returned.
110
111 @see elm_list_item_append()
112 @see elm_list_items_get()
113
114 @ingroup List
115 */
116 /*legacy: elm_list_item_next;*/
117 }
118 values {
119 Elm_Object_Item *item; /*@ The item after @p it, or @c NULL if none or on failure. */
120 }
121 }
122 }
123 methods {
124 /* init { FIXME
125 params {
126 Evas_Smart_Cb func;
127 const(void)* data;
128 }
129 }*/
130 show {
131 /*@
132 Show @p item in the list view.
133
134 It won't animate list until item is visible. If such behavior is wanted,
135 use elm_list_bring_in() instead.
136
137 @ingroup List
138 */
139 }
140 bring_in {
141 /*@
142 Bring in the given item to list view.
143
144 This causes list to jump to the given item @p item and show it
145 (by scrolling), if it is not fully visible.
146
147 This may use animation to do so and take a period of time.
148
149 If animation isn't wanted, elm_list_item_show() can be used.
150
151 @ingroup List
152 */
153 }
154 }
155 implements {
156 Eo.Base.constructor;
157 Elm_Widget_Item.disable;
158 Elm_Widget_Item.del_pre;
159 Elm_Widget_Item.signal_emit;
160 Elm_Widget_Item.focus.set;
161 Elm_Widget_Item.focus.get;
162 Elm_Widget_Item.part_text.get;
163 Elm_Widget_Item.part_text.set;
164 Elm_Widget_Item.part_content.get;
165 Elm_Widget_Item.part_content.set;
166 Elm_Widget_Item.part_content_unset;
167 }
168}
169
170
diff --git a/src/lib/elm_widget_list.h b/src/lib/elm_widget_list.h
index 1ba59c039..a2fc15e17 100644
--- a/src/lib/elm_widget_list.h
+++ b/src/lib/elm_widget_list.h
@@ -10,6 +10,7 @@
10 * IT AT RUNTIME. 10 * IT AT RUNTIME.
11 */ 11 */
12 12
13#include "elm_object_item_migration_temp.h"
13/** 14/**
14 * @addtogroup Widget 15 * @addtogroup Widget
15 * @{ 16 * @{
@@ -23,6 +24,7 @@
23 24
24#define ELM_LIST_SWIPE_MOVES 12 25#define ELM_LIST_SWIPE_MOVES 12
25 26
27typedef struct _Elm_List_Item_Data Elm_List_Item_Data;
26/** 28/**
27 * Base widget smart data extended with list instance data. 29 * Base widget smart data extended with list instance data.
28 */ 30 */
@@ -32,9 +34,9 @@ struct _Elm_List_Data
32 Evas_Object *box, *hit_rect; 34 Evas_Object *box, *hit_rect;
33 35
34 Eina_List *items, *selected, *to_delete; 36 Eina_List *items, *selected, *to_delete;
35 Elm_Object_Item *last_selected_item; 37 Elm_List_Item_Data *last_selected_item;
36 Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */ 38 Elm_List_Item_Data *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
37 Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */ 39 Elm_List_Item_Data *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
38 Evas_Coord minw[2], minh[2]; 40 Evas_Coord minw[2], minh[2];
39 Elm_Object_Select_Mode select_mode; 41 Elm_Object_Select_Mode select_mode;
40 Elm_Object_Multi_Select_Mode multi_select_mode; /**< select mode for multiple selection */ 42 Elm_Object_Multi_Select_Mode multi_select_mode; /**< select mode for multiple selection */
@@ -63,10 +65,9 @@ struct _Elm_List_Data
63 Eina_Bool item_looping_on : 1; 65 Eina_Bool item_looping_on : 1;
64}; 66};
65 67
66typedef struct _Elm_List_Item Elm_List_Item; 68struct _Elm_List_Item_Data
67struct _Elm_List_Item
68{ 69{
69 ELM_WIDGET_ITEM; 70 Elm_Widget_Item_Data *base;
70 71
71 Ecore_Timer *swipe_timer; 72 Ecore_Timer *swipe_timer;
72 Ecore_Timer *long_timer; 73 Ecore_Timer *long_timer;
@@ -120,21 +121,24 @@ struct _Elm_List_Item
120 return 121 return
121 122
122#define ELM_LIST_ITEM_CHECK(it) \ 123#define ELM_LIST_ITEM_CHECK(it) \
123 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 124 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
124 ELM_LIST_CHECK(it->base.widget); \ 125 ELM_LIST_CHECK(it->base->widget); \
125 if (((Elm_List_Item *)it)->deleted) \ 126 if (((Elm_List_Item_Data *)it)->deleted) \
126 { \ 127 { \
127 ERR("ERROR: " #it " has been DELETED.\n"); \ 128 ERR("ERROR: " #it " has been DELETED.\n"); \
128 return; \ 129 return; \
129 } 130 }
130 131
131#define ELM_LIST_ITEM_CHECK_OR_RETURN(it, ...) \ 132#define ELM_LIST_ITEM_CHECK_OR_RETURN(it, ...) \
132 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 133 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
133 ELM_LIST_CHECK(it->base.widget) __VA_ARGS__; \ 134 ELM_LIST_CHECK(it->base->widget) __VA_ARGS__; \
134 if (((Elm_List_Item *)it)->deleted) \ 135 if (((Elm_List_Item_Data *)it)->deleted) \
135 { \ 136 { \
136 ERR("ERROR: " #it " has been DELETED.\n"); \ 137 ERR("ERROR: " #it " has been DELETED.\n"); \
137 return __VA_ARGS__; \ 138 return __VA_ARGS__; \
138 } 139 }
139 140
141#define ELM_LIST_ITEM_DATA_GET(o, sd) \
142 Elm_List_Item_Data* sd = eo_data_scope_get((Eo *)o, ELM_LIST_ITEM_CLASS)
143
140#endif 144#endif