summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-08-13 08:56:24 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:42 +0300
commitbf7afd0469bb6eb4c58b032df85d6dee2b72e042 (patch)
tree37bea8454aacbeb9e1bb44494e401ab83c0b65ca
parentbb92dcfd56bf160dc314fb3e3758705fa81a8be5 (diff)
Porting to Eo: Elm Toolbar Item
-rw-r--r--src/lib/Makefile.am11
-rw-r--r--src/lib/elm_toolbar.c638
-rw-r--r--src/lib/elm_toolbar_common.h338
-rw-r--r--src/lib/elm_toolbar_item.eo429
-rw-r--r--src/lib/elm_widget_toolbar.h34
5 files changed, 842 insertions, 608 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index fcd12a689..f8caed429 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -873,7 +873,9 @@ BUILT_SOURCES = \
873 elm_gengrid_item.eo.c \ 873 elm_gengrid_item.eo.c \
874 elm_gengrid_item.eo.h \ 874 elm_gengrid_item.eo.h \
875 elm_list_item.eo.c \ 875 elm_list_item.eo.c \
876 elm_list_item.eo.h 876 elm_list_item.eo.h \
877 elm_toolbar_item.eo.c \
878 elm_toolbar_item.eo.h
877 879
878elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 880elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
879elementaryeolianfiles_DATA = \ 881elementaryeolianfiles_DATA = \
@@ -982,7 +984,8 @@ elementaryeolianfiles_DATA = \
982 elm_naviframe_item.eo \ 984 elm_naviframe_item.eo \
983 elm_genlist_item.eo \ 985 elm_genlist_item.eo \
984 elm_gengrid_item.eo \ 986 elm_gengrid_item.eo \
985 elm_list_item.eo 987 elm_list_item.eo \
988 elm_toolbar_item.eo
986 989
987EXTRA_DIST += ${elementaryeolianfiles_DATA} 990EXTRA_DIST += ${elementaryeolianfiles_DATA}
988 991
@@ -1091,6 +1094,7 @@ nodist_includesunstable_HEADERS = \
1091 elm_genlist_item.eo.h \ 1094 elm_genlist_item.eo.h \
1092 elm_gengrid_item.eo.h \ 1095 elm_gengrid_item.eo.h \
1093 elm_list_item.eo.h \ 1096 elm_list_item.eo.h \
1097 elm_toolbar_item.eo.h \
1094 elm_ctxpopup_item.eo.h \ 1098 elm_ctxpopup_item.eo.h \
1095 elm_slideshow_item.eo.h \ 1099 elm_slideshow_item.eo.h \
1096 elm_layout.eo.legacy.h \ 1100 elm_layout.eo.legacy.h \
@@ -1170,7 +1174,8 @@ nodist_includesunstable_HEADERS = \
1170 elm_naviframe_item.eo.legacy.h \ 1174 elm_naviframe_item.eo.legacy.h \
1171 elm_genlist_item.eo.legacy.h \ 1175 elm_genlist_item.eo.legacy.h \
1172 elm_gengrid_item.eo.legacy.h \ 1176 elm_gengrid_item.eo.legacy.h \
1173 elm_list_item.eo.legacy.h 1177 elm_list_item.eo.legacy.h \
1178 elm_toolbar_item.eo.legacy.h
1174 1179
1175if HAVE_CXX11 1180if HAVE_CXX11
1176 1181
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index 2556c6889..f3b514df3 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#define ELM_WIDGET_ITEM_PROTECTED
5#include <Elementary.h> 6#include <Elementary.h>
6 7
7#include "elm_priv.h" 8#include "elm_priv.h"
@@ -16,13 +17,15 @@
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_toolbar_item.eo.h"
21
19#define MY_CLASS ELM_TOOLBAR_CLASS 22#define MY_CLASS ELM_TOOLBAR_CLASS
20 23
21#define MY_CLASS_NAME "Elm_Toolbar" 24#define MY_CLASS_NAME "Elm_Toolbar"
22#define MY_CLASS_NAME_LEGACY "elm_toolbar" 25#define MY_CLASS_NAME_LEGACY "elm_toolbar"
23 26
24#define ELM_TOOLBAR_ITEM_FROM_INLIST(item) \ 27#define ELM_TOOLBAR_ITEM_FROM_INLIST(item) \
25 ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Toolbar_Item) : NULL) 28 ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Toolbar_Item_Data) : NULL)
26 29
27static const char SIG_SCROLL[] = "scroll"; 30static const char SIG_SCROLL[] = "scroll";
28static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start"; 31static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
@@ -65,14 +68,14 @@ static const Elm_Action key_actions[] = {
65 {NULL, NULL} 68 {NULL, NULL}
66}; 69};
67 70
68static void _item_select(Elm_Toolbar_Item *it); 71static void _item_select(Elm_Toolbar_Item_Data *it);
69 72
70static int 73static int
71_toolbar_item_prio_compare_cb(const void *i1, 74_toolbar_item_prio_compare_cb(const void *i1,
72 const void *i2) 75 const void *i2)
73{ 76{
74 const Elm_Toolbar_Item *eti1 = i1; 77 const Elm_Toolbar_Item_Data *eti1 = i1;
75 const Elm_Toolbar_Item *eti2 = i2; 78 const Elm_Toolbar_Item_Data *eti2 = i2;
76 79
77 if (!eti2) return 1; 80 if (!eti2) return 1;
78 if (!eti1) return -1; 81 if (!eti1) return -1;
@@ -89,7 +92,7 @@ _items_visibility_fix(Elm_Toolbar_Data *sd,
89 Evas_Coord vw, 92 Evas_Coord vw,
90 Eina_Bool *more) 93 Eina_Bool *more)
91{ 94{
92 Elm_Toolbar_Item *it, *prev; 95 Elm_Toolbar_Item_Data *it, *prev;
93 Evas_Coord ciw = 0, cih = 0; 96 Evas_Coord ciw = 0, cih = 0;
94 Eina_List *sorted = NULL; 97 Eina_List *sorted = NULL;
95 int count = 0, i = 0; 98 int count = 0, i = 0;
@@ -143,14 +146,14 @@ _items_visibility_fix(Elm_Toolbar_Data *sd,
143} 146}
144 147
145static void 148static void
146_item_menu_destroy(Elm_Toolbar_Item *item) 149_item_menu_destroy(Elm_Toolbar_Item_Data *item)
147{ 150{
148 ELM_SAFE_FREE(item->o_menu, evas_object_del); 151 ELM_SAFE_FREE(item->o_menu, evas_object_del);
149 item->menu = EINA_FALSE; 152 item->menu = EINA_FALSE;
150} 153}
151 154
152static void 155static void
153_item_unselect(Elm_Toolbar_Item *item) 156_item_unselect(Elm_Toolbar_Item_Data *item)
154{ 157{
155 if ((!item) || (!item->selected)) return; 158 if ((!item) || (!item->selected)) return;
156 159
@@ -161,7 +164,7 @@ _item_unselect(Elm_Toolbar_Item *item)
161 edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm"); 164 edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm");
162 if (item->icon) 165 if (item->icon)
163 elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); 166 elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm");
164 evas_object_smart_callback_call(WIDGET(item), SIG_UNSELECTED, item); 167 evas_object_smart_callback_call(WIDGET(item), SIG_UNSELECTED, EO_OBJ(item));
165} 168}
166 169
167static void 170static void
@@ -170,10 +173,11 @@ _menu_hide(void *data,
170 Evas_Object *obj EINA_UNUSED, 173 Evas_Object *obj EINA_UNUSED,
171 void *event_info EINA_UNUSED) 174 void *event_info EINA_UNUSED)
172{ 175{
173 Elm_Toolbar_Item *selected; 176 Elm_Object_Item *eo_selected;
174 Elm_Toolbar_Item *it = data; 177 Elm_Toolbar_Item_Data *it = data;
175 178
176 selected = (Elm_Toolbar_Item *)elm_toolbar_selected_item_get(WIDGET(it)); 179 eo_selected = elm_toolbar_selected_item_get(WIDGET(it));
180 ELM_TOOLBAR_ITEM_DATA_GET(eo_selected, selected);
177 _item_unselect(selected); 181 _item_unselect(selected);
178} 182}
179 183
@@ -190,7 +194,7 @@ _menu_del(void *data,
190 194
191static void 195static void
192_item_menu_create(Elm_Toolbar_Data *sd, 196_item_menu_create(Elm_Toolbar_Data *sd,
193 Elm_Toolbar_Item *item) 197 Elm_Toolbar_Item_Data *item)
194{ 198{
195 item->o_menu = elm_menu_add(elm_widget_parent_get(WIDGET(item))); 199 item->o_menu = elm_menu_add(elm_widget_parent_get(WIDGET(item)));
196 item->menu = EINA_TRUE; 200 item->menu = EINA_TRUE;
@@ -209,13 +213,13 @@ _elm_toolbar_item_menu_cb(void *data,
209 Evas_Object *obj EINA_UNUSED, 213 Evas_Object *obj EINA_UNUSED,
210 void *event_info EINA_UNUSED) 214 void *event_info EINA_UNUSED)
211{ 215{
212 Elm_Toolbar_Item *it = data; 216 Elm_Toolbar_Item_Data *it = data;
213 217
214 if (it->func) it->func((void *)(it->base.data), WIDGET(it), it); 218 if (it->func) it->func((void *)(it->base->data), WIDGET(it), EO_OBJ(it));
215} 219}
216 220
217static void 221static void
218_item_show(Elm_Toolbar_Item *it) 222_item_show(Elm_Toolbar_Item_Data *it)
219{ 223{
220 Evas_Coord x, y, w, h, bx, by; 224 Evas_Coord x, y, w, h, bx, by;
221 225
@@ -229,7 +233,7 @@ _item_show(Elm_Toolbar_Item *it)
229 233
230static void 234static void
231_item_mirrored_set(Evas_Object *obj EINA_UNUSED, 235_item_mirrored_set(Evas_Object *obj EINA_UNUSED,
232 Elm_Toolbar_Item *it, 236 Elm_Toolbar_Item_Data *it,
233 Eina_Bool mirrored) 237 Eina_Bool mirrored)
234{ 238{
235 edje_object_mirrored_set(VIEW(it), mirrored); 239 edje_object_mirrored_set(VIEW(it), mirrored);
@@ -240,7 +244,7 @@ static void
240_mirrored_set(Evas_Object *obj, 244_mirrored_set(Evas_Object *obj,
241 Eina_Bool mirrored) 245 Eina_Bool mirrored)
242{ 246{
243 Elm_Toolbar_Item *it; 247 Elm_Toolbar_Item_Data *it;
244 248
245 ELM_TOOLBAR_DATA_GET(obj, sd); 249 ELM_TOOLBAR_DATA_GET(obj, sd);
246 250
@@ -253,7 +257,7 @@ _mirrored_set(Evas_Object *obj,
253static void 257static void
254_items_size_fit(Evas_Object *obj, Evas_Coord *bl, Evas_Coord view) 258_items_size_fit(Evas_Object *obj, Evas_Coord *bl, Evas_Coord view)
255{ 259{
256 Elm_Toolbar_Item *it, *prev; 260 Elm_Toolbar_Item_Data *it, *prev;
257 Eina_Bool full = EINA_FALSE, more = EINA_FALSE; 261 Eina_Bool full = EINA_FALSE, more = EINA_FALSE;
258 Evas_Coord min, mw, mh; 262 Evas_Coord min, mw, mh;
259 int sumf = 0, sumb = 0, prev_min = 0; 263 int sumf = 0, sumb = 0, prev_min = 0;
@@ -304,7 +308,7 @@ _items_size_fit(Evas_Object *obj, Evas_Coord *bl, Evas_Coord view)
304} 308}
305 309
306static Eina_Bool 310static Eina_Bool
307_elm_toolbar_item_coordinates_calc(Elm_Toolbar_Item *item, 311_elm_toolbar_item_coordinates_calc(Elm_Toolbar_Item_Data *item,
308 Elm_Toolbar_Item_Scrollto_Type type, 312 Elm_Toolbar_Item_Scrollto_Type type,
309 Evas_Coord *x, 313 Evas_Coord *x,
310 Evas_Coord *y, 314 Evas_Coord *y,
@@ -363,7 +367,7 @@ _resize_job(void *data)
363{ 367{
364 Evas_Object *obj = (Evas_Object *)data; 368 Evas_Object *obj = (Evas_Object *)data;
365 Evas_Coord mw, mh, vw = 0, vh = 0, w = 0, h = 0; 369 Evas_Coord mw, mh, vw = 0, vh = 0, w = 0, h = 0;
366 Elm_Toolbar_Item *it; 370 Elm_Toolbar_Item_Data *it;
367 Eina_List *list; 371 Eina_List *list;
368 Eina_Bool more; 372 Eina_Bool more;
369 373
@@ -413,7 +417,7 @@ _resize_job(void *data)
413 _item_menu_destroy(sd->more_item); 417 _item_menu_destroy(sd->more_item);
414 _item_menu_create(sd, sd->more_item); 418 _item_menu_create(sd, sd->more_item);
415 menu = 419 menu =
416 elm_toolbar_item_menu_get((Elm_Object_Item *)sd->more_item); 420 elm_toolbar_item_menu_get(EO_OBJ(sd->more_item));
417 EINA_INLIST_FOREACH(sd->items, it) 421 EINA_INLIST_FOREACH(sd->items, it)
418 { 422 {
419 if (!it->prio.visible) 423 if (!it->prio.visible)
@@ -427,8 +431,8 @@ _resize_job(void *data)
427 menu_it = elm_menu_item_add 431 menu_it = elm_menu_item_add
428 (menu, NULL, it->icon_str, it->label, 432 (menu, NULL, it->icon_str, it->label,
429 _elm_toolbar_item_menu_cb, it); 433 _elm_toolbar_item_menu_cb, it);
430 elm_object_item_disabled_set 434 Eina_Bool disabled = eo_do(EO_OBJ(it), elm_wdg_item_disabled_get());
431 (menu_it, elm_widget_item_disabled_get(it)); 435 eo_do(menu_it, elm_wdg_item_disabled_set(disabled));
432 if (it->o_menu) 436 if (it->o_menu)
433 elm_menu_clone(it->o_menu, menu, menu_it); 437 elm_menu_clone(it->o_menu, menu, menu_it);
434 } 438 }
@@ -599,25 +603,25 @@ _resize_job(void *data)
599} 603}
600 604
601static void 605static void
602_elm_toolbar_item_focused(Elm_Toolbar_Item *it) 606_elm_toolbar_item_focused(Elm_Toolbar_Item_Data *it)
603{ 607{
604 Evas_Object *obj = WIDGET(it); 608 Evas_Object *obj = WIDGET(it);
605 ELM_TOOLBAR_DATA_GET(obj, sd); 609 ELM_TOOLBAR_DATA_GET(obj, sd);
606 const char *focus_raise; 610 const char *focus_raise;
607 611
608 if ((!sd) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) || 612 if ((!sd) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) ||
609 ((Elm_Object_Item *)it == sd->focused_item)) 613 (it == sd->focused_item))
610 return; 614 return;
611 615
612 sd->focused_item = (Elm_Object_Item *)it; 616 sd->focused_item = it;
613 switch (_elm_config->focus_autoscroll_mode) 617 switch (_elm_config->focus_autoscroll_mode)
614 { 618 {
615 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW: 619 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
616 elm_toolbar_item_show((Elm_Object_Item *)it, 620 elm_toolbar_item_show(EO_OBJ(it),
617 ELM_TOOLBAR_ITEM_SCROLLTO_IN); 621 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
618 break; 622 break;
619 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN: 623 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
620 elm_toolbar_item_bring_in((Elm_Object_Item *)it, 624 elm_toolbar_item_bring_in(EO_OBJ(it),
621 ELM_TOOLBAR_ITEM_SCROLLTO_IN); 625 ELM_TOOLBAR_ITEM_SCROLLTO_IN);
622 break; 626 break;
623 default: 627 default:
@@ -635,11 +639,11 @@ _elm_toolbar_item_focused(Elm_Toolbar_Item *it)
635 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 639 if ((focus_raise) && (!strcmp(focus_raise, "on")))
636 evas_object_raise(VIEW(it)); 640 evas_object_raise(VIEW(it));
637 evas_object_smart_callback_call 641 evas_object_smart_callback_call
638 (obj, SIG_ITEM_FOCUSED, it); 642 (obj, SIG_ITEM_FOCUSED, EO_OBJ(it));
639} 643}
640 644
641static void 645static void
642_elm_toolbar_item_unfocused(Elm_Object_Item *it) 646_elm_toolbar_item_unfocused(Elm_Toolbar_Item_Data *it)
643{ 647{
644 Evas_Object *obj = WIDGET(it); 648 Evas_Object *obj = WIDGET(it);
645 ELM_TOOLBAR_DATA_GET(obj, sd); 649 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -658,7 +662,7 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *it)
658 (VIEW(it), "elm,highlight,off", "elm"); 662 (VIEW(it), "elm,highlight,off", "elm");
659 sd->focused_item = NULL; 663 sd->focused_item = NULL;
660 evas_object_smart_callback_call 664 evas_object_smart_callback_call
661 (obj, SIG_ITEM_UNFOCUSED, it); 665 (obj, SIG_ITEM_UNFOCUSED, EO_OBJ(it));
662} 666}
663 667
664/* 668/*
@@ -667,14 +671,14 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *it)
667 * Or this searches other items and checks the nearest fully visible item 671 * Or this searches other items and checks the nearest fully visible item
668 * according to the given item's position. 672 * according to the given item's position.
669 */ 673 */
670static Elm_Object_Item * 674static Elm_Toolbar_Item_Data *
671_elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it) 675_elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Toolbar_Item_Data *it)
672{ 676{
673 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // toolbar viewport geometry 677 Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0; // toolbar viewport geometry
674 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry 678 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; // given item geometry
675 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry 679 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; // candidate item geometry
676 Eina_List *item_list = NULL; 680 Eina_List *item_list = NULL;
677 Elm_Object_Item *item = NULL; 681 Elm_Toolbar_Item_Data *item = NULL;
678 ELM_TOOLBAR_DATA_GET(obj, sd); 682 ELM_TOOLBAR_DATA_GET(obj, sd);
679 Eina_Bool search_next = EINA_FALSE; 683 Eina_Bool search_next = EINA_FALSE;
680 Evas_Object *it_obj; 684 Evas_Object *it_obj;
@@ -688,7 +692,7 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
688 692
689 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) 693 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih))
690 { 694 {
691 if (!elm_object_item_disabled_get(it)) 695 if (!elm_object_item_disabled_get(EO_OBJ(it)))
692 return it; 696 return it;
693 else 697 else
694 search_next = EINA_TRUE; 698 search_next = EINA_TRUE;
@@ -707,7 +711,7 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
707 break; 711 break;
708 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 712 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
709 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 713 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
710 !elm_object_item_disabled_get(item)) 714 !elm_object_item_disabled_get(EO_OBJ(item)))
711 return item; 715 return item;
712 } 716 }
713 } 717 }
@@ -722,7 +726,7 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *it)
722 break; 726 break;
723 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); 727 evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch);
724 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && 728 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) &&
725 !elm_object_item_disabled_get(item)) 729 !elm_object_item_disabled_get(EO_OBJ(item)))
726 return item; 730 return item;
727 } 731 }
728 } 732 }
@@ -734,7 +738,7 @@ _elm_toolbar_elm_widget_on_focus(Eo *obj, Elm_Toolbar_Data *sd)
734{ 738{
735 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 739 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
736 Eina_Bool int_ret = EINA_FALSE; 740 Eina_Bool int_ret = EINA_FALSE;
737 Elm_Object_Item *it = NULL; 741 Elm_Toolbar_Item_Data *it = NULL;
738 742
739 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus()); 743 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus());
740 if (!int_ret) return EINA_FALSE; 744 if (!int_ret) return EINA_FALSE;
@@ -746,12 +750,16 @@ _elm_toolbar_elm_widget_on_focus(Eo *obj, Elm_Toolbar_Data *sd)
746 it = sd->last_focused_item; 750 it = sd->last_focused_item;
747 else if (_elm_config->first_item_focus_on_first_focus_in && 751 else if (_elm_config->first_item_focus_on_first_focus_in &&
748 elm_widget_focus_highlight_enabled_get(obj)) 752 elm_widget_focus_highlight_enabled_get(obj))
749 it = elm_toolbar_first_item_get(obj); 753 {
754 Elm_Object_Item *eo_it = elm_toolbar_first_item_get(obj);
755 if (!eo_it) it = NULL;
756 else it = eo_data_scope_get(eo_it, ELM_TOOLBAR_ITEM_CLASS);
757 }
750 758
751 if (it) 759 if (it)
752 { 760 {
753 it = _elm_toolbar_nearest_visible_item_get(obj, it); 761 it = _elm_toolbar_nearest_visible_item_get(obj, it);
754 if (it) _elm_toolbar_item_focused((Elm_Toolbar_Item *)it); 762 if (it) _elm_toolbar_item_focused(it);
755 } 763 }
756 evas_object_focus_set(wd->resize_obj, EINA_TRUE); 764 evas_object_focus_set(wd->resize_obj, EINA_TRUE);
757 } 765 }
@@ -765,12 +773,12 @@ _elm_toolbar_elm_widget_on_focus(Eo *obj, Elm_Toolbar_Data *sd)
765 return EINA_TRUE; 773 return EINA_TRUE;
766} 774}
767 775
768static Elm_Toolbar_Item * 776static Elm_Toolbar_Item_Data *
769_focus_next_item_get(Evas_Object *obj, Eina_Bool reverse) 777_focus_next_item_get(Evas_Object *obj, Eina_Bool reverse)
770{ 778{
771 ELM_TOOLBAR_DATA_GET(obj, sd); 779 ELM_TOOLBAR_DATA_GET(obj, sd);
772 Eina_List *list = NULL; 780 Eina_List *list = NULL;
773 Elm_Toolbar_Item *it = NULL; 781 Elm_Toolbar_Item_Data *it = NULL;
774 Evas_Object *it_obj = NULL; 782 Evas_Object *it_obj = NULL;
775 783
776 list = evas_object_box_children_get(sd->bx); 784 list = evas_object_box_children_get(sd->bx);
@@ -788,7 +796,7 @@ _focus_next_item_get(Evas_Object *obj, Eina_Bool reverse)
788 796
789 while (it && 797 while (it &&
790 (it->separator || 798 (it->separator ||
791 elm_object_item_disabled_get((Elm_Object_Item *)it))) 799 elm_object_item_disabled_get(EO_OBJ(it))))
792 { 800 {
793 if (list) list = eina_list_next(list); 801 if (list) list = eina_list_next(list);
794 if (!list) 802 if (!list)
@@ -804,8 +812,8 @@ _focus_next_item_get(Evas_Object *obj, Eina_Bool reverse)
804 return it; 812 return it;
805} 813}
806 814
807static void 815EOLIAN static void
808_item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused) 816_elm_toolbar_item_elm_widget_item_focus_set(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it, Eina_Bool focused)
809{ 817{
810 ELM_TOOLBAR_ITEM_CHECK(it); 818 ELM_TOOLBAR_ITEM_CHECK(it);
811 Evas_Object *obj = WIDGET(it); 819 Evas_Object *obj = WIDGET(it);
@@ -816,11 +824,11 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
816 sd->last_focused_item = it; 824 sd->last_focused_item = it;
817 if (!elm_object_focus_get(obj)) 825 if (!elm_object_focus_get(obj))
818 elm_object_focus_set(obj, EINA_TRUE); 826 elm_object_focus_set(obj, EINA_TRUE);
819 if (it != (Elm_Object_Item *)sd->focused_item) 827 if (it != sd->focused_item)
820 { 828 {
821 if (sd->focused_item) 829 if (sd->focused_item)
822 _elm_toolbar_item_unfocused(sd->focused_item); 830 _elm_toolbar_item_unfocused(sd->focused_item);
823 _elm_toolbar_item_focused((Elm_Toolbar_Item *)it); 831 _elm_toolbar_item_focused(it);
824 } 832 }
825 } 833 }
826 else 834 else
@@ -829,13 +837,13 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
829 _elm_toolbar_item_unfocused(it); 837 _elm_toolbar_item_unfocused(it);
830 } 838 }
831 839
832 _elm_widget_item_highlight_in_theme(obj, (Elm_Object_Item *)it); 840 _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
833 _elm_widget_highlight_in_theme_update(obj); 841 _elm_widget_highlight_in_theme_update(obj);
834 _elm_widget_focus_highlight_start(obj); 842 _elm_widget_focus_highlight_start(obj);
835} 843}
836 844
837static Eina_Bool 845EOLIAN static Eina_Bool
838_item_focus_get_hook(Elm_Object_Item *it) 846_elm_toolbar_item_elm_widget_item_focus_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it)
839{ 847{
840 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 848 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
841 Evas_Object *obj = WIDGET(it); 849 Evas_Object *obj = WIDGET(it);
@@ -853,7 +861,7 @@ _item_focused_next( Evas_Object *obj,
853 Elm_Focus_Direction dir) 861 Elm_Focus_Direction dir)
854{ 862{
855 ELM_TOOLBAR_DATA_GET(obj, sd); 863 ELM_TOOLBAR_DATA_GET(obj, sd);
856 Elm_Toolbar_Item *next_focused_item; 864 Elm_Toolbar_Item_Data *next_focused_item;
857 865
858 next_focused_item = _focus_next_item_get(obj, reverse); 866 next_focused_item = _focus_next_item_get(obj, reverse);
859 if (!next_focused_item) 867 if (!next_focused_item)
@@ -862,7 +870,7 @@ _item_focused_next( Evas_Object *obj,
862 if ((!sd->vertical && (dir == ELM_FOCUS_LEFT || dir == ELM_FOCUS_RIGHT)) 870 if ((!sd->vertical && (dir == ELM_FOCUS_LEFT || dir == ELM_FOCUS_RIGHT))
863 || (sd->vertical && (dir == ELM_FOCUS_UP || dir == ELM_FOCUS_DOWN))) 871 || (sd->vertical && (dir == ELM_FOCUS_UP || dir == ELM_FOCUS_DOWN)))
864 { 872 {
865 elm_object_item_focus_set((Elm_Object_Item *)next_focused_item, EINA_TRUE); 873 elm_object_item_focus_set(EO_OBJ(next_focused_item), EINA_TRUE);
866 return EINA_TRUE; 874 return EINA_TRUE;
867 } 875 }
868 _elm_widget_focus_highlight_start(obj); 876 _elm_widget_focus_highlight_start(obj);
@@ -875,7 +883,7 @@ _key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
875 ELM_TOOLBAR_DATA_GET(obj, sd); 883 ELM_TOOLBAR_DATA_GET(obj, sd);
876 884
877 if (sd->focused_item) 885 if (sd->focused_item)
878 _item_select((Elm_Toolbar_Item *)sd->focused_item); 886 _item_select(sd->focused_item);
879 887
880 return EINA_TRUE; 888 return EINA_TRUE;
881} 889}
@@ -946,14 +954,12 @@ _resize_cb(void *data,
946 sd->resize_job = ecore_job_add(_resize_job, data); 954 sd->resize_job = ecore_job_add(_resize_job, data);
947} 955}
948 956
949static void 957EOLIAN static void
950_item_disable_hook(Elm_Object_Item *it) 958_elm_toolbar_item_elm_widget_item_disable(Eo *eo_toolbar, Elm_Toolbar_Item_Data *toolbar_it)
951{ 959{
952 Elm_Toolbar_Item *toolbar_it = (Elm_Toolbar_Item *)it;
953
954 const char* emission; 960 const char* emission;
955 961
956 if (elm_widget_item_disabled_get(toolbar_it)) 962 if (eo_do(eo_toolbar, elm_wdg_item_disabled_get()))
957 emission = "elm,state,disabled"; 963 emission = "elm,state,disabled";
958 else 964 else
959 emission = "elm,state,enabled"; 965 emission = "elm,state,enabled";
@@ -1003,7 +1009,7 @@ _menu_move_resize_cb(void *data,
1003 Evas_Object *obj EINA_UNUSED, 1009 Evas_Object *obj EINA_UNUSED,
1004 void *event_info EINA_UNUSED) 1010 void *event_info EINA_UNUSED)
1005{ 1011{
1006 Elm_Toolbar_Item *it = data; 1012 Elm_Toolbar_Item_Data *it = data;
1007 Evas_Coord x, y, h; 1013 Evas_Coord x, y, h;
1008 1014
1009 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); 1015 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
@@ -1014,15 +1020,14 @@ _menu_move_resize_cb(void *data,
1014} 1020}
1015 1021
1016static void 1022static void
1017_item_select(Elm_Toolbar_Item *it) 1023_item_select(Elm_Toolbar_Item_Data *it)
1018{ 1024{
1019 Elm_Toolbar_Item *it2;
1020 Evas_Object *obj; 1025 Evas_Object *obj;
1021 Eina_Bool sel; 1026 Eina_Bool sel;
1022 1027
1023 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); 1028 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
1024 1029
1025 if (elm_widget_item_disabled_get(it) || (it->separator) || (it->object)) 1030 if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) || (it->separator) || (it->object))
1026 return; 1031 return;
1027 sel = it->selected; 1032 sel = it->selected;
1028 1033
@@ -1045,8 +1050,8 @@ _item_select(Elm_Toolbar_Item *it)
1045 } 1050 }
1046 else 1051 else
1047 { 1052 {
1048 it2 = (Elm_Toolbar_Item *) 1053 Elm_Object_Item *eo_it2 = elm_toolbar_selected_item_get(WIDGET(it));
1049 elm_toolbar_selected_item_get(WIDGET(it)); 1054 ELM_TOOLBAR_ITEM_DATA_GET(eo_it2, it2);
1050 _item_unselect(it2); 1055 _item_unselect(it2);
1051 1056
1052 it->selected = EINA_TRUE; 1057 it->selected = EINA_TRUE;
@@ -1107,14 +1112,14 @@ _item_select(Elm_Toolbar_Item *it)
1107 1112
1108 if ((!sel) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS)) 1113 if ((!sel) || (sd->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS))
1109 { 1114 {
1110 if (it->func) it->func((void *)(it->base.data), WIDGET(it), it); 1115 if (it->func) it->func((void *)(it->base->data), WIDGET(it), EO_OBJ(it));
1111 } 1116 }
1112 evas_object_smart_callback_call(obj, SIG_CLICKED, it); 1117 evas_object_smart_callback_call(obj, SIG_CLICKED, EO_OBJ(it));
1113 evas_object_smart_callback_call(obj, SIG_SELECTED, it); 1118 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it));
1114} 1119}
1115 1120
1116static void 1121static void
1117_item_del(Elm_Toolbar_Item *it) 1122_item_del(Elm_Toolbar_Item_Data *it)
1118{ 1123{
1119 Elm_Toolbar_Item_State *it_state; 1124 Elm_Toolbar_Item_State *it_state;
1120 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); 1125 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
@@ -1142,9 +1147,9 @@ _item_del(Elm_Toolbar_Item *it)
1142 evas_object_del(it->icon); 1147 evas_object_del(it->icon);
1143 } 1148 }
1144 1149
1145 if (sd->focused_item == (Elm_Object_Item *)it) 1150 if (sd->focused_item == it)
1146 sd->focused_item = NULL; 1151 sd->focused_item = NULL;
1147 if (sd->last_focused_item == (Elm_Object_Item *)it) 1152 if (sd->last_focused_item == it)
1148 sd->last_focused_item = NULL; 1153 sd->last_focused_item = NULL;
1149 1154
1150 evas_object_del(it->object); 1155 evas_object_del(it->object);
@@ -1155,7 +1160,7 @@ _item_del(Elm_Toolbar_Item *it)
1155 1160
1156static void 1161static void
1157_item_theme_hook(Evas_Object *obj, 1162_item_theme_hook(Evas_Object *obj,
1158 Elm_Toolbar_Item *it, 1163 Elm_Toolbar_Item_Data *it,
1159 double scale, 1164 double scale,
1160 int icon_size) 1165 int icon_size)
1161{ 1166{
@@ -1179,7 +1184,7 @@ _item_theme_hook(Evas_Object *obj,
1179 if (it->icon) 1184 if (it->icon)
1180 elm_widget_signal_emit(it->icon, "elm,state,selected", "elm"); 1185 elm_widget_signal_emit(it->icon, "elm,state,selected", "elm");
1181 } 1186 }
1182 if (elm_widget_item_disabled_get(it)) 1187 if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()))
1183 { 1188 {
1184 edje_object_signal_emit(view, "elm,state,disabled", "elm"); 1189 edje_object_signal_emit(view, "elm,state,disabled", "elm");
1185 if (it->icon) 1190 if (it->icon)
@@ -1258,7 +1263,7 @@ static void
1258_inform_item_number(Evas_Object *obj) 1263_inform_item_number(Evas_Object *obj)
1259{ 1264{
1260 ELM_TOOLBAR_DATA_GET(obj, sd); 1265 ELM_TOOLBAR_DATA_GET(obj, sd);
1261 Elm_Toolbar_Item *it; 1266 Elm_Toolbar_Item_Data *it;
1262 char buf[sizeof("elm,number,item,") + 4]; 1267 char buf[sizeof("elm,number,item,") + 4];
1263 static int scount = 0; 1268 static int scount = 0;
1264 int count = 0; 1269 int count = 0;
@@ -1372,7 +1377,7 @@ _elm_toolbar_highlight_in_theme(Evas_Object *obj)
1372EOLIAN static Eina_Bool 1377EOLIAN static Eina_Bool
1373_elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd) 1378_elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
1374{ 1379{
1375 Elm_Toolbar_Item *it; 1380 Elm_Toolbar_Item_Data *it;
1376 double scale = 0; 1381 double scale = 0;
1377 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 1382 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1378 1383
@@ -1418,7 +1423,7 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
1418} 1423}
1419 1424
1420static void 1425static void
1421_elm_toolbar_item_label_update(Elm_Toolbar_Item *item) 1426_elm_toolbar_item_label_update(Elm_Toolbar_Item_Data *item)
1422{ 1427{
1423 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1; 1428 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1;
1424 1429
@@ -1476,7 +1481,7 @@ _elm_toolbar_item_label_set_cb(void *data,
1476 const char *emission, 1481 const char *emission,
1477 const char *source) 1482 const char *source)
1478{ 1483{
1479 Elm_Toolbar_Item *item = data; 1484 Elm_Toolbar_Item_Data *item = data;
1480 1485
1481 _elm_toolbar_item_label_update(item); 1486 _elm_toolbar_item_label_update(item);
1482 edje_object_signal_callback_del 1487 edje_object_signal_callback_del
@@ -1485,7 +1490,7 @@ _elm_toolbar_item_label_set_cb(void *data,
1485} 1490}
1486 1491
1487static void 1492static void
1488_item_label_set(Elm_Toolbar_Item *item, 1493_item_label_set(Elm_Toolbar_Item_Data *item,
1489 const char *label, 1494 const char *label,
1490 const char *sig) 1495 const char *sig)
1491{ 1496{
@@ -1510,19 +1515,17 @@ _item_label_set(Elm_Toolbar_Item *item,
1510 _resize_cb(WIDGET(item), NULL, NULL, NULL); 1515 _resize_cb(WIDGET(item), NULL, NULL, NULL);
1511} 1516}
1512 1517
1513static void 1518EOLIAN static void
1514_item_text_set_hook(Elm_Object_Item *it, 1519_elm_toolbar_item_elm_widget_item_part_text_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
1515 const char *part, 1520 const char *part,
1516 const char *label) 1521 const char *label)
1517{ 1522{
1518 Elm_Toolbar_Item *item;
1519 char buf[256]; 1523 char buf[256];
1520 item = (Elm_Toolbar_Item *)it;
1521 1524
1522 if ((!part) || (!strcmp(part, "default")) || 1525 if ((!part) || (!strcmp(part, "default")) ||
1523 (!strcmp(part, "elm.text"))) 1526 (!strcmp(part, "elm.text")))
1524 { 1527 {
1525 _item_label_set(((Elm_Toolbar_Item *)it), label, "elm,state,label_set"); 1528 _item_label_set(item, label, "elm,state,label_set");
1526 } 1529 }
1527 else 1530 else
1528 { 1531 {
@@ -1540,8 +1543,8 @@ _item_text_set_hook(Elm_Object_Item *it,
1540 } 1543 }
1541} 1544}
1542 1545
1543static const char * 1546EOLIAN static const char *
1544_item_text_get_hook(const Elm_Object_Item *it, 1547_elm_toolbar_item_elm_widget_item_part_text_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
1545 const char *part) 1548 const char *part)
1546{ 1549{
1547 char buf[256]; 1550 char buf[256];
@@ -1554,12 +1557,11 @@ _item_text_get_hook(const Elm_Object_Item *it,
1554 return edje_object_part_text_get(VIEW(it), buf); 1557 return edje_object_part_text_get(VIEW(it), buf);
1555} 1558}
1556 1559
1557static void 1560EOLIAN static void
1558_item_content_set_hook(Elm_Object_Item *it, 1561_elm_toolbar_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
1559 const char *part, 1562 const char *part,
1560 Evas_Object *content) 1563 Evas_Object *content)
1561{ 1564{
1562 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
1563 Evas_Object *obj = WIDGET(item); 1565 Evas_Object *obj = WIDGET(item);
1564 double scale; 1566 double scale;
1565 1567
@@ -1578,19 +1580,18 @@ _item_content_set_hook(Elm_Object_Item *it,
1578 _item_theme_hook(obj, item, scale, sd->icon_size); 1580 _item_theme_hook(obj, item, scale, sd->icon_size);
1579} 1581}
1580 1582
1581static Evas_Object * 1583EOLIAN static Evas_Object *
1582_item_content_get_hook(const Elm_Object_Item *it, 1584_elm_toolbar_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
1583 const char *part) 1585 const char *part)
1584{ 1586{
1585 if (part && strcmp(part, "object")) return NULL; 1587 if (part && strcmp(part, "object")) return NULL;
1586 return ((Elm_Toolbar_Item *)it)->object; 1588 return it->object;
1587} 1589}
1588 1590
1589static Evas_Object * 1591EOLIAN static Evas_Object *
1590_item_content_unset_hook(Elm_Object_Item *it, 1592_elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
1591 const char *part) 1593 const char *part)
1592{ 1594{
1593 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
1594 Evas_Object *obj = WIDGET(item); 1595 Evas_Object *obj = WIDGET(item);
1595 Evas_Object *o; 1596 Evas_Object *o;
1596 double scale; 1597 double scale;
@@ -1599,7 +1600,7 @@ _item_content_unset_hook(Elm_Object_Item *it,
1599 1600
1600 if (part && strcmp(part, "object")) return NULL; 1601 if (part && strcmp(part, "object")) return NULL;
1601 1602
1602 edje_object_part_unswallow(VIEW(it), item->object); 1603 edje_object_part_unswallow(VIEW(item), item->object);
1603 elm_widget_sub_object_del(obj, item->object); 1604 elm_widget_sub_object_del(obj, item->object);
1604 o = item->object; 1605 o = item->object;
1605 item->object = NULL; 1606 item->object = NULL;
@@ -1612,10 +1613,10 @@ _item_content_unset_hook(Elm_Object_Item *it,
1612EOLIAN static Eina_Bool 1613EOLIAN static Eina_Bool
1613_elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 1614_elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
1614{ 1615{
1615 Elm_Toolbar_Item *it; 1616 Elm_Toolbar_Item_Data *it;
1616 1617
1617 EINA_INLIST_FOREACH(sd->items, it) 1618 EINA_INLIST_FOREACH(sd->items, it)
1618 elm_widget_item_translate(it); 1619 eo_do(EO_OBJ(it), elm_wdg_item_translate());
1619 1620
1620 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 1621 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
1621 1622
@@ -1646,7 +1647,7 @@ _move_cb(void *data,
1646} 1647}
1647 1648
1648static void 1649static void
1649_select_filter_cb(Elm_Toolbar_Item *it, 1650_select_filter_cb(Elm_Toolbar_Item_Data *it,
1650 Evas_Object *obj EINA_UNUSED, 1651 Evas_Object *obj EINA_UNUSED,
1651 const char *emission, 1652 const char *emission,
1652 const char *source EINA_UNUSED) 1653 const char *source EINA_UNUSED)
@@ -1666,7 +1667,7 @@ _select_cb(void *data,
1666 const char *emission EINA_UNUSED, 1667 const char *emission EINA_UNUSED,
1667 const char *source EINA_UNUSED) 1668 const char *source EINA_UNUSED)
1668{ 1669{
1669 Elm_Toolbar_Item *it = data; 1670 Elm_Toolbar_Item_Data *it = data;
1670 1671
1671 if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) || 1672 if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
1672 (_elm_access_2nd_click_timeout(VIEW(it)))) 1673 (_elm_access_2nd_click_timeout(VIEW(it))))
@@ -1683,7 +1684,7 @@ _item_move_cb(void *data,
1683 Evas_Object *obj EINA_UNUSED, 1684 Evas_Object *obj EINA_UNUSED,
1684 void *event_info EINA_UNUSED) 1685 void *event_info EINA_UNUSED)
1685{ 1686{
1686 Elm_Toolbar_Item *item = data; 1687 Elm_Toolbar_Item_Data *item = data;
1687 1688
1688 item->on_move = EINA_FALSE; 1689 item->on_move = EINA_FALSE;
1689 1690
@@ -1692,9 +1693,9 @@ _item_move_cb(void *data,
1692} 1693}
1693 1694
1694static void 1695static void
1695_items_change(Elm_Toolbar_Item *reorder_from, Elm_Toolbar_Item *reorder_to) 1696_items_change(Elm_Toolbar_Item_Data *reorder_from, Elm_Toolbar_Item_Data *reorder_to)
1696{ 1697{
1697 Elm_Toolbar_Item *prev = NULL, *next = NULL; 1698 Elm_Toolbar_Item_Data *prev = NULL, *next = NULL;
1698 int tmp; 1699 int tmp;
1699 1700
1700 if (!reorder_from) return; 1701 if (!reorder_from) return;
@@ -1768,7 +1769,7 @@ _items_change(Elm_Toolbar_Item *reorder_from, Elm_Toolbar_Item *reorder_to)
1768static void 1769static void
1769_transit_del_cb(void *data, Elm_Transit *transit EINA_UNUSED) 1770_transit_del_cb(void *data, Elm_Transit *transit EINA_UNUSED)
1770{ 1771{
1771 Elm_Toolbar_Item *it, *item = data; 1772 Elm_Toolbar_Item_Data *it, *item = data;
1772 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); 1773 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
1773 1774
1774 if (item->reorder_to) 1775 if (item->reorder_to)
@@ -1810,7 +1811,7 @@ _transit_del_cb(void *data, Elm_Transit *transit EINA_UNUSED)
1810 1811
1811static void 1812static void
1812_item_transition_start 1813_item_transition_start
1813(Elm_Toolbar_Item *it, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) 1814(Elm_Toolbar_Item_Data *it, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
1814{ 1815{
1815 Evas_Coord tx, ty; 1816 Evas_Coord tx, ty;
1816 Evas_Object *obj = WIDGET(it), *img = NULL; 1817 Evas_Object *obj = WIDGET(it), *img = NULL;
@@ -1839,10 +1840,10 @@ _item_transition_start
1839} 1840}
1840 1841
1841static void 1842static void
1842_animate_missed_items(Elm_Toolbar_Item *prev, Elm_Toolbar_Item *next) 1843_animate_missed_items(Elm_Toolbar_Item_Data *prev, Elm_Toolbar_Item_Data *next)
1843{ 1844{
1844 ELM_TOOLBAR_DATA_GET(WIDGET(prev), sd); 1845 ELM_TOOLBAR_DATA_GET(WIDGET(prev), sd);
1845 Elm_Toolbar_Item *it, *it2; 1846 Elm_Toolbar_Item_Data *it, *it2;
1846 Eina_List *list, *l; 1847 Eina_List *list, *l;
1847 Evas_Object *o; 1848 Evas_Object *o;
1848 Eina_Bool reverse = EINA_FALSE; 1849 Eina_Bool reverse = EINA_FALSE;
@@ -1897,14 +1898,14 @@ _animate_missed_items(Elm_Toolbar_Item *prev, Elm_Toolbar_Item *next)
1897} 1898}
1898 1899
1899static void 1900static void
1900_mouse_move_reorder(Elm_Toolbar_Item *item, 1901_mouse_move_reorder(Elm_Toolbar_Item_Data *item,
1901 Evas *evas EINA_UNUSED, 1902 Evas *evas EINA_UNUSED,
1902 Evas_Object *obj EINA_UNUSED, 1903 Evas_Object *obj EINA_UNUSED,
1903 Evas_Event_Mouse_Move *ev) 1904 Evas_Event_Mouse_Move *ev)
1904{ 1905{
1905 Evas_Coord x, y, w, h; 1906 Evas_Coord x, y, w, h;
1906 Evas_Coord fx, fy, fw, fh; 1907 Evas_Coord fx, fy, fw, fh;
1907 Elm_Toolbar_Item *it, *it2; 1908 Elm_Toolbar_Item_Data *it, *it2;
1908 1909
1909 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); 1910 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
1910 1911
@@ -1952,7 +1953,7 @@ _mouse_move_reorder(Elm_Toolbar_Item *item,
1952} 1953}
1953 1954
1954static void 1955static void
1955_mouse_up_reorder(Elm_Toolbar_Item *it, 1956_mouse_up_reorder(Elm_Toolbar_Item_Data *it,
1956 Evas *evas EINA_UNUSED, 1957 Evas *evas EINA_UNUSED,
1957 Evas_Object *obj, 1958 Evas_Object *obj,
1958 Evas_Event_Mouse_Up *ev EINA_UNUSED) 1959 Evas_Event_Mouse_Up *ev EINA_UNUSED)
@@ -1985,7 +1986,7 @@ _mouse_up_reorder(Elm_Toolbar_Item *it,
1985} 1986}
1986 1987
1987static void 1988static void
1988_item_reorder_start(Elm_Toolbar_Item *item) 1989_item_reorder_start(Elm_Toolbar_Item_Data *item)
1989{ 1990{
1990 Evas_Object *obj = WIDGET(item), *img = NULL; 1991 Evas_Object *obj = WIDGET(item), *img = NULL;
1991 Evas_Coord x, y, w, h; 1992 Evas_Coord x, y, w, h;
@@ -2035,7 +2036,7 @@ _item_reorder_start(Elm_Toolbar_Item *item)
2035static Eina_Bool 2036static Eina_Bool
2036_long_press_cb(void *data) 2037_long_press_cb(void *data)
2037{ 2038{
2038 Elm_Toolbar_Item *it = data; 2039 Elm_Toolbar_Item_Data *it = data;
2039 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); 2040 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
2040 2041
2041 sd->long_timer = NULL; 2042 sd->long_timer = NULL;
@@ -2044,13 +2045,13 @@ _long_press_cb(void *data)
2044 if (sd->reorder_mode) 2045 if (sd->reorder_mode)
2045 _item_reorder_start(it); 2046 _item_reorder_start(it);
2046 2047
2047 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it); 2048 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, EO_OBJ(it));
2048 2049
2049 return ECORE_CALLBACK_CANCEL; 2050 return ECORE_CALLBACK_CANCEL;
2050} 2051}
2051 2052
2052static void 2053static void
2053_mouse_move_cb(Elm_Toolbar_Item *it, 2054_mouse_move_cb(Elm_Toolbar_Item_Data *it,
2054 Evas *evas EINA_UNUSED, 2055 Evas *evas EINA_UNUSED,
2055 Evas_Object *obj EINA_UNUSED, 2056 Evas_Object *obj EINA_UNUSED,
2056 Evas_Event_Mouse_Move *ev) 2057 Evas_Event_Mouse_Move *ev)
@@ -2068,7 +2069,7 @@ _mouse_move_cb(Elm_Toolbar_Item *it,
2068} 2069}
2069 2070
2070static void 2071static void
2071_mouse_down_cb(Elm_Toolbar_Item *it, 2072_mouse_down_cb(Elm_Toolbar_Item_Data *it,
2072 Evas *evas EINA_UNUSED, 2073 Evas *evas EINA_UNUSED,
2073 Evas_Object *obj EINA_UNUSED, 2074 Evas_Object *obj EINA_UNUSED,
2074 Evas_Event_Mouse_Down *ev) 2075 Evas_Event_Mouse_Down *ev)
@@ -2077,7 +2078,7 @@ _mouse_down_cb(Elm_Toolbar_Item *it,
2077 2078
2078 if (ev->button != 1) return; 2079 if (ev->button != 1) return;
2079 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 2080 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
2080 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it); 2081 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, EO_OBJ(it));
2081 sd->mouse_down = EINA_TRUE; 2082 sd->mouse_down = EINA_TRUE;
2082 sd->long_press = EINA_FALSE; 2083 sd->long_press = EINA_FALSE;
2083 if (sd->long_timer) 2084 if (sd->long_timer)
@@ -2092,7 +2093,7 @@ _mouse_down_cb(Elm_Toolbar_Item *it,
2092} 2093}
2093 2094
2094static void 2095static void
2095_mouse_up_cb(Elm_Toolbar_Item *it, 2096_mouse_up_cb(Elm_Toolbar_Item_Data *it,
2096 Evas *evas EINA_UNUSED, 2097 Evas *evas EINA_UNUSED,
2097 Evas_Object *obj EINA_UNUSED, 2098 Evas_Object *obj EINA_UNUSED,
2098 Evas_Event_Mouse_Up *ev) 2099 Evas_Event_Mouse_Up *ev)
@@ -2102,9 +2103,9 @@ _mouse_up_cb(Elm_Toolbar_Item *it,
2102 if (ev->button != 1) return; 2103 if (ev->button != 1) return;
2103 sd->mouse_down = EINA_FALSE; 2104 sd->mouse_down = EINA_FALSE;
2104 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del); 2105 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
2105 if ((!elm_object_item_disabled_get((Elm_Object_Item *)it)) && 2106 if ((!elm_object_item_disabled_get(EO_OBJ(it))) &&
2106 (sd->focused_item != (Elm_Object_Item *)it)) 2107 (sd->focused_item != it))
2107 elm_object_item_focus_set((Elm_Object_Item *)it, EINA_TRUE); 2108 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
2108 evas_object_event_callback_del_full 2109 evas_object_event_callback_del_full
2109 (VIEW(it), EVAS_CALLBACK_MOUSE_MOVE, 2110 (VIEW(it), EVAS_CALLBACK_MOUSE_MOVE,
2110 (Evas_Object_Event_Cb)_mouse_move_cb, it); 2111 (Evas_Object_Event_Cb)_mouse_move_cb, it);
@@ -2116,15 +2117,15 @@ _mouse_in_cb(void *data,
2116 const char *emission EINA_UNUSED, 2117 const char *emission EINA_UNUSED,
2117 const char *source EINA_UNUSED) 2118 const char *source EINA_UNUSED)
2118{ 2119{
2119 Elm_Toolbar_Item *it = data; 2120 Elm_Toolbar_Item_Data *it = data;
2120 2121
2121 edje_object_signal_emit(VIEW(it), "elm,state,highlighted", "elm"); 2122 edje_object_signal_emit(VIEW(it), "elm,state,highlighted", "elm");
2122 if (it->icon) 2123 if (it->icon)
2123 elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm"); 2124 elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm");
2124 2125
2125 if (!elm_object_item_disabled_get(data) && 2126 if (!elm_object_item_disabled_get(EO_OBJ(it)) &&
2126 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN)) 2127 (_elm_config->focus_move_policy == ELM_FOCUS_MOVE_POLICY_IN))
2127 elm_object_item_focus_set(data, EINA_TRUE); 2128 elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
2128} 2129}
2129 2130
2130static void 2131static void
@@ -2133,7 +2134,7 @@ _mouse_out_cb(void *data,
2133 const char *emission EINA_UNUSED, 2134 const char *emission EINA_UNUSED,
2134 const char *source EINA_UNUSED) 2135 const char *source EINA_UNUSED)
2135{ 2136{
2136 Elm_Toolbar_Item *it = data; 2137 Elm_Toolbar_Item_Data *it = data;
2137 2138
2138 edje_object_signal_emit(VIEW(it), "elm,state,unhighlighted", "elm"); 2139 edje_object_signal_emit(VIEW(it), "elm,state,unhighlighted", "elm");
2139 if (it->icon) 2140 if (it->icon)
@@ -2193,8 +2194,8 @@ _layout(Evas_Object *o,
2193static char * 2194static char *
2194_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) 2195_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
2195{ 2196{
2196 Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)data; 2197 Elm_Toolbar_Item_Data *it = (Elm_Toolbar_Item_Data *)data;
2197 const char *txt = ((Elm_Widget_Item_Data *)it)->access_info; 2198 const char *txt = (it->base)->access_info;
2198 2199
2199 if (!txt) txt = it->label; 2200 if (!txt) txt = it->label;
2200 if (txt) return strdup(txt); 2201 if (txt) return strdup(txt);
@@ -2205,11 +2206,11 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
2205static char * 2206static char *
2206_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED) 2207_access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
2207{ 2208{
2208 Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)data; 2209 Elm_Toolbar_Item_Data *it = (Elm_Toolbar_Item_Data *)data;
2209 2210
2210 if (it->separator) 2211 if (it->separator)
2211 return strdup(E_("Separator")); 2212 return strdup(E_("Separator"));
2212 else if (elm_widget_item_disabled_get(it)) 2213 else if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()))
2213 return strdup(E_("State: Disabled")); 2214 return strdup(E_("State: Disabled"));
2214 else if (it->selected) 2215 else if (it->selected)
2215 return strdup(E_("State: Selected")); 2216 return strdup(E_("State: Selected"));
@@ -2219,14 +2220,12 @@ _access_state_cb(void *data, Evas_Object *obj EINA_UNUSED)
2219 return NULL; 2220 return NULL;
2220} 2221}
2221 2222
2222static Eina_Bool 2223EOLIAN static Eina_Bool
2223_item_del_pre_hook(Elm_Object_Item *it) 2224_elm_toolbar_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
2224{ 2225{
2225 Elm_Toolbar_Item *item, *next = NULL; 2226 Elm_Toolbar_Item_Data *next = NULL;
2226 Evas_Object *obj; 2227 Evas_Object *obj;
2227 2228
2228 item = (Elm_Toolbar_Item *)it;
2229
2230 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); 2229 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
2231 2230
2232 obj = WIDGET(item); 2231 obj = WIDGET(item);
@@ -2258,11 +2257,10 @@ _access_activate_cb(void *data EINA_UNUSED,
2258 Evas_Object *part_obj EINA_UNUSED, 2257 Evas_Object *part_obj EINA_UNUSED,
2259 Elm_Object_Item *item) 2258 Elm_Object_Item *item)
2260{ 2259{
2261 Elm_Toolbar_Item *it; 2260 ELM_TOOLBAR_ITEM_DATA_GET(item, it);
2262 it = (Elm_Toolbar_Item *)item;
2263 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); 2261 ELM_TOOLBAR_DATA_GET(WIDGET(it), sd);
2264 2262
2265 if (elm_widget_item_disabled_get(it)) return; 2263 if (eo_do(item, elm_wdg_item_disabled_get())) return;
2266 2264
2267 if (it->selected && (sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS)) 2265 if (it->selected && (sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS))
2268 { 2266 {
@@ -2277,11 +2275,11 @@ _access_activate_cb(void *data EINA_UNUSED,
2277} 2275}
2278 2276
2279static void 2277static void
2280_access_widget_item_register(Elm_Toolbar_Item *it) 2278_access_widget_item_register(Elm_Toolbar_Item_Data *it)
2281{ 2279{
2282 Elm_Access_Info *ai; 2280 Elm_Access_Info *ai;
2283 _elm_access_widget_item_register((Elm_Widget_Item_Data *)it); 2281 _elm_access_widget_item_register(it->base);
2284 ai = _elm_access_info_get(it->base.access_obj); 2282 ai = _elm_access_info_get(it->base->access_obj);
2285 2283
2286 _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Toolbar Item")); 2284 _elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("Toolbar Item"));
2287 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it); 2285 _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, it);
@@ -2289,7 +2287,14 @@ _access_widget_item_register(Elm_Toolbar_Item *it)
2289 _elm_access_activate_callback_set(ai, _access_activate_cb, NULL); 2287 _elm_access_activate_callback_set(ai, _access_activate_cb, NULL);
2290} 2288}
2291 2289
2292static Elm_Toolbar_Item * 2290EOLIAN static void
2291_elm_toolbar_item_eo_base_constructor(Eo *eo_it, Elm_Toolbar_Item_Data *it)
2292{
2293 eo_do_super(eo_it, ELM_TOOLBAR_ITEM_CLASS, eo_constructor());
2294 it->base = eo_data_scope_get(eo_it, ELM_WIDGET_ITEM_CLASS);
2295}
2296
2297static Elm_Toolbar_Item_Data *
2293_item_new(Evas_Object *obj, 2298_item_new(Evas_Object *obj,
2294 const char *icon, 2299 const char *icon,
2295 const char *label, 2300 const char *label,
@@ -2297,7 +2302,6 @@ _item_new(Evas_Object *obj,
2297 const void *data) 2302 const void *data)
2298{ 2303{
2299 Evas_Object *icon_obj; 2304 Evas_Object *icon_obj;
2300 Elm_Toolbar_Item *it;
2301 Evas_Coord mw, mh; 2305 Evas_Coord mw, mh;
2302 2306
2303 ELM_TOOLBAR_DATA_GET(obj, sd); 2307 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -2306,22 +2310,13 @@ _item_new(Evas_Object *obj,
2306 elm_icon_order_lookup_set(icon_obj, sd->lookup_order); 2310 elm_icon_order_lookup_set(icon_obj, sd->lookup_order);
2307 if (!icon_obj) return NULL; 2311 if (!icon_obj) return NULL;
2308 2312
2309 it = elm_widget_item_new(obj, Elm_Toolbar_Item); 2313 Eo *eo_it = eo_add(ELM_TOOLBAR_ITEM_CLASS, obj);
2310 if (!it) 2314 if (!eo_it)
2311 { 2315 {
2312 evas_object_del(icon_obj); 2316 evas_object_del(icon_obj);
2313 return NULL; 2317 return NULL;
2314 } 2318 }
2315 2319 ELM_TOOLBAR_ITEM_DATA_GET(eo_it, it);
2316 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
2317 elm_widget_item_disable_hook_set(it, _item_disable_hook);
2318 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
2319 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
2320 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
2321 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
2322 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
2323 elm_widget_item_focus_set_hook_set(it, _item_focus_set_hook);
2324 elm_widget_item_focus_get_hook_set(it, _item_focus_get_hook);
2325 2320
2326 it->label = eina_stringshare_add(label); 2321 it->label = eina_stringshare_add(label);
2327 it->prio.visible = 1; 2322 it->prio.visible = 1;
@@ -2329,7 +2324,7 @@ _item_new(Evas_Object *obj,
2329 it->func = func; 2324 it->func = func;
2330 it->separator = EINA_FALSE; 2325 it->separator = EINA_FALSE;
2331 it->object = NULL; 2326 it->object = NULL;
2332 it->base.data = data; 2327 it->base->data = data;
2333 2328
2334 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 2329 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
2335 evas_object_data_set(VIEW(it), "item", it); 2330 evas_object_data_set(VIEW(it), "item", it);
@@ -2427,7 +2422,7 @@ _item_new(Evas_Object *obj,
2427} 2422}
2428 2423
2429static void 2424static void
2430_elm_toolbar_item_icon_update(Elm_Toolbar_Item *item) 2425_elm_toolbar_item_icon_update(Elm_Toolbar_Item_Data *item)
2431{ 2426{
2432 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1; 2427 Evas_Coord mw = -1, mh = -1, minw = -1, minh = -1;
2433 Elm_Toolbar_Item_State *it_state; 2428 Elm_Toolbar_Item_State *it_state;
@@ -2496,7 +2491,7 @@ _elm_toolbar_item_icon_set_cb(void *data,
2496 const char *emission, 2491 const char *emission,
2497 const char *source) 2492 const char *source)
2498{ 2493{
2499 Elm_Toolbar_Item *item = data; 2494 Elm_Toolbar_Item_Data *item = data;
2500 2495
2501 edje_object_part_unswallow(VIEW(item), item->icon); 2496 edje_object_part_unswallow(VIEW(item), item->icon);
2502 _elm_toolbar_item_icon_update(item); 2497 _elm_toolbar_item_icon_update(item);
@@ -2507,7 +2502,7 @@ _elm_toolbar_item_icon_set_cb(void *data,
2507 2502
2508static void 2503static void
2509_elm_toolbar_item_icon_obj_set(Evas_Object *obj, 2504_elm_toolbar_item_icon_obj_set(Evas_Object *obj,
2510 Elm_Toolbar_Item *item, 2505 Elm_Toolbar_Item_Data *item,
2511 Evas_Object *icon_obj, 2506 Evas_Object *icon_obj,
2512 const char *icon_str, 2507 const char *icon_str,
2513 double icon_size, 2508 double icon_size,
@@ -2561,7 +2556,8 @@ _elm_toolbar_item_state_cb(void *data EINA_UNUSED,
2561 Evas_Object *obj EINA_UNUSED, 2556 Evas_Object *obj EINA_UNUSED,
2562 void *event_info) 2557 void *event_info)
2563{ 2558{
2564 Elm_Toolbar_Item *it = event_info; 2559 Elm_Object_Item *eo_it = event_info;
2560 ELM_TOOLBAR_ITEM_DATA_GET(eo_it, it);
2565 Elm_Toolbar_Item_State *it_state; 2561 Elm_Toolbar_Item_State *it_state;
2566 2562
2567 it_state = eina_list_data_get(it->current_state); 2563 it_state = eina_list_data_get(it->current_state);
@@ -2595,7 +2591,7 @@ _elm_toolbar_action_left_cb(void *data,
2595 const char *src EINA_UNUSED) 2591 const char *src EINA_UNUSED)
2596{ 2592{
2597 Evas_Object *obj = data; 2593 Evas_Object *obj = data;
2598 Elm_Toolbar_Item *it, *it2; 2594 Elm_Toolbar_Item_Data *it, *it2;
2599 Eina_Bool done = EINA_FALSE; 2595 Eina_Bool done = EINA_FALSE;
2600 2596
2601 ELM_TOOLBAR_DATA_GET(obj, sd); 2597 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -2608,7 +2604,7 @@ _elm_toolbar_action_left_cb(void *data,
2608 2604
2609 EINA_INLIST_REVERSE_FOREACH(sd->items, it2) 2605 EINA_INLIST_REVERSE_FOREACH(sd->items, it2)
2610 { 2606 {
2611 if (elm_object_item_disabled_get((Elm_Object_Item *)it2)) 2607 if (elm_object_item_disabled_get(EO_OBJ(it2)))
2612 continue; 2608 continue;
2613 if (it2 == it) 2609 if (it2 == it)
2614 { 2610 {
@@ -2629,7 +2625,7 @@ _elm_toolbar_action_left_cb(void *data,
2629 { 2625 {
2630 EINA_INLIST_FOREACH(sd->items, it) 2626 EINA_INLIST_FOREACH(sd->items, it)
2631 { 2627 {
2632 if (elm_object_item_disabled_get((Elm_Object_Item *)it)) continue; 2628 if (elm_object_item_disabled_get(EO_OBJ(it))) continue;
2633 if (it->separator) continue; 2629 if (it->separator) continue;
2634 _item_select(it); 2630 _item_select(it);
2635 break; 2631 break;
@@ -2644,7 +2640,7 @@ _elm_toolbar_action_right_cb(void *data,
2644 const char *src EINA_UNUSED) 2640 const char *src EINA_UNUSED)
2645{ 2641{
2646 Evas_Object *obj = data; 2642 Evas_Object *obj = data;
2647 Elm_Toolbar_Item *it, *it2; 2643 Elm_Toolbar_Item_Data *it, *it2;
2648 Eina_Bool done = EINA_FALSE; 2644 Eina_Bool done = EINA_FALSE;
2649 2645
2650 ELM_TOOLBAR_DATA_GET(obj, sd); 2646 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -2657,7 +2653,7 @@ _elm_toolbar_action_right_cb(void *data,
2657 2653
2658 EINA_INLIST_FOREACH(sd->items, it2) 2654 EINA_INLIST_FOREACH(sd->items, it2)
2659 { 2655 {
2660 if (elm_object_item_disabled_get((Elm_Object_Item *)it2)) 2656 if (elm_object_item_disabled_get(EO_OBJ(it2)))
2661 continue; 2657 continue;
2662 if (it2 == it) 2658 if (it2 == it)
2663 { 2659 {
@@ -2678,7 +2674,7 @@ _elm_toolbar_action_right_cb(void *data,
2678 { 2674 {
2679 EINA_INLIST_REVERSE_FOREACH(sd->items, it) 2675 EINA_INLIST_REVERSE_FOREACH(sd->items, it)
2680 { 2676 {
2681 if (elm_object_item_disabled_get((Elm_Object_Item *)it)) continue; 2677 if (elm_object_item_disabled_get(EO_OBJ(it))) continue;
2682 if (it->separator) continue; 2678 if (it->separator) continue;
2683 _item_select(it); 2679 _item_select(it);
2684 break; 2680 break;
@@ -2809,7 +2805,7 @@ _elm_toolbar_evas_object_smart_add(Eo *obj, Elm_Toolbar_Data *priv)
2809EOLIAN static void 2805EOLIAN static void
2810_elm_toolbar_evas_object_smart_del(Eo *obj, Elm_Toolbar_Data *sd) 2806_elm_toolbar_evas_object_smart_del(Eo *obj, Elm_Toolbar_Data *sd)
2811{ 2807{
2812 Elm_Toolbar_Item *it, *next; 2808 Elm_Toolbar_Item_Data *it, *next;
2813 2809
2814 sd->delete_me = EINA_TRUE; 2810 sd->delete_me = EINA_TRUE;
2815 2811
@@ -2820,10 +2816,10 @@ _elm_toolbar_evas_object_smart_del(Eo *obj, Elm_Toolbar_Data *sd)
2820 while (it) 2816 while (it)
2821 { 2817 {
2822 next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 2818 next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
2823 elm_widget_item_del(it); 2819 eo_do(EO_OBJ(it), elm_wdg_item_del());
2824 it = next; 2820 it = next;
2825 } 2821 }
2826 if (sd->more_item) elm_widget_item_del(sd->more_item); 2822 if (sd->more_item) eo_do(EO_OBJ(sd->more_item), elm_wdg_item_del());
2827 ecore_timer_del(sd->long_timer); 2823 ecore_timer_del(sd->long_timer);
2828 2824
2829 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 2825 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
@@ -2859,7 +2855,7 @@ _access_item_find_append(const Evas_Object *obj,
2859 Evas_Object *bx, 2855 Evas_Object *bx,
2860 Eina_List *items) 2856 Eina_List *items)
2861{ 2857{
2862 Elm_Toolbar_Item *it; 2858 Elm_Toolbar_Item_Data *it;
2863 Eina_List *list; 2859 Eina_List *list;
2864 2860
2865 ELM_TOOLBAR_DATA_GET(obj, sd); 2861 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -2870,8 +2866,8 @@ _access_item_find_append(const Evas_Object *obj,
2870 EINA_INLIST_FOREACH (sd->items, it) 2866 EINA_INLIST_FOREACH (sd->items, it)
2871 { 2867 {
2872 if (it->separator) continue; 2868 if (it->separator) continue;
2873 if (eina_list_data_find(list, it->base.view)) 2869 if (eina_list_data_find(list, it->base->view))
2874 items = eina_list_append(items, it->base.access_obj); 2870 items = eina_list_append(items, it->base->access_obj);
2875 } 2871 }
2876 2872
2877 return items; 2873 return items;
@@ -2894,15 +2890,15 @@ _elm_toolbar_elm_widget_focus_next(Eo *obj, Elm_Toolbar_Data *sd, Elm_Focus_Dire
2894 { 2890 {
2895 items = _access_item_find_append(obj, sd->bx_more, items); 2891 items = _access_item_find_append(obj, sd->bx_more, items);
2896 items = _access_item_find_append(obj, sd->bx_more2, items); 2892 items = _access_item_find_append(obj, sd->bx_more2, items);
2897 items = eina_list_append(items, sd->more_item->base.access_obj); 2893 items = eina_list_append(items, sd->more_item->base->access_obj);
2898 } 2894 }
2899 else 2895 else
2900 { 2896 {
2901 items = _access_item_find_append(obj, sd->bx, items); 2897 items = _access_item_find_append(obj, sd->bx, items);
2902 if (sd->more_item && 2898 if (sd->more_item &&
2903 eina_list_data_find(evas_object_box_children_get(sd->bx), 2899 eina_list_data_find(evas_object_box_children_get(sd->bx),
2904 sd->more_item->base.view)) 2900 sd->more_item->base->view))
2905 items = eina_list_append(items, sd->more_item->base.access_obj); 2901 items = eina_list_append(items, sd->more_item->base->access_obj);
2906 } 2902 }
2907 2903
2908 return elm_widget_focus_list_next_get 2904 return elm_widget_focus_list_next_get
@@ -2912,12 +2908,12 @@ _elm_toolbar_elm_widget_focus_next(Eo *obj, Elm_Toolbar_Data *sd, Elm_Focus_Dire
2912static void 2908static void
2913_access_obj_process(Elm_Toolbar_Data * sd, Eina_Bool is_access) 2909_access_obj_process(Elm_Toolbar_Data * sd, Eina_Bool is_access)
2914{ 2910{
2915 Elm_Toolbar_Item *it; 2911 Elm_Toolbar_Item_Data *it;
2916 2912
2917 EINA_INLIST_FOREACH (sd->items, it) 2913 EINA_INLIST_FOREACH (sd->items, it)
2918 { 2914 {
2919 if (is_access) _access_widget_item_register(it); 2915 if (is_access) _access_widget_item_register(it);
2920 else _elm_access_widget_item_unregister((Elm_Widget_Item_Data *)it); 2916 else _elm_access_widget_item_unregister(it->base);
2921 } 2917 }
2922} 2918}
2923 2919
@@ -2929,7 +2925,7 @@ _elm_toolbar_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Eina_B
2929} 2925}
2930 2926
2931static void 2927static void
2932_elm_toolbar_coordinates_adjust(Elm_Object_Item *it, 2928_elm_toolbar_coordinates_adjust(Elm_Toolbar_Item_Data *it,
2933 Evas_Coord *x, 2929 Evas_Coord *x,
2934 Evas_Coord *y, 2930 Evas_Coord *y,
2935 Evas_Coord *w, 2931 Evas_Coord *w,
@@ -3017,7 +3013,7 @@ _elm_toolbar_icon_size_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3017EOLIAN static Elm_Object_Item* 3013EOLIAN static Elm_Object_Item*
3018_elm_toolbar_item_append(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) 3014_elm_toolbar_item_append(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
3019{ 3015{
3020 Elm_Toolbar_Item *it; 3016 Elm_Toolbar_Item_Data *it;
3021 double scale; 3017 double scale;
3022 3018
3023 it = _item_new(obj, icon, label, func, data); 3019 it = _item_new(obj, icon, label, func, data);
@@ -3032,13 +3028,13 @@ _elm_toolbar_item_append(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const
3032 _sizing_eval(obj); 3028 _sizing_eval(obj);
3033 sd->item_count++; 3029 sd->item_count++;
3034 3030
3035 return (Elm_Object_Item *)it; 3031 return EO_OBJ(it);
3036} 3032}
3037 3033
3038EOLIAN static Elm_Object_Item* 3034EOLIAN static Elm_Object_Item*
3039_elm_toolbar_item_prepend(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) 3035_elm_toolbar_item_prepend(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
3040{ 3036{
3041 Elm_Toolbar_Item *it; 3037 Elm_Toolbar_Item_Data *it;
3042 double scale; 3038 double scale;
3043 3039
3044 it = _item_new(obj, icon, label, func, data); 3040 it = _item_new(obj, icon, label, func, data);
@@ -3052,18 +3048,18 @@ _elm_toolbar_item_prepend(Eo *obj, Elm_Toolbar_Data *sd, const char *icon, const
3052 _sizing_eval(obj); 3048 _sizing_eval(obj);
3053 sd->item_count++; 3049 sd->item_count++;
3054 3050
3055 return (Elm_Object_Item *)it; 3051 return EO_OBJ(it);
3056} 3052}
3057 3053
3058EOLIAN static Elm_Object_Item* 3054EOLIAN static Elm_Object_Item*
3059_elm_toolbar_item_insert_before(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) 3055_elm_toolbar_item_insert_before(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *eo_before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
3060{ 3056{
3061 Elm_Toolbar_Item *it, *_before; 3057 Elm_Toolbar_Item_Data *it;
3062 double scale; 3058 double scale;
3063 3059
3064 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(before, NULL); 3060 ELM_TOOLBAR_ITEM_DATA_GET(eo_before, _before);
3061 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(_before, NULL);
3065 3062
3066 _before = (Elm_Toolbar_Item *)before;
3067 it = _item_new(obj, icon, label, func, data); 3063 it = _item_new(obj, icon, label, func, data);
3068 if (!it) return NULL; 3064 if (!it) return NULL;
3069 scale = (elm_widget_scale_get(obj) * elm_config_scale_get()); 3065 scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
@@ -3076,18 +3072,18 @@ _elm_toolbar_item_insert_before(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *
3076 _sizing_eval(obj); 3072 _sizing_eval(obj);
3077 sd->item_count++; 3073 sd->item_count++;
3078 3074
3079 return (Elm_Object_Item *)it; 3075 return EO_OBJ(it);
3080} 3076}
3081 3077
3082EOLIAN static Elm_Object_Item* 3078EOLIAN static Elm_Object_Item*
3083_elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) 3079_elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *eo_after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
3084{ 3080{
3085 Elm_Toolbar_Item *it, *_after; 3081 Elm_Toolbar_Item_Data *it;
3086 double scale; 3082 double scale;
3087 3083
3088 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(after, NULL); 3084 ELM_TOOLBAR_ITEM_DATA_GET(eo_after, _after);
3085 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(_after, NULL);
3089 3086
3090 _after = (Elm_Toolbar_Item *)after;
3091 it = _item_new(obj, icon, label, func, data); 3087 it = _item_new(obj, icon, label, func, data);
3092 if (!it) return NULL; 3088 if (!it) return NULL;
3093 scale = (elm_widget_scale_get(obj) * elm_config_scale_get()); 3089 scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
@@ -3100,14 +3096,16 @@ _elm_toolbar_item_insert_after(Eo *obj, Elm_Toolbar_Data *sd, Elm_Object_Item *a
3100 _sizing_eval(obj); 3096 _sizing_eval(obj);
3101 sd->item_count++; 3097 sd->item_count++;
3102 3098
3103 return (Elm_Object_Item *)it; 3099 return EO_OBJ(it);
3104} 3100}
3105 3101
3106EOLIAN static Elm_Object_Item* 3102EOLIAN static Elm_Object_Item*
3107_elm_toolbar_first_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 3103_elm_toolbar_first_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3108{ 3104{
3109 if (!sd->items) return NULL; 3105 if (!sd->items) return NULL;
3110 return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items); 3106 Elm_Toolbar_Item_Data *it = ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items);
3107 if (it) return EO_OBJ(it);
3108 return NULL;
3111} 3109}
3112 3110
3113EOLIAN static Elm_Object_Item* 3111EOLIAN static Elm_Object_Item*
@@ -3115,35 +3113,55 @@ _elm_toolbar_last_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3115{ 3113{
3116 if (!sd->items) return NULL; 3114 if (!sd->items) return NULL;
3117 3115
3118 return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items->last); 3116 Elm_Toolbar_Item_Data *it = ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items->last);
3117 if (it) return EO_OBJ(it);
3118 return NULL;
3119} 3119}
3120 3120
3121EAPI Elm_Object_Item * 3121EAPI Elm_Object_Item *
3122elm_toolbar_item_next_get(const Elm_Object_Item *it) 3122elm_toolbar_item_next_get(const Elm_Object_Item *it)
3123{ 3123{
3124 return eo_do(it, elm_obj_toolbar_item_next_get());
3125}
3126
3127EOLIAN static Elm_Object_Item *
3128_elm_toolbar_item_next_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
3129{
3124 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3130 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
3125 3131
3126 return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST( 3132 Elm_Toolbar_Item_Data *ret_it = ELM_TOOLBAR_ITEM_FROM_INLIST(
3127 EINA_INLIST_GET(((Elm_Toolbar_Item *)it))->next); 3133 EINA_INLIST_GET(it)->next);
3134 if (ret_it) return EO_OBJ(ret_it);
3135 else return NULL;
3128} 3136}
3129 3137
3130EAPI Elm_Object_Item * 3138EAPI Elm_Object_Item *
3131elm_toolbar_item_prev_get(const Elm_Object_Item *it) 3139elm_toolbar_item_prev_get(const Elm_Object_Item *it)
3132{ 3140{
3141 return eo_do(it, elm_obj_toolbar_item_prev_get());
3142}
3143
3144EOLIAN static Elm_Object_Item *
3145_elm_toolbar_item_prev_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
3146{
3133 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3147 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
3134 3148
3135 return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST( 3149 Elm_Toolbar_Item_Data *ret_it = ELM_TOOLBAR_ITEM_FROM_INLIST(
3136 EINA_INLIST_GET(((Elm_Toolbar_Item *)it))->prev); 3150 EINA_INLIST_GET(it)->prev);
3151 if (ret_it) return EO_OBJ(ret_it);
3152 else return NULL;
3137} 3153}
3138 3154
3139EAPI void 3155EAPI void
3140elm_toolbar_item_priority_set(Elm_Object_Item *it, 3156elm_toolbar_item_priority_set(Elm_Object_Item *it,
3141 int priority) 3157 int priority)
3142{ 3158{
3143 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3159 eo_do(it, elm_obj_toolbar_item_priority_set(priority));
3144 3160}
3145 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it);
3146 3161
3162EOLIAN static void
3163_elm_toolbar_item_priority_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, int priority)
3164{
3147 if (item->prio.priority == priority) return; 3165 if (item->prio.priority == priority) return;
3148 item->prio.priority = priority; 3166 item->prio.priority = priority;
3149 _resize_cb(WIDGET(item), NULL, NULL, NULL); 3167 _resize_cb(WIDGET(item), NULL, NULL, NULL);
@@ -3152,19 +3170,23 @@ elm_toolbar_item_priority_set(Elm_Object_Item *it,
3152EAPI int 3170EAPI int
3153elm_toolbar_item_priority_get(const Elm_Object_Item *it) 3171elm_toolbar_item_priority_get(const Elm_Object_Item *it)
3154{ 3172{
3155 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, 0); 3173 return eo_do(it, elm_obj_toolbar_item_priority_get());
3174}
3156 3175
3157 return ((Elm_Toolbar_Item *)it)->prio.priority; 3176EOLIAN static int
3177_elm_toolbar_item_priority_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3178{
3179 return item->prio.priority;
3158} 3180}
3159 3181
3160EOLIAN static Elm_Object_Item* 3182EOLIAN static Elm_Object_Item*
3161_elm_toolbar_item_find_by_label(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, const char *label) 3183_elm_toolbar_item_find_by_label(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, const char *label)
3162{ 3184{
3163 Elm_Toolbar_Item *it; 3185 Elm_Toolbar_Item_Data *it;
3164 3186
3165 EINA_INLIST_FOREACH(sd->items, it) 3187 EINA_INLIST_FOREACH(sd->items, it)
3166 { 3188 {
3167 if (!strcmp(it->label, label)) return (Elm_Object_Item *)it; 3189 if (!strcmp(it->label, label)) return EO_OBJ(it);
3168 } 3190 }
3169 3191
3170 return NULL; 3192 return NULL;
@@ -3174,10 +3196,12 @@ EAPI void
3174elm_toolbar_item_selected_set(Elm_Object_Item *it, 3196elm_toolbar_item_selected_set(Elm_Object_Item *it,
3175 Eina_Bool selected) 3197 Eina_Bool selected)
3176{ 3198{
3177 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3199 eo_do(it, elm_obj_toolbar_item_selected_set(selected));
3178 3200}
3179 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it);
3180 3201
3202EOLIAN static void
3203_elm_toolbar_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item, Eina_Bool selected)
3204{
3181 if (item->selected == selected) return; 3205 if (item->selected == selected) return;
3182 if (selected) _item_select(item); 3206 if (selected) _item_select(item);
3183 else _item_unselect(item); 3207 else _item_unselect(item);
@@ -3186,32 +3210,42 @@ elm_toolbar_item_selected_set(Elm_Object_Item *it,
3186EAPI Eina_Bool 3210EAPI Eina_Bool
3187elm_toolbar_item_selected_get(const Elm_Object_Item *it) 3211elm_toolbar_item_selected_get(const Elm_Object_Item *it)
3188{ 3212{
3189 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3213 return eo_do(it, elm_obj_toolbar_item_selected_get());
3214}
3190 3215
3191 return ((Elm_Toolbar_Item *)it)->selected; 3216EOLIAN static Eina_Bool
3217_elm_toolbar_item_selected_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3218{
3219 return item->selected;
3192} 3220}
3193 3221
3194EOLIAN static Elm_Object_Item* 3222EOLIAN static Elm_Object_Item*
3195_elm_toolbar_selected_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 3223_elm_toolbar_selected_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3196{ 3224{
3197 return (Elm_Object_Item *)sd->selected_item; 3225 return sd->selected_item?EO_OBJ(sd->selected_item):NULL;
3198} 3226}
3199 3227
3200EOLIAN static Elm_Object_Item* 3228EOLIAN static Elm_Object_Item*
3201_elm_toolbar_more_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 3229_elm_toolbar_more_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3202{ 3230{
3203 return (Elm_Object_Item *)sd->more_item; 3231 return sd->more_item?EO_OBJ(sd->more_item):NULL;
3204} 3232}
3205 3233
3206EAPI void 3234EAPI void
3207elm_toolbar_item_icon_set(Elm_Object_Item *it, 3235elm_toolbar_item_icon_set(Elm_Object_Item *it,
3208 const char *icon) 3236 const char *icon)
3209{ 3237{
3238 eo_do(it, elm_obj_toolbar_item_icon_set(icon));
3239}
3240
3241EOLIAN static void
3242_elm_toolbar_item_icon_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3243 const char *icon)
3244{
3210 Evas_Object *obj; 3245 Evas_Object *obj;
3211 Evas_Object *icon_obj; 3246 Evas_Object *icon_obj;
3212 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
3213 3247
3214 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); 3248 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item);
3215 3249
3216 obj = WIDGET(item); 3250 obj = WIDGET(item);
3217 ELM_TOOLBAR_DATA_GET(obj, sd); 3251 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -3233,17 +3267,27 @@ elm_toolbar_item_icon_set(Elm_Object_Item *it,
3233EAPI const char * 3267EAPI const char *
3234elm_toolbar_item_icon_get(const Elm_Object_Item *it) 3268elm_toolbar_item_icon_get(const Elm_Object_Item *it)
3235{ 3269{
3270 return eo_do(it, elm_obj_toolbar_item_icon_get());
3271}
3272
3273EOLIAN static const char *
3274_elm_toolbar_item_icon_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
3275{
3236 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3276 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
3237 3277
3238 return ((Elm_Toolbar_Item *)it)->icon_str; 3278 return it->icon_str;
3239} 3279}
3240 3280
3241EAPI Evas_Object * 3281EAPI Evas_Object *
3242elm_toolbar_item_object_get(const Elm_Object_Item *it) 3282elm_toolbar_item_object_get(const Elm_Object_Item *it)
3243{ 3283{
3244 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3284 return eo_do(it, elm_obj_toolbar_item_object_get());
3285}
3245 3286
3246 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3287EOLIAN static Evas_Object *
3288_elm_toolbar_item_object_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3289{
3290 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3247 3291
3248 return VIEW(item); 3292 return VIEW(item);
3249} 3293}
@@ -3251,9 +3295,15 @@ elm_toolbar_item_object_get(const Elm_Object_Item *it)
3251EAPI Evas_Object * 3295EAPI Evas_Object *
3252elm_toolbar_item_icon_object_get(Elm_Object_Item *it) 3296elm_toolbar_item_icon_object_get(Elm_Object_Item *it)
3253{ 3297{
3298 return eo_do(it, elm_obj_toolbar_item_icon_object_get());
3299}
3300
3301EOLIAN static Evas_Object *
3302_elm_toolbar_item_icon_object_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it)
3303{
3254 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3304 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL);
3255 3305
3256 return ((Elm_Toolbar_Item *)it)->icon; 3306 return it->icon;
3257} 3307}
3258 3308
3259EAPI Eina_Bool 3309EAPI Eina_Bool
@@ -3263,12 +3313,21 @@ elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it,
3263 const char *format, 3313 const char *format,
3264 const char *key) 3314 const char *key)
3265{ 3315{
3266 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3316 return eo_do(it, elm_obj_toolbar_item_icon_memfile_set(img, size, format, key));
3317}
3318
3319EOLIAN static Eina_Bool
3320_elm_toolbar_item_icon_memfile_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3321 const void *img,
3322 size_t size,
3323 const char *format,
3324 const char *key)
3325{
3267 Evas_Object *icon_obj; 3326 Evas_Object *icon_obj;
3268 Evas_Object *obj; 3327 Evas_Object *obj;
3269 Eina_Bool ret; 3328 Eina_Bool ret;
3270 3329
3271 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3330 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
3272 3331
3273 obj = WIDGET(item); 3332 obj = WIDGET(item);
3274 ELM_TOOLBAR_DATA_GET(obj, sd); 3333 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -3297,12 +3356,19 @@ elm_toolbar_item_icon_file_set(Elm_Object_Item *it,
3297 const char *file, 3356 const char *file,
3298 const char *key) 3357 const char *key)
3299{ 3358{
3300 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3359 return eo_do(it, elm_obj_toolbar_item_icon_file_set(file, key));
3360}
3361
3362EOLIAN static Eina_Bool
3363_elm_toolbar_item_icon_file_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3364 const char *file,
3365 const char *key)
3366{
3301 Evas_Object *icon_obj; 3367 Evas_Object *icon_obj;
3302 Evas_Object *obj; 3368 Evas_Object *obj;
3303 Eina_Bool ret; 3369 Eina_Bool ret;
3304 3370
3305 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3371 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
3306 3372
3307 obj = WIDGET(item); 3373 obj = WIDGET(item);
3308 ELM_TOOLBAR_DATA_GET(obj, sd); 3374 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -3330,11 +3396,17 @@ EAPI void
3330elm_toolbar_item_separator_set(Elm_Object_Item *it, 3396elm_toolbar_item_separator_set(Elm_Object_Item *it,
3331 Eina_Bool separator) 3397 Eina_Bool separator)
3332{ 3398{
3333 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3399 eo_do(it, elm_obj_toolbar_item_separator_set(separator));
3400}
3401
3402EOLIAN static void
3403_elm_toolbar_item_separator_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3404 Eina_Bool separator)
3405{
3334 Evas_Object *obj = WIDGET(item); 3406 Evas_Object *obj = WIDGET(item);
3335 double scale; 3407 double scale;
3336 3408
3337 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); 3409 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item);
3338 ELM_TOOLBAR_DATA_GET(obj, sd); 3410 ELM_TOOLBAR_DATA_GET(obj, sd);
3339 3411
3340 if (item->separator == separator) return; 3412 if (item->separator == separator) return;
@@ -3349,9 +3421,15 @@ elm_toolbar_item_separator_set(Elm_Object_Item *it,
3349EAPI Eina_Bool 3421EAPI Eina_Bool
3350elm_toolbar_item_separator_get(const Elm_Object_Item *it) 3422elm_toolbar_item_separator_get(const Elm_Object_Item *it)
3351{ 3423{
3424 return eo_do(it, elm_obj_toolbar_item_separator_get());
3425}
3426
3427EOLIAN static Eina_Bool
3428_elm_toolbar_item_separator_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *it)
3429{
3352 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3430 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
3353 3431
3354 return ((Elm_Toolbar_Item *)it)->separator; 3432 return it->separator;
3355} 3433}
3356 3434
3357EOLIAN static void 3435EOLIAN static void
@@ -3367,7 +3445,7 @@ _elm_toolbar_shrink_mode_set(Eo *obj, Elm_Toolbar_Data *sd, Elm_Toolbar_Shrink_M
3367 3445
3368 if (sd->more_item) 3446 if (sd->more_item)
3369 { 3447 {
3370 elm_widget_item_del(sd->more_item); 3448 eo_do(EO_OBJ(sd->more_item), elm_wdg_item_del());
3371 sd->more_item = NULL; 3449 sd->more_item = NULL;
3372 } 3450 }
3373 3451
@@ -3444,7 +3522,7 @@ _elm_toolbar_homogeneous_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3444EOLIAN static void 3522EOLIAN static void
3445_elm_toolbar_menu_parent_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Evas_Object *parent) 3523_elm_toolbar_menu_parent_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Evas_Object *parent)
3446{ 3524{
3447 Elm_Toolbar_Item *it; 3525 Elm_Toolbar_Item_Data *it;
3448 3526
3449 EINA_SAFETY_ON_NULL_RETURN(parent); 3527 EINA_SAFETY_ON_NULL_RETURN(parent);
3450 3528
@@ -3490,9 +3568,14 @@ EAPI void
3490elm_toolbar_item_menu_set(Elm_Object_Item *it, 3568elm_toolbar_item_menu_set(Elm_Object_Item *it,
3491 Eina_Bool menu) 3569 Eina_Bool menu)
3492{ 3570{
3493 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3571 eo_do(it, elm_obj_toolbar_item_menu_set(menu));
3572}
3494 3573
3495 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); 3574EOLIAN static void
3575_elm_toolbar_item_menu_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3576 Eina_Bool menu)
3577{
3578 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item);
3496 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); 3579 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
3497 3580
3498 if (item->menu == menu) return; 3581 if (item->menu == menu) return;
@@ -3503,9 +3586,13 @@ elm_toolbar_item_menu_set(Elm_Object_Item *it,
3503EAPI Evas_Object * 3586EAPI Evas_Object *
3504elm_toolbar_item_menu_get(const Elm_Object_Item *it) 3587elm_toolbar_item_menu_get(const Elm_Object_Item *it)
3505{ 3588{
3506 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3589 return eo_do(it, elm_obj_toolbar_item_menu_get());
3590}
3507 3591
3508 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3592EOLIAN static Evas_Object *
3593_elm_toolbar_item_menu_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3594{
3595 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3509 3596
3510 if (!item->menu) return NULL; 3597 if (!item->menu) return NULL;
3511 return item->o_menu; 3598 return item->o_menu;
@@ -3518,12 +3605,21 @@ elm_toolbar_item_state_add(Elm_Object_Item *it,
3518 Evas_Smart_Cb func, 3605 Evas_Smart_Cb func,
3519 const void *data) 3606 const void *data)
3520{ 3607{
3521 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3608 return eo_do(it, elm_obj_toolbar_item_state_add(icon, label, func, data));
3609}
3610
3611EOLIAN static Elm_Toolbar_Item_State *
3612_elm_toolbar_item_state_add(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3613 const char *icon,
3614 const char *label,
3615 Evas_Smart_Cb func,
3616 const void *data)
3617{
3522 Elm_Toolbar_Item_State *it_state; 3618 Elm_Toolbar_Item_State *it_state;
3523 Evas_Object *icon_obj; 3619 Evas_Object *icon_obj;
3524 Evas_Object *obj; 3620 Evas_Object *obj;
3525 3621
3526 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3622 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3527 3623
3528 obj = WIDGET(item); 3624 obj = WIDGET(item);
3529 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd); 3625 ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
@@ -3532,7 +3628,7 @@ elm_toolbar_item_state_add(Elm_Object_Item *it,
3532 { 3628 {
3533 it_state = _item_state_new 3629 it_state = _item_state_new
3534 (item->label, item->icon_str, item->icon, item->func, 3630 (item->label, item->icon_str, item->icon, item->func,
3535 item->base.data); 3631 item->base->data);
3536 item->states = eina_list_append(item->states, it_state); 3632 item->states = eina_list_append(item->states, it_state);
3537 item->current_state = item->states; 3633 item->current_state = item->states;
3538 } 3634 }
@@ -3550,7 +3646,7 @@ elm_toolbar_item_state_add(Elm_Object_Item *it,
3550 it_state = _item_state_new(label, icon, icon_obj, func, data); 3646 it_state = _item_state_new(label, icon, icon_obj, func, data);
3551 item->states = eina_list_append(item->states, it_state); 3647 item->states = eina_list_append(item->states, it_state);
3552 item->func = _elm_toolbar_item_state_cb; 3648 item->func = _elm_toolbar_item_state_cb;
3553 item->base.data = NULL; 3649 item->base->data = NULL;
3554 3650
3555 return it_state; 3651 return it_state;
3556 3652
@@ -3569,21 +3665,26 @@ EAPI Eina_Bool
3569elm_toolbar_item_state_del(Elm_Object_Item *it, 3665elm_toolbar_item_state_del(Elm_Object_Item *it,
3570 Elm_Toolbar_Item_State *state) 3666 Elm_Toolbar_Item_State *state)
3571{ 3667{
3668 return eo_do(it, elm_obj_toolbar_item_state_del(state));
3669}
3670
3671EOLIAN static Eina_Bool
3672_elm_toolbar_item_state_del(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3673 Elm_Toolbar_Item_State *state)
3674{
3572 Elm_Toolbar_Item_State *it_state; 3675 Elm_Toolbar_Item_State *it_state;
3573 Elm_Toolbar_Item *item;
3574 Eina_List *del_state; 3676 Eina_List *del_state;
3575 3677
3576 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3678 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
3577 3679
3578 if (!state) return EINA_FALSE; 3680 if (!state) return EINA_FALSE;
3579 3681
3580 item = (Elm_Toolbar_Item *)it;
3581 if (!item->states) return EINA_FALSE; 3682 if (!item->states) return EINA_FALSE;
3582 3683
3583 del_state = eina_list_data_find_list(item->states, state); 3684 del_state = eina_list_data_find_list(item->states, state);
3584 if (del_state == item->states) return EINA_FALSE; 3685 if (del_state == item->states) return EINA_FALSE;
3585 if (del_state == item->current_state) 3686 if (del_state == item->current_state)
3586 elm_toolbar_item_state_unset(it); 3687 elm_toolbar_item_state_unset(EO_OBJ(item));
3587 3688
3588 eina_stringshare_del(state->label); 3689 eina_stringshare_del(state->label);
3589 eina_stringshare_del(state->icon_str); 3690 eina_stringshare_del(state->icon_str);
@@ -3594,7 +3695,7 @@ elm_toolbar_item_state_del(Elm_Object_Item *it,
3594 if (item->states && !eina_list_next(item->states)) 3695 if (item->states && !eina_list_next(item->states))
3595 { 3696 {
3596 it_state = eina_list_data_get(item->states); 3697 it_state = eina_list_data_get(item->states);
3597 item->base.data = it_state->data; 3698 item->base->data = it_state->data;
3598 item->func = it_state->func; 3699 item->func = it_state->func;
3599 eina_stringshare_del(it_state->label); 3700 eina_stringshare_del(it_state->label);
3600 eina_stringshare_del(it_state->icon_str); 3701 eina_stringshare_del(it_state->icon_str);
@@ -3609,12 +3710,18 @@ EAPI Eina_Bool
3609elm_toolbar_item_state_set(Elm_Object_Item *it, 3710elm_toolbar_item_state_set(Elm_Object_Item *it,
3610 Elm_Toolbar_Item_State *state) 3711 Elm_Toolbar_Item_State *state)
3611{ 3712{
3612 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3713 return eo_do(it, elm_obj_toolbar_item_state_set(state));
3714}
3715
3716EOLIAN static Eina_Bool
3717_elm_toolbar_item_state_set(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3718 Elm_Toolbar_Item_State *state)
3719{
3613 Elm_Toolbar_Item_State *it_state; 3720 Elm_Toolbar_Item_State *it_state;
3614 Eina_List *next_state; 3721 Eina_List *next_state;
3615 Evas_Object *obj; 3722 Evas_Object *obj;
3616 3723
3617 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 3724 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
3618 3725
3619 obj = WIDGET(item); 3726 obj = WIDGET(item);
3620 ELM_TOOLBAR_DATA_GET(obj, sd); 3727 ELM_TOOLBAR_DATA_GET(obj, sd);
@@ -3647,7 +3754,7 @@ elm_toolbar_item_state_set(Elm_Object_Item *it,
3647 } 3754 }
3648 if (item->icon) 3755 if (item->icon)
3649 { 3756 {
3650 if (elm_widget_item_disabled_get(item)) 3757 if (eo_do(EO_OBJ(item), elm_wdg_item_disabled_get()))
3651 elm_widget_signal_emit(item->icon, "elm,state,disabled", "elm"); 3758 elm_widget_signal_emit(item->icon, "elm,state,disabled", "elm");
3652 else 3759 else
3653 elm_widget_signal_emit(item->icon, "elm,state,enabled", "elm"); 3760 elm_widget_signal_emit(item->icon, "elm,state,enabled", "elm");
@@ -3661,15 +3768,19 @@ elm_toolbar_item_state_set(Elm_Object_Item *it,
3661EAPI void 3768EAPI void
3662elm_toolbar_item_state_unset(Elm_Object_Item *it) 3769elm_toolbar_item_state_unset(Elm_Object_Item *it)
3663{ 3770{
3664 elm_toolbar_item_state_set(it, NULL); 3771 eo_do(it, elm_obj_toolbar_item_state_set(NULL));
3665} 3772}
3666 3773
3667EAPI Elm_Toolbar_Item_State * 3774EAPI Elm_Toolbar_Item_State *
3668elm_toolbar_item_state_get(const Elm_Object_Item *it) 3775elm_toolbar_item_state_get(const Elm_Object_Item *it)
3669{ 3776{
3670 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it; 3777 return eo_do(it, elm_obj_toolbar_item_state_get());
3778}
3671 3779
3672 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3780EOLIAN static Elm_Toolbar_Item_State *
3781_elm_toolbar_item_state_get(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3782{
3783 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3673 3784
3674 if ((!item->states) || (!item->current_state)) return NULL; 3785 if ((!item->states) || (!item->current_state)) return NULL;
3675 if (item->current_state == item->states) return NULL; 3786 if (item->current_state == item->states) return NULL;
@@ -3680,10 +3791,15 @@ elm_toolbar_item_state_get(const Elm_Object_Item *it)
3680EAPI Elm_Toolbar_Item_State * 3791EAPI Elm_Toolbar_Item_State *
3681elm_toolbar_item_state_next(Elm_Object_Item *it) 3792elm_toolbar_item_state_next(Elm_Object_Item *it)
3682{ 3793{
3794 return eo_do(it, elm_obj_toolbar_item_state_next());
3795}
3796
3797EOLIAN static Elm_Toolbar_Item_State *
3798_elm_toolbar_item_state_next(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3799{
3683 Eina_List *next_state; 3800 Eina_List *next_state;
3684 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
3685 3801
3686 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3802 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3687 3803
3688 if (!item->states) return NULL; 3804 if (!item->states) return NULL;
3689 3805
@@ -3696,10 +3812,15 @@ elm_toolbar_item_state_next(Elm_Object_Item *it)
3696EAPI Elm_Toolbar_Item_State * 3812EAPI Elm_Toolbar_Item_State *
3697elm_toolbar_item_state_prev(Elm_Object_Item *it) 3813elm_toolbar_item_state_prev(Elm_Object_Item *it)
3698{ 3814{
3815 return eo_do(it, elm_obj_toolbar_item_state_prev());
3816}
3817
3818EOLIAN static Elm_Toolbar_Item_State *
3819_elm_toolbar_item_state_prev(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item)
3820{
3699 Eina_List *prev_state; 3821 Eina_List *prev_state;
3700 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
3701 3822
3702 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, NULL); 3823 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
3703 3824
3704 if (!item->states) return NULL; 3825 if (!item->states) return NULL;
3705 3826
@@ -3712,7 +3833,7 @@ elm_toolbar_item_state_prev(Elm_Object_Item *it)
3712EOLIAN static void 3833EOLIAN static void
3713_elm_toolbar_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Elm_Icon_Lookup_Order order) 3834_elm_toolbar_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Elm_Icon_Lookup_Order order)
3714{ 3835{
3715 Elm_Toolbar_Item *it; 3836 Elm_Toolbar_Item_Data *it;
3716 3837
3717 3838
3718 if (sd->lookup_order == order) return; 3839 if (sd->lookup_order == order) return;
@@ -3814,10 +3935,16 @@ elm_toolbar_reorder_mode_get(const Evas_Object *obj)
3814EAPI void 3935EAPI void
3815elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type) 3936elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type)
3816{ 3937{
3938 eo_do(it, elm_obj_toolbar_item_show(type));
3939}
3940
3941EOLIAN static void
3942_elm_toolbar_item_show(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3943 Elm_Toolbar_Item_Scrollto_Type type)
3944{
3817 Evas_Coord x, y, w, h; 3945 Evas_Coord x, y, w, h;
3818 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
3819 3946
3820 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); 3947 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item);
3821 3948
3822 if (_elm_toolbar_item_coordinates_calc(item, type, &x, &y, &w, &h)) 3949 if (_elm_toolbar_item_coordinates_calc(item, type, &x, &y, &w, &h))
3823 eo_do(WIDGET(item), elm_interface_scrollable_content_region_show 3950 eo_do(WIDGET(item), elm_interface_scrollable_content_region_show
@@ -3827,10 +3954,16 @@ elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type)
3827EAPI void 3954EAPI void
3828elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type) 3955elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type)
3829{ 3956{
3957 eo_do(it, elm_obj_toolbar_item_bring_in(type));
3958}
3959
3960EOLIAN static void
3961_elm_toolbar_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *item,
3962 Elm_Toolbar_Item_Scrollto_Type type)
3963{
3830 Evas_Coord x, y, w, h; 3964 Evas_Coord x, y, w, h;
3831 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
3832 3965
3833 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it); 3966 ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item);
3834 3967
3835 if (_elm_toolbar_item_coordinates_calc(item, type, &x, &y, &w, &h)) 3968 if (_elm_toolbar_item_coordinates_calc(item, type, &x, &y, &w, &h))
3836 eo_do(WIDGET(item), elm_interface_scrollable_region_bring_in 3969 eo_do(WIDGET(item), elm_interface_scrollable_region_bring_in
@@ -3840,7 +3973,7 @@ elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type ty
3840EOLIAN static Elm_Object_Item * 3973EOLIAN static Elm_Object_Item *
3841_elm_toolbar_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 3974_elm_toolbar_elm_widget_focused_item_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
3842{ 3975{
3843 return sd->focused_item; 3976 return sd->focused_item?EO_OBJ(sd->focused_item):NULL;
3844} 3977}
3845 3978
3846EOLIAN static void 3979EOLIAN static void
@@ -3864,3 +3997,4 @@ _elm_toolbar_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUS
3864} 3997}
3865 3998
3866#include "elm_toolbar.eo.c" 3999#include "elm_toolbar.eo.c"
4000#include "elm_toolbar_item.eo.c"
diff --git a/src/lib/elm_toolbar_common.h b/src/lib/elm_toolbar_common.h
index 032f6f469..14723b999 100644
--- a/src/lib/elm_toolbar_common.h
+++ b/src/lib/elm_toolbar_common.h
@@ -41,322 +41,42 @@ typedef enum
41 41
42typedef struct _Elm_Toolbar_Item_State Elm_Toolbar_Item_State; /**< State of a Elm_Toolbar_Item. Can be created with elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). */ 42typedef struct _Elm_Toolbar_Item_State Elm_Toolbar_Item_State; /**< State of a Elm_Toolbar_Item. Can be created with elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). */
43 43
44/**
45 * Get the item after @p item in toolbar.
46 *
47 * @param it The toolbar item.
48 * @return The item after @p item, or @c NULL if none or on failure.
49 *
50 * @note If it is the last item, @c NULL will be returned.
51 *
52 * @see elm_toolbar_item_append()
53 *
54 * @ingroup Toolbar
55 */
56EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it); 44EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
57 45
58/**
59 * Get the item before @p item in toolbar.
60 *
61 * @param it The toolbar item.
62 * @return The item before @p item, or @c NULL if none or on failure.
63 *
64 * @note If it is the first item, @c NULL will be returned.
65 *
66 * @see elm_toolbar_item_prepend()
67 *
68 * @ingroup Toolbar
69 */
70EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it); 46EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
71 47
72/**
73 * Set the priority of a toolbar item.
74 *
75 * @param it The toolbar item.
76 * @param priority The item priority. The default is zero.
77 *
78 * This is used only when the toolbar shrink mode is set
79 * to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
80 * When space is less than required, items with low priority
81 * will be removed from the toolbar and added to a dynamically-created menu,
82 * while items with higher priority will remain on the toolbar,
83 * with the same order they were added.
84 *
85 * @see elm_toolbar_item_priority_get()
86 *
87 * @ingroup Toolbar
88 */
89EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority); 48EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
90 49
91/**
92 * Get the priority of a toolbar item.
93 *
94 * @param it The toolbar item.
95 * @return The @p item priority, or @c 0 on failure.
96 *
97 * @see elm_toolbar_item_priority_set() for details.
98 *
99 * @ingroup Toolbar
100 */
101EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it); 50EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
102 51
103/**
104 * Get whether the @p item is selected or not.
105 *
106 * @param it The toolbar item.
107 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
108 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
109 *
110 * @see elm_toolbar_selected_item_set() for details.
111 * @see elm_toolbar_item_selected_get()
112 *
113 * @ingroup Toolbar
114 */
115EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it); 52EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
116 53
117/**
118 * Set the selected state of an item.
119 *
120 * @param it The toolbar item
121 * @param selected The selected state
122 *
123 * This sets the selected state of the given item @p it.
124 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
125 *
126 * If a new item is selected the previously selected will be unselected.
127 * Previously selected item can be get with function
128 * elm_toolbar_selected_item_get().
129 *
130 * Selected items will be highlighted.
131 *
132 * @see elm_toolbar_item_selected_get()
133 * @see elm_toolbar_selected_item_get()
134 *
135 * @ingroup Toolbar
136 */
137EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); 54EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
138 55
139/**
140 * Set the icon associated with @p item.
141 *
142 * @param it The toolbar item.
143 * @param icon A string with icon name or the absolute path of an image file.
144 *
145 * Toolbar will load icon image from fdo or current theme.
146 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
147 * If an absolute path is provided it will load it direct from a file.
148 *
149 * @note This function does not accept relative icon path.
150 *
151 * @see elm_toolbar_icon_order_lookup_set()
152 * @see elm_toolbar_icon_order_lookup_get()
153 *
154 * @ingroup Toolbar
155 */
156EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon); 56EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
157 57
158/**
159 * Get the string used to set the icon of @p item.
160 *
161 * @param it The toolbar item.
162 * @return The string associated with the icon object.
163 *
164 * @see elm_toolbar_item_icon_set() for details.
165 *
166 * @ingroup Toolbar
167 */
168EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it); 58EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
169 59
170/**
171 * Get the real Evas(Edje) object created to implement the view of a given
172 * toolbar @p item.
173 *
174 * @param it The toolbar item.
175 * @return The base Edje object associated with @p it.
176 *
177 * @ingroup Toolbar
178 */
179EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it); 60EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
180 61
181/**
182 * Get the icon object of @p item.
183 *
184 * @param it The toolbar item.
185 * @return The icon object
186 *
187 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
188 * or elm_toolbar_item_icon_memfile_set() for details.
189 *
190 * @ingroup Toolbar
191 */
192EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it); 62EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
193 63
194/**
195 * Set the icon associated with @p item to an image in a binary buffer.
196 *
197 * @param it The toolbar item.
198 * @param img The binary data that will be used as an image
199 * @param size The size of binary data @p img
200 * @param format Optional format of @p img to pass to the image loader
201 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
202 *
203 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
204 *
205 * @note The icon image set by this function can be changed by
206 * elm_toolbar_item_icon_set().
207 *
208 * @ingroup Toolbar
209 */
210EAPI Eina_Bool elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it, const void *img, size_t size, const char *format, const char *key); 64EAPI Eina_Bool elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it, const void *img, size_t size, const char *format, const char *key);
211 65
212/**
213 * Set the icon associated with @p item to an image in a binary buffer.
214 *
215 * @param it The toolbar item.
216 * @param file The file that contains the image
217 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
218 *
219 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
220 *
221 * @note The icon image set by this function can be changed by
222 * elm_toolbar_item_icon_set().
223 *
224 * @ingroup Toolbar
225 */
226EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key); 66EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
227 67
228/**
229 * Set or unset item as a separator.
230 *
231 * @param it The toolbar item.
232 * @param separator @c EINA_TRUE to set item @p item as separator or
233 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
234 *
235 * Items aren't set as separator by default.
236 *
237 * If set as separator it will display separator theme, so won't display
238 * icons or label.
239 *
240 * @see elm_toolbar_item_separator_get()
241 *
242 * @ingroup Toolbar
243 */
244EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator); 68EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
245 69
246/**
247 * Get a value whether item is a separator or not.
248 *
249 * @param it The toolbar item.
250 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
251 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
252 *
253 * @see elm_toolbar_item_separator_set() for details.
254 *
255 * @ingroup Toolbar
256 */
257EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it); 70EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
258 71
259/**
260 * Set whether the toolbar item opens a menu.
261 *
262 * @param it The toolbar item.
263 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
264 *
265 * A toolbar item can be set to be a menu, using this function.
266 *
267 * Once it is set to be a menu, it can be manipulated through the
268 * menu-like function elm_toolbar_menu_parent_set() and the other
269 * elm_menu functions, using the Evas_Object @c menu returned by
270 * elm_toolbar_item_menu_get().
271 *
272 * So, items to be displayed in this item's menu should be added with
273 * elm_menu_item_add().
274 *
275 * The following code exemplifies the most basic usage:
276 * @code
277 * tb = elm_toolbar_add(win)
278 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
279 * elm_toolbar_item_menu_set(item, EINA_TRUE);
280 * elm_toolbar_menu_parent_set(tb, win);
281 * menu = elm_toolbar_item_menu_get(item);
282 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
283 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
284 * NULL);
285 * @endcode
286 *
287 * @see elm_toolbar_item_menu_get()
288 *
289 * @ingroup Toolbar
290 */
291EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu); 72EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
292 73
293/**
294 * Get toolbar item's menu.
295 *
296 * @param it The toolbar item.
297 * @return Item's menu object or @c NULL on failure.
298 *
299 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
300 * this function will set it.
301 *
302 * @see elm_toolbar_item_menu_set() for details.
303 *
304 * @ingroup Toolbar
305 */
306EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it); 74EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
307 75
308/**
309 * Add a new state to @p item.
310 *
311 * @param it The toolbar item.
312 * @param icon A string with icon name or the absolute path of an image file.
313 * @param label The label of the new state.
314 * @param func The function to call when the item is clicked when this
315 * state is selected.
316 * @param data The data to associate with the state.
317 * @return The toolbar item state, or @c NULL upon failure.
318 *
319 * Toolbar will load icon image from fdo or current theme.
320 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
321 * If an absolute path is provided it will load it direct from a file.
322 *
323 * States created with this function can be removed with
324 * elm_toolbar_item_state_del().
325 *
326 * @see elm_toolbar_item_state_del()
327 * @see elm_toolbar_item_state_sel()
328 * @see elm_toolbar_item_state_get()
329 *
330 * @ingroup Toolbar
331 */
332EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Object_Item *it, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); 76EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Object_Item *it, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
333 77
334/**
335 * Delete a previously added state to @p item.
336 *
337 * @param it The toolbar item.
338 * @param state The state to be deleted.
339 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
340 *
341 * @see elm_toolbar_item_state_add()
342 */
343EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state); 78EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
344 79
345/**
346 * Set @p state as the current state of @p it.
347 *
348 * @param it The toolbar item.
349 * @param state The state to use.
350 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
351 *
352 * If @p state is @c NULL, it won't select any state and the default item's
353 * icon and label will be used. It's the same behaviour than
354 * elm_toolbar_item_state_unset().
355 *
356 * @see elm_toolbar_item_state_unset()
357 *
358 * @ingroup Toolbar
359 */
360EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state); 80EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
361 81
362/** 82/**
@@ -372,71 +92,13 @@ EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it
372 */ 92 */
373EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it); 93EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
374 94
375/**
376 * Get the current state of @p it.
377 *
378 * @param it The toolbar item.
379 * @return The selected state or @c NULL if none is selected or on failure.
380 *
381 * @see elm_toolbar_item_state_set() for details.
382 * @see elm_toolbar_item_state_unset()
383 * @see elm_toolbar_item_state_add()
384 *
385 * @ingroup Toolbar
386 */
387EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it); 95EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
388 96
389/**
390 * Get the state after selected state in toolbar's @p item.
391 *
392 * @param it The toolbar item to change state.
393 * @return The state after current state, or @c NULL on failure.
394 *
395 * If last state is selected, this function will return first state.
396 *
397 * @see elm_toolbar_item_state_set()
398 * @see elm_toolbar_item_state_add()
399 *
400 * @ingroup Toolbar
401 */
402EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it); 97EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
403 98
404/**
405 * Get the state before selected state in toolbar's @p item.
406 *
407 * @param it The toolbar item to change state.
408 * @return The state before current state, or @c NULL on failure.
409 *
410 * If first state is selected, this function will return last state.
411 *
412 * @see elm_toolbar_item_state_set()
413 * @see elm_toolbar_item_state_add()
414 *
415 * @ingroup Toolbar
416 */
417EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it); 99EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
418 100
419/**
420 * Show a specific item, when the toolbar can be scrolled.
421 *
422 * @param it the toolbar item
423 *
424 * see elm_toolbar_item_bring_in()
425 *
426 * @since 1.8
427 * @ingroup Toolbar
428 */
429EAPI void elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type); 101EAPI void elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type);
430 102
431/**
432 * Show a specific item with scroll animation, when the toolbar can be scrolled.
433 *
434 * @param it the toolbar item
435 *
436 * see elm_toolbar_item_show()
437 *
438 * @since 1.8
439 * @ingroup Toolbar
440 */
441EAPI void elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type); 103EAPI void elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type);
442 104
diff --git a/src/lib/elm_toolbar_item.eo b/src/lib/elm_toolbar_item.eo
new file mode 100644
index 000000000..8a07c231d
--- /dev/null
+++ b/src/lib/elm_toolbar_item.eo
@@ -0,0 +1,429 @@
1class Elm_Toolbar_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_toolbar_item;
5 properties {
6 prev {
7 get {
8 /*@
9 Get the item before @p item in toolbar.
10
11 @note If it is the first item, @c NULL will be returned.
12
13 @see elm_toolbar_item_prepend()
14
15 @ingroup Toolbar
16 */
17 }
18 values {
19 Elm_Object_Item *item; /*@ The item before @p item, or @c NULL if none or on failure. */
20 }
21 }
22 next {
23 get {
24 /*@
25 Get the item after @p item in toolbar.
26
27 @note If it is the last item, @c NULL will be returned.
28
29 @see elm_toolbar_item_append()
30
31 @ingroup Toolbar
32 */
33 }
34 values {
35 Elm_Object_Item *item; /*@ The item after @p item, or @c NULL if none or on failure. */
36 }
37 }
38 priority {
39 get {
40 /*@
41 Get the priority of a toolbar item.
42
43 @see elm_toolbar_item_priority_set() for details.
44
45 @ingroup Toolbar
46 */
47 }
48 set {
49 /*@
50 Set the priority of a toolbar item.
51
52 This is used only when the toolbar shrink mode is set
53 to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
54 When space is less than required, items with low priority
55 will be removed from the toolbar and added to a dynamically-created menu,
56 while items with higher priority will remain on the toolbar,
57 with the same order they were added.
58
59 @see elm_toolbar_item_priority_get()
60
61 @ingroup Toolbar
62 */
63 }
64 values {
65 int priority; /* The @p item priority. The default is zero for set and 0 is returned on failure. */
66 }
67 }
68 selected {
69 get {
70 /*@
71 Get whether the @p item is selected or not.
72
73 @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
74 it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
75
76 @see elm_toolbar_selected_item_set() for details.
77 @see elm_toolbar_item_selected_get()
78
79 @ingroup Toolbar
80 */
81 }
82 set {
83 /*@
84 Set the selected state of an item.
85
86 This sets the selected state of the given item @p it.
87 @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
88
89 If a new item is selected the previously selected will be unselected.
90 Previously selected item can be get with function
91 elm_toolbar_selected_item_get().
92
93 Selected items will be highlighted.
94
95 @see elm_toolbar_item_selected_get()
96 @see elm_toolbar_selected_item_get()
97
98 @ingroup Toolbar
99 */
100 }
101 values {
102 Eina_Bool selected; /*@ The selected state */
103 }
104 }
105 icon {
106 get {
107 /*@
108 Get the string used to set the icon of @p item.
109
110 @return The string associated with the icon object.
111
112 @see elm_toolbar_item_icon_set() for details.
113
114 @ingroup Toolbar
115 */
116 }
117 set {
118 /*@
119 Set the icon associated with @p item.
120
121 @param icon A string with icon name or the absolute path of an image file.
122
123 Toolbar will load icon image from fdo or current theme.
124 This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
125 If an absolute path is provided it will load it direct from a file.
126
127 @note This function does not accept relative icon path.
128
129 @see elm_toolbar_icon_order_lookup_set()
130 @see elm_toolbar_icon_order_lookup_get()
131
132 @ingroup Toolbar
133 */
134 }
135 values {
136 const (char) *icon;
137 }
138 }
139 object {
140 get {
141 /*@
142 Get the real Evas(Edje) object created to implement the view of a given
143 toolbar @p item.
144
145 @ingroup Toolbar
146 */
147 }
148 values {
149 Evas_Object *obj; /*@ The base Edje object associated with @p it. */
150 }
151 }
152 icon_object {
153 get {
154 /*@
155 Get the icon object of @p item.
156
157 @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
158 or elm_toolbar_item_icon_memfile_set() for details.
159
160 @ingroup Toolbar
161 */
162 }
163 values {
164 Evas_Object *obj; /*@ The icon object */
165 }
166 }
167 separator {
168 get {
169 /*@
170 Get a value whether item is a separator or not.
171
172 @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
173 indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
174
175 @see elm_toolbar_item_separator_set() for details.
176
177 @ingroup Toolbar
178 */
179 }
180 set {
181 /*@
182 Set or unset item as a separator.
183
184 @param separator @c EINA_TRUE to set item @p item as separator or
185 @c EINA_FALSE to unset, i.e., item will be used as a regular item.
186
187 Items aren't set as separator by default.
188
189 If set as separator it will display separator theme, so won't display
190 icons or label.
191
192 @see elm_toolbar_item_separator_get()
193
194 @ingroup Toolbar
195 */
196 }
197 values {
198 Eina_Bool separator;
199 }
200 }
201 menu {
202 get {
203 /*@
204 Get toolbar item's menu.
205
206 If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
207 this function will set it.
208
209 @see elm_toolbar_item_menu_set() for details.
210
211 @ingroup Toolbar
212 */
213 }
214 values {
215 Evas_Object *menu; /*@ Item's menu object or @c NULL on failure. */
216 }
217 }
218 state {
219 get {
220 /*@
221 Get the current state of @p it.
222
223 @return The selected state or @c NULL if none is selected or on failure.
224
225 @see elm_toolbar_item_state_set() for details.
226 @see elm_toolbar_item_state_unset()
227 @see elm_toolbar_item_state_add()
228
229 @ingroup Toolbar
230 */
231 }
232 set {
233 /*@
234 Set @p state as the current state of @p it.
235
236 @param state The state to use.
237 @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
238
239 If @p state is @c NULL, it won't select any state and the default item's
240 icon and label will be used. It's the same behaviour than
241 elm_toolbar_item_state_unset().
242
243 @see elm_toolbar_item_state_unset()
244
245 @ingroup Toolbar
246 */
247 return: bool;
248 }
249 values {
250 Elm_Toolbar_Item_State *state;
251 }
252 }
253 }
254 methods {
255 /* init { FIXME
256 params {
257 Evas_Smart_Cb func;
258 const(void)* data;
259 }
260 }*/
261 icon_memfile_set {
262 /*@
263 Set the icon associated with @p item to an image in a binary buffer.
264
265 @note The icon image set by this function can be changed by
266 elm_toolbar_item_icon_set().
267
268 @ingroup Toolbar
269 */
270 params {
271 @in const (void) *img; /*@ The binary data that will be used as an image */
272 @in size_t size; /*@ The size of binary data @p img */
273 @in const (char) *format; /*@ Optional format of @p img to pass to the image loader */
274 @in const (char) *key; /*@ Optional key of @p img to pass to the image loader (eg. if @p img is an edje file) */
275 }
276 return: bool; /*@ (@c EINA_TRUE = success, @c EINA_FALSE = error) */
277 }
278 icon_file_set {
279 /*@
280 Set the icon associated with @p item to an image in a binary buffer.
281
282 @note The icon image set by this function can be changed by
283 elm_toolbar_item_icon_set().
284
285 @ingroup Toolbar
286 */
287 params {
288 @in const (char) *file; /*@ The file that contains the image */
289 @in const (char) *key; /*@ Optional key of @p img to pass to the image loader (eg. if @p img is an edje file) */
290 }
291 return: bool; /*@ (@c EINA_TRUE = success, @c EINA_FALSE = error) */
292 }
293 state_add {
294 /*@
295 Add a new state to @p item.
296
297 Toolbar will load icon image from fdo or current theme.
298 This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
299 If an absolute path is provided it will load it direct from a file.
300
301 States created with this function can be removed with
302 elm_toolbar_item_state_del().
303
304 @see elm_toolbar_item_state_del()
305 @see elm_toolbar_item_state_sel()
306 @see elm_toolbar_item_state_get()
307
308 @ingroup Toolbar
309 */
310 params {
311 @in const (char) *icon; /*@ A string with icon name or the absolute path of an image file. */
312 @in const (char) *label; /*@ The label of the new state. */
313 @in Evas_Smart_Cb func; /*@ The function to call when the item is clicked when this * state is selected. */
314 @in const (void) *data; /*@ The data to associate with the state. */
315 }
316 return: Elm_Toolbar_Item_State *; /*@ The toolbar item state, or @c NULL upon failure. */
317 }
318 state_del {
319 /*@
320 Delete a previously added state to @p item.
321
322 @see elm_toolbar_item_state_add()
323 */
324 params {
325 @in Elm_Toolbar_Item_State *state; /*@ The state to be deleted. */
326 }
327 return: bool; /*@ @c EINA_TRUE on success or @c EINA_FALSE on failure. */
328 }
329 state_next {
330 /*@
331 Get the state after selected state in toolbar's @p item.
332
333 If last state is selected, this function will return first state.
334
335 @see elm_toolbar_item_state_set()
336 @see elm_toolbar_item_state_add()
337
338 @ingroup Toolbar
339 */
340 return: Elm_Toolbar_Item_State *; /*@ The state after current state, or @c NULL on failure. */
341 }
342 state_prev {
343 /*@
344 Get the state before selected state in toolbar's @p item.
345
346
347 If first state is selected, this function will return last state.
348
349 @see elm_toolbar_item_state_set()
350 @see elm_toolbar_item_state_add()
351
352 @ingroup Toolbar
353 */
354 return: Elm_Toolbar_Item_State *; /*@ The state before current state, or @c NULL on failure. */
355 }
356 show {
357 /*@
358 Show a specific item, when the toolbar can be scrolled.
359
360 see elm_toolbar_item_bring_in()
361
362 @since 1.8
363 @ingroup Toolbar
364 */
365 params {
366 @in Elm_Toolbar_Item_Scrollto_Type type;
367 }
368 }
369 bring_in {
370 /*@
371 Show a specific item with scroll animation, when the toolbar can be scrolled.
372
373 see elm_toolbar_item_show()
374
375 @since 1.8
376 @ingroup Toolbar
377 */
378 params {
379 @in Elm_Toolbar_Item_Scrollto_Type type;
380 }
381 }
382 menu_set {
383 /*@
384 Set whether the toolbar item opens a menu.
385
386 A toolbar item can be set to be a menu, using this function.
387
388 Once it is set to be a menu, it can be manipulated through the
389 menu-like function elm_toolbar_menu_parent_set() and the other
390 elm_menu functions, using the Evas_Object @c menu returned by
391 elm_toolbar_item_menu_get().
392
393 So, items to be displayed in this item's menu should be added with
394 elm_menu_item_add().
395
396 The following code exemplifies the most basic usage:
397 @code
398 tb = elm_toolbar_add(win)
399 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
400 elm_toolbar_item_menu_set(item, EINA_TRUE);
401 elm_toolbar_menu_parent_set(tb, win);
402 menu = elm_toolbar_item_menu_get(item);
403 elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
404 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
405 NULL);
406 @endcode
407
408 @see elm_toolbar_item_menu_get()
409
410 @ingroup Toolbar
411 */
412 params {
413 @in Eina_Bool menu; /*@ If @c EINA_TRUE, @p item will opens a menu when selected. */
414 }
415 }
416 }
417 implements {
418 Eo.Base.constructor;
419 Elm_Widget_Item.disable;
420 Elm_Widget_Item.del_pre;
421 Elm_Widget_Item.focus.set;
422 Elm_Widget_Item.focus.get;
423 Elm_Widget_Item.part_text.get;
424 Elm_Widget_Item.part_text.set;
425 Elm_Widget_Item.part_content.get;
426 Elm_Widget_Item.part_content.set;
427 Elm_Widget_Item.part_content_unset;
428 }
429}
diff --git a/src/lib/elm_widget_toolbar.h b/src/lib/elm_widget_toolbar.h
index fb5783533..b4a3a8a15 100644
--- a/src/lib/elm_widget_toolbar.h
+++ b/src/lib/elm_widget_toolbar.h
@@ -9,6 +9,7 @@
9 * IT AT RUNTIME. 9 * IT AT RUNTIME.
10 */ 10 */
11 11
12#include "elm_object_item_migration_temp.h"
12/** 13/**
13 * @addtogroup Widget 14 * @addtogroup Widget
14 * @{ 15 * @{
@@ -20,7 +21,7 @@
20 * widgets which are a toolbar with some more logic on top. 21 * widgets which are a toolbar with some more logic on top.
21 */ 22 */
22 23
23typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; 24typedef struct _Elm_Toolbar_Item_Data Elm_Toolbar_Item_Data;
24 25
25/** 26/**
26 * Base widget smart data extended with toolbar instance data. 27 * Base widget smart data extended with toolbar instance data.
@@ -33,11 +34,11 @@ struct _Elm_Toolbar_Data
33 Evas_Object *bx, *more, *bx_more, *bx_more2; 34 Evas_Object *bx, *more, *bx_more, *bx_more2;
34 Evas_Object *menu_parent; 35 Evas_Object *menu_parent;
35 Eina_Inlist *items; 36 Eina_Inlist *items;
36 Elm_Toolbar_Item *more_item; 37 Elm_Toolbar_Item_Data *more_item;
37 Elm_Toolbar_Item *selected_item; /**< a selected item by mouse click, return key, api, and etc. */ 38 Elm_Toolbar_Item_Data *selected_item; /**< a selected item by mouse click, return key, api, and etc. */
38 Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */ 39 Elm_Toolbar_Item_Data *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
39 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. */ 40 Elm_Toolbar_Item_Data *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
40 Elm_Toolbar_Item *reorder_empty, *reorder_item; 41 Elm_Toolbar_Item_Data *reorder_empty, *reorder_item;
41 Elm_Toolbar_Shrink_Mode shrink_mode; 42 Elm_Toolbar_Shrink_Mode shrink_mode;
42 Elm_Icon_Lookup_Order lookup_order; 43 Elm_Icon_Lookup_Order lookup_order;
43 int theme_icon_size, priv_icon_size, 44 int theme_icon_size, priv_icon_size,
@@ -59,9 +60,9 @@ struct _Elm_Toolbar_Data
59 Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the toolbar at the moment. This flag is set to true on mouse and reset to false on mouse up. */ 60 Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the toolbar at the moment. This flag is set to true on mouse and reset to false on mouse up. */
60}; 61};
61 62
62struct _Elm_Toolbar_Item 63struct _Elm_Toolbar_Item_Data
63{ 64{
64 ELM_WIDGET_ITEM; 65 Elm_Widget_Item_Data *base;
65 EINA_INLIST; 66 EINA_INLIST;
66 67
67 const char *label; 68 const char *label;
@@ -73,7 +74,7 @@ struct _Elm_Toolbar_Item
73 Evas_Object *proxy; 74 Evas_Object *proxy;
74 Evas_Smart_Cb func; 75 Evas_Smart_Cb func;
75 Elm_Transit *trans; 76 Elm_Transit *trans;
76 Elm_Toolbar_Item *reorder_to; 77 Elm_Toolbar_Item_Data *reorder_to;
77 struct 78 struct
78 { 79 {
79 int priority; 80 int priority;
@@ -128,15 +129,18 @@ struct _Elm_Toolbar_Item_State
128 return 129 return
129 130
130#define ELM_TOOLBAR_ITEM_CHECK(it) \ 131#define ELM_TOOLBAR_ITEM_CHECK(it) \
131 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 132 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
132 ELM_TOOLBAR_CHECK(it->base.widget); 133 ELM_TOOLBAR_CHECK(it->base->widget);
133 134
134#define ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, ...) \ 135#define ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, ...) \
135 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 136 ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
136 ELM_TOOLBAR_CHECK(it->base.widget) __VA_ARGS__; 137 ELM_TOOLBAR_CHECK(it->base->widget) __VA_ARGS__;
137 138
138#define ELM_TOOLBAR_ITEM_CHECK_OR_GOTO(it, label) \ 139#define ELM_TOOLBAR_ITEM_CHECK_OR_GOTO(it, label) \
139 ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item_Data *)it, label); \ 140 ELM_WIDGET_ITEM_CHECK_OR_GOTO(it->base, label); \
140 if (!it->base.widget || !eo_isa ((it->base.widget), ELM_TOOLBAR_CLASS)) goto label; 141 if (!it->base->widget || !eo_isa ((it->base->widget), ELM_TOOLBAR_CLASS)) goto label;
142
143#define ELM_TOOLBAR_ITEM_DATA_GET(o, sd) \
144 Elm_Toolbar_Item_Data* sd = eo_data_scope_get((Eo *)o, ELM_TOOLBAR_ITEM_CLASS)
141 145
142#endif 146#endif