summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-08-11 14:29:42 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commitda2848e67c773375c0fa8cca9a3ccf9d5666aaad (patch)
tree9d928007b64f67952011da5998a54a6b16a14a4e
parenta62119ca3ab9bec796220f3325ebfc5f527fe201 (diff)
Porting to Eo: Elm Gengrid Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elm_gengrid.c885
-rw-r--r--src/lib/elm_gengrid_item.eo248
-rw-r--r--src/lib/elm_widget_gengrid.h26
4 files changed, 787 insertions, 383 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index d0ea5eea2..72a1dac10 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -869,7 +869,9 @@ BUILT_SOURCES = \
869 elm_naviframe_item.eo.c \ 869 elm_naviframe_item.eo.c \
870 elm_naviframe_item.eo.h \ 870 elm_naviframe_item.eo.h \
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 \
874 elm_gengrid_item.eo.h
873 875
874elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 876elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
875elementaryeolianfiles_DATA = \ 877elementaryeolianfiles_DATA = \
@@ -976,7 +978,8 @@ elementaryeolianfiles_DATA = \
976 elm_index_item.eo \ 978 elm_index_item.eo \
977 elm_multibuttonentry_item.eo \ 979 elm_multibuttonentry_item.eo \
978 elm_naviframe_item.eo \ 980 elm_naviframe_item.eo \
979 elm_genlist_item.eo 981 elm_genlist_item.eo \
982 elm_gengrid_item.eo
980 983
981EXTRA_DIST += ${elementaryeolianfiles_DATA} 984EXTRA_DIST += ${elementaryeolianfiles_DATA}
982 985
@@ -1083,6 +1086,7 @@ nodist_includesunstable_HEADERS = \
1083 elm_multibuttonentry_item.eo.h \ 1086 elm_multibuttonentry_item.eo.h \
1084 elm_naviframe_item.eo.h \ 1087 elm_naviframe_item.eo.h \
1085 elm_genlist_item.eo.h \ 1088 elm_genlist_item.eo.h \
1089 elm_gengrid_item.eo.h \
1086 elm_ctxpopup_item.eo.h \ 1090 elm_ctxpopup_item.eo.h \
1087 elm_slideshow_item.eo.h \ 1091 elm_slideshow_item.eo.h \
1088 elm_layout.eo.legacy.h \ 1092 elm_layout.eo.legacy.h \
@@ -1160,7 +1164,8 @@ nodist_includesunstable_HEADERS = \
1160 elm_index_item.eo.legacy.h \ 1164 elm_index_item.eo.legacy.h \
1161 elm_multibuttonentry_item.eo.legacy.h \ 1165 elm_multibuttonentry_item.eo.legacy.h \
1162 elm_naviframe_item.eo.legacy.h \ 1166 elm_naviframe_item.eo.legacy.h \
1163 elm_genlist_item.eo.legacy.h 1167 elm_genlist_item.eo.legacy.h \
1168 elm_gengrid_item.eo.legacy.h
1164 1169
1165if HAVE_CXX11 1170if HAVE_CXX11
1166 1171
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index a118d7ff3..5026922ec 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.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#include <Elementary_Cursor.h> 7#include <Elementary_Cursor.h>
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_gengrid_item.eo.h"
21
19#define MY_PAN_CLASS ELM_GENGRID_PAN_CLASS 22#define MY_PAN_CLASS ELM_GENGRID_PAN_CLASS
20 23
21#define MY_PAN_CLASS_NAME "Elm_Gengrid_Pan" 24#define MY_PAN_CLASS_NAME "Elm_Gengrid_Pan"
@@ -120,7 +123,7 @@ _is_no_select(Elm_Gen_Item *it)
120EOLIAN static Elm_Object_Item * 123EOLIAN static Elm_Object_Item *
121_elm_gengrid_search_by_text_item_get(Eo *obj EINA_UNUSED, 124_elm_gengrid_search_by_text_item_get(Eo *obj EINA_UNUSED,
122 Elm_Gengrid_Data *sd, 125 Elm_Gengrid_Data *sd,
123 Elm_Object_Item *item_to_search_from, 126 Elm_Object_Item *eo_item_to_search_from,
124 const char *part_name, 127 const char *part_name,
125 const char *pattern, 128 const char *pattern,
126 Elm_Glob_Match_Flags flags) 129 Elm_Glob_Match_Flags flags)
@@ -140,19 +143,20 @@ _elm_gengrid_search_by_text_item_get(Eo *obj EINA_UNUSED,
140 if (flags & ELM_GLOB_MATCH_NOCASE) fnflags |= FNM_CASEFOLD; 143 if (flags & ELM_GLOB_MATCH_NOCASE) fnflags |= FNM_CASEFOLD;
141#endif 144#endif
142 145
146 ELM_GENGRID_ITEM_DATA_GET(eo_item_to_search_from, item_to_search_from);
143 start = (item_to_search_from) ? 147 start = (item_to_search_from) ?
144 EINA_INLIST_GET((Elm_Gen_Item *)item_to_search_from) : 148 EINA_INLIST_GET(item_to_search_from) :
145 sd->items; 149 sd->items;
146 EINA_INLIST_FOREACH(start, it) 150 EINA_INLIST_FOREACH(start, it)
147 { 151 {
148 if (!it->itc->func.text_get) continue; 152 if (!it->itc->func.text_get) continue;
149 str = it->itc->func.text_get((void *)it->base.data, 153 str = it->itc->func.text_get((void *)it->base->data,
150 WIDGET(it), part_name); 154 WIDGET(it), part_name);
151 if (!str) continue; 155 if (!str) continue;
152 if (!fnmatch(pattern, str, fnflags)) 156 if (!fnmatch(pattern, str, fnflags))
153 { 157 {
154 free(str); 158 free(str);
155 return (Elm_Object_Item *)it; 159 return EO_OBJ(it);
156 } 160 }
157 free(str); 161 free(str);
158 } 162 }
@@ -355,7 +359,7 @@ _item_unselect(Elm_Gen_Item *it)
355 return; 359 return;
356 360
357 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); 361 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
358 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, it); 362 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it));
359 363
360 evas_object_stack_below(VIEW(it), sd->stack); 364 evas_object_stack_below(VIEW(it), sd->stack);
361 365
@@ -363,8 +367,8 @@ _item_unselect(Elm_Gen_Item *it)
363 if (it->selected) 367 if (it->selected)
364 { 368 {
365 it->selected = EINA_FALSE; 369 it->selected = EINA_FALSE;
366 sd->selected = eina_list_remove(sd->selected, it); 370 sd->selected = eina_list_remove(sd->selected, EO_OBJ(it));
367 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it); 371 evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, EO_OBJ(it));
368 } 372 }
369} 373}
370 374
@@ -374,9 +378,10 @@ _item_mouse_in_cb(void *data,
374 Evas_Object *obj EINA_UNUSED, 378 Evas_Object *obj EINA_UNUSED,
375 void *event_info EINA_UNUSED) 379 void *event_info EINA_UNUSED)
376{ 380{
377 if (!elm_object_item_disabled_get(data) && 381 Elm_Gen_Item *it = data;
382 if (!elm_object_item_disabled_get(EO_OBJ(it)) &&
378 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN)) 383 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN))
379 elm_object_item_focus_set(data, EINA_TRUE); 384 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
380} 385}
381 386
382static void 387static void
@@ -404,7 +409,7 @@ _item_mouse_move_cb(void *data,
404 if ((it->dragging) && (it->down)) 409 if ((it->dragging) && (it->down))
405 { 410 {
406 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 411 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
407 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, it); 412 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG, EO_OBJ(it));
408 return; 413 return;
409 } 414 }
410 415
@@ -476,25 +481,25 @@ _item_mouse_move_cb(void *data,
476 { 481 {
477 if (ady > adx) 482 if (ady > adx)
478 evas_object_smart_callback_call 483 evas_object_smart_callback_call
479 (WIDGET(it), SIG_DRAG_START_UP, it); 484 (WIDGET(it), SIG_DRAG_START_UP, EO_OBJ(it));
480 else 485 else
481 { 486 {
482 if (dx < 0) 487 if (dx < 0)
483 evas_object_smart_callback_call(WIDGET(it), left_drag, it); 488 evas_object_smart_callback_call(WIDGET(it), left_drag, EO_OBJ(it));
484 } 489 }
485 } 490 }
486 else 491 else
487 { 492 {
488 if (ady > adx) 493 if (ady > adx)
489 evas_object_smart_callback_call 494 evas_object_smart_callback_call
490 (WIDGET(it), SIG_DRAG_START_DOWN, it); 495 (WIDGET(it), SIG_DRAG_START_DOWN, EO_OBJ(it));
491 else 496 else
492 { 497 {
493 if (dx < 0) 498 if (dx < 0)
494 evas_object_smart_callback_call(WIDGET(it), left_drag, it); 499 evas_object_smart_callback_call(WIDGET(it), left_drag, EO_OBJ(it));
495 else 500 else
496 evas_object_smart_callback_call 501 evas_object_smart_callback_call
497 (WIDGET(it), right_drag, it); 502 (WIDGET(it), right_drag, EO_OBJ(it));
498 } 503 }
499 } 504 }
500 } 505 }
@@ -507,10 +512,10 @@ _long_press_cb(void *data)
507 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 512 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
508 513
509 it->long_timer = NULL; 514 it->long_timer = NULL;
510 if (elm_widget_item_disabled_get(it) || (it->dragging)) 515 if (eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get()) || (it->dragging))
511 return ECORE_CALLBACK_CANCEL; 516 return ECORE_CALLBACK_CANCEL;
512 sd->longpressed = EINA_TRUE; 517 sd->longpressed = EINA_TRUE;
513 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it); 518 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, EO_OBJ(it));
514 519
515 if (sd->reorder_mode) 520 if (sd->reorder_mode)
516 { 521 {
@@ -540,7 +545,7 @@ _item_highlight(Elm_Gen_Item *it)
540 return; 545 return;
541 546
542 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 547 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
543 evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it); 548 evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, EO_OBJ(it));
544 549
545 selectraise = edje_object_data_get(VIEW(it), "selectraise"); 550 selectraise = edje_object_data_get(VIEW(it), "selectraise");
546 if ((selectraise) && (!strcmp(selectraise, "on"))) 551 if ((selectraise) && (!strcmp(selectraise, "on")))
@@ -580,11 +585,11 @@ _item_mouse_down_cb(void *data,
580 it->highlight_cb(it); 585 it->highlight_cb(it);
581 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 586 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
582 { 587 {
583 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it); 588 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, EO_OBJ(it));
584 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); 589 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, EO_OBJ(it));
585 } 590 }
586 591
587 evas_object_smart_callback_call(WIDGET(it), SIG_PRESSED, it); 592 evas_object_smart_callback_call(WIDGET(it), SIG_PRESSED, EO_OBJ(it));
588 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 593 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
589 if (it->realized) 594 if (it->realized)
590 it->long_timer = ecore_timer_add 595 it->long_timer = ecore_timer_add
@@ -604,7 +609,7 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
604 609
605 evas_event_freeze(evas_object_evas_get(WIDGET(it))); 610 evas_event_freeze(evas_object_evas_get(WIDGET(it)));
606 if (!calc) 611 if (!calc)
607 evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, it); 612 evas_object_smart_callback_call(WIDGET(it), SIG_UNREALIZED, EO_OBJ(it));
608 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 613 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
609 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free); 614 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free);
610 ELM_SAFE_FREE(it->contents, elm_widget_stringlist_free); 615 ELM_SAFE_FREE(it->contents, elm_widget_stringlist_free);
@@ -613,7 +618,7 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
613 EINA_LIST_FREE(it->content_objs, content) 618 EINA_LIST_FREE(it->content_objs, content)
614 evas_object_del(content); 619 evas_object_del(content);
615 620
616 elm_widget_item_track_cancel(it); 621 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_track_cancel());
617 622
618 it->unrealize_cb(it); 623 it->unrealize_cb(it);
619 624
@@ -643,12 +648,12 @@ _item_mouse_up_cb(void *data,
643 sd->on_hold = EINA_TRUE; 648 sd->on_hold = EINA_TRUE;
644 else sd->on_hold = EINA_FALSE; 649 else sd->on_hold = EINA_FALSE;
645 650
646 evas_object_smart_callback_call(WIDGET(it), SIG_RELEASED, it); 651 evas_object_smart_callback_call(WIDGET(it), SIG_RELEASED, EO_OBJ(it));
647 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 652 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
648 if (it->dragging) 653 if (it->dragging)
649 { 654 {
650 it->dragging = EINA_FALSE; 655 it->dragging = EINA_FALSE;
651 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, it); 656 evas_object_smart_callback_call(WIDGET(it), SIG_DRAG_STOP, EO_OBJ(it));
652 dragged = EINA_TRUE; 657 dragged = EINA_TRUE;
653 } 658 }
654 if (sd->on_hold) 659 if (sd->on_hold)
@@ -661,7 +666,7 @@ _item_mouse_up_cb(void *data,
661 (sd->reorder_it)) 666 (sd->reorder_it))
662 { 667 {
663 evas_object_smart_callback_call 668 evas_object_smart_callback_call
664 (WIDGET(it), SIG_MOVED, sd->reorder_it); 669 (WIDGET(it), SIG_MOVED, EO_OBJ(sd->reorder_it));
665 sd->reorder_it = NULL; 670 sd->reorder_it = NULL;
666 sd->move_effect_enabled = EINA_FALSE; 671 sd->move_effect_enabled = EINA_FALSE;
667 ecore_job_del(sd->calc_job); 672 ecore_job_del(sd->calc_job);
@@ -687,10 +692,10 @@ _item_mouse_up_cb(void *data,
687 _elm_gengrid_item_unrealize(it, EINA_FALSE); 692 _elm_gengrid_item_unrealize(it, EINA_FALSE);
688 } 693 }
689 694
690 if (elm_widget_item_disabled_get(it) || (dragged)) return; 695 if (eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get()) || (dragged)) return;
691 696
692 if (sd->focused_item != (Elm_Object_Item *)it) 697 if (sd->focused_item != it)
693 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 698 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
694 699
695 if (sd->multi && 700 if (sd->multi &&
696 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) || 701 ((sd->multi_select_mode != ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL) ||
@@ -708,15 +713,22 @@ _item_mouse_up_cb(void *data,
708 if (!it->selected) 713 if (!it->selected)
709 { 714 {
710 while (sd->selected) 715 while (sd->selected)
711 it->unsel_cb(sd->selected->data); 716 {
717 Elm_Object_Item *eo_sel = sd->selected->data;
718 Elm_Gen_Item *sel = eo_data_scope_get((Eo *)eo_sel, ELM_GENGRID_ITEM_CLASS);
719 it->unsel_cb(sel);
720 }
712 } 721 }
713 else 722 else
714 { 723 {
715 const Eina_List *l, *l_next; 724 const Eina_List *l, *l_next;
716 Elm_Gen_Item *item2; 725 Elm_Object_Item *eo_item2;
717 726
718 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, item2) 727 EINA_LIST_FOREACH_SAFE(sd->selected, l, l_next, eo_item2)
719 if (item2 != it) it->unsel_cb(item2); 728 {
729 ELM_GENGRID_ITEM_DATA_GET(eo_item2, item2);
730 if (item2 != it) it->unsel_cb(item2);
731 }
720 } 732 }
721 it->highlight_cb(it); 733 it->highlight_cb(it);
722 it->sel_cb(it); 734 it->sel_cb(it);
@@ -728,7 +740,7 @@ _elm_gengrid_item_index_update(Elm_Gen_Item *it)
728{ 740{
729 if (it->position_update) 741 if (it->position_update)
730 { 742 {
731 evas_object_smart_callback_call(WIDGET(it), SIG_INDEX_UPDATE, it); 743 evas_object_smart_callback_call(WIDGET(it), SIG_INDEX_UPDATE, EO_OBJ(it));
732 it->position_update = EINA_FALSE; 744 it->position_update = EINA_FALSE;
733 } 745 }
734} 746}
@@ -757,7 +769,7 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
757 EINA_LIST_FOREACH(it->texts, l, key) 769 EINA_LIST_FOREACH(it->texts, l, key)
758 { 770 {
759 char *s = it->itc->func.text_get 771 char *s = it->itc->func.text_get
760 ((void *)it->base.data, WIDGET(it), key); 772 ((void *)it->base->data, WIDGET(it), key);
761 return s; 773 return s;
762 } 774 }
763 } 775 }
@@ -771,7 +783,7 @@ _access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
771 Elm_Gen_Item *it = (Elm_Gen_Item *)data; 783 Elm_Gen_Item *it = (Elm_Gen_Item *)data;
772 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL); 784 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
773 785
774 if (it->base.disabled) 786 if (it->base->disabled)
775 return strdup(E_("State: Disabled")); 787 return strdup(E_("State: Disabled"));
776 788
777 return NULL; 789 return NULL;
@@ -785,11 +797,11 @@ _access_on_highlight_cb(void *data)
785 Elm_Gen_Item *it = (Elm_Gen_Item *)data; 797 Elm_Gen_Item *it = (Elm_Gen_Item *)data;
786 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 798 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
787 799
788 evas_object_geometry_get(it->base.view, &x, &y, &w, &h); 800 evas_object_geometry_get(it->base->view, &x, &y, &w, &h);
789 801
790 evas_object_geometry_get(it->base.widget, &sx, &sy, &sw, &sh); 802 evas_object_geometry_get(it->base->widget, &sx, &sy, &sw, &sh);
791 if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh))) 803 if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
792 elm_gengrid_item_bring_in((Elm_Object_Item *)it, 804 elm_gengrid_item_bring_in(EO_OBJ(it),
793 ELM_GENGRID_ITEM_SCROLLTO_IN); 805 ELM_GENGRID_ITEM_SCROLLTO_IN);
794} 806}
795 807
@@ -798,9 +810,9 @@ _access_widget_item_register(Elm_Gen_Item *it)
798{ 810{
799 Elm_Access_Info *ai; 811 Elm_Access_Info *ai;
800 812
801 _elm_access_widget_item_register((Elm_Widget_Item_Data *)it); 813 _elm_access_widget_item_register(it->base);
802 814
803 ai = _elm_access_info_get(it->base.access_obj); 815 ai = _elm_access_info_get(it->base->access_obj);
804 816
805 _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Gengrid Item")); 817 _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Gengrid Item"));
806 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it); 818 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
@@ -861,7 +873,7 @@ _item_realize(Elm_Gen_Item *it)
861 EINA_LIST_FOREACH(it->texts, l, key) 873 EINA_LIST_FOREACH(it->texts, l, key)
862 { 874 {
863 char *s = it->itc->func.text_get 875 char *s = it->itc->func.text_get
864 ((void *)it->base.data, WIDGET(it), key); 876 ((void *)it->base->data, WIDGET(it), key);
865 if (s) 877 if (s)
866 { 878 {
867 edje_object_part_text_escaped_set(VIEW(it), key, s); 879 edje_object_part_text_escaped_set(VIEW(it), key, s);
@@ -880,7 +892,7 @@ _item_realize(Elm_Gen_Item *it)
880 (edje_object_data_get(VIEW(it), "contents")); 892 (edje_object_data_get(VIEW(it), "contents"));
881 EINA_LIST_FOREACH(it->contents, l, key) 893 EINA_LIST_FOREACH(it->contents, l, key)
882 { 894 {
883 ic = it->itc->func.content_get((void *)it->base.data, WIDGET(it), key); 895 ic = it->itc->func.content_get((void *)it->base->data, WIDGET(it), key);
884 if (ic) 896 if (ic)
885 { 897 {
886 it->content_objs = eina_list_append(it->content_objs, ic); 898 it->content_objs = eina_list_append(it->content_objs, ic);
@@ -901,7 +913,7 @@ _item_realize(Elm_Gen_Item *it)
901 EINA_LIST_FOREACH(it->states, l, key) 913 EINA_LIST_FOREACH(it->states, l, key)
902 { 914 {
903 Eina_Bool on = it->itc->func.state_get 915 Eina_Bool on = it->itc->func.state_get
904 ((void *)it->base.data, WIDGET(it), l->data); 916 ((void *)it->base->data, WIDGET(it), l->data);
905 if (on) 917 if (on)
906 { 918 {
907 snprintf(buf, sizeof(buf), "elm,state,%s,active", key); 919 snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
@@ -950,7 +962,7 @@ _item_realize(Elm_Gen_Item *it)
950 962
951 if (it->selected) 963 if (it->selected)
952 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 964 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
953 if (elm_widget_item_disabled_get(it)) 965 if (eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get()))
954 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); 966 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
955 } 967 }
956 edje_object_message_signal_process(VIEW(it)); 968 edje_object_message_signal_process(VIEW(it));
@@ -958,14 +970,15 @@ _item_realize(Elm_Gen_Item *it)
958 970
959 if (it->tooltip.content_cb) 971 if (it->tooltip.content_cb)
960 { 972 {
961 elm_widget_item_tooltip_content_cb_set 973 eo_do((Eo *)EO_OBJ(it),
962 (it, it->tooltip.content_cb, it->tooltip.data, NULL); 974 elm_wdg_item_tooltip_content_cb_set(
963 elm_widget_item_tooltip_style_set(it, it->tooltip.style); 975 it->tooltip.content_cb, it->tooltip.data, NULL),
964 elm_widget_item_tooltip_window_mode_set(it, it->tooltip.free_size); 976 elm_wdg_item_tooltip_style_set(it->tooltip.style),
977 elm_wdg_item_tooltip_window_mode_set(it->tooltip.free_size));
965 } 978 }
966 979
967 if (it->mouse_cursor) 980 if (it->mouse_cursor)
968 elm_widget_item_cursor_set(it, it->mouse_cursor); 981 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_cursor_set(it->mouse_cursor));
969 982
970 it->realized = EINA_TRUE; 983 it->realized = EINA_TRUE;
971 it->want_unrealize = EINA_FALSE; 984 it->want_unrealize = EINA_FALSE;
@@ -1194,7 +1207,7 @@ _item_place(Elm_Gen_Item *it,
1194 { 1207 {
1195 _item_realize(it); 1208 _item_realize(it);
1196 if (!was_realized) 1209 if (!was_realized)
1197 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it); 1210 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, EO_OBJ(it));
1198 if (it->parent) 1211 if (it->parent)
1199 { 1212 {
1200 if (wsd->horizontal) 1213 if (wsd->horizontal)
@@ -1388,7 +1401,7 @@ _group_item_place(Elm_Gengrid_Pan_Data *psd)
1388 { 1401 {
1389 _item_realize(it); 1402 _item_realize(it);
1390 if (!was_realized) 1403 if (!was_realized)
1391 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, it); 1404 evas_object_smart_callback_call(WIDGET(it), SIG_REALIZED, EO_OBJ(it));
1392 evas_object_move 1405 evas_object_move
1393 (VIEW(it), GG_IT(it)->gx, 1406 (VIEW(it), GG_IT(it)->gx,
1394 GG_IT(it)->gy); 1407 GG_IT(it)->gy);
@@ -1548,25 +1561,25 @@ _elm_gengrid_item_focused(Elm_Gen_Item *it)
1548 return; 1561 return;
1549 1562
1550 if (_is_no_select(it) || 1563 if (_is_no_select(it) ||
1551 (it == (Elm_Gen_Item *)sd->focused_item) || 1564 (it == sd->focused_item) ||
1552 (elm_widget_item_disabled_get(it))) 1565 (eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get())))
1553 return; 1566 return;
1554 1567
1555 switch (_elm_config->focus_autoscroll_mode) 1568 switch (_elm_config->focus_autoscroll_mode)
1556 { 1569 {
1557 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW: 1570 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
1558 elm_gengrid_item_show 1571 elm_gengrid_item_show
1559 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN); 1572 (EO_OBJ(it), ELM_GENGRID_ITEM_SCROLLTO_IN);
1560 break; 1573 break;
1561 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN: 1574 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
1562 elm_gengrid_item_bring_in 1575 elm_gengrid_item_bring_in
1563 ((Elm_Object_Item *)it, ELM_GENGRID_ITEM_SCROLLTO_IN); 1576 (EO_OBJ(it), ELM_GENGRID_ITEM_SCROLLTO_IN);
1564 break; 1577 break;
1565 default: 1578 default:
1566 break; 1579 break;
1567 } 1580 }
1568 1581
1569 sd->focused_item = (Elm_Object_Item *)it; 1582 sd->focused_item = it;
1570 1583
1571 if (elm_widget_focus_highlight_enabled_get(obj)) 1584 if (elm_widget_focus_highlight_enabled_get(obj))
1572 { 1585 {
@@ -1577,7 +1590,7 @@ _elm_gengrid_item_focused(Elm_Gen_Item *it)
1577 focus_raise = edje_object_data_get(VIEW(it), "focusraise"); 1590 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
1578 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 1591 if ((focus_raise) && (!strcmp(focus_raise, "on")))
1579 evas_object_raise(VIEW(it)); 1592 evas_object_raise(VIEW(it));
1580 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, it); 1593 evas_object_smart_callback_call(obj, SIG_ITEM_FOCUSED, EO_OBJ(it));
1581} 1594}
1582 1595
1583static void 1596static void
@@ -1593,7 +1606,7 @@ _elm_gengrid_item_unfocused(Elm_Gen_Item *it)
1593 return; 1606 return;
1594 1607
1595 if ((!sd->focused_item) || 1608 if ((!sd->focused_item) ||
1596 (it != (Elm_Gen_Item *)sd->focused_item)) 1609 (it != sd->focused_item))
1597 return; 1610 return;
1598 1611
1599 if (elm_widget_focus_highlight_enabled_get(obj)) 1612 if (elm_widget_focus_highlight_enabled_get(obj))
@@ -1603,7 +1616,7 @@ _elm_gengrid_item_unfocused(Elm_Gen_Item *it)
1603 } 1616 }
1604 1617
1605 sd->focused_item = NULL; 1618 sd->focused_item = NULL;
1606 evas_object_smart_callback_call(obj, SIG_ITEM_UNFOCUSED, it); 1619 evas_object_smart_callback_call(obj, SIG_ITEM_UNFOCUSED, EO_OBJ(it));
1607} 1620}
1608 1621
1609static Eina_Bool 1622static Eina_Bool
@@ -1617,25 +1630,26 @@ _item_focus_up(Elm_Gengrid_Data *sd)
1617 prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); 1630 prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
1618 while ((prev) && (prev->generation < sd->generation)) 1631 while ((prev) && (prev->generation < sd->generation))
1619 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); 1632 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
1620 elm_object_item_focus_set((Elm_Object_Item *)prev, EINA_TRUE); 1633 elm_object_item_focus_set(EO_OBJ(prev), EINA_TRUE);
1621 return EINA_TRUE; 1634 return EINA_TRUE;
1622 } 1635 }
1623 else 1636 else
1624 { 1637 {
1625 prev = (Elm_Gen_Item *)elm_gengrid_item_prev_get(sd->focused_item); 1638 Elm_Object_Item *eo_prev = elm_gengrid_item_prev_get(EO_OBJ(sd->focused_item));
1626 if (!prev) return EINA_FALSE; 1639 if (!eo_prev) return EINA_FALSE;
1627 if (prev == (Elm_Gen_Item *)sd->focused_item) return EINA_FALSE; 1640 prev = eo_data_scope_get((Eo *)eo_prev, ELM_GENGRID_ITEM_CLASS);
1641 if (prev == sd->focused_item) return EINA_FALSE;
1628 } 1642 }
1629 1643
1630 for (i = 1; i < sd->nmax; i++) 1644 for (i = 1; i < sd->nmax; i++)
1631 { 1645 {
1632 Elm_Object_Item *tmp = 1646 Elm_Object_Item *eo_tmp =
1633 elm_gengrid_item_prev_get((Elm_Object_Item *)prev); 1647 elm_gengrid_item_prev_get(EO_OBJ(prev));
1634 if (!tmp) return EINA_FALSE; 1648 if (!eo_tmp) return EINA_FALSE;
1635 prev = (Elm_Gen_Item *)tmp; 1649 prev = eo_data_scope_get((Eo *)eo_tmp, ELM_GENGRID_ITEM_CLASS);
1636 } 1650 }
1637 1651
1638 elm_object_item_focus_set((Elm_Object_Item *)prev, EINA_TRUE); 1652 elm_object_item_focus_set(EO_OBJ(prev), EINA_TRUE);
1639 1653
1640 return EINA_TRUE; 1654 return EINA_TRUE;
1641} 1655}
@@ -1652,25 +1666,26 @@ _item_focus_down(Elm_Gengrid_Data *sd)
1652 while ((next) && (next->generation < sd->generation)) 1666 while ((next) && (next->generation < sd->generation))
1653 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 1667 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
1654 1668
1655 elm_object_item_focus_set((Elm_Object_Item *)next, EINA_TRUE); 1669 elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE);
1656 return EINA_TRUE; 1670 return EINA_TRUE;
1657 } 1671 }
1658 else 1672 else
1659 { 1673 {
1660 next = (Elm_Gen_Item *)elm_gengrid_item_next_get(sd->focused_item); 1674 Elm_Object_Item *eo_next = elm_gengrid_item_next_get(EO_OBJ(sd->focused_item));
1661 if (!next) return EINA_FALSE; 1675 if (!eo_next) return EINA_FALSE;
1662 if (next == (Elm_Gen_Item *)sd->focused_item) return EINA_FALSE; 1676 next = eo_data_scope_get((Eo *)eo_next, ELM_GENGRID_ITEM_CLASS);
1677 if (next == sd->focused_item) return EINA_FALSE;
1663 } 1678 }
1664 1679
1665 for (i = 1; i < sd->nmax; i++) 1680 for (i = 1; i < sd->nmax; i++)
1666 { 1681 {
1667 Elm_Object_Item *tmp = 1682 Elm_Object_Item *eo_tmp =
1668 elm_gengrid_item_next_get((Elm_Object_Item *)next); 1683 elm_gengrid_item_next_get(EO_OBJ(next));
1669 if (!tmp) return EINA_FALSE; 1684 if (!eo_tmp) return EINA_FALSE;
1670 next = (Elm_Gen_Item *)tmp; 1685 next = eo_data_scope_get((Eo *)eo_tmp, ELM_GENGRID_ITEM_CLASS);
1671 } 1686 }
1672 1687
1673 elm_object_item_focus_set((Elm_Object_Item *)next, EINA_TRUE); 1688 elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE);
1674 1689
1675 return EINA_TRUE; 1690 return EINA_TRUE;
1676} 1691}
@@ -1688,12 +1703,13 @@ _item_focus_left(Elm_Gengrid_Data *sd)
1688 } 1703 }
1689 else 1704 else
1690 { 1705 {
1691 prev = (Elm_Gen_Item *)elm_gengrid_item_prev_get(sd->focused_item); 1706 Elm_Object_Item *eo_prev = elm_gengrid_item_prev_get(EO_OBJ(sd->focused_item));
1692 if (!prev) return EINA_FALSE; 1707 if (!eo_prev) return EINA_FALSE;
1693 if (prev == (Elm_Gen_Item *)sd->focused_item) return EINA_FALSE; 1708 prev = eo_data_scope_get((Eo *)eo_prev, ELM_GENGRID_ITEM_CLASS);
1709 if (prev == sd->focused_item) return EINA_FALSE;
1694 } 1710 }
1695 1711
1696 elm_object_item_focus_set((Elm_Object_Item *)prev, EINA_TRUE); 1712 elm_object_item_focus_set(EO_OBJ(prev), EINA_TRUE);
1697 1713
1698 return EINA_TRUE; 1714 return EINA_TRUE;
1699} 1715}
@@ -1711,12 +1727,13 @@ _item_focus_right(Elm_Gengrid_Data *sd)
1711 } 1727 }
1712 else 1728 else
1713 { 1729 {
1714 next = (Elm_Gen_Item *)elm_gengrid_item_next_get(sd->focused_item); 1730 Elm_Object_Item *eo_next = elm_gengrid_item_next_get(EO_OBJ(sd->focused_item));
1715 if (!next) return EINA_FALSE; 1731 if (!eo_next) return EINA_FALSE;
1716 if (next == (Elm_Gen_Item *)sd->focused_item) return EINA_FALSE; 1732 next = eo_data_scope_get((Eo *)eo_next, ELM_GENGRID_ITEM_CLASS);
1733 if (next == sd->focused_item) return EINA_FALSE;
1717 } 1734 }
1718 1735
1719 elm_object_item_focus_set((Elm_Object_Item *)next, EINA_TRUE); 1736 elm_object_item_focus_set(EO_OBJ(next), EINA_TRUE);
1720 1737
1721 return EINA_TRUE; 1738 return EINA_TRUE;
1722} 1739}
@@ -1724,24 +1741,25 @@ _item_focus_right(Elm_Gengrid_Data *sd)
1724static Eina_Bool 1741static Eina_Bool
1725_item_multi_select_left(Elm_Gengrid_Data *sd) 1742_item_multi_select_left(Elm_Gengrid_Data *sd)
1726{ 1743{
1727 Elm_Object_Item *prev; 1744 Elm_Object_Item *eo_prev;
1728 1745
1729 if (!sd->selected) return EINA_FALSE; 1746 if (!sd->selected) return EINA_FALSE;
1730 1747
1731 prev = elm_gengrid_item_prev_get(sd->last_selected_item); 1748 eo_prev = elm_gengrid_item_prev_get(EO_OBJ(sd->last_selected_item));
1732 if (!prev) return EINA_TRUE; 1749 if (!eo_prev) return EINA_TRUE;
1733 1750
1734 if (elm_gengrid_item_selected_get(prev)) 1751 if (elm_gengrid_item_selected_get(eo_prev))
1735 { 1752 {
1736 elm_gengrid_item_selected_set(sd->last_selected_item, EINA_FALSE); 1753 ELM_GENGRID_ITEM_DATA_GET(eo_prev, prev);
1754 elm_gengrid_item_selected_set(EO_OBJ(sd->last_selected_item), EINA_FALSE);
1737 sd->last_selected_item = prev; 1755 sd->last_selected_item = prev;
1738 elm_gengrid_item_show 1756 elm_gengrid_item_show
1739 (sd->last_selected_item, ELM_GENGRID_ITEM_SCROLLTO_IN); 1757 (eo_prev, ELM_GENGRID_ITEM_SCROLLTO_IN);
1740 } 1758 }
1741 else 1759 else
1742 { 1760 {
1743 elm_gengrid_item_selected_set(prev, EINA_TRUE); 1761 elm_gengrid_item_selected_set(eo_prev, EINA_TRUE);
1744 elm_gengrid_item_show(prev, ELM_GENGRID_ITEM_SCROLLTO_IN); 1762 elm_gengrid_item_show(eo_prev, ELM_GENGRID_ITEM_SCROLLTO_IN);
1745 } 1763 }
1746 1764
1747 return EINA_TRUE; 1765 return EINA_TRUE;
@@ -1750,24 +1768,25 @@ _item_multi_select_left(Elm_Gengrid_Data *sd)
1750static Eina_Bool 1768static Eina_Bool
1751_item_multi_select_right(Elm_Gengrid_Data *sd) 1769_item_multi_select_right(Elm_Gengrid_Data *sd)
1752{ 1770{
1753 Elm_Object_Item *next; 1771 Elm_Object_Item *eo_next;
1754 1772
1755 if (!sd->selected) return EINA_FALSE; 1773 if (!sd->selected) return EINA_FALSE;
1756 1774
1757 next = elm_gengrid_item_next_get(sd->last_selected_item); 1775 eo_next = elm_gengrid_item_next_get(EO_OBJ(sd->last_selected_item));
1758 if (!next) return EINA_TRUE; 1776 if (!eo_next) return EINA_TRUE;
1759 1777
1760 if (elm_gengrid_item_selected_get(next)) 1778 if (elm_gengrid_item_selected_get(eo_next))
1761 { 1779 {
1762 elm_gengrid_item_selected_set(sd->last_selected_item, EINA_FALSE); 1780 ELM_GENGRID_ITEM_DATA_GET(eo_next, next);
1781 elm_gengrid_item_selected_set(EO_OBJ(sd->last_selected_item), EINA_FALSE);
1763 sd->last_selected_item = next; 1782 sd->last_selected_item = next;
1764 elm_gengrid_item_show 1783 elm_gengrid_item_show
1765 (sd->last_selected_item, ELM_GENGRID_ITEM_SCROLLTO_IN); 1784 (eo_next, ELM_GENGRID_ITEM_SCROLLTO_IN);
1766 } 1785 }
1767 else 1786 else
1768 { 1787 {
1769 elm_gengrid_item_selected_set(next, EINA_TRUE); 1788 elm_gengrid_item_selected_set(eo_next, EINA_TRUE);
1770 elm_gengrid_item_show(next, ELM_GENGRID_ITEM_SCROLLTO_IN); 1789 elm_gengrid_item_show(eo_next, ELM_GENGRID_ITEM_SCROLLTO_IN);
1771 } 1790 }
1772 1791
1773 return EINA_TRUE; 1792 return EINA_TRUE;
@@ -1807,8 +1826,10 @@ _all_items_deselect(Elm_Gengrid_Data *sd)
1807 if (!sd->selected) return EINA_FALSE; 1826 if (!sd->selected) return EINA_FALSE;
1808 1827
1809 while (sd->selected) 1828 while (sd->selected)
1810 elm_gengrid_item_selected_set 1829 {
1811 ((Elm_Object_Item *)sd->selected->data, EINA_FALSE); 1830 Elm_Object_Item *eo_it = sd->selected->data;
1831 elm_gengrid_item_selected_set(eo_it, EINA_FALSE);
1832 }
1812 1833
1813 return EINA_TRUE; 1834 return EINA_TRUE;
1814} 1835}
@@ -1817,10 +1838,10 @@ static Eina_Bool
1817_item_single_select_up(Elm_Gengrid_Data *sd) 1838_item_single_select_up(Elm_Gengrid_Data *sd)
1818{ 1839{
1819 unsigned int i; 1840 unsigned int i;
1820 Elm_Object_Item *prev; 1841 Elm_Gen_Item *prev;
1821 1842
1822 if (!sd->selected) 1843 if (!sd->selected)
1823 prev = (Elm_Object_Item *)ELM_GEN_ITEM_FROM_INLIST(sd->items->last); 1844 prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
1824 else 1845 else
1825 prev = sd->last_selected_item; 1846 prev = sd->last_selected_item;
1826 1847
@@ -1828,17 +1849,18 @@ _item_single_select_up(Elm_Gengrid_Data *sd)
1828 { 1849 {
1829 for (i = 0; i < sd->nmax; i++) 1850 for (i = 0; i < sd->nmax; i++)
1830 { 1851 {
1831 prev = elm_gengrid_item_prev_get((Elm_Object_Item *)prev); 1852 Elm_Object_Item *eo_prev = elm_gengrid_item_prev_get(EO_OBJ(prev));
1832 if (!prev) return EINA_FALSE; 1853 if (!eo_prev) return EINA_FALSE;
1854 prev = eo_data_scope_get((Eo *)eo_prev, ELM_GENGRID_ITEM_CLASS);
1833 } 1855 }
1834 1856
1835 if (!elm_object_item_disabled_get(prev)) break; 1857 if (!elm_object_item_disabled_get(EO_OBJ(prev))) break;
1836 } 1858 }
1837 1859
1838 if (!prev) return EINA_FALSE; 1860 if (!prev) return EINA_FALSE;
1839 1861
1840 _all_items_deselect(sd); 1862 _all_items_deselect(sd);
1841 elm_gengrid_item_selected_set(prev, EINA_TRUE); 1863 elm_gengrid_item_selected_set(EO_OBJ(prev), EINA_TRUE);
1842 1864
1843 return EINA_TRUE; 1865 return EINA_TRUE;
1844} 1866}
@@ -1847,10 +1869,10 @@ static Eina_Bool
1847_item_single_select_down(Elm_Gengrid_Data *sd) 1869_item_single_select_down(Elm_Gengrid_Data *sd)
1848{ 1870{
1849 unsigned int i; 1871 unsigned int i;
1850 Elm_Object_Item *next; 1872 Elm_Gen_Item *next;
1851 1873
1852 if (!sd->selected) 1874 if (!sd->selected)
1853 next = (Elm_Object_Item *)ELM_GEN_ITEM_FROM_INLIST(sd->items); 1875 next = ELM_GEN_ITEM_FROM_INLIST(sd->items);
1854 else 1876 else
1855 next = sd->last_selected_item; 1877 next = sd->last_selected_item;
1856 1878
@@ -1858,17 +1880,18 @@ _item_single_select_down(Elm_Gengrid_Data *sd)
1858 { 1880 {
1859 for (i = 0; i < sd->nmax; i++) 1881 for (i = 0; i < sd->nmax; i++)
1860 { 1882 {
1861 next = elm_gengrid_item_next_get((Elm_Object_Item *)next); 1883 Elm_Object_Item *eo_next = elm_gengrid_item_next_get(EO_OBJ(next));
1862 if (!next) return EINA_FALSE; 1884 if (!eo_next) return EINA_FALSE;
1885 next = eo_data_scope_get((Eo *)eo_next, ELM_GENGRID_ITEM_CLASS);
1863 } 1886 }
1864 1887
1865 if (!elm_object_item_disabled_get(next)) break; 1888 if (!elm_object_item_disabled_get(EO_OBJ(next))) break;
1866 } 1889 }
1867 1890
1868 if (!next) return EINA_FALSE; 1891 if (!next) return EINA_FALSE;
1869 1892
1870 _all_items_deselect(sd); 1893 _all_items_deselect(sd);
1871 elm_gengrid_item_selected_set(next, EINA_TRUE); 1894 elm_gengrid_item_selected_set(EO_OBJ(next), EINA_TRUE);
1872 1895
1873 return EINA_TRUE; 1896 return EINA_TRUE;
1874} 1897}
@@ -1882,25 +1905,27 @@ _item_single_select_left(Elm_Gengrid_Data *sd)
1882 { 1905 {
1883 prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); 1906 prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
1884 while ((prev) && (prev->generation < sd->generation) 1907 while ((prev) && (prev->generation < sd->generation)
1885 && elm_object_item_disabled_get((Elm_Object_Item *)prev)) 1908 && elm_object_item_disabled_get(EO_OBJ(prev)))
1886 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); 1909 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
1887 } 1910 }
1888 else 1911 else
1889 { 1912 {
1890 prev = (Elm_Gen_Item *)elm_gengrid_item_prev_get(sd->last_selected_item); 1913 Elm_Object_Item *eo_prev =
1891 while (prev) 1914 elm_gengrid_item_prev_get(EO_OBJ(sd->last_selected_item));
1915 while (eo_prev)
1892 { 1916 {
1893 if (!elm_object_item_disabled_get((Elm_Object_Item *)prev)) 1917 if (!elm_object_item_disabled_get(eo_prev))
1894 break; 1918 break;
1895 prev = (Elm_Gen_Item *)elm_gengrid_item_prev_get((Elm_Object_Item *)prev); 1919 eo_prev = elm_gengrid_item_prev_get(eo_prev);
1896 } 1920 }
1921 prev = eo_data_scope_get((Eo *)eo_prev, ELM_GENGRID_ITEM_CLASS);
1897 } 1922 }
1898 1923
1899 if (!prev) return EINA_FALSE; 1924 if (!prev) return EINA_FALSE;
1900 1925
1901 _all_items_deselect(sd); 1926 _all_items_deselect(sd);
1902 1927
1903 elm_gengrid_item_selected_set((Elm_Object_Item *)prev, EINA_TRUE); 1928 elm_gengrid_item_selected_set(EO_OBJ(prev), EINA_TRUE);
1904 1929
1905 return EINA_TRUE; 1930 return EINA_TRUE;
1906} 1931}
@@ -1914,53 +1939,56 @@ _item_single_select_right(Elm_Gengrid_Data *sd)
1914 { 1939 {
1915 next = ELM_GEN_ITEM_FROM_INLIST(sd->items); 1940 next = ELM_GEN_ITEM_FROM_INLIST(sd->items);
1916 while ((next) && (next->generation < sd->generation) 1941 while ((next) && (next->generation < sd->generation)
1917 && elm_object_item_disabled_get((Elm_Object_Item *)next)) 1942 && elm_object_item_disabled_get(EO_OBJ(next)))
1918 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 1943 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
1919 } 1944 }
1920 else 1945 else
1921 { 1946 {
1922 next = (Elm_Gen_Item *)elm_gengrid_item_next_get(sd->last_selected_item); 1947 Elm_Object_Item *eo_next =
1923 while (next) 1948 elm_gengrid_item_next_get(EO_OBJ(sd->last_selected_item));
1949 while (eo_next)
1924 { 1950 {
1925 if (!elm_object_item_disabled_get((Elm_Object_Item *)next)) 1951 if (!elm_object_item_disabled_get(eo_next))
1926 break; 1952 break;
1927 next = (Elm_Gen_Item *)elm_gengrid_item_next_get((Elm_Object_Item *)next); 1953 eo_next = elm_gengrid_item_next_get(eo_next);
1928 } 1954 }
1955 next = eo_data_scope_get((Eo *)eo_next, ELM_GENGRID_ITEM_CLASS);
1929 } 1956 }
1930 1957
1931 if (!next) return EINA_FALSE; 1958 if (!next) return EINA_FALSE;
1932 1959
1933 _all_items_deselect(sd); 1960 _all_items_deselect(sd);
1934 1961
1935 elm_gengrid_item_selected_set((Elm_Object_Item *)next, EINA_TRUE); 1962 elm_gengrid_item_selected_set(EO_OBJ(next), EINA_TRUE);
1936 1963
1937 return EINA_TRUE; 1964 return EINA_TRUE;
1938} 1965}
1939 1966
1940static Eina_Bool 1967static Eina_Bool
1941_elm_gengrid_item_edge_check(Elm_Object_Item *it, 1968_elm_gengrid_item_edge_check(Elm_Gen_Item *it,
1942 Elm_Focus_Direction dir) 1969 Elm_Focus_Direction dir)
1943{ 1970{
1944 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 1971 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1945 ELM_GENGRID_DATA_GET(WIDGET(it), sd); 1972 ELM_GENGRID_DATA_GET(WIDGET(it), sd);
1946 Evas_Coord ix = 0, iy = 0; //item's geometry 1973 Evas_Coord ix = 0, iy = 0; //item's geometry
1947 Evas_Coord cx = 0, cy = 0; //prev or next item's geometry 1974 Evas_Coord cx = 0, cy = 0; //prev or next item's geometry
1948 Elm_Object_Item *item = NULL; 1975 Elm_Object_Item *eo_item = NULL;
1949 Elm_Gen_Item *tmp = (Elm_Gen_Item *)it; 1976 Elm_Gen_Item *tmp = it;
1950 1977
1951 evas_object_geometry_get(VIEW(it), &ix, &iy, NULL, NULL); 1978 evas_object_geometry_get(VIEW(it), &ix, &iy, NULL, NULL);
1952 1979
1953 if (((sd->horizontal) && (dir == ELM_FOCUS_UP)) || 1980 if (((sd->horizontal) && (dir == ELM_FOCUS_UP)) ||
1954 ((!sd->horizontal) && (dir == ELM_FOCUS_LEFT))) 1981 ((!sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
1955 { 1982 {
1956 item = elm_gengrid_item_prev_get(it); 1983 eo_item = elm_gengrid_item_prev_get(EO_OBJ(it));
1957 while (item) 1984 while (eo_item)
1958 { 1985 {
1959 if (sd->reorder_mode || !elm_object_item_disabled_get(item)) break; 1986 if (sd->reorder_mode || !elm_object_item_disabled_get(eo_item)) break;
1960 item = elm_gengrid_item_prev_get(item); 1987 eo_item = elm_gengrid_item_prev_get(eo_item);
1961 } 1988 }
1962 if (item) 1989 if (eo_item)
1963 { 1990 {
1991 ELM_GENGRID_ITEM_DATA_GET(eo_item, item);
1964 evas_object_geometry_get(VIEW(item), &cx, &cy, NULL, NULL); 1992 evas_object_geometry_get(VIEW(item), &cx, &cy, NULL, NULL);
1965 if (((sd->horizontal) && (ix == cx) && (iy > cy))|| 1993 if (((sd->horizontal) && (ix == cx) && (iy > cy))||
1966 ((!sd->horizontal) && (iy == cy) && (ix > cx))) 1994 ((!sd->horizontal) && (iy == cy) && (ix > cx)))
@@ -1968,20 +1996,21 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1968 else 1996 else
1969 return EINA_TRUE; 1997 return EINA_TRUE;
1970 } 1998 }
1971 if ((dir == ELM_FOCUS_UP) || (!item && sd->reorder_mode)) 1999 if ((dir == ELM_FOCUS_UP) || (!eo_item && sd->reorder_mode))
1972 return EINA_TRUE; 2000 return EINA_TRUE;
1973 } 2001 }
1974 else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) || 2002 else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) ||
1975 ((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT))) 2003 ((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT)))
1976 { 2004 {
1977 item = elm_gengrid_item_next_get(it); 2005 eo_item = elm_gengrid_item_next_get(EO_OBJ(it));
1978 while (item) 2006 while (eo_item)
1979 { 2007 {
1980 if (sd->reorder_mode || !elm_object_item_disabled_get(item)) break; 2008 if (sd->reorder_mode || !elm_object_item_disabled_get(eo_item)) break;
1981 item = elm_gengrid_item_next_get(item); 2009 eo_item = elm_gengrid_item_next_get(eo_item);
1982 } 2010 }
1983 if (item) 2011 if (eo_item)
1984 { 2012 {
2013 ELM_GENGRID_ITEM_DATA_GET(eo_item, item);
1985 evas_object_geometry_get(VIEW(item), &cx, &cy, NULL, NULL); 2014 evas_object_geometry_get(VIEW(item), &cx, &cy, NULL, NULL);
1986 if (((sd->horizontal) && (ix == cx) && (iy < cy)) || 2015 if (((sd->horizontal) && (ix == cx) && (iy < cy)) ||
1987 ((!sd->horizontal) && (iy == cy) && (ix < cx))) 2016 ((!sd->horizontal) && (iy == cy) && (ix < cx)))
@@ -1989,7 +2018,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
1989 else 2018 else
1990 return EINA_TRUE; 2019 return EINA_TRUE;
1991 } 2020 }
1992 if ((dir == ELM_FOCUS_DOWN) || (!item && sd->reorder_mode)) 2021 if ((dir == ELM_FOCUS_DOWN) || (!eo_item && sd->reorder_mode))
1993 return EINA_TRUE; 2022 return EINA_TRUE;
1994 } 2023 }
1995 else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) || 2024 else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) ||
@@ -2063,46 +2092,44 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
2063 return EINA_FALSE; 2092 return EINA_FALSE;
2064} 2093}
2065 2094
2066static Elm_Gen_Item * 2095static Elm_Object_Item *
2067get_up_item(Elm_Gengrid_Data *sd, Elm_Object_Item *it) 2096get_up_item(Elm_Gengrid_Data *sd, Elm_Gen_Item *it)
2068{ 2097{
2069 Elm_Gen_Item *prev = NULL; 2098 Elm_Object_Item *eo_prev = NULL;
2070 unsigned int i; 2099 unsigned int i;
2071 2100
2072 prev = (Elm_Gen_Item *)elm_gengrid_item_prev_get(it); 2101 eo_prev = elm_gengrid_item_prev_get(EO_OBJ(it));
2073 if (!prev) 2102 if (!eo_prev)
2074 return prev; 2103 return NULL;
2075 2104
2076 for (i = 1; i < sd->nmax; i++) 2105 for (i = 1; i < sd->nmax; i++)
2077 { 2106 {
2078 Elm_Object_Item *tmp = 2107 Elm_Object_Item *eo_tmp = elm_gengrid_item_prev_get(eo_prev);
2079 elm_gengrid_item_prev_get((Elm_Object_Item *)prev); 2108 if (!eo_tmp) return eo_prev;
2080 if (!tmp) return prev; 2109 eo_prev = eo_tmp;
2081 prev = (Elm_Gen_Item *)tmp;
2082 } 2110 }
2083 2111
2084 return prev; 2112 return eo_prev;
2085} 2113}
2086 2114
2087static Elm_Gen_Item * 2115static Elm_Object_Item *
2088get_down_item(Elm_Gengrid_Data *sd, Elm_Object_Item *it) 2116get_down_item(Elm_Gengrid_Data *sd, Elm_Gen_Item *it)
2089{ 2117{
2090 Elm_Gen_Item *next = NULL; 2118 Elm_Object_Item *eo_next = NULL;
2091 unsigned int i; 2119 unsigned int i;
2092 2120
2093 next = (Elm_Gen_Item *)elm_gengrid_item_next_get(it); 2121 eo_next = elm_gengrid_item_next_get(EO_OBJ(it));
2094 if (!next) 2122 if (!eo_next)
2095 return next; 2123 return NULL;
2096 2124
2097 for (i = 1; i < sd->nmax; i++) 2125 for (i = 1; i < sd->nmax; i++)
2098 { 2126 {
2099 Elm_Object_Item *tmp = 2127 Elm_Object_Item *eo_tmp = elm_gengrid_item_next_get(eo_next);
2100 elm_gengrid_item_next_get((Elm_Object_Item *)next); 2128 if (!eo_tmp) return eo_next;
2101 if (!tmp) return next; 2129 eo_next = eo_tmp;
2102 next = (Elm_Gen_Item *)tmp;
2103 } 2130 }
2104 2131
2105 return next; 2132 return eo_next;
2106} 2133}
2107 2134
2108typedef struct _Item_Info 2135typedef struct _Item_Info
@@ -2185,7 +2212,7 @@ _anim_end(Elm_Gengrid_Data *sd)
2185 else if ((!sd->horizontal && (sd->reorder.dir == ELM_FOCUS_LEFT)) || 2212 else if ((!sd->horizontal && (sd->reorder.dir == ELM_FOCUS_LEFT)) ||
2186 (sd->horizontal && (sd->reorder.dir == ELM_FOCUS_UP))) 2213 (sd->horizontal && (sd->reorder.dir == ELM_FOCUS_UP)))
2187 { 2214 {
2188 if (!((Elm_Gen_Item *)sd->reorder.it2 == it1_prev)) 2215 if (!(sd->reorder.it2 == it1_prev))
2189 { 2216 {
2190 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1)); 2217 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
2191 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2)); 2218 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
@@ -2218,7 +2245,7 @@ _anim_end(Elm_Gengrid_Data *sd)
2218 else if ((!sd->horizontal && (sd->reorder.dir == ELM_FOCUS_RIGHT)) || 2245 else if ((!sd->horizontal && (sd->reorder.dir == ELM_FOCUS_RIGHT)) ||
2219 (sd->horizontal && (sd->reorder.dir == ELM_FOCUS_DOWN))) 2246 (sd->horizontal && (sd->reorder.dir == ELM_FOCUS_DOWN)))
2220 { 2247 {
2221 if (!((Elm_Gen_Item *)sd->reorder.it1 == it2_prev)) 2248 if (!(sd->reorder.it1 == it2_prev))
2222 { 2249 {
2223 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1)); 2250 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it1));
2224 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2)); 2251 sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(sd->reorder.it2));
@@ -2315,10 +2342,10 @@ _item_move_cb(void *data, double pos)
2315 _anim_end(sd); 2342 _anim_end(sd);
2316 if (sd->reorder.type == ELM_GENGRID_REORDER_TYPE_NORMAL) 2343 if (sd->reorder.type == ELM_GENGRID_REORDER_TYPE_NORMAL)
2317 _free_reorder_normal_data(sd->reorder.data); 2344 _free_reorder_normal_data(sd->reorder.data);
2318 elm_gengrid_item_show((Elm_Object_Item *)sd->reorder.it1, 2345 elm_gengrid_item_show(EO_OBJ(sd->reorder.it1),
2319 ELM_GENGRID_ITEM_SCROLLTO_IN); 2346 ELM_GENGRID_ITEM_SCROLLTO_IN);
2320 evas_object_smart_callback_call(sd->obj, SIG_ITEM_REORDER_STOP, 2347 evas_object_smart_callback_call(sd->obj, SIG_ITEM_REORDER_STOP,
2321 sd->reorder.it1); 2348 EO_OBJ(sd->reorder.it1));
2322 sd->reorder.running = EINA_FALSE; 2349 sd->reorder.running = EINA_FALSE;
2323 } 2350 }
2324 _elm_widget_focus_highlight_start(sd->obj); 2351 _elm_widget_focus_highlight_start(sd->obj);
@@ -2444,7 +2471,7 @@ _swap_items(Elm_Gen_Item *it1, Elm_Gen_Item *it2, Elm_Focus_Direction dir)
2444 } 2471 }
2445 evas_object_raise(VIEW(it1)); 2472 evas_object_raise(VIEW(it1));
2446 evas_object_smart_callback_call(sd->obj, SIG_ITEM_REORDER_START, 2473 evas_object_smart_callback_call(sd->obj, SIG_ITEM_REORDER_START,
2447 sd->reorder.it1); 2474 EO_OBJ(sd->reorder.it1));
2448 //TODO: Add elm config for time 2475 //TODO: Add elm config for time
2449 ecore_animator_timeline_add(0.3, _item_move_cb, sd); 2476 ecore_animator_timeline_add(0.3, _item_move_cb, sd);
2450} 2477}
@@ -2453,10 +2480,12 @@ static Eina_Bool
2453_item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir) 2480_item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
2454{ 2481{
2455 ELM_GENGRID_DATA_GET(obj, sd); 2482 ELM_GENGRID_DATA_GET(obj, sd);
2456 Elm_Object_Item *item; 2483 Elm_Object_Item *eo_item;
2484 Elm_Gen_Item *item;
2457 item = sd->focused_item; 2485 item = sd->focused_item;
2458 unsigned int counter, i; 2486 unsigned int counter, i;
2459 2487
2488 eo_item = EO_OBJ(item);
2460 if (sd->horizontal) 2489 if (sd->horizontal)
2461 { 2490 {
2462 if (dir == ELM_FOCUS_UP) 2491 if (dir == ELM_FOCUS_UP)
@@ -2464,12 +2493,13 @@ _item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
2464 counter = 0; 2493 counter = 0;
2465 while (!_elm_gengrid_item_edge_check(item, dir)) 2494 while (!_elm_gengrid_item_edge_check(item, dir))
2466 { 2495 {
2467 item = elm_gengrid_item_prev_get(item); 2496 eo_item = elm_gengrid_item_prev_get(eo_item);
2497 item = eo_data_scope_get((Eo *)eo_item, ELM_GENGRID_ITEM_CLASS);
2468 counter++; 2498 counter++;
2469 } 2499 }
2470 item = elm_gengrid_first_item_get(obj); 2500 eo_item = elm_gengrid_first_item_get(obj);
2471 for (i = 0; i < counter; i++) 2501 for (i = 0; i < counter; i++)
2472 item = elm_gengrid_item_next_get(item); 2502 eo_item = elm_gengrid_item_next_get(eo_item);
2473 } 2503 }
2474 else 2504 else
2475 { 2505 {
@@ -2480,7 +2510,8 @@ _item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
2480 else 2510 else
2481 { 2511 {
2482 for (i = 0; i < sd->nmax; i++) 2512 for (i = 0; i < sd->nmax; i++)
2483 item = elm_gengrid_item_next_get(item); 2513 eo_item = elm_gengrid_item_next_get(eo_item);
2514 item = eo_data_scope_get((Eo *)eo_item, ELM_GENGRID_ITEM_CLASS);
2484 } 2515 }
2485 } 2516 }
2486 } 2517 }
@@ -2491,32 +2522,35 @@ _item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
2491 { 2522 {
2492 while (!_elm_gengrid_item_edge_check(item, dir)) 2523 while (!_elm_gengrid_item_edge_check(item, dir))
2493 { 2524 {
2494 if (!elm_gengrid_item_next_get(item)) 2525 if (!elm_gengrid_item_next_get(eo_item))
2495 break; 2526 break;
2496 item = elm_gengrid_item_next_get(item); 2527 eo_item = elm_gengrid_item_next_get(eo_item);
2528 item = eo_data_scope_get((Eo *)eo_item, ELM_GENGRID_ITEM_CLASS);
2497 } 2529 }
2498 } 2530 }
2499 else if (dir == ELM_FOCUS_LEFT) 2531 else if (dir == ELM_FOCUS_LEFT)
2500 { 2532 {
2501 while (!_elm_gengrid_item_edge_check(item, dir)) 2533 while (!_elm_gengrid_item_edge_check(item, dir))
2502 { 2534 {
2503 if (!elm_gengrid_item_prev_get(item)) 2535 if (!elm_gengrid_item_prev_get(EO_OBJ(item)))
2504 break; 2536 break;
2505 item = elm_gengrid_item_prev_get(item); 2537 eo_item = elm_gengrid_item_prev_get(eo_item);
2538 item = eo_data_scope_get((Eo *)eo_item, ELM_GENGRID_ITEM_CLASS);
2506 } 2539 }
2507 } 2540 }
2508 else 2541 else
2509 return EINA_FALSE; 2542 return EINA_FALSE;
2510 } 2543 }
2511 if (!item) return EINA_FALSE; 2544 if (!eo_item) return EINA_FALSE;
2512 if (sd->reorder_mode && !(sd->focused_item == item)) 2545 if (sd->reorder_mode && !(EO_OBJ(sd->focused_item) == eo_item))
2513 { 2546 {
2514 _swap_items((Elm_Gen_Item *)sd->focused_item, (Elm_Gen_Item *)item, ELM_FOCUS_RIGHT); 2547 item = eo_data_scope_get((Eo *)eo_item, ELM_GENGRID_ITEM_CLASS);
2548 _swap_items(sd->focused_item, item, ELM_FOCUS_RIGHT);
2515 return EINA_TRUE; 2549 return EINA_TRUE;
2516 } 2550 }
2517 else 2551 else
2518 { 2552 {
2519 elm_gengrid_item_selected_set(item, EINA_TRUE); 2553 elm_gengrid_item_selected_set(eo_item, EINA_TRUE);
2520 return EINA_TRUE; 2554 return EINA_TRUE;
2521 } 2555 }
2522 return EINA_FALSE; 2556 return EINA_FALSE;
@@ -2551,7 +2585,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2551 { 2585 {
2552 if (sd->reorder_mode) 2586 if (sd->reorder_mode)
2553 { 2587 {
2554 Elm_Gen_Item *left; 2588 Elm_Object_Item *eo_left;
2555 2589
2556 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT)) 2590 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT))
2557 { 2591 {
@@ -2563,12 +2597,13 @@ _key_action_move(Evas_Object *obj, const char *params)
2563 return EINA_TRUE; 2597 return EINA_TRUE;
2564 } 2598 }
2565 if (!sd->horizontal) 2599 if (!sd->horizontal)
2566 left = (Elm_Gen_Item *)elm_gengrid_item_prev_get(sd->focused_item); 2600 eo_left = elm_gengrid_item_prev_get(EO_OBJ(sd->focused_item));
2567 else 2601 else
2568 left = get_up_item(sd, sd->focused_item); 2602 eo_left = get_up_item(sd, sd->focused_item);
2569 if (!left) 2603 if (!eo_left)
2570 return EINA_TRUE; 2604 return EINA_TRUE;
2571 _swap_items((Elm_Gen_Item *)sd->focused_item, left, ELM_FOCUS_LEFT); 2605 ELM_GENGRID_ITEM_DATA_GET(eo_left, left);
2606 _swap_items(sd->focused_item, left, ELM_FOCUS_LEFT);
2572 2607
2573 return EINA_TRUE; 2608 return EINA_TRUE;
2574 } 2609 }
@@ -2593,7 +2628,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2593 else 2628 else
2594 { 2629 {
2595 if (sd->focused_item && (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT) || 2630 if (sd->focused_item && (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT) ||
2596 !elm_gengrid_item_prev_get(sd->focused_item))) 2631 !elm_gengrid_item_prev_get(EO_OBJ(sd->focused_item))))
2597 { 2632 {
2598 if (sd->item_loop_enable) 2633 if (sd->item_loop_enable)
2599 { 2634 {
@@ -2631,7 +2666,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2631 { 2666 {
2632 if (sd->reorder_mode) 2667 if (sd->reorder_mode)
2633 { 2668 {
2634 Elm_Gen_Item *right; 2669 Elm_Object_Item *eo_right;
2635 2670
2636 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_RIGHT)) 2671 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_RIGHT))
2637 { 2672 {
@@ -2648,12 +2683,13 @@ _key_action_move(Evas_Object *obj, const char *params)
2648 return EINA_TRUE; 2683 return EINA_TRUE;
2649 } 2684 }
2650 if (!sd->horizontal) 2685 if (!sd->horizontal)
2651 right = (Elm_Gen_Item *)elm_gengrid_item_next_get(sd->focused_item); 2686 eo_right = elm_gengrid_item_next_get(EO_OBJ(sd->focused_item));
2652 else 2687 else
2653 right = get_down_item(sd, sd->focused_item); 2688 eo_right = get_down_item(sd, sd->focused_item);
2654 if (!right) 2689 if (!eo_right)
2655 return EINA_TRUE; 2690 return EINA_TRUE;
2656 _swap_items((Elm_Gen_Item *)sd->focused_item, right, ELM_FOCUS_RIGHT); 2691 ELM_GENGRID_ITEM_DATA_GET(eo_right, right);
2692 _swap_items(sd->focused_item, right, ELM_FOCUS_RIGHT);
2657 2693
2658 return EINA_TRUE; 2694 return EINA_TRUE;
2659 } 2695 }
@@ -2678,7 +2714,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2678 else 2714 else
2679 { 2715 {
2680 if (sd->focused_item && (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_RIGHT) || 2716 if (sd->focused_item && (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_RIGHT) ||
2681 !elm_gengrid_item_next_get(sd->focused_item))) 2717 !elm_gengrid_item_next_get(EO_OBJ(sd->focused_item))))
2682 { 2718 {
2683 if (sd->item_loop_enable) 2719 if (sd->item_loop_enable)
2684 { 2720 {
@@ -2716,17 +2752,18 @@ _key_action_move(Evas_Object *obj, const char *params)
2716 { 2752 {
2717 if (sd->reorder_mode) 2753 if (sd->reorder_mode)
2718 { 2754 {
2719 Elm_Gen_Item *up; 2755 Elm_Object_Item *eo_up;
2720 2756
2721 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_UP)) 2757 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_UP))
2722 return EINA_TRUE; 2758 return EINA_TRUE;
2723 if (!sd->horizontal) 2759 if (!sd->horizontal)
2724 up = get_up_item(sd, sd->focused_item); 2760 eo_up = get_up_item(sd, sd->focused_item);
2725 else 2761 else
2726 up = (Elm_Gen_Item *)elm_gengrid_item_prev_get(sd->focused_item); 2762 eo_up = elm_gengrid_item_prev_get(EO_OBJ(sd->focused_item));
2727 if (!up) 2763 if (!eo_up)
2728 return EINA_TRUE; 2764 return EINA_TRUE;
2729 _swap_items((Elm_Gen_Item *)sd->focused_item, up, ELM_FOCUS_UP); 2765 ELM_GENGRID_ITEM_DATA_GET(eo_up, up);
2766 _swap_items(sd->focused_item, up, ELM_FOCUS_UP);
2730 2767
2731 return EINA_TRUE; 2768 return EINA_TRUE;
2732 } 2769 }
@@ -2773,17 +2810,18 @@ _key_action_move(Evas_Object *obj, const char *params)
2773 { 2810 {
2774 if (sd->reorder_mode) 2811 if (sd->reorder_mode)
2775 { 2812 {
2776 Elm_Gen_Item *down; 2813 Elm_Object_Item *eo_down;
2777 2814
2778 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_DOWN)) 2815 if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_DOWN))
2779 return EINA_TRUE; 2816 return EINA_TRUE;
2780 if (!sd->horizontal) 2817 if (!sd->horizontal)
2781 down = get_down_item(sd, sd->focused_item); 2818 eo_down = get_down_item(sd, sd->focused_item);
2782 else 2819 else
2783 down = (Elm_Gen_Item *)elm_gengrid_item_next_get((Elm_Object_Item *)sd->focused_item); 2820 eo_down = elm_gengrid_item_next_get(EO_OBJ(sd->focused_item));
2784 if (!down) 2821 if (!eo_down)
2785 return EINA_TRUE; 2822 return EINA_TRUE;
2786 _swap_items((Elm_Gen_Item *)sd->focused_item, down, ELM_FOCUS_DOWN); 2823 ELM_GENGRID_ITEM_DATA_GET(eo_down, down);
2824 _swap_items(sd->focused_item, down, ELM_FOCUS_DOWN);
2787 2825
2788 return EINA_TRUE; 2826 return EINA_TRUE;
2789 } 2827 }
@@ -2887,12 +2925,13 @@ static Eina_Bool
2887_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED) 2925_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
2888{ 2926{
2889 ELM_GENGRID_DATA_GET(obj, sd); 2927 ELM_GENGRID_DATA_GET(obj, sd);
2890 Elm_Object_Item *it = NULL; 2928 Elm_Object_Item *eo_it = NULL;
2891 2929
2892 if (!sd->multi) 2930 if (!sd->multi)
2893 { 2931 {
2894 it = elm_object_focused_item_get(obj); 2932 eo_it = elm_object_focused_item_get(obj);
2895 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); 2933 ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
2934 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, eo_it);
2896 return EINA_TRUE; 2935 return EINA_TRUE;
2897 } 2936 }
2898 return EINA_FALSE; 2937 return EINA_FALSE;
@@ -2930,14 +2969,14 @@ _elm_gengrid_elm_widget_event(Eo *obj, Elm_Gengrid_Data *sd, Evas_Object *src, E
2930 * Or this searches the realized items and checks the nearest fully visible item 2969 * Or this searches the realized items and checks the nearest fully visible item
2931 * according to the given item's position. 2970 * according to the given item's position.
2932 */ 2971 */
2933static Elm_Object_Item * 2972static Elm_Gen_Item *
2934_elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it) 2973_elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Gen_Item *it)
2935{ 2974{
2936 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // gengrid viewport geometry 2975 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // gengrid viewport geometry
2937 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry 2976 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry
2938 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry 2977 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry
2939 Eina_List *item_list = NULL, *l = NULL; 2978 Eina_List *item_list = NULL, *l = NULL;
2940 Elm_Object_Item *item = NULL; 2979 Elm_Object_Item *eo_item = NULL;
2941 ELM_GENGRID_DATA_GET(obj, sd); 2980 ELM_GENGRID_DATA_GET(obj, sd);
2942 Eina_Bool search_next = EINA_FALSE; 2981 Eina_Bool search_next = EINA_FALSE;
2943 2982
@@ -2950,7 +2989,7 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
2950 2989
2951 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) 2990 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih))
2952 { 2991 {
2953 if (!elm_object_item_disabled_get(it)) 2992 if (!elm_object_item_disabled_get(EO_OBJ(it)))
2954 return it; 2993 return it;
2955 else 2994 else
2956 search_next = EINA_TRUE; 2995 search_next = EINA_TRUE;
@@ -2958,21 +2997,23 @@ _elm_gengrid_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
2958 2997
2959 if ((iy < vy) || search_next) 2998 if ((iy < vy) || search_next)
2960 { 2999 {
2961 EINA_LIST_FOREACH(item_list, l, item) 3000 EINA_LIST_FOREACH(item_list, l, eo_item)
2962 { 3001 {
3002 ELM_GENGRID_ITEM_DATA_GET(eo_item, item);
2963 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 3003 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
2964 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 3004 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
2965 !elm_object_item_disabled_get(item)) 3005 !elm_object_item_disabled_get(EO_OBJ(item)))
2966 return item; 3006 return item;
2967 } 3007 }
2968 } 3008 }
2969 else 3009 else
2970 { 3010 {
2971 EINA_LIST_REVERSE_FOREACH(item_list, l, item) 3011 EINA_LIST_REVERSE_FOREACH(item_list, l, eo_item)
2972 { 3012 {
3013 ELM_GENGRID_ITEM_DATA_GET(eo_item, item);
2973 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 3014 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
2974 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 3015 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
2975 !elm_object_item_disabled_get(item)) 3016 !elm_object_item_disabled_get(EO_OBJ(item)))
2976 return item; 3017 return item;
2977 } 3018 }
2978 } 3019 }
@@ -2983,7 +3024,7 @@ EOLIAN static Eina_Bool
2983_elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd) 3024_elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd)
2984{ 3025{
2985 Eina_Bool int_ret = EINA_FALSE; 3026 Eina_Bool int_ret = EINA_FALSE;
2986 Elm_Object_Item *it = NULL; 3027 Elm_Gen_Item *it = NULL;
2987 Eina_Bool is_sel = EINA_FALSE; 3028 Eina_Bool is_sel = EINA_FALSE;
2988 3029
2989 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus()); 3030 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
@@ -2991,7 +3032,10 @@ _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd)
2991 3032
2992 if (elm_widget_focus_get(obj) && (sd->selected) && 3033 if (elm_widget_focus_get(obj) && (sd->selected) &&
2993 (!sd->last_selected_item)) 3034 (!sd->last_selected_item))
2994 sd->last_selected_item = eina_list_data_get(sd->selected); 3035 {
3036 Elm_Object_Item *sel = eina_list_data_get(sd->selected);
3037 sd->last_selected_item = eo_data_scope_get((Eo *)sel, ELM_GENGRID_ITEM_CLASS);
3038 }
2995 3039
2996 if (elm_widget_focus_get(obj) && !sd->mouse_down) 3040 if (elm_widget_focus_get(obj) && !sd->mouse_down)
2997 { 3041 {
@@ -3002,7 +3046,9 @@ _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd)
3002 else if (_elm_config->first_item_focus_on_first_focus_in && 3046 else if (_elm_config->first_item_focus_on_first_focus_in &&
3003 elm_widget_focus_highlight_enabled_get(obj)) 3047 elm_widget_focus_highlight_enabled_get(obj))
3004 { 3048 {
3005 it = elm_gengrid_first_item_get(obj); 3049 Elm_Object_Item *eo_it = elm_gengrid_first_item_get(obj);
3050 if (eo_it) it = eo_data_scope_get((Eo *)eo_it, ELM_GENGRID_ITEM_CLASS);
3051 else it = NULL;
3006 is_sel = EINA_TRUE; 3052 is_sel = EINA_TRUE;
3007 } 3053 }
3008 3054
@@ -3012,9 +3058,9 @@ _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd)
3012 if (it) 3058 if (it)
3013 { 3059 {
3014 if (!_elm_config->item_select_on_focus_disable && is_sel) 3060 if (!_elm_config->item_select_on_focus_disable && is_sel)
3015 elm_gengrid_item_selected_set(it, EINA_TRUE); 3061 elm_gengrid_item_selected_set(EO_OBJ(it), EINA_TRUE);
3016 else 3062 else
3017 elm_object_item_focus_set(it, EINA_TRUE); 3063 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
3018 _elm_widget_focus_highlight_start(obj); 3064 _elm_widget_focus_highlight_start(obj);
3019 } 3065 }
3020 } 3066 }
@@ -3024,7 +3070,7 @@ _elm_gengrid_elm_widget_on_focus(Eo *obj, Elm_Gengrid_Data *sd)
3024 if (sd->focused_item) 3070 if (sd->focused_item)
3025 { 3071 {
3026 sd->last_focused_item = sd->focused_item; 3072 sd->last_focused_item = sd->focused_item;
3027 _elm_gengrid_item_unfocused((Elm_Gen_Item *)sd->focused_item); 3073 _elm_gengrid_item_unfocused(sd->focused_item);
3028 } 3074 }
3029 } 3075 }
3030 3076
@@ -3054,7 +3100,7 @@ _elm_gengrid_elm_widget_focus_next(Eo *obj, Elm_Gengrid_Data *sd, Elm_Focus_Dire
3054 EINA_INLIST_FOREACH(sd->items, it) 3100 EINA_INLIST_FOREACH(sd->items, it)
3055 { 3101 {
3056 if (it->realized) 3102 if (it->realized)
3057 items = eina_list_append(items, it->base.access_obj); 3103 items = eina_list_append(items, it->base->access_obj);
3058 } 3104 }
3059 3105
3060 return elm_widget_focus_list_next_get 3106 return elm_widget_focus_list_next_get
@@ -3077,7 +3123,7 @@ _mirrored_set(Evas_Object *obj,
3077 while (it) 3123 while (it)
3078 { 3124 {
3079 edje_object_mirrored_set(VIEW(it), rtl); 3125 edje_object_mirrored_set(VIEW(it), rtl);
3080 elm_gengrid_item_update((Elm_Object_Item *)it); 3126 elm_gengrid_item_update(EO_OBJ(it));
3081 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 3127 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
3082 } 3128 }
3083} 3129}
@@ -3112,22 +3158,22 @@ _elm_gengrid_item_del_not_serious(Elm_Gen_Item *it)
3112{ 3158{
3113 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 3159 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
3114 3160
3115 elm_widget_item_pre_notify_del(it); 3161 eo_do((Eo *)EO_OBJ(it), elm_wdg_item_pre_notify_del());
3116 it->generation = sd->generation - 1; /* This means that the item is deleted */ 3162 it->generation = sd->generation - 1; /* This means that the item is deleted */
3117 3163
3118 if (it->walking > 0) return; 3164 if (it->walking > 0) return;
3119 3165
3120 if (it->selected) 3166 if (it->selected)
3121 sd->selected = eina_list_remove(sd->selected, it); 3167 sd->selected = eina_list_remove(sd->selected, EO_OBJ(it));
3122 if (sd->last_selected_item == (Elm_Object_Item *)it) 3168 if (sd->last_selected_item == it)
3123 sd->last_selected_item = NULL; 3169 sd->last_selected_item = NULL;
3124 if (sd->focused_item == (Elm_Object_Item *)it) 3170 if (sd->focused_item == it)
3125 sd->focused_item = NULL; 3171 sd->focused_item = NULL;
3126 if (sd->last_focused_item == (Elm_Object_Item *)it) 3172 if (sd->last_focused_item == it)
3127 sd->last_focused_item = NULL; 3173 sd->last_focused_item = NULL;
3128 3174
3129 if (it->itc->func.del) 3175 if (it->itc->func.del)
3130 it->itc->func.del((void *)it->base.data, WIDGET(it)); 3176 it->itc->func.del((void *)it->base->data, WIDGET(it));
3131} 3177}
3132 3178
3133static void 3179static void
@@ -3252,34 +3298,30 @@ _elm_gengrid_item_compare(const void *data,
3252 cb = GG_IT(it)->wsd->item_compare_cb; 3298 cb = GG_IT(it)->wsd->item_compare_cb;
3253 else if (item1 && GG_IT(item1)->wsd->item_compare_cb) 3299 else if (item1 && GG_IT(item1)->wsd->item_compare_cb)
3254 cb = GG_IT(item1)->wsd->item_compare_cb; 3300 cb = GG_IT(item1)->wsd->item_compare_cb;
3255 if (cb && it && item1) return cb(it, item1); 3301 if (cb && it && item1) return cb(EO_OBJ(it), EO_OBJ(item1));
3256 d = (char *)data - (char *)data1; 3302 d = (char *)data - (char *)data1;
3257 if (d < 0) return -1; 3303 if (d < 0) return -1;
3258 if (!d) return 0; 3304 if (!d) return 0;
3259 return 1; 3305 return 1;
3260} 3306}
3261 3307
3262static void 3308EOLIAN static void
3263_item_disable_hook(Elm_Object_Item *item) 3309_elm_gengrid_item_elm_widget_item_disable(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
3264{ 3310{
3265 Elm_Gen_Item *it = (Elm_Gen_Item *)item;
3266
3267 if (it->generation < GG_IT(it)->wsd->generation) return; 3311 if (it->generation < GG_IT(it)->wsd->generation) return;
3268 3312
3269 if (it->realized) 3313 if (it->realized)
3270 { 3314 {
3271 if (elm_widget_item_disabled_get(it)) 3315 if (eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get()))
3272 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); 3316 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
3273 else 3317 else
3274 edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm"); 3318 edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
3275 } 3319 }
3276} 3320}
3277 3321
3278static Eina_Bool 3322EOLIAN static Eina_Bool
3279_item_del_pre_hook(Elm_Object_Item *item) 3323_elm_gengrid_item_elm_widget_item_del_pre(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
3280{ 3324{
3281 Elm_Gen_Item *it = (Elm_Gen_Item *)item;
3282
3283 if (it->walking > 0) 3325 if (it->walking > 0)
3284 { 3326 {
3285 _elm_gengrid_item_del_not_serious(it); 3327 _elm_gengrid_item_del_not_serious(it);
@@ -3290,31 +3332,27 @@ _item_del_pre_hook(Elm_Object_Item *item)
3290 return EINA_TRUE; 3332 return EINA_TRUE;
3291} 3333}
3292 3334
3293static Evas_Object * 3335EOLIAN static Evas_Object *
3294_item_content_get_hook(Elm_Gen_Item *it, 3336_elm_gengrid_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
3295 const char *part)
3296{ 3337{
3297 return edje_object_part_swallow_get(VIEW(it), part); 3338 return edje_object_part_swallow_get(VIEW(it), part);
3298} 3339}
3299 3340
3300static const char * 3341EOLIAN static const char *
3301_item_text_get_hook(Elm_Gen_Item *it, 3342_elm_gengrid_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char * part)
3302 const char *part)
3303{ 3343{
3304 if (!it->itc->func.text_get) return NULL; 3344 if (!it->itc->func.text_get) return NULL;
3305 return edje_object_part_text_get(VIEW(it), part); 3345 return edje_object_part_text_get(VIEW(it), part);
3306} 3346}
3307 3347
3308static void 3348EOLIAN static void
3309_item_signal_emit_hook(Elm_Object_Item *it, 3349_elm_gengrid_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char *emission, const char *source)
3310 const char *emission,
3311 const char *source)
3312{ 3350{
3313 edje_object_signal_emit(VIEW(it), emission, source); 3351 edje_object_signal_emit(VIEW(it), emission, source);
3314} 3352}
3315 3353
3316static void 3354EOLIAN static void
3317_item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused) 3355_elm_gengrid_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, Eina_Bool focused)
3318{ 3356{
3319 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 3357 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
3320 Evas_Object *obj = WIDGET(it); 3358 Evas_Object *obj = WIDGET(it);
@@ -3329,20 +3367,20 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
3329 if (it != sd->focused_item) 3367 if (it != sd->focused_item)
3330 { 3368 {
3331 if (sd->focused_item) 3369 if (sd->focused_item)
3332 _elm_gengrid_item_unfocused((Elm_Gen_Item *)sd->focused_item); 3370 _elm_gengrid_item_unfocused(sd->focused_item);
3333 _elm_gengrid_item_focused((Elm_Gen_Item *)it); 3371 _elm_gengrid_item_focused(it);
3334 3372
3335 _elm_widget_item_highlight_in_theme(obj, (Elm_Object_Item *)it); 3373 _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
3336 _elm_widget_highlight_in_theme_update(obj); 3374 _elm_widget_highlight_in_theme_update(obj);
3337 _elm_widget_focus_highlight_start(obj); 3375 _elm_widget_focus_highlight_start(obj);
3338 } 3376 }
3339 } 3377 }
3340 else 3378 else
3341 _elm_gengrid_item_unfocused((Elm_Gen_Item *)it); 3379 _elm_gengrid_item_unfocused(it);
3342} 3380}
3343 3381
3344static Eina_Bool 3382EOLIAN static Eina_Bool
3345_item_focus_get_hook(Elm_Object_Item *it) 3383_elm_gengrid_item_elm_widget_item_focus_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
3346{ 3384{
3347 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3385 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
3348 Evas_Object *obj = WIDGET(it); 3386 Evas_Object *obj = WIDGET(it);
@@ -3386,7 +3424,7 @@ _internal_elm_gengrid_clear(Evas_Object *obj,
3386 if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next); 3424 if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
3387 if (itn) itn->walking++; /* prevent early death of subitem */ 3425 if (itn) itn->walking++; /* prevent early death of subitem */
3388 it->del_cb(it); 3426 it->del_cb(it);
3389 elm_widget_item_free(it); 3427 eo_del((Eo *)EO_OBJ(it));
3390 if (itn) itn->walking--; 3428 if (itn) itn->walking--;
3391 } 3429 }
3392 } 3430 }
@@ -3424,7 +3462,7 @@ _item_select(Elm_Gen_Item *it)
3424 if (!it->selected) 3462 if (!it->selected)
3425 { 3463 {
3426 it->selected = EINA_TRUE; 3464 it->selected = EINA_TRUE;
3427 sd->selected = eina_list_append(sd->selected, it); 3465 sd->selected = eina_list_append(sd->selected, EO_OBJ(it));
3428 } 3466 }
3429 else if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS) && 3467 else if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS) &&
3430 (it->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS)) 3468 (it->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS))
@@ -3433,11 +3471,11 @@ _item_select(Elm_Gen_Item *it)
3433 evas_object_ref(obj); 3471 evas_object_ref(obj);
3434 it->walking++; 3472 it->walking++;
3435 sd->walking++; 3473 sd->walking++;
3436 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), it); 3474 if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), EO_OBJ(it));
3437 if (it->generation == sd->generation) 3475 if (it->generation == sd->generation)
3438 { 3476 {
3439 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, it); 3477 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, EO_OBJ(it));
3440 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 3478 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
3441 } 3479 }
3442 3480
3443 it->walking--; 3481 it->walking--;
@@ -3449,14 +3487,21 @@ _item_select(Elm_Gen_Item *it)
3449 if ((!it->walking) && (it->generation < sd->generation)) 3487 if ((!it->walking) && (it->generation < sd->generation))
3450 { 3488 {
3451 it->del_cb(it); 3489 it->del_cb(it);
3452 elm_widget_item_free(it); 3490 eo_del((Eo *)EO_OBJ(it));
3453 } 3491 }
3454 else 3492 else
3455 sd->last_selected_item = (Elm_Object_Item *)it; 3493 sd->last_selected_item = it;
3456 } 3494 }
3457 evas_object_unref(obj); 3495 evas_object_unref(obj);
3458} 3496}
3459 3497
3498EOLIAN static void
3499_elm_gengrid_item_eo_base_constructor(Eo *eo_it, Elm_Gen_Item *it)
3500{
3501 eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS, eo_constructor());
3502 it->base = eo_data_scope_get((Eo *)eo_it, ELM_WIDGET_ITEM_CLASS);
3503}
3504
3460static Elm_Gen_Item * 3505static Elm_Gen_Item *
3461_elm_gengrid_item_new(Elm_Gengrid_Data *sd, 3506_elm_gengrid_item_new(Elm_Gengrid_Data *sd,
3462 const Elm_Gen_Item_Class *itc, 3507 const Elm_Gen_Item_Class *itc,
@@ -3464,31 +3509,21 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd,
3464 Evas_Smart_Cb func, 3509 Evas_Smart_Cb func,
3465 const void *func_data) 3510 const void *func_data)
3466{ 3511{
3467 Elm_Gen_Item *it;
3468
3469 if (!itc) return NULL; 3512 if (!itc) return NULL;
3470 3513
3471 it = elm_widget_item_new(sd->obj, Elm_Gen_Item); 3514 Eo *eo_it = eo_add(ELM_GENGRID_ITEM_CLASS, sd->obj);
3472 if (!it) return NULL; 3515 if (!eo_it) return NULL;
3516 ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
3473 3517
3474 it->generation = sd->generation; 3518 it->generation = sd->generation;
3475 it->itc = itc; 3519 it->itc = itc;
3476 elm_gengrid_item_class_ref((Elm_Gengrid_Item_Class *)itc); 3520 elm_gengrid_item_class_ref((Elm_Gengrid_Item_Class *)itc);
3477 3521
3478 it->base.data = data; 3522 it->base->data = data;
3479 it->parent = NULL; 3523 it->parent = NULL;
3480 it->func.func = func; 3524 it->func.func = func;
3481 it->func.data = func_data; 3525 it->func.data = func_data;
3482 3526
3483 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
3484 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
3485 elm_widget_item_disable_hook_set(it, _item_disable_hook);
3486 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
3487 elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
3488 elm_widget_item_focus_set_hook_set(it, _item_focus_set_hook);
3489 elm_widget_item_focus_get_hook_set(it, _item_focus_get_hook);
3490
3491
3492 it->del_cb = (Ecore_Cb)_item_del; 3527 it->del_cb = (Ecore_Cb)_item_del;
3493 it->highlight_cb = (Ecore_Cb)_item_highlight; 3528 it->highlight_cb = (Ecore_Cb)_item_highlight;
3494 it->sel_cb = (Ecore_Cb)_item_select; 3529 it->sel_cb = (Ecore_Cb)_item_select;
@@ -3626,7 +3661,7 @@ _access_obj_process(Elm_Gengrid_Data * sd, Eina_Bool is_access)
3626 if (!it->realized) continue; 3661 if (!it->realized) continue;
3627 if (is_access) _access_widget_item_register(it); 3662 if (is_access) _access_widget_item_register(it);
3628 else 3663 else
3629 _elm_access_widget_item_unregister((Elm_Widget_Item_Data *)it); 3664 _elm_access_widget_item_unregister(it->base);
3630 3665
3631 } 3666 }
3632} 3667}
@@ -3742,7 +3777,7 @@ _elm_gengrid_item_append(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_C
3742 ecore_job_del(sd->calc_job); 3777 ecore_job_del(sd->calc_job);
3743 sd->calc_job = ecore_job_add(_calc_job, obj); 3778 sd->calc_job = ecore_job_add(_calc_job, obj);
3744 3779
3745 return (Elm_Object_Item *)it; 3780 return EO_OBJ(it);
3746} 3781}
3747 3782
3748EOLIAN static Elm_Object_Item* 3783EOLIAN static Elm_Object_Item*
@@ -3762,14 +3797,15 @@ _elm_gengrid_item_prepend(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_
3762 ecore_job_del(sd->calc_job); 3797 ecore_job_del(sd->calc_job);
3763 sd->calc_job = ecore_job_add(_calc_job, obj); 3798 sd->calc_job = ecore_job_add(_calc_job, obj);
3764 3799
3765 return (Elm_Object_Item *)it; 3800 return EO_OBJ(it);
3766} 3801}
3767 3802
3768EOLIAN static Elm_Object_Item* 3803EOLIAN static Elm_Object_Item*
3769_elm_gengrid_item_insert_before(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data) 3804_elm_gengrid_item_insert_before(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *eo_relative, Evas_Smart_Cb func, const void *func_data)
3770{ 3805{
3771 Elm_Gen_Item *it; 3806 Elm_Gen_Item *it;
3772 Eina_Inlist *tmp; 3807 Eina_Inlist *tmp;
3808 ELM_GENGRID_ITEM_DATA_GET(eo_relative, relative);
3773 3809
3774 ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL); 3810 ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL);
3775 3811
@@ -3777,25 +3813,26 @@ _elm_gengrid_item_insert_before(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid
3777 if (!it) return NULL; 3813 if (!it) return NULL;
3778 sd->items = eina_inlist_prepend_relative 3814 sd->items = eina_inlist_prepend_relative
3779 (sd->items, EINA_INLIST_GET(it), 3815 (sd->items, EINA_INLIST_GET(it),
3780 EINA_INLIST_GET((Elm_Gen_Item *)relative)); 3816 EINA_INLIST_GET(relative));
3781 tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it)); 3817 tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it));
3782 _item_position_update(tmp, ((Elm_Gen_Item *)relative)->position); 3818 _item_position_update(tmp, relative->position);
3783 3819
3784 if (it->group) 3820 if (it->group)
3785 sd->group_items = eina_list_append_relative 3821 sd->group_items = eina_list_append_relative
3786 (sd->group_items, it, ((Elm_Gen_Item *)relative)->parent); 3822 (sd->group_items, it, relative->parent);
3787 3823
3788 ecore_job_del(sd->calc_job); 3824 ecore_job_del(sd->calc_job);
3789 sd->calc_job = ecore_job_add(_calc_job, obj); 3825 sd->calc_job = ecore_job_add(_calc_job, obj);
3790 3826
3791 return (Elm_Object_Item *)it; 3827 return EO_OBJ(it);
3792} 3828}
3793 3829
3794EOLIAN static Elm_Object_Item* 3830EOLIAN static Elm_Object_Item*
3795_elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data) 3831_elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_Item_Class *itc, const void *data, Elm_Object_Item *eo_relative, Evas_Smart_Cb func, const void *func_data)
3796{ 3832{
3797 Elm_Gen_Item *it; 3833 Elm_Gen_Item *it;
3798 Eina_Inlist *tmp; 3834 Eina_Inlist *tmp;
3835 ELM_GENGRID_ITEM_DATA_GET(eo_relative, relative);
3799 3836
3800 ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL); 3837 ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL);
3801 3838
@@ -3803,18 +3840,18 @@ _elm_gengrid_item_insert_after(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid_
3803 if (!it) return NULL; 3840 if (!it) return NULL;
3804 sd->items = eina_inlist_append_relative 3841 sd->items = eina_inlist_append_relative
3805 (sd->items, EINA_INLIST_GET(it), 3842 (sd->items, EINA_INLIST_GET(it),
3806 EINA_INLIST_GET((Elm_Gen_Item *)relative)); 3843 EINA_INLIST_GET(relative));
3807 tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it)); 3844 tmp = eina_inlist_find(sd->items, EINA_INLIST_GET(it));
3808 _item_position_update(tmp, ((Elm_Gen_Item *)relative)->position + 1); 3845 _item_position_update(tmp, relative->position + 1);
3809 3846
3810 if (it->group) 3847 if (it->group)
3811 sd->group_items = eina_list_prepend_relative 3848 sd->group_items = eina_list_prepend_relative
3812 (sd->group_items, it, ((Elm_Gen_Item *)relative)->parent); 3849 (sd->group_items, it, relative->parent);
3813 3850
3814 ecore_job_del(sd->calc_job); 3851 ecore_job_del(sd->calc_job);
3815 sd->calc_job = ecore_job_add(_calc_job, obj); 3852 sd->calc_job = ecore_job_add(_calc_job, obj);
3816 3853
3817 return (Elm_Object_Item *)it; 3854 return EO_OBJ(it);
3818} 3855}
3819 3856
3820EOLIAN static Elm_Object_Item* 3857EOLIAN static Elm_Object_Item*
@@ -3839,7 +3876,7 @@ _elm_gengrid_item_sorted_insert(Eo *obj, Elm_Gengrid_Data *sd, const Elm_Gengrid
3839 ecore_job_del(sd->calc_job); 3876 ecore_job_del(sd->calc_job);
3840 sd->calc_job = ecore_job_add(_calc_job, obj); 3877 sd->calc_job = ecore_job_add(_calc_job, obj);
3841 3878
3842 return (Elm_Object_Item *)it; 3879 return EO_OBJ(it);
3843} 3880}
3844 3881
3845EOLIAN static void 3882EOLIAN static void
@@ -3867,8 +3904,9 @@ _elm_gengrid_clear(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED)
3867} 3904}
3868 3905
3869EINA_DEPRECATED EAPI const Evas_Object * 3906EINA_DEPRECATED EAPI const Evas_Object *
3870elm_gengrid_item_object_get(const Elm_Object_Item *it) 3907elm_gengrid_item_object_get(const Elm_Object_Item *eo_it)
3871{ 3908{
3909 ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
3872 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL); 3910 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
3873 3911
3874 return VIEW(it); 3912 return VIEW(it);
@@ -3877,8 +3915,12 @@ elm_gengrid_item_object_get(const Elm_Object_Item *it)
3877EAPI void 3915EAPI void
3878elm_gengrid_item_update(Elm_Object_Item *item) 3916elm_gengrid_item_update(Elm_Object_Item *item)
3879{ 3917{
3880 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 3918 eo_do((Eo *)item, elm_obj_gengrid_item_update());
3919}
3881 3920
3921EOLIAN static void
3922_elm_gengrid_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
3923{
3882 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 3924 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
3883 3925
3884 if (!it->realized) return; 3926 if (!it->realized) return;
@@ -3890,12 +3932,14 @@ elm_gengrid_item_update(Elm_Object_Item *item)
3890} 3932}
3891 3933
3892EAPI const Elm_Gengrid_Item_Class * 3934EAPI const Elm_Gengrid_Item_Class *
3893elm_gengrid_item_item_class_get(const Elm_Object_Item *it) 3935elm_gengrid_item_item_class_get(const Elm_Object_Item *item)
3894{ 3936{
3895 Elm_Gen_Item *item = (Elm_Gen_Item *)it; 3937 return eo_do((Eo *)item, elm_obj_gengrid_item_class_get());
3896 3938}
3897 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
3898 3939
3940EOLIAN static const Elm_Gengrid_Item_Class *
3941_elm_gengrid_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *item)
3942{
3899 if (item->generation < GG_IT(item)->wsd->generation) return NULL; 3943 if (item->generation < GG_IT(item)->wsd->generation) return NULL;
3900 return item->itc; 3944 return item->itc;
3901} 3945}
@@ -3904,14 +3948,18 @@ EAPI void
3904elm_gengrid_item_item_class_update(Elm_Object_Item *item, 3948elm_gengrid_item_item_class_update(Elm_Object_Item *item,
3905 const Elm_Gengrid_Item_Class *itc) 3949 const Elm_Gengrid_Item_Class *itc)
3906{ 3950{
3907 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 3951 eo_do((Eo *)item, elm_obj_gengrid_item_class_update(itc));
3952}
3908 3953
3909 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 3954EOLIAN static void
3955_elm_gengrid_item_item_class_update(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
3956 const Elm_Gengrid_Item_Class *itc)
3957{
3910 EINA_SAFETY_ON_NULL_RETURN(itc); 3958 EINA_SAFETY_ON_NULL_RETURN(itc);
3911 3959
3912 if (it->generation < GG_IT(it)->wsd->generation) return; 3960 if (it->generation < GG_IT(it)->wsd->generation) return;
3913 it->itc = itc; 3961 it->itc = itc;
3914 elm_gengrid_item_update(item); 3962 elm_gengrid_item_update(EO_OBJ(it));
3915} 3963}
3916 3964
3917EAPI void 3965EAPI void
@@ -3919,10 +3967,16 @@ elm_gengrid_item_pos_get(const Elm_Object_Item *it,
3919 unsigned int *x, 3967 unsigned int *x,
3920 unsigned int *y) 3968 unsigned int *y)
3921{ 3969{
3922 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 3970 return eo_do((Eo *)it, elm_obj_gengrid_item_pos_get(x, y));
3971}
3923 3972
3924 if (x) *x = ((Elm_Gen_Item *)it)->x; 3973EOLIAN static void
3925 if (y) *y = ((Elm_Gen_Item *)it)->y; 3974_elm_gengrid_item_pos_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
3975 unsigned int *x,
3976 unsigned int *y)
3977{
3978 if (x) *x = it->x;
3979 if (y) *y = it->y;
3926} 3980}
3927 3981
3928EOLIAN static void 3982EOLIAN static void
@@ -3970,12 +4024,15 @@ EAPI void
3970elm_gengrid_item_selected_set(Elm_Object_Item *item, 4024elm_gengrid_item_selected_set(Elm_Object_Item *item,
3971 Eina_Bool selected) 4025 Eina_Bool selected)
3972{ 4026{
3973 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4027 eo_do((Eo *)item, elm_obj_gengrid_item_selected_set(selected));
4028}
3974 4029
3975 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4030EOLIAN static void
4031_elm_gengrid_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
4032 Eina_Bool selected)
4033{
3976 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 4034 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
3977 4035 if ((it->generation < sd->generation) || eo_do((Eo *)EO_OBJ(it), elm_wdg_item_disabled_get()))
3978 if ((it->generation < sd->generation) || elm_widget_item_disabled_get(it))
3979 return; 4036 return;
3980 selected = !!selected; 4037 selected = !!selected;
3981 if (it->selected == selected) return; 4038 if (it->selected == selected) return;
@@ -3986,9 +4043,10 @@ elm_gengrid_item_selected_set(Elm_Object_Item *item,
3986 { 4043 {
3987 while (sd->selected) 4044 while (sd->selected)
3988 { 4045 {
3989 if (it->unhighlight_cb) 4046 Elm_Object_Item *eo_sel = sd->selected->data;
3990 it->unhighlight_cb(sd->selected->data); 4047 ELM_GENGRID_ITEM_DATA_GET(eo_sel, sel);
3991 it->unsel_cb(sd->selected->data); 4048 if (it->unhighlight_cb) it->unhighlight_cb(sel);
4049 it->unsel_cb(sel);
3992 } 4050 }
3993 } 4051 }
3994 it->highlight_cb(it); 4052 it->highlight_cb(it);
@@ -4002,9 +4060,13 @@ elm_gengrid_item_selected_set(Elm_Object_Item *item,
4002EAPI Eina_Bool 4060EAPI Eina_Bool
4003elm_gengrid_item_selected_get(const Elm_Object_Item *it) 4061elm_gengrid_item_selected_get(const Elm_Object_Item *it)
4004{ 4062{
4005 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 4063 return eo_do((Eo *)it, elm_obj_gengrid_item_selected_get());
4064}
4006 4065
4007 return ((Elm_Gen_Item *)it)->selected; 4066EOLIAN static Eina_Bool
4067_elm_gengrid_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
4068{
4069 return it->selected;
4008} 4070}
4009 4071
4010EOLIAN static Eina_List* 4072EOLIAN static Eina_List*
@@ -4016,7 +4078,7 @@ _elm_gengrid_realized_items_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
4016 4078
4017 EINA_INLIST_FOREACH(sd->items, it) 4079 EINA_INLIST_FOREACH(sd->items, it)
4018 { 4080 {
4019 if (it->realized) ret = eina_list_append(ret, (Elm_Object_Item *)it); 4081 if (it->realized) ret = eina_list_append(ret, EO_OBJ(it));
4020 } 4082 }
4021 4083
4022 return ret; 4084 return ret;
@@ -4059,11 +4121,15 @@ EAPI void
4059elm_gengrid_item_tooltip_text_set(Elm_Object_Item *it, 4121elm_gengrid_item_tooltip_text_set(Elm_Object_Item *it,
4060 const char *text) 4122 const char *text)
4061{ 4123{
4062 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4124 eo_do((Eo *)it, elm_wdg_item_tooltip_text_set(text));
4125}
4063 4126
4127EOLIAN static void
4128_elm_gengrid_item_elm_widget_item_tooltip_text_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, const char *text)
4129{
4064 text = eina_stringshare_add(text); 4130 text = eina_stringshare_add(text);
4065 elm_gengrid_item_tooltip_content_cb_set 4131 elm_gengrid_item_tooltip_content_cb_set
4066 (it, _elm_gengrid_item_label_create, text, 4132 (EO_OBJ(it), _elm_gengrid_item_label_create, text,
4067 _elm_gengrid_item_label_del_cb); 4133 _elm_gengrid_item_label_del_cb);
4068} 4134}
4069 4135
@@ -4073,24 +4139,33 @@ elm_gengrid_item_tooltip_content_cb_set(Elm_Object_Item *item,
4073 const void *data, 4139 const void *data,
4074 Evas_Smart_Cb del_cb) 4140 Evas_Smart_Cb del_cb)
4075{ 4141{
4076 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4142 eo_do((Eo *)item, elm_wdg_item_tooltip_content_cb_set(func, data, del_cb));
4143}
4077 4144
4145EOLIAN static void
4146_elm_gengrid_item_elm_widget_item_tooltip_content_cb_set(Eo *eo_it, Elm_Gen_Item *it,
4147 Elm_Tooltip_Item_Content_Cb func,
4148 const void *data,
4149 Evas_Smart_Cb del_cb)
4150{
4078 ELM_GENGRID_ITEM_CHECK_OR_GOTO(it, error); 4151 ELM_GENGRID_ITEM_CHECK_OR_GOTO(it, error);
4079 4152
4080 if ((it->tooltip.content_cb == func) && (it->tooltip.data == data)) 4153 if ((it->tooltip.content_cb != func) || (it->tooltip.data != data))
4081 return; 4154 {
4082 4155 if (it->tooltip.del_cb)
4083 if (it->tooltip.del_cb) 4156 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
4084 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it); 4157 it->tooltip.content_cb = func;
4085 it->tooltip.content_cb = func; 4158 it->tooltip.data = data;
4086 it->tooltip.data = data; 4159 it->tooltip.del_cb = del_cb;
4087 it->tooltip.del_cb = del_cb; 4160 }
4088 if (VIEW(it)) 4161 if (VIEW(it))
4089 { 4162 {
4090 elm_widget_item_tooltip_content_cb_set 4163 eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4091 (it, it->tooltip.content_cb, it->tooltip.data, NULL); 4164 elm_wdg_item_tooltip_content_cb_set
4092 elm_widget_item_tooltip_style_set(it, it->tooltip.style); 4165 (it->tooltip.content_cb, it->tooltip.data, NULL));
4093 elm_widget_item_tooltip_window_mode_set(it, it->tooltip.free_size); 4166 eo_do(eo_it,
4167 elm_wdg_item_tooltip_style_set(it->tooltip.style),
4168 elm_wdg_item_tooltip_window_mode_set(it->tooltip.free_size));
4094 } 4169 }
4095 4170
4096 return; 4171 return;
@@ -4102,12 +4177,17 @@ error:
4102EAPI void 4177EAPI void
4103elm_gengrid_item_tooltip_unset(Elm_Object_Item *item) 4178elm_gengrid_item_tooltip_unset(Elm_Object_Item *item)
4104{ 4179{
4105 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4180 eo_do((Eo *)item, elm_wdg_item_tooltip_unset());
4181}
4106 4182
4183EOLIAN static void
4184_elm_gengrid_item_elm_widget_item_tooltip_unset(Eo *eo_it, Elm_Gen_Item *it)
4185{
4107 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4186 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
4108 4187
4109 if ((VIEW(it)) && (it->tooltip.content_cb)) 4188 if ((VIEW(it)) && (it->tooltip.content_cb))
4110 elm_widget_item_tooltip_unset(it); 4189 eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4190 elm_wdg_item_tooltip_unset());
4111 4191
4112 if (it->tooltip.del_cb) 4192 if (it->tooltip.del_cb)
4113 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it); 4193 it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
@@ -4116,35 +4196,52 @@ elm_gengrid_item_tooltip_unset(Elm_Object_Item *item)
4116 it->tooltip.data = NULL; 4196 it->tooltip.data = NULL;
4117 it->tooltip.free_size = EINA_FALSE; 4197 it->tooltip.free_size = EINA_FALSE;
4118 if (it->tooltip.style) 4198 if (it->tooltip.style)
4119 elm_gengrid_item_tooltip_style_set(item, NULL); 4199 eo_do(eo_it, elm_wdg_item_tooltip_style_set(NULL));
4120} 4200}
4121 4201
4122EAPI void 4202EAPI void
4123elm_gengrid_item_tooltip_style_set(Elm_Object_Item *it, 4203elm_gengrid_item_tooltip_style_set(Elm_Object_Item *it,
4124 const char *style) 4204 const char *style)
4125{ 4205{
4126 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4206 eo_do((Eo *)it, elm_wdg_item_tooltip_style_set(style));
4207}
4127 4208
4128 eina_stringshare_replace(&((Elm_Gen_Item *)it)->tooltip.style, style); 4209EOLIAN static void
4129 if (VIEW(it)) elm_widget_item_tooltip_style_set(it, style); 4210_elm_gengrid_item_elm_widget_item_tooltip_style_set(Eo *eo_it, Elm_Gen_Item *it,
4211 const char *style)
4212{
4213 eina_stringshare_replace(&it->tooltip.style, style);
4214 if (VIEW(it)) eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4215 elm_wdg_item_tooltip_style_set(style));
4130} 4216}
4131 4217
4132EAPI const char * 4218EAPI const char *
4133elm_gengrid_item_tooltip_style_get(const Elm_Object_Item *it) 4219elm_gengrid_item_tooltip_style_get(const Elm_Object_Item *it)
4134{ 4220{
4135 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL); 4221 return eo_do((Eo *)it, elm_wdg_item_tooltip_style_get());
4222}
4136 4223
4137 return ((Elm_Gen_Item *)it)->tooltip.style; 4224EOLIAN static const char *
4225_elm_gengrid_item_elm_widget_item_tooltip_style_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4226{
4227 return it->tooltip.style;
4138} 4228}
4139 4229
4140EAPI Eina_Bool 4230EAPI Eina_Bool
4141elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it, 4231elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it,
4142 Eina_Bool disable) 4232 Eina_Bool disable)
4143{ 4233{
4144 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 4234 return eo_do((Eo *)it, elm_wdg_item_tooltip_window_mode_set(disable));
4235}
4145 4236
4146 ((Elm_Gen_Item *)it)->tooltip.free_size = disable; 4237EOLIAN static Eina_Bool
4147 if (VIEW(it)) return elm_widget_item_tooltip_window_mode_set(it, disable); 4238_elm_gengrid_item_elm_widget_item_tooltip_window_mode_set(Eo *eo_it, Elm_Gen_Item *it,
4239 Eina_Bool disable)
4240{
4241 it->tooltip.free_size = disable;
4242 if (VIEW(it))
4243 return eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4244 elm_wdg_item_tooltip_window_mode_set(disable));
4148 4245
4149 return EINA_TRUE; 4246 return EINA_TRUE;
4150} 4247}
@@ -4152,38 +4249,56 @@ elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it,
4152EAPI Eina_Bool 4249EAPI Eina_Bool
4153elm_gengrid_item_tooltip_window_mode_get(const Elm_Object_Item *it) 4250elm_gengrid_item_tooltip_window_mode_get(const Elm_Object_Item *it)
4154{ 4251{
4252 return eo_do((Eo *)it, elm_wdg_item_tooltip_window_mode_get());
4253}
4254
4255EOLIAN static Eina_Bool
4256_elm_gengrid_item_elm_widget_item_tooltip_window_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4257{
4155 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 4258 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
4156 4259
4157 return ((Elm_Gen_Item *)it)->tooltip.free_size; 4260 return it->tooltip.free_size;
4158} 4261}
4159 4262
4160EAPI void 4263EAPI void
4161elm_gengrid_item_cursor_set(Elm_Object_Item *it, 4264elm_gengrid_item_cursor_set(Elm_Object_Item *it,
4162 const char *cursor) 4265 const char *cursor)
4163{ 4266{
4267 eo_do((Eo *)it, elm_wdg_item_cursor_set(cursor));
4268}
4269
4270EOLIAN static void
4271_elm_gengrid_item_elm_widget_item_cursor_set(Eo *eo_it, Elm_Gen_Item *it,
4272 const char *cursor)
4273{
4164 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4274 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
4165 4275
4166 eina_stringshare_replace(&((Elm_Gen_Item *)it)->mouse_cursor, cursor); 4276 eina_stringshare_replace(&it->mouse_cursor, cursor);
4167 if (VIEW(it)) elm_widget_item_cursor_set(it, cursor); 4277 if (VIEW(it)) eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4278 elm_wdg_item_cursor_set(cursor));
4168} 4279}
4169 4280
4170EAPI const char * 4281EAPI const char *
4171elm_gengrid_item_cursor_get(const Elm_Object_Item *it) 4282elm_gengrid_item_cursor_get(const Elm_Object_Item *it)
4172{ 4283{
4173 return elm_widget_item_cursor_get(it); 4284 return eo_do((Eo *)it, elm_wdg_item_cursor_get());
4174} 4285}
4175 4286
4176EAPI void 4287EAPI void
4177elm_gengrid_item_cursor_unset(Elm_Object_Item *item) 4288elm_gengrid_item_cursor_unset(Elm_Object_Item *item)
4178{ 4289{
4179 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4290 eo_do((Eo *)item, elm_wdg_item_cursor_unset());
4291}
4180 4292
4293EOLIAN static void
4294_elm_gengrid_item_elm_widget_item_cursor_unset(Eo *eo_it, Elm_Gen_Item *it)
4295{
4181 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4296 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
4182 if (!it->mouse_cursor) 4297 if (!it->mouse_cursor)
4183 return; 4298 return;
4184 4299
4185 if (VIEW(it)) 4300 if (VIEW(it)) eo_do_super(eo_it, ELM_GENGRID_ITEM_CLASS,
4186 elm_widget_item_cursor_unset(it); 4301 elm_wdg_item_cursor_unset());
4187 4302
4188 ELM_SAFE_FREE(it->mouse_cursor, eina_stringshare_del); 4303 ELM_SAFE_FREE(it->mouse_cursor, eina_stringshare_del);
4189} 4304}
@@ -4192,26 +4307,26 @@ EAPI void
4192elm_gengrid_item_cursor_style_set(Elm_Object_Item *it, 4307elm_gengrid_item_cursor_style_set(Elm_Object_Item *it,
4193 const char *style) 4308 const char *style)
4194{ 4309{
4195 elm_widget_item_cursor_style_set(it, style); 4310 eo_do((Eo *)it, elm_wdg_item_cursor_style_set(style));
4196} 4311}
4197 4312
4198EAPI const char * 4313EAPI const char *
4199elm_gengrid_item_cursor_style_get(const Elm_Object_Item *it) 4314elm_gengrid_item_cursor_style_get(const Elm_Object_Item *it)
4200{ 4315{
4201 return elm_widget_item_cursor_style_get(it); 4316 return eo_do((Eo *)it, elm_wdg_item_cursor_style_get());
4202} 4317}
4203 4318
4204EAPI void 4319EAPI void
4205elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *it, 4320elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *it,
4206 Eina_Bool engine_only) 4321 Eina_Bool engine_only)
4207{ 4322{
4208 elm_widget_item_cursor_engine_only_set(it, engine_only); 4323 eo_do((Eo *)it, elm_wdg_item_cursor_engine_only_set(engine_only));
4209} 4324}
4210 4325
4211EAPI Eina_Bool 4326EAPI Eina_Bool
4212elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *it) 4327elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *it)
4213{ 4328{
4214 return elm_widget_item_cursor_engine_only_get(it); 4329 return eo_do((Eo *) it, elm_wdg_item_cursor_engine_only_get());
4215} 4330}
4216 4331
4217EAPI void 4332EAPI void
@@ -4392,7 +4507,7 @@ _elm_gengrid_first_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
4392 while ((it) && (it->generation < sd->generation)) 4507 while ((it) && (it->generation < sd->generation))
4393 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 4508 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
4394 4509
4395 return (Elm_Object_Item *)it; 4510 return EO_OBJ(it);
4396} 4511}
4397 4512
4398EOLIAN static Elm_Object_Item* 4513EOLIAN static Elm_Object_Item*
@@ -4456,7 +4571,7 @@ _elm_gengrid_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd, Evas_Coor
4456 else *xposret = 0; 4571 else *xposret = 0;
4457 } 4572 }
4458 4573
4459 return (Elm_Object_Item *) it; 4574 return EO_OBJ(it);
4460 } 4575 }
4461 4576
4462 } while ((it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next))); 4577 } while ((it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next)));
@@ -4492,14 +4607,18 @@ _elm_gengrid_last_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
4492 while ((it) && (it->generation < sd->generation)) 4607 while ((it) && (it->generation < sd->generation))
4493 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev); 4608 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
4494 4609
4495 return (Elm_Object_Item *)it; 4610 return EO_OBJ(it);
4496} 4611}
4497 4612
4498EAPI Elm_Object_Item * 4613EAPI Elm_Object_Item *
4499elm_gengrid_item_next_get(const Elm_Object_Item *item) 4614elm_gengrid_item_next_get(const Elm_Object_Item *item)
4500{ 4615{
4501 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4616 return eo_do((Eo *)item, elm_obj_gengrid_item_next_get());
4617}
4502 4618
4619EOLIAN static Elm_Object_Item *
4620_elm_gengrid_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4621{
4503 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL); 4622 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
4504 4623
4505 while (it) 4624 while (it)
@@ -4508,14 +4627,19 @@ elm_gengrid_item_next_get(const Elm_Object_Item *item)
4508 if ((it) && (it->generation == GG_IT(it)->wsd->generation)) break; 4627 if ((it) && (it->generation == GG_IT(it)->wsd->generation)) break;
4509 } 4628 }
4510 4629
4511 return (Elm_Object_Item *)it; 4630 if (it) return EO_OBJ(it);
4631 else return NULL;
4512} 4632}
4513 4633
4514EAPI Elm_Object_Item * 4634EAPI Elm_Object_Item *
4515elm_gengrid_item_prev_get(const Elm_Object_Item *item) 4635elm_gengrid_item_prev_get(const Elm_Object_Item *item)
4516{ 4636{
4517 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4637 return eo_do((Eo *)item, elm_obj_gengrid_item_prev_get());
4638}
4518 4639
4640EOLIAN static Elm_Object_Item *
4641_elm_gengrid_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4642{
4519 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL); 4643 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, NULL);
4520 4644
4521 while (it) 4645 while (it)
@@ -4524,16 +4648,20 @@ elm_gengrid_item_prev_get(const Elm_Object_Item *item)
4524 if ((it) && (it->generation == GG_IT(it)->wsd->generation)) break; 4648 if ((it) && (it->generation == GG_IT(it)->wsd->generation)) break;
4525 } 4649 }
4526 4650
4527 return (Elm_Object_Item *)it; 4651 if (it) return EO_OBJ(it);
4652 else return NULL;
4528} 4653}
4529 4654
4530EAPI void 4655EAPI void
4531elm_gengrid_item_show(Elm_Object_Item *item, 4656elm_gengrid_item_show(Elm_Object_Item *item,
4532 Elm_Gengrid_Item_Scrollto_Type type) 4657 Elm_Gengrid_Item_Scrollto_Type type)
4533{ 4658{
4534 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4659 eo_do((Eo *)item, elm_obj_gengrid_item_show(type));
4660}
4535 4661
4536 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4662EOLIAN static void
4663_elm_gengrid_item_show(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, Elm_Gengrid_Item_Scrollto_Type type)
4664{
4537 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 4665 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
4538 4666
4539 if ((it->generation < sd->generation)) return; 4667 if ((it->generation < sd->generation)) return;
@@ -4549,9 +4677,12 @@ EAPI void
4549elm_gengrid_item_bring_in(Elm_Object_Item *item, 4677elm_gengrid_item_bring_in(Elm_Object_Item *item,
4550 Elm_Gengrid_Item_Scrollto_Type type) 4678 Elm_Gengrid_Item_Scrollto_Type type)
4551{ 4679{
4552 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4680 eo_do((Eo *)item, elm_obj_gengrid_item_bring_in(type));
4681}
4553 4682
4554 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4683EOLIAN static void
4684_elm_gengrid_item_bring_in(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it, Elm_Gengrid_Item_Scrollto_Type type)
4685{
4555 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 4686 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
4556 4687
4557 if (it->generation < sd->generation) return; 4688 if (it->generation < sd->generation) return;
@@ -4664,8 +4795,12 @@ _elm_gengrid_highlight_mode_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
4664EAPI int 4795EAPI int
4665elm_gengrid_item_index_get(const Elm_Object_Item *item) 4796elm_gengrid_item_index_get(const Elm_Object_Item *item)
4666{ 4797{
4667 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4798 return eo_do((Eo *)item, elm_obj_gengrid_item_index_get());
4799}
4668 4800
4801EOLIAN static int
4802_elm_gengrid_item_index_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4803{
4669 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, -1); 4804 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, -1);
4670 4805
4671 return it->position; 4806 return it->position;
@@ -4675,9 +4810,13 @@ EAPI void
4675elm_gengrid_item_select_mode_set(Elm_Object_Item *item, 4810elm_gengrid_item_select_mode_set(Elm_Object_Item *item,
4676 Elm_Object_Select_Mode mode) 4811 Elm_Object_Select_Mode mode)
4677{ 4812{
4678 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4813 eo_do((Eo *)item, elm_obj_gengrid_item_select_mode_set(mode));
4679 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4814}
4680 4815
4816EOLIAN static void
4817_elm_gengrid_item_select_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
4818 Elm_Object_Select_Mode mode)
4819{
4681 if (it->generation < GG_IT(it)->wsd->generation) return; 4820 if (it->generation < GG_IT(it)->wsd->generation) return;
4682 if (mode >= ELM_OBJECT_SELECT_MODE_MAX) 4821 if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
4683 return; 4822 return;
@@ -4686,13 +4825,18 @@ elm_gengrid_item_select_mode_set(Elm_Object_Item *item,
4686 it->select_mode = mode; 4825 it->select_mode = mode;
4687 4826
4688 if (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) 4827 if (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
4689 elm_gengrid_item_update(item); 4828 elm_gengrid_item_update(EO_OBJ(it));
4690} 4829}
4691 4830
4692EAPI Elm_Object_Select_Mode 4831EAPI Elm_Object_Select_Mode
4693elm_gengrid_item_select_mode_get(const Elm_Object_Item *item) 4832elm_gengrid_item_select_mode_get(const Elm_Object_Item *item)
4694{ 4833{
4695 Elm_Gen_Item *it = (Elm_Gen_Item *)item; 4834 return eo_do((Eo *)item, elm_obj_gengrid_item_select_mode_get());
4835}
4836
4837EOLIAN static Elm_Object_Select_Mode
4838_elm_gengrid_item_select_mode_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
4839{
4696 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, ELM_OBJECT_SELECT_MODE_MAX); 4840 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, ELM_OBJECT_SELECT_MODE_MAX);
4697 4841
4698 return it->select_mode; 4842 return it->select_mode;
@@ -4715,7 +4859,7 @@ elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth)
4715 if (eina_accessor_data_get(a, nth, &data)) 4859 if (eina_accessor_data_get(a, nth, &data))
4716 it = ELM_GEN_ITEM_FROM_INLIST(data); 4860 it = ELM_GEN_ITEM_FROM_INLIST(data);
4717 eina_accessor_free(a); 4861 eina_accessor_free(a);
4718 return (Elm_Object_Item *)it; 4862 return EO_OBJ(it);
4719} 4863}
4720 4864
4721EOLIAN static void 4865EOLIAN static void
@@ -4763,7 +4907,7 @@ _elm_gengrid_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Ge
4763EOLIAN static Elm_Object_Item * 4907EOLIAN static Elm_Object_Item *
4764_elm_gengrid_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) 4908_elm_gengrid_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
4765{ 4909{
4766 return sd->focused_item; 4910 return EO_OBJ(sd->focused_item);
4767} 4911}
4768 4912
4769EOLIAN static void 4913EOLIAN static void
@@ -4828,3 +4972,4 @@ _elm_gengrid_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUS
4828} 4972}
4829 4973
4830#include "elm_gengrid.eo.c" 4974#include "elm_gengrid.eo.c"
4975#include "elm_gengrid_item.eo.c"
diff --git a/src/lib/elm_gengrid_item.eo b/src/lib/elm_gengrid_item.eo
new file mode 100644
index 000000000..d8eb49f38
--- /dev/null
+++ b/src/lib/elm_gengrid_item.eo
@@ -0,0 +1,248 @@
1class Elm_Gengrid_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_gengrid_item;
5 data: Elm_Gen_Item;
6 properties {
7 prev {
8 get {
9 /*@
10 Get the @b previous item in a gengrid widget's internal list of items,
11 given a handle to one of those items.
12
13 This returns the item placed before the @p item, on the container
14 gengrid.
15
16 @see elm_gengrid_item_next_get()
17
18 @ingroup Gengrid
19 */
20 }
21 values {
22 Elm_Object_Item *item; /*@ @return The item before @p item, or @c NULL if there's none (and on errors) */
23 }
24 }
25 next {
26 get {
27 /*@
28 Get the @b next item in a gengrid widget's internal list of items,
29 given a handle to one of those items.
30
31 This returns the item placed after the @p item, on the container
32 gengrid.
33
34 @see elm_gengrid_item_prev_get()
35
36 @ingroup Gengrid
37 */
38 }
39 values {
40 Elm_Object_Item *item; /*@ @return The item after @p item, or @c NULL if there's none (and on errors) */
41 }
42 }
43 selected {
44 get {
45 /*@
46 Get whether a given gengrid item is selected or not
47
48 This API returns EINA_TRUE for all the items selected in multi-select mode as well.
49
50 @see elm_gengrid_item_selected_set() for more details
51
52 @ingroup Gengrid
53 */
54 }
55 set {
56 /*@
57 Set whether a given gengrid item is selected or not
58
59 This sets the selected state of an item. If multi-selection is
60 not enabled on the containing gengrid and @p selected is @c
61 EINA_TRUE, any other previously selected items will get
62 unselected in favor of this new one.
63
64 @see elm_gengrid_item_selected_get()
65
66 @ingroup Gengrid
67 */
68 }
69 values {
70 Eina_Bool selected; /*@ the selected state (@c EINA_TRUE selected, @c EINA_FALSE not selected) */
71 }
72 }
73 item_class {
74 get {
75 /*@
76 Get the Gengrid Item class for the given Gengrid Item.
77
78 This returns the Gengrid_Item_Class for the given item. It can be used to examine
79 the function pointers and item_style.
80
81 @ingroup Gengrid
82 */
83 }
84 values {
85 const (Elm_Gengrid_Item_Class) *itc; /*@ Gengrid Item class for the given item */
86 }
87 }
88 index {
89 get {
90 /*@
91 Get the index of the item. It is only valid once displayed.
92
93 @ingroup Gengrid
94 */
95 }
96 values {
97 int index; /*@ @return the position inside the list of item. */
98 }
99 }
100 pos {
101 get {
102 /*@
103 Get a given gengrid item's position, relative to the whole
104 gengrid's grid area.
105
106 This returns the "logical" position of the item within the
107 gengrid. For example, @c (0, 1) would stand for first row,
108 second column.
109
110 @ingroup Gengrid
111 */
112 }
113 values {
114 uint x; /*@ Pointer to variable to store the item's <b>row number</b>. */
115 uint y; /*@ Pointer to variable to store the item's <b>column number</b>. */
116 }
117 }
118 select_mode {
119 get {
120 /*@
121 Get the gengrid item's select mode.
122
123 (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
124
125 @see elm_gengrid_item_select_mode_set()
126
127 @ingroup Gengrid
128 */
129 }
130 set {
131 /*@
132 Set the gengrid item's select mode.
133
134 elm_gengrid_select_mode_set() changes item's select mode.
135 - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and
136 callback when first becoming selected. Any further clicks will
137 do nothing, unless you set always select mode.
138 - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
139 every click will make the selected callbacks be called.
140 - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item
141 entirely and they will neither appear selected nor call selected
142 callback functions.
143 - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule
144 with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be
145 smaller than lower limit. Clickable objects should be bigger than
146 human touch point device (your finger) for some touch or
147 small screen devices. So it is enabled, the item can be shrink than
148 predefined finger-size value. And the item will be updated.
149
150 @see elm_gengrid_item_select_mode_get()
151
152 @ingroup Gengrid
153 */
154 }
155 values {
156 Elm_Object_Select_Mode mode; /*@ The selected mode */
157 }
158 }
159 }
160 methods {
161 /* init { FIXME
162 params {
163 Evas_Smart_Cb func;
164 const(void)* data;
165 }
166 }*/
167 show {
168 /*@
169 Show the portion of a gengrid's internal grid containing a given
170 item, @b immediately.
171
172 This causes gengrid to @b redraw its viewport's contents to the
173 region containing the given @p item item, if it is not fully
174 visible.
175
176 @see elm_gengrid_item_bring_in()
177
178 @ingroup Gengrid
179 */
180 params {
181 @in Elm_Gengrid_Item_Scrollto_Type type; /*@ Where to position the item in the viewport. */
182 }
183 }
184 bring_in {
185 /*@
186 Animatedly bring in, to the visible area of a gengrid, a given
187 item on it.
188
189 This causes gengrid to jump to the given @p item and show
190 it (by scrolling), if it is not fully visible. This will use
191 animation to do so and take a period of time to complete.
192
193 @see elm_gengrid_item_show()
194
195 @ingroup Gengrid
196 */
197 params {
198 @in Elm_Gengrid_Item_Scrollto_Type type; /*@ Where to position the item in the viewport. */
199 }
200 }
201 update {
202 /*@
203 Update the contents of a given gengrid item
204
205 This updates an item by calling all the item class functions
206 again to get the contents, texts and states. Use this when the
207 original item data has changed and you want the changes to be
208 reflected.
209
210 @ingroup Gengrid
211 */
212 }
213 item_class_update {
214 /*@
215 Update the item class of a gengrid item.
216
217 This sets another class of the item, changing the way that it is
218 displayed. After changing the item class, elm_gengrid_item_update() is
219 called on the item @p it.
220
221 @ingroup Gengrid
222 */
223 params {
224 @in const (Elm_Gengrid_Item_Class) *itc; /*@ The gengrid item class describing the function pointers and the item style. */
225 }
226 }
227 }
228 implements {
229 Eo.Base.constructor;
230 Elm_Widget_Item.del_pre;
231 Elm_Widget_Item.disable;
232 Elm_Widget_Item.signal_emit;
233 Elm_Widget_Item.focus.set;
234 Elm_Widget_Item.focus.get;
235 Elm_Widget_Item.part_text.get;
236 Elm_Widget_Item.part_content.get;
237 Elm_Widget_Item.tooltip_text_set;
238 Elm_Widget_Item.tooltip_style.get;
239 Elm_Widget_Item.tooltip_style.set;
240 Elm_Widget_Item.tooltip_window_mode.get;
241 Elm_Widget_Item.tooltip_window_mode.set;
242 Elm_Widget_Item.tooltip_content_cb_set;
243 Elm_Widget_Item.tooltip_unset;
244 Elm_Widget_Item.cursor.set;
245 Elm_Widget_Item.cursor_unset;
246 }
247}
248
diff --git a/src/lib/elm_widget_gengrid.h b/src/lib/elm_widget_gengrid.h
index 7f9fcddc8..6277c2d06 100644
--- a/src/lib/elm_widget_gengrid.h
+++ b/src/lib/elm_widget_gengrid.h
@@ -1,6 +1,8 @@
1#ifndef ELM_WIDGET_GENGRID_H 1#ifndef ELM_WIDGET_GENGRID_H
2#define ELM_WIDGET_GENGRID_H 2#define ELM_WIDGET_GENGRID_H
3 3
4#define OBJECT_ITEMS_MIGRATION
5
4#include "elm_gen_common.h" 6#include "elm_gen_common.h"
5#include "Elementary.h" 7#include "Elementary.h"
6 8
@@ -10,6 +12,7 @@
10 * IT AT RUNTIME. 12 * IT AT RUNTIME.
11 */ 13 */
12 14
15#include "elm_object_item_migration_temp.h"
13/** 16/**
14 * @addtogroup Widget 17 * @addtogroup Widget
15 * @{ 18 * @{
@@ -43,9 +46,9 @@ struct _Elm_Gengrid_Data
43 Elm_Gen_Item *reorder_it; /* item currently 46 Elm_Gen_Item *reorder_it; /* item currently
44 * being 47 * being
45 * repositioned */ 48 * repositioned */
46 Elm_Object_Item *last_selected_item; 49 Elm_Gen_Item *last_selected_item;
47 Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */ 50 Elm_Gen_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
48 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. */ 51 Elm_Gen_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. */
49 Elm_Gen_Item *show_it; 52 Elm_Gen_Item *show_it;
50 Elm_Gen_Item *bring_in_it; 53 Elm_Gen_Item *bring_in_it;
51 Elm_Gengrid_Item_Scrollto_Type scroll_to_type; 54 Elm_Gengrid_Item_Scrollto_Type scroll_to_type;
@@ -192,16 +195,19 @@ struct _Elm_Gengrid_Pan_Data
192 return 195 return
193 196
194#define ELM_GENGRID_ITEM_CHECK(it) \ 197#define ELM_GENGRID_ITEM_CHECK(it) \
195 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 198 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
196 ELM_GENGRID_CHECK(it->base.widget); 199 ELM_GENGRID_CHECK(it->base->widget);
197 200
198#define ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, ...) \ 201#define ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, ...) \
199 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 202 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
200 ELM_GENGRID_CHECK(it->base.widget) __VA_ARGS__; 203 ELM_GENGRID_CHECK(it->base->widget) __VA_ARGS__;
201 204
202#define ELM_GENGRID_ITEM_CHECK_OR_GOTO(it, label) \ 205#define ELM_GENGRID_ITEM_CHECK_OR_GOTO(it, label) \
203 ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item_Data *)it, label); \ 206 ELM_WIDGET_ITEM_CHECK_OR_GOTO(it->base, label); \
204 if (!it->base.widget || !eo_isa \ 207 if (!it->base->widget || !eo_isa \
205 ((it->base.widget), ELM_GENGRID_CLASS)) goto label; 208 ((it->base->widget), ELM_GENGRID_CLASS)) goto label;
209
210#define ELM_GENGRID_ITEM_DATA_GET(o, sd) \
211 Elm_Gen_Item* sd = eo_data_scope_get((Eo *)o, ELM_GENGRID_ITEM_CLASS)
206 212
207#endif 213#endif