1 #include <Elementary.h>
3 #include "els_scroller.h"
7 typedef struct _Widget_Data Widget_Data;
8 typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item;
12 Evas_Object *scr, *bx;
13 Evas_Object *menu_parent;
15 Elm_Toolbar_Item *more_item, *selected_item;
16 Elm_Toolbar_Shrink_Mode shrink_mode;
17 Elm_Icon_Lookup_Order lookup_order;
19 unsigned int item_count;
21 Eina_Bool homogeneous : 1;
22 Eina_Bool no_select : 1;
23 Eina_Bool always_select : 1;
24 Eina_Bool vertical : 1;
25 Eina_Bool long_press : 1;
26 Ecore_Timer *long_timer;
27 Ecore_Job *resize_job;
30 struct _Elm_Toolbar_Item
42 Eina_Bool visible : 1;
44 Eina_Bool selected : 1;
45 Eina_Bool separator : 1;
48 Eina_List *current_state;
51 #define ELM_TOOLBAR_ITEM_FROM_INLIST(item) \
52 ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Toolbar_Item) : NULL)
54 struct _Elm_Toolbar_Item_State
63 static const char *widtype = NULL;
64 static void _item_show(Elm_Toolbar_Item *it);
65 static void _item_select(Elm_Toolbar_Item *it);
66 static void _item_unselect(Elm_Toolbar_Item *it);
67 static void _del_pre_hook(Evas_Object *obj);
68 static void _del_hook(Evas_Object *obj);
69 static void _mirrored_set(Evas_Object *obj, Eina_Bool mirrored);
70 static void _mirrored_set_item(Evas_Object *obj, Elm_Toolbar_Item *it, Eina_Bool mirrored);
71 static void _theme_hook(Evas_Object *obj);
72 static void _sizing_eval(Evas_Object *obj);
73 static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
74 static void _menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
75 static void _menu_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
76 static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data);
77 static void _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal);
78 static void _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal);
80 static const char SIG_CLICKED[] = "clicked";
81 static const char SIG_LONGPRESSED[] = "longpressed";
82 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
84 static const Evas_Smart_Cb_Description _signals[] = {
86 {SIG_LONGPRESSED, ""},
87 {SIG_CLICKED_DOUBLE, ""},
92 _item_disable_hook(Elm_Object_Item *it)
94 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
97 Elm_Toolbar_Item *toolbar_it = (Elm_Toolbar_Item *) it;
99 wd = elm_widget_data_get(WIDGET(toolbar_it));
102 if (elm_widget_item_disabled_get(toolbar_it))
104 edje_object_signal_emit(VIEW(toolbar_it), "elm,state,disabled", "elm");
105 elm_widget_signal_emit(toolbar_it->icon, "elm,state,disabled", "elm");
109 edje_object_signal_emit(VIEW(toolbar_it), "elm,state,enabled", "elm");
110 elm_widget_signal_emit(toolbar_it->icon, "elm,state,enabled", "elm");
112 _resize(WIDGET(toolbar_it), NULL, NULL, NULL);
116 _item_icon_set(Evas_Object *icon_obj, const char *type, const char *icon)
120 if ((!type) || (!*type)) goto end;
121 if ((!icon) || (!*icon)) return EINA_FALSE;
122 if ((snprintf(icon_str, sizeof(icon_str), "%s%s", type, icon) > 0)
123 && (elm_icon_standard_set(icon_obj, icon_str)))
126 if (elm_icon_standard_set(icon_obj, icon))
128 WRN("couldn't find icon definition for '%s'", icon);
133 _elm_toolbar_icon_size_get(Widget_Data *wd)
135 const char *icon_size = edje_object_data_get(
136 elm_smart_scroller_edje_object_get(wd->scr), "icon_size");
138 return atoi(icon_size);
139 return _elm_config->icon_size;
143 _item_show(Elm_Toolbar_Item *it)
145 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
146 Evas_Coord x, y, w, h, bx, by;
149 evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL);
150 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
151 elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h);
155 _item_unselect(Elm_Toolbar_Item *item)
158 if ((!item) || (!item->selected)) return;
159 wd = elm_widget_data_get(WIDGET(item));
161 item->selected = EINA_FALSE;
162 wd->selected_item = NULL;
163 edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm");
164 elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm");
168 _item_select(Elm_Toolbar_Item *it)
170 Elm_Toolbar_Item *it2;
171 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
176 if (elm_widget_item_disabled_get(it) || (it->separator) || (it->object)) return;
183 if (wd->always_select) return;
188 it2 = (Elm_Toolbar_Item *)
189 elm_toolbar_selected_item_get(WIDGET(it));
192 it->selected = EINA_TRUE;
193 wd->selected_item = it;
194 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
195 elm_widget_signal_emit(it->icon, "elm,state,selected", "elm");
200 if (it->menu && (!sel))
202 evas_object_show(it->o_menu);
203 evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_RESIZE,
204 _menu_move_resize, it);
205 evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOVE,
206 _menu_move_resize, it);
208 _menu_move_resize(it, NULL, NULL, NULL);
210 if (it->func) it->func((void *)(it->base.data), WIDGET(it), it);
211 evas_object_smart_callback_call(obj2, SIG_CLICKED, it);
215 _menu_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
217 Elm_Toolbar_Item *selected;
218 Elm_Toolbar_Item *it = data;
219 selected = (Elm_Toolbar_Item *) elm_toolbar_selected_item_get(WIDGET(it));
220 _item_unselect(selected);
224 _menu_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
226 // avoid hide being emitted during object deletion
227 evas_object_event_callback_del_full
228 (obj, EVAS_CALLBACK_HIDE, _menu_hide, data);
232 _menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
234 Elm_Toolbar_Item *it = data;
236 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
238 if ((!wd) || (!wd->menu_parent)) return;
239 evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
240 elm_menu_move(it->o_menu, x, y+h);
244 _item_del(Elm_Toolbar_Item *it)
246 Elm_Toolbar_Item_State *it_state;
248 EINA_LIST_FREE(it->states, it_state)
250 if (it->icon == it_state->icon)
252 eina_stringshare_del(it_state->label);
253 eina_stringshare_del(it_state->icon_str);
254 if (it_state->icon) evas_object_del(it_state->icon);
257 eina_stringshare_del(it->label);
258 eina_stringshare_del(it->icon_str);
259 if (it->icon) evas_object_del(it->icon);
260 //TODO: See if checking for wd->menu_parent is necessary before deleting menu
261 if (it->o_menu) evas_object_del(it->o_menu);
265 _del_pre_hook(Evas_Object *obj)
267 Widget_Data *wd = elm_widget_data_get(obj);
268 Elm_Toolbar_Item *it, *next;
271 it = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
274 next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
276 elm_widget_item_free(it);
281 _item_del(wd->more_item);
282 elm_widget_item_free(wd->more_item);
286 ecore_timer_del(wd->long_timer);
287 wd->long_timer = NULL;
292 _del_hook(Evas_Object *obj)
294 Widget_Data *wd = elm_widget_data_get(obj);
302 _mirrored_set_item(Evas_Object *obj __UNUSED__, Elm_Toolbar_Item *it, Eina_Bool mirrored)
304 edje_object_mirrored_set(VIEW(it), mirrored);
305 elm_widget_mirrored_set(it->o_menu, mirrored);
309 _theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_size)
311 Widget_Data *wd = elm_widget_data_get(obj);
312 Evas_Object *view = VIEW(it);
314 const char *style = elm_widget_style_get(obj);
316 _mirrored_set_item(obj, it, elm_widget_mirrored_get(obj));
317 edje_object_scale_set(view, scale);
318 if (!it->separator && !it->object)
320 _elm_theme_object_set(obj, view, "toolbar", "item", style);
323 edje_object_signal_emit(view, "elm,state,selected", "elm");
324 elm_widget_signal_emit(it->icon, "elm,state,selected", "elm");
326 if (elm_widget_item_disabled_get(it))
328 edje_object_signal_emit(view, "elm,state,disabled", "elm");
329 elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm");
335 ms = ((double)icon_size * scale);
336 evas_object_size_hint_min_set(it->icon, ms, ms);
337 evas_object_size_hint_max_set(it->icon, ms, ms);
338 edje_object_part_swallow(view, "elm.swallow.icon", it->icon);
340 edje_object_part_text_set(view, "elm.text", it->label);
346 _elm_theme_object_set(obj, view, "toolbar", "separator", style);
349 evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, -1.0);
350 evas_object_size_hint_align_set(view, EVAS_HINT_FILL, 0.5);
354 evas_object_size_hint_weight_set(view, -1.0, EVAS_HINT_EXPAND);
355 evas_object_size_hint_align_set(view, 0.5, EVAS_HINT_FILL);
360 _elm_theme_object_set(obj, view, "toolbar", "object", style);
361 edje_object_part_swallow(view, "elm.swallow.object", it->object);
366 if (!it->separator && !it->object)
367 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
368 edje_object_size_min_restricted_calc(view, &mw, &mh, mw, mh);
369 if (!it->separator && !it->object)
370 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
371 evas_object_size_hint_min_set(view, mw, mh);
375 _mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
377 Widget_Data *wd = elm_widget_data_get(obj);
378 Elm_Toolbar_Item *it;
380 EINA_INLIST_FOREACH(wd->items, it)
381 _mirrored_set_item(obj, it, mirrored);
383 _mirrored_set_item(obj, wd->more_item, mirrored);
387 _theme_hook(Evas_Object *obj)
389 Widget_Data *wd = elm_widget_data_get(obj);
390 Elm_Toolbar_Item *it;
394 _elm_widget_mirrored_reload(obj);
395 elm_smart_scroller_object_theme_set(obj, wd->scr, "toolbar", "base", elm_widget_style_get(obj));
396 _mirrored_set(obj, elm_widget_mirrored_get(obj));
397 scale = (elm_widget_scale_get(obj) * _elm_config->scale);
398 edje_object_scale_set(wd->scr, scale);
399 wd->icon_size = _elm_toolbar_icon_size_get(wd);
400 EINA_INLIST_FOREACH(wd->items, it)
401 _theme_hook_item(obj, it, scale, wd->icon_size);
403 _theme_hook_item(obj, wd->more_item, scale, wd->icon_size);
408 _item_text_set_hook(Elm_Object_Item *it,
412 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
413 if (part && strcmp(part, "default")) return;
414 _item_label_set(((Elm_Toolbar_Item *) it), label, "elm,state,label_set");
418 _item_text_get_hook(const Elm_Object_Item *it, const char *part)
420 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
421 if (part && strcmp(part, "default")) return NULL;
422 return ((Elm_Toolbar_Item *) it)->label;
426 _item_content_set_hook(Elm_Object_Item *it,
428 Evas_Object *content)
430 if (part && strcmp(part, "object")) return;
431 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
432 Evas_Object *obj = WIDGET(item);
433 Widget_Data *wd = elm_widget_data_get(obj);
435 if (item->object == content) return;
436 item->object = content;
437 elm_widget_sub_object_add(obj, item->object);
438 scale = (elm_widget_scale_get(obj) * _elm_config->scale);
439 _theme_hook_item(obj, item, scale, wd->icon_size);
443 _item_content_get_hook(const Elm_Object_Item *it, const char *part)
445 if (part && strcmp(part, "object")) return NULL;
446 return ((Elm_Toolbar_Item *) it)->object;
450 _item_content_unset_hook(Elm_Object_Item *it, const char *part)
452 if (part && strcmp(part, "object")) return;
453 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
454 Evas_Object *obj = WIDGET(item);
455 Widget_Data *wd = elm_widget_data_get(obj);
457 edje_object_part_unswallow(VIEW(it), item->object);
458 elm_widget_sub_object_del(obj, item->object);
460 scale = (elm_widget_scale_get(obj) * _elm_config->scale);
461 _theme_hook_item(obj, item, scale, wd->icon_size);
465 _translate_hook(Evas_Object *obj)
467 evas_object_smart_callback_call(obj, "language,changed", NULL);
471 _sizing_eval(Evas_Object *obj)
473 Widget_Data *wd = elm_widget_data_get(obj);
474 Evas_Coord minw = -1, minh = -1, minw_bx = -1, minh_bx = -1;
475 Evas_Coord vw = 0, vh = 0;
479 evas_object_smart_need_recalculate_set(wd->bx, EINA_TRUE);
480 evas_object_smart_calculate(wd->bx);
481 edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr),
483 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
484 if (w < minw) w = minw;
485 if (h < minh) h = minh;
486 evas_object_resize(wd->scr, w, h);
488 evas_object_size_hint_min_get(wd->bx, &minw_bx, &minh_bx);
489 // if (wd->vertical && (h > minh)) minh = h;
490 // if ((!wd->vertical) && (w > minw)) minw = w;
491 elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
492 if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_NONE)
496 minw = minw_bx + (w - vw);
497 minh = minh_bx + (h - vh);
501 minw = minw_bx + (w - vw);
502 minh = minh_bx + (h - vh);
505 else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND)
507 minw = minw_bx + (w - vw);
508 minh = minh_bx + (h - vh);
509 if (minw_bx < vw) minw_bx = vw;
510 if (minh_bx < vh) minh_bx = vh;
516 minw = minw_bx + (w - vw);
522 minh = minh_bx + (h - vh);
524 // if (wd->vertical) minh = h - vh;
525 // else minw = w - vw;
526 // minh = minh + (h - vh);
528 evas_object_resize(wd->bx, minw_bx, minh_bx);
529 evas_object_size_hint_min_set(obj, minw, minh);
530 evas_object_size_hint_max_set(obj, -1, -1);
534 _item_menu_create(Widget_Data *wd, Elm_Toolbar_Item *item)
536 item->o_menu = elm_menu_add(VIEW(item));
537 item->menu = EINA_TRUE;
539 elm_menu_parent_set(item->o_menu, wd->menu_parent);
540 evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE,
542 evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_DEL,
547 _item_menu_destroy(Elm_Toolbar_Item *item)
551 evas_object_del(item->o_menu);
554 item->menu = EINA_FALSE;
558 _toolbar_item_prio_compare_cb(const void *i1, const void *i2)
560 const Elm_Toolbar_Item *eti1 = i1;
561 const Elm_Toolbar_Item *eti2 = i2;
564 if (!eti1) return -1;
566 return eti2->prio.priority - eti1->prio.priority;
570 _fix_items_visibility(Widget_Data *wd, Evas_Coord *iw, Evas_Coord vw)
572 Elm_Toolbar_Item *it;
573 Eina_List *sorted = NULL;
574 Evas_Coord ciw = 0, cih = 0;
576 EINA_INLIST_FOREACH(wd->items, it)
578 sorted = eina_list_sorted_insert(sorted,
579 _toolbar_item_prio_compare_cb, it);
584 evas_object_geometry_get(wd->VIEW(more_item), NULL, NULL, &ciw, &cih);
585 if (wd->vertical) *iw += cih;
588 EINA_LIST_FREE(sorted, it)
590 evas_object_geometry_get(VIEW(it), NULL, NULL, &ciw, &cih);
591 if (wd->vertical) *iw += cih;
593 it->prio.visible = (*iw <= vw);
598 _elm_toolbar_item_menu_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
600 Elm_Toolbar_Item *it = data;
601 if (it->func) it->func((void *)(it->base.data), WIDGET(it), it);
605 _resize_job(void *data)
607 Evas_Object *obj = (Evas_Object *)data;
608 Widget_Data *wd = elm_widget_data_get(obj);
609 Evas_Coord mw, mh, vw = 0, vh = 0, w = 0, h = 0;
610 Elm_Toolbar_Item *it;
613 wd->resize_job = NULL;
614 elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
615 evas_object_size_hint_min_get(wd->bx, &mw, &mh);
616 evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h);
617 if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU)
619 Evas_Coord iw = 0, ih = 0, more_w = 0, more_h = 0;
623 evas_object_resize(wd->bx, w, vh);
624 _fix_items_visibility(wd, &ih, vh);
628 evas_object_resize(wd->bx, vw, h);
629 _fix_items_visibility(wd, &iw, vw);
631 evas_object_geometry_get(wd->VIEW(more_item), NULL, NULL,
635 if ((ih - more_h) <= vh) ih -= more_h;
639 if ((iw - more_w) <= vw) iw -= more_w;
642 /* All items are removed from the box object, since removing individual
643 * items won't trigger a resize. Items are be readded below. */
644 evas_object_box_remove_all(wd->bx, EINA_FALSE);
645 if (((wd->vertical) && (ih > vh)) ||
646 ((!wd->vertical) && (iw > vw)))
650 _item_menu_destroy(wd->more_item);
651 _item_menu_create(wd, wd->more_item);
652 menu = elm_toolbar_item_menu_get((Elm_Object_Item *)wd->more_item);
653 EINA_INLIST_FOREACH(wd->items, it)
655 if (!it->prio.visible)
658 elm_menu_item_separator_add(menu, NULL);
661 Elm_Object_Item *menu_it;
662 menu_it = elm_menu_item_add
663 (menu, NULL, it->icon_str, it->label,
664 _elm_toolbar_item_menu_cb, it);
665 elm_object_item_disabled_set
666 (menu_it, elm_widget_item_disabled_get(it));
668 elm_menu_clone(it->o_menu, menu, menu_it);
670 evas_object_hide(VIEW(it));
674 evas_object_box_append(wd->bx, VIEW(it));
675 evas_object_show(VIEW(it));
678 evas_object_box_append(wd->bx, wd->VIEW(more_item));
679 evas_object_show(wd->VIEW(more_item));
683 /* All items are visible, show them all (except for the "More"
684 * button, of course). */
685 EINA_INLIST_FOREACH(wd->items, it)
687 evas_object_show(VIEW(it));
688 evas_object_box_append(wd->bx, VIEW(it));
690 evas_object_hide(wd->VIEW(more_item));
693 else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
695 Evas_Coord iw = 0, ih = 0;
699 evas_object_resize(wd->bx, w, vh);
700 _fix_items_visibility(wd, &ih, vh);
704 evas_object_resize(wd->bx, vw, h);
705 _fix_items_visibility(wd, &iw, vw);
707 evas_object_box_remove_all(wd->bx, EINA_FALSE);
708 if (((wd->vertical) && (ih > vh)) ||
709 ((!wd->vertical) && (iw > vw)))
711 EINA_INLIST_FOREACH(wd->items, it)
713 if (!it->prio.visible)
714 evas_object_hide(VIEW(it));
717 evas_object_box_append(wd->bx, VIEW(it));
718 evas_object_show(VIEW(it));
724 /* All items are visible, show them all */
725 EINA_INLIST_FOREACH(wd->items, it)
727 evas_object_show(VIEW(it));
728 evas_object_box_append(wd->bx, VIEW(it));
732 else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND)
734 if ((vw >= mw) && (vh >= mh))
735 evas_object_resize(wd->bx, vw, vh);
737 evas_object_resize(wd->bx, mw, vh);
739 evas_object_resize(wd->bx, vw, mh);
745 if ((vh >= mh) && (h != vh)) evas_object_resize(wd->bx, w, vh);
749 if ((vw >= mw) && (w != vw)) evas_object_resize(wd->bx, vw, h);
751 EINA_INLIST_FOREACH(wd->items, it)
761 _mirrored_set(obj, elm_widget_mirrored_get(obj));
765 _resize_item(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
768 _resize(data, NULL, NULL, NULL);
772 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
774 Widget_Data *wd = elm_widget_data_get(data);
776 wd->resize_job = ecore_job_add(_resize_job, data);
780 _select_filter(Elm_Toolbar_Item *it, Evas_Object *obj __UNUSED__, const char *emission, const char *source __UNUSED__)
783 char buf[sizeof("elm,action,click,") + 1];
785 button = atoi(emission + sizeof("mouse,clicked,") - 1);
786 if (button == 1) return; /* regular left click event */
787 snprintf(buf, sizeof(buf), "elm,action,click,%d", button);
788 edje_object_signal_emit(VIEW(it), buf, "elm");
792 _select(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
794 Elm_Toolbar_Item *it = data;
796 if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
797 (_elm_access_2nd_click_timeout(VIEW(it))))
799 if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
800 _elm_access_say(E_("Selected"));
806 _long_press(Elm_Toolbar_Item *it)
808 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
809 wd->long_timer = NULL;
810 wd->long_press = EINA_TRUE;
811 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
812 return ECORE_CALLBACK_CANCEL;
816 _mouse_down(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Down *ev)
818 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
820 if (ev->button != 1) return;
821 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
822 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
823 wd->long_press = EINA_FALSE;
824 if (wd->long_timer) ecore_timer_interval_set(wd->long_timer, _elm_config->longpress_timeout);
825 else wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, (Ecore_Task_Cb)_long_press, it);
829 _mouse_up(Elm_Toolbar_Item *it, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, Evas_Event_Mouse_Up *ev)
831 Widget_Data *wd = elm_widget_data_get(WIDGET(it));
833 if (ev->button != 1) return;
836 ecore_timer_del(wd->long_timer);
837 wd->long_timer = NULL;
842 _mouse_in(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
844 Elm_Toolbar_Item *it = data;
845 edje_object_signal_emit(VIEW(it), "elm,state,highlighted", "elm");
846 elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm");
850 _mouse_out(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
852 Elm_Toolbar_Item *it = data;
853 edje_object_signal_emit(VIEW(it), "elm,state,unhighlighted", "elm");
854 elm_widget_signal_emit(it->icon, "elm,state,unhighlighted", "elm");
858 _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
860 Evas_Object *obj = (Evas_Object *) data;
861 Widget_Data *wd = elm_widget_data_get(obj);
863 _els_box_layout(o, priv, !wd->vertical, wd->homogeneous,
864 elm_widget_mirrored_get(obj));
868 _access_info_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Widget_Item *item)
870 Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)item;
871 const char *txt = item->access_info;
872 if (!txt) txt = it->label;
873 if (txt) return strdup(txt);
878 _access_state_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Widget_Item *item __UNUSED__)
880 Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)item;
882 return strdup(E_("Separator"));
883 else if (elm_widget_item_disabled_get(it))
884 return strdup(E_("State: Disabled"));
885 else if (it->selected)
886 return strdup(E_("State: Selected"));
888 return strdup(E_("Has menu"));
893 _item_del_pre_hook(Elm_Object_Item *it)
895 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
899 Elm_Toolbar_Item *item, *next;
900 item = (Elm_Toolbar_Item *) it;
902 wd = elm_widget_data_get(WIDGET(item));
903 if (!wd) return EINA_FALSE;
906 next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next);
907 wd->items = eina_inlist_remove(wd->items, EINA_INLIST_GET(item));
909 if (!next) next = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
910 if (wd->always_select && item->selected && next) _item_select(next);
917 static Elm_Toolbar_Item *
918 _item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
920 Widget_Data *wd = elm_widget_data_get(obj);
921 Evas_Object *icon_obj;
923 Elm_Toolbar_Item *it;
925 icon_obj = elm_icon_add(obj);
926 elm_icon_order_lookup_set(icon_obj, wd->lookup_order);
927 if (!icon_obj) return NULL;
928 it = elm_widget_item_new(obj, Elm_Toolbar_Item);
931 evas_object_del(icon_obj);
935 elm_widget_item_del_pre_hook_set(it, _item_del_pre_hook);
936 elm_widget_item_disable_hook_set(it, _item_disable_hook);
937 elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
938 elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
939 elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
940 elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
941 elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
943 it->label = eina_stringshare_add(label);
944 it->prio.visible = 1;
945 it->prio.priority = 0;
947 it->separator = EINA_FALSE;
949 it->base.data = data;
950 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
951 _elm_access_item_register(&it->base, VIEW(it));
952 _elm_access_text_set(_elm_access_item_get(&it->base),
953 ELM_ACCESS_TYPE, E_("Tool Item"));
954 _elm_access_callback_set(_elm_access_item_get(&it->base),
955 ELM_ACCESS_INFO, _access_info_cb, it);
956 _elm_access_callback_set(_elm_access_item_get(&it->base),
957 ELM_ACCESS_STATE, _access_state_cb, it);
959 if (_item_icon_set(icon_obj, "toolbar/", icon))
962 it->icon_str = eina_stringshare_add(icon);
968 evas_object_del(icon_obj);
971 _elm_theme_object_set(obj, VIEW(it), "toolbar", "item",
972 elm_widget_style_get(obj));
973 edje_object_signal_callback_add(VIEW(it), "elm,action,click", "elm",
975 edje_object_signal_callback_add(VIEW(it), "mouse,clicked,*", "*",
976 (Edje_Signal_Cb)_select_filter, it);
977 edje_object_signal_callback_add(VIEW(it), "elm,mouse,in", "elm",
979 edje_object_signal_callback_add(VIEW(it), "elm,mouse,out", "elm",
981 evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_DOWN,
982 (Evas_Object_Event_Cb)_mouse_down, it);
983 evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MOUSE_UP,
984 (Evas_Object_Event_Cb)_mouse_up, it);
985 elm_widget_sub_object_add(obj, VIEW(it));
990 ms = ((double)wd->icon_size * _elm_config->scale);
991 evas_object_size_hint_min_set(it->icon, ms, ms);
992 evas_object_size_hint_max_set(it->icon, ms, ms);
993 edje_object_part_swallow(VIEW(it), "elm.swallow.icon", it->icon);
994 evas_object_show(it->icon);
995 elm_widget_sub_object_add(obj, it->icon);
997 edje_object_part_text_set(VIEW(it), "elm.text", it->label);
999 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1000 edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh);
1001 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1002 if (wd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
1006 evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, -1.0);
1007 evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, 0.5);
1011 evas_object_size_hint_weight_set(VIEW(it), -1.0, EVAS_HINT_EXPAND);
1012 evas_object_size_hint_align_set(VIEW(it), 0.5, EVAS_HINT_FILL);
1017 evas_object_size_hint_weight_set(VIEW(it), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1018 evas_object_size_hint_align_set(VIEW(it), EVAS_HINT_FILL, EVAS_HINT_FILL);
1020 evas_object_size_hint_min_set(VIEW(it), mw, mh);
1021 evas_object_size_hint_max_set(VIEW(it), -1, -1);
1022 evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_RESIZE,
1024 if ((!wd->items) && wd->always_select) _item_select(it);
1030 _elm_toolbar_item_label_update(Elm_Toolbar_Item *item)
1032 Evas_Coord mw = -1, mh = -1;
1033 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1034 edje_object_part_text_set(VIEW(item), "elm.text", item->label);
1036 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1037 edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
1038 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1039 if (wd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
1043 evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, -1.0);
1044 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, 0.5);
1048 evas_object_size_hint_weight_set(VIEW(item), -1.0, EVAS_HINT_EXPAND);
1049 evas_object_size_hint_align_set(VIEW(item), 0.5, EVAS_HINT_FILL);
1054 evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1055 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
1057 evas_object_size_hint_min_set(VIEW(item), mw, mh);
1061 _elm_toolbar_item_label_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
1063 Elm_Toolbar_Item *item = data;
1064 _elm_toolbar_item_label_update(item);
1065 edje_object_signal_callback_del(obj, emission, source,
1066 _elm_toolbar_item_label_set_cb);
1067 edje_object_signal_emit (VIEW(item), "elm,state,label,reset", "elm");
1071 _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal)
1075 if ((label) && (item->label) && (!strcmp(label, item->label))) return;
1077 eina_stringshare_replace(&item->label, label);
1078 s = edje_object_data_get(VIEW(item), "transition_animation_on");
1079 if ((s) && (atoi(s)))
1081 edje_object_part_text_set(VIEW(item), "elm.text_new", item->label);
1082 edje_object_signal_emit (VIEW(item), signal, "elm");
1083 edje_object_signal_callback_add(VIEW(item),
1084 "elm,state,label_set,done", "elm",
1085 _elm_toolbar_item_label_set_cb, item);
1088 _elm_toolbar_item_label_update(item);
1089 _resize(WIDGET(item), NULL, NULL, NULL);
1093 _elm_toolbar_item_icon_update(Elm_Toolbar_Item *item)
1095 Elm_Toolbar_Item_State *it_state;
1097 Evas_Coord mw = -1, mh = -1;
1098 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1099 Evas_Object *old_icon = edje_object_part_swallow_get(VIEW(item),
1100 "elm.swallow.icon");
1101 elm_widget_sub_object_del(VIEW(item), old_icon);
1102 evas_object_hide(old_icon);
1103 edje_object_part_swallow(VIEW(item), "elm.swallow.icon", item->icon);
1104 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1105 edje_object_size_min_restricted_calc(VIEW(item), &mw, &mh, mw, mh);
1106 elm_coords_finger_size_adjust(1, &mw, 1, &mh);
1107 if (wd->shrink_mode != ELM_TOOLBAR_SHRINK_EXPAND)
1111 evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, -1.0);
1112 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, 0.5);
1116 evas_object_size_hint_weight_set(VIEW(item), -1.0, EVAS_HINT_EXPAND);
1117 evas_object_size_hint_align_set(VIEW(item), 0.5, EVAS_HINT_FILL);
1122 evas_object_size_hint_weight_set(VIEW(item), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1123 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
1125 evas_object_size_hint_min_set(VIEW(item), mw, mh);
1127 EINA_LIST_FOREACH(item->states, l, it_state)
1129 if (it_state->icon == old_icon) return;
1131 evas_object_del(old_icon);
1135 _elm_toolbar_item_icon_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source)
1137 Elm_Toolbar_Item *item = data;
1138 edje_object_part_unswallow(VIEW(item), item->icon);
1139 _elm_toolbar_item_icon_update(item);
1140 edje_object_signal_callback_del(obj, emission, source,
1141 _elm_toolbar_item_icon_set_cb);
1142 edje_object_signal_emit (VIEW(item), "elm,state,icon,reset", "elm");
1146 _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal)
1148 Evas_Object *old_icon;
1153 eina_stringshare_replace(&item->icon_str, icon_str);
1156 eina_stringshare_del(item->icon_str);
1157 item->icon_str = NULL;
1159 item->icon = icon_obj;
1162 ms = (icon_size * _elm_config->scale);
1163 evas_object_size_hint_min_set(item->icon, ms, ms);
1164 evas_object_size_hint_max_set(item->icon, ms, ms);
1165 evas_object_show(item->icon);
1166 elm_widget_sub_object_add(obj, item->icon);
1168 s = edje_object_data_get(VIEW(item), "transition_animation_on");
1169 if ((s) && (atoi(s)))
1171 old_icon = edje_object_part_swallow_get(VIEW(item),
1172 "elm.swallow.icon_new");
1175 elm_widget_sub_object_del(VIEW(item), old_icon);
1176 evas_object_hide(old_icon);
1178 edje_object_part_swallow(VIEW(item), "elm.swallow.icon_new",
1180 edje_object_signal_emit (VIEW(item), signal, "elm");
1181 edje_object_signal_callback_add(VIEW(item),
1182 "elm,state,icon_set,done", "elm",
1183 _elm_toolbar_item_icon_set_cb, item);
1186 _elm_toolbar_item_icon_update(item);
1187 _resize(obj, NULL, NULL, NULL);
1191 _elm_toolbar_item_state_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
1193 Elm_Toolbar_Item *it = event_info;
1194 Elm_Toolbar_Item_State *it_state;
1196 it_state = eina_list_data_get(it->current_state);
1198 it_state->func((void *)it_state->data, obj, event_info);
1201 static Elm_Toolbar_Item_State *
1202 _item_state_new(const char *label, const char *icon_str, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
1204 Elm_Toolbar_Item_State *it_state;
1205 it_state = ELM_NEW(Elm_Toolbar_Item_State);
1206 it_state->label = eina_stringshare_add(label);
1207 it_state->icon_str = eina_stringshare_add(icon_str);
1208 it_state->icon = icon;
1209 it_state->func = func;
1210 it_state->data = data;
1215 elm_toolbar_add(Evas_Object *parent)
1221 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
1223 ELM_SET_WIDTYPE(widtype, "toolbar");
1224 elm_widget_type_set(obj, "toolbar");
1225 elm_widget_sub_object_add(parent, obj);
1226 elm_widget_data_set(obj, wd);
1227 elm_widget_del_pre_hook_set(obj, _del_pre_hook);
1228 elm_widget_del_hook_set(obj, _del_hook);
1229 elm_widget_theme_hook_set(obj, _theme_hook);
1230 elm_widget_translate_hook_set(obj, _translate_hook);
1231 elm_widget_can_focus_set(obj, EINA_FALSE);
1233 wd->more_item = NULL;
1234 wd->selected_item = NULL;
1235 wd->scr = elm_smart_scroller_add(e);
1236 elm_smart_scroller_widget_set(wd->scr, obj);
1237 elm_smart_scroller_object_theme_set(obj, wd->scr, "toolbar", "base", "default");
1238 elm_smart_scroller_bounce_allow_set(wd->scr,
1239 _elm_config->thumbscroll_bounce_enable,
1241 elm_widget_resize_object_set(obj, wd->scr);
1242 elm_smart_scroller_policy_set(wd->scr,
1243 ELM_SMART_SCROLLER_POLICY_AUTO,
1244 ELM_SMART_SCROLLER_POLICY_OFF);
1247 wd->icon_size = _elm_toolbar_icon_size_get(wd);
1250 wd->homogeneous = EINA_TRUE;
1253 wd->bx = evas_object_box_add(e);
1254 evas_object_size_hint_align_set(wd->bx, wd->align, 0.5);
1255 evas_object_box_layout_set(wd->bx, _layout, obj, NULL);
1256 elm_widget_sub_object_add(obj, wd->bx);
1257 elm_smart_scroller_child_set(wd->scr, wd->bx);
1258 evas_object_show(wd->bx);
1260 elm_toolbar_shrink_mode_set(obj, _elm_config->toolbar_shrink_mode);
1261 evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE, _resize, obj);
1262 evas_object_event_callback_add(wd->bx, EVAS_CALLBACK_RESIZE, _resize, obj);
1263 elm_toolbar_icon_order_lookup_set(obj, ELM_ICON_LOOKUP_THEME_FDO);
1265 evas_object_smart_callbacks_descriptions_set(obj, _signals);
1272 elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size)
1274 ELM_CHECK_WIDTYPE(obj, widtype);
1275 Widget_Data *wd = elm_widget_data_get(obj);
1277 if (wd->icon_size == icon_size) return;
1278 wd->icon_size = icon_size;
1283 elm_toolbar_icon_size_get(const Evas_Object *obj)
1285 ELM_CHECK_WIDTYPE(obj, widtype) 0;
1286 Widget_Data *wd = elm_widget_data_get(obj);
1288 return wd->icon_size;
1291 EAPI Elm_Object_Item *
1292 elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
1294 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1295 Widget_Data *wd = elm_widget_data_get(obj);
1296 if (!wd) return NULL;
1298 Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data);
1299 if (!it) return NULL;
1300 double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
1302 wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it));
1303 evas_object_box_append(wd->bx, VIEW(it));
1304 evas_object_show(VIEW(it));
1306 _theme_hook_item(obj, it, scale, wd->icon_size);
1309 return (Elm_Object_Item *) it;
1312 EAPI Elm_Object_Item *
1313 elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
1315 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1316 Widget_Data *wd = elm_widget_data_get(obj);
1317 if (!wd) return NULL;
1319 Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data);
1320 if (!it) return NULL;
1321 double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
1323 wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
1324 evas_object_box_prepend(wd->bx, VIEW(it));
1325 evas_object_show(VIEW(it));
1326 _theme_hook_item(obj, it, scale, wd->icon_size);
1329 return (Elm_Object_Item *) it;
1332 EAPI Elm_Object_Item *
1333 elm_toolbar_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
1335 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1336 ELM_OBJ_ITEM_CHECK_OR_RETURN(before, NULL);
1338 Elm_Toolbar_Item *it, *_before;
1340 wd = elm_widget_data_get(obj);
1341 if (!wd) return NULL;
1342 _before = (Elm_Toolbar_Item *) before;
1343 it = _item_new(obj, icon, label, func, data);
1344 if (!it) return NULL;
1345 double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
1347 wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
1348 EINA_INLIST_GET(_before));
1349 evas_object_box_insert_before(wd->bx, VIEW(it), VIEW(_before));
1350 evas_object_show(VIEW(it));
1351 _theme_hook_item(obj, it, scale, wd->icon_size);
1354 return (Elm_Object_Item *) it;
1357 EAPI Elm_Object_Item *
1358 elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
1360 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1361 ELM_OBJ_ITEM_CHECK_OR_RETURN(after, NULL);
1363 Elm_Toolbar_Item *it, *_after;
1365 wd = elm_widget_data_get(obj);
1366 if (!wd) return NULL;
1367 _after = (Elm_Toolbar_Item *) after;
1368 it = _item_new(obj, icon, label, func, data);
1369 if (!it) return NULL;
1370 double scale = (elm_widget_scale_get(obj) * _elm_config->scale);
1372 wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
1373 EINA_INLIST_GET(_after));
1374 evas_object_box_insert_after(wd->bx, VIEW(it), VIEW(_after));
1375 evas_object_show(VIEW(it));
1376 _theme_hook_item(obj, it, scale, wd->icon_size);
1379 return (Elm_Object_Item *) it;
1382 EAPI Elm_Object_Item *
1383 elm_toolbar_first_item_get(const Evas_Object *obj)
1385 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1386 Widget_Data *wd = elm_widget_data_get(obj);
1387 if (!wd || !wd->items) return NULL;
1388 return (Elm_Object_Item *) ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items);
1391 EAPI Elm_Object_Item *
1392 elm_toolbar_last_item_get(const Evas_Object *obj)
1394 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1395 Widget_Data *wd = elm_widget_data_get(obj);
1396 if (!wd || !wd->items) return NULL;
1397 return (Elm_Object_Item *) ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items->last);
1400 EAPI Elm_Object_Item *
1401 elm_toolbar_item_next_get(const Elm_Object_Item *it)
1403 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1404 return (Elm_Object_Item *) ELM_TOOLBAR_ITEM_FROM_INLIST(
1405 EINA_INLIST_GET(((Elm_Toolbar_Item *) it))->next);
1408 EAPI Elm_Object_Item *
1409 elm_toolbar_item_prev_get(const Elm_Object_Item *it)
1411 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1412 return (Elm_Object_Item *) ELM_TOOLBAR_ITEM_FROM_INLIST(
1413 EINA_INLIST_GET(((Elm_Toolbar_Item *) it))->prev);
1417 elm_toolbar_item_toolbar_get(const Elm_Object_Item *it)
1419 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1420 return elm_object_item_widget_get(it);
1424 elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority)
1426 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1427 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1428 if (item->prio.priority == priority) return;
1429 item->prio.priority = priority;
1430 _resize(WIDGET(item), NULL, NULL, NULL);
1434 elm_toolbar_item_priority_get(const Elm_Object_Item *it)
1436 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, 0);
1437 return ((Elm_Toolbar_Item *) it)->prio.priority;
1441 elm_toolbar_item_label_get(const Elm_Object_Item *it)
1443 return _item_text_get_hook(it, NULL);
1447 elm_toolbar_item_label_set(Elm_Object_Item *it, const char *label)
1449 _item_text_set_hook(it, NULL, label);
1453 elm_toolbar_item_data_get(const Elm_Object_Item *it)
1455 return elm_object_item_data_get(it);
1459 elm_toolbar_item_data_set(Elm_Object_Item *it, const void *data)
1461 elm_object_item_data_set(it, (void *) data);
1464 EAPI Elm_Object_Item *
1465 elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label)
1467 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1468 Elm_Toolbar_Item *it;
1469 Widget_Data *wd = elm_widget_data_get(obj);
1470 if (!wd) return NULL;
1472 EINA_INLIST_FOREACH(wd->items, it)
1474 if (!strcmp(it->label, label))
1475 return (Elm_Object_Item *) it;
1481 elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected)
1483 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1484 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1485 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1488 if (item->selected == selected) return;
1489 if (selected) _item_select(item);
1490 else _item_unselect(item);
1494 elm_toolbar_item_selected_get(const Elm_Object_Item *it)
1496 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1497 return ((Elm_Toolbar_Item *) it)->selected;
1500 EAPI Elm_Object_Item *
1501 elm_toolbar_selected_item_get(const Evas_Object *obj)
1503 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1504 Widget_Data *wd = elm_widget_data_get(obj);
1505 if (!wd) return NULL;
1506 return (Elm_Object_Item *) wd->selected_item;
1510 elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon)
1512 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1514 Evas_Object *icon_obj;
1517 Elm_Toolbar_Item * item = (Elm_Toolbar_Item *) it;
1520 wd = elm_widget_data_get(obj);
1522 if ((icon) && (item->icon_str) && (!strcmp(icon, item->icon_str))) return;
1524 icon_obj = elm_icon_add(obj);
1525 if (!icon_obj) return;
1526 if (_item_icon_set(icon_obj, "toolbar/", icon))
1527 _elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size,
1528 "elm,state,icon_set");
1531 _elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0,
1532 "elm,state,icon_set");
1533 evas_object_del(icon_obj);
1538 elm_toolbar_item_icon_get(const Elm_Object_Item *it)
1540 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1541 return ((Elm_Toolbar_Item *) it)->icon_str;
1545 elm_toolbar_item_object_get(const Elm_Object_Item *it)
1547 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1551 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1554 wd = elm_widget_data_get(obj);
1555 if (!wd) return NULL;
1561 elm_toolbar_item_icon_object_get(Elm_Object_Item *it)
1563 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1564 return ((Elm_Toolbar_Item *) it)->icon;
1568 elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it, const void *img, size_t size, const char *format, const char *key)
1570 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1572 Evas_Object *icon_obj;
1576 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1579 wd = elm_widget_data_get(obj);
1580 if (!wd) return EINA_FALSE;
1584 icon_obj = _els_smart_icon_add(evas_object_evas_get(obj));
1585 evas_object_repeat_events_set(icon_obj, EINA_TRUE);
1586 ret = _els_smart_icon_memfile_set(icon_obj, img, size, format, key);
1589 evas_object_del(icon_obj);
1592 _elm_toolbar_item_icon_obj_set(obj, item, icon_obj, NULL, wd->icon_size,
1593 "elm,state,icon_set");
1596 _elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0, "elm,state,icon_set");
1601 elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key)
1603 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1605 Evas_Object *icon_obj;
1609 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1612 wd = elm_widget_data_get(obj);
1613 if (!wd) return EINA_FALSE;
1617 icon_obj = _els_smart_icon_add(evas_object_evas_get(obj));
1618 evas_object_repeat_events_set(icon_obj, EINA_TRUE);
1619 ret = _els_smart_icon_file_key_set(icon_obj, file, key);
1622 evas_object_del(icon_obj);
1625 _elm_toolbar_item_icon_obj_set(obj, item, icon_obj, NULL, wd->icon_size,
1626 "elm,state,icon_set");
1629 _elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0, "elm,state,icon_set");
1634 elm_toolbar_item_del(Elm_Object_Item *it)
1636 elm_object_item_del(it);
1640 elm_toolbar_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func)
1642 elm_object_item_del_cb_set(it, func);
1646 elm_toolbar_item_disabled_get(const Elm_Object_Item *it)
1648 return elm_object_item_disabled_get(it);
1652 elm_toolbar_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
1654 elm_object_item_disabled_set(it, disabled);
1658 elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator)
1660 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1661 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1662 Evas_Object *obj = WIDGET(item);
1663 Widget_Data *wd = elm_widget_data_get(obj);
1665 if (item->separator == separator) return;
1666 item->separator = separator;
1667 scale = (elm_widget_scale_get(obj) * _elm_config->scale);
1668 _theme_hook_item(obj, item, scale, wd->icon_size);
1672 elm_toolbar_item_separator_get(const Elm_Object_Item *it)
1674 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1675 return ((Elm_Toolbar_Item *) it)->separator;
1679 elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode)
1681 ELM_CHECK_WIDTYPE(obj, widtype);
1682 Widget_Data *wd = elm_widget_data_get(obj);
1686 wd->shrink_mode = shrink_mode;
1687 bounce = (_elm_config->thumbscroll_bounce_enable) &&
1688 (shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL);
1689 elm_smart_scroller_bounce_allow_set(wd->scr, bounce, EINA_FALSE);
1693 _item_del(wd->more_item);
1694 elm_widget_item_free(wd->more_item);
1695 wd->more_item = NULL;
1698 if (shrink_mode == ELM_TOOLBAR_SHRINK_MENU)
1700 elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF,
1701 ELM_SMART_SCROLLER_POLICY_OFF);
1702 wd->more_item = _item_new(obj, "more_menu", "More", NULL, NULL);
1704 else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
1705 elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF,
1706 ELM_SMART_SCROLLER_POLICY_OFF);
1708 elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_AUTO,
1709 ELM_SMART_SCROLLER_POLICY_OFF);
1713 EAPI Elm_Toolbar_Shrink_Mode
1714 elm_toolbar_shrink_mode_get(const Evas_Object *obj)
1716 ELM_CHECK_WIDTYPE(obj, widtype) ELM_TOOLBAR_SHRINK_NONE;
1717 Widget_Data *wd = elm_widget_data_get(obj);
1719 if (!wd) return ELM_TOOLBAR_SHRINK_NONE;
1720 return wd->shrink_mode;
1724 elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous)
1726 ELM_CHECK_WIDTYPE(obj, widtype);
1727 Widget_Data *wd = elm_widget_data_get(obj);
1730 wd->homogeneous = !!homogeneous;
1731 evas_object_smart_calculate(wd->bx);
1735 elm_toolbar_homogeneous_get(const Evas_Object *obj)
1737 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
1738 Widget_Data *wd = elm_widget_data_get(obj);
1740 if (!wd) return EINA_FALSE;
1741 return wd->homogeneous;
1745 elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent)
1747 Elm_Toolbar_Item *it;
1748 ELM_CHECK_WIDTYPE(obj, widtype);
1749 Widget_Data *wd = elm_widget_data_get(obj);
1752 EINA_SAFETY_ON_NULL_RETURN(parent);
1753 wd->menu_parent = parent;
1754 EINA_INLIST_FOREACH(wd->items, it)
1757 elm_menu_parent_set(it->o_menu, wd->menu_parent);
1759 if ((wd->more_item) && (wd->more_item->o_menu))
1760 elm_menu_parent_set(wd->more_item->o_menu, wd->menu_parent);
1764 elm_toolbar_menu_parent_get(const Evas_Object *obj)
1766 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1767 Widget_Data *wd = elm_widget_data_get(obj);
1769 if (!wd) return NULL;
1770 return wd->menu_parent;
1774 elm_toolbar_align_set(Evas_Object *obj, double align)
1776 ELM_CHECK_WIDTYPE(obj, widtype);
1777 Widget_Data *wd = elm_widget_data_get(obj);
1782 if (wd->align != align)
1783 evas_object_size_hint_align_set(wd->bx, 0.5, align);
1787 if (wd->align != align)
1788 evas_object_size_hint_align_set(wd->bx, align, 0.5);
1794 elm_toolbar_align_get(const Evas_Object *obj)
1796 ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
1797 Widget_Data *wd = elm_widget_data_get(obj);
1799 if (!wd) return 0.0;
1804 elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu)
1806 ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
1807 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1808 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1811 if (item->menu == menu) return;
1812 if (menu) _item_menu_create(wd, item);
1813 else _item_menu_destroy(item);
1817 elm_toolbar_item_menu_get(const Elm_Object_Item *it)
1819 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1820 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1821 if (!item->menu) return NULL;
1822 Widget_Data *wd = elm_widget_data_get(WIDGET(item));
1823 if (!wd) return NULL;
1824 return item->o_menu;
1827 EAPI Elm_Toolbar_Item_State *
1828 elm_toolbar_item_state_add(Elm_Object_Item *it, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
1830 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1832 Elm_Toolbar_Item_State *it_state;
1833 Evas_Object *icon_obj;
1836 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1838 wd = elm_widget_data_get(WIDGET(item));
1839 if (!wd) return NULL;
1843 it_state = _item_state_new(item->label, item->icon_str, item->icon,
1844 item->func, item->base.data);
1845 item->states = eina_list_append(item->states, it_state);
1846 item->current_state = item->states;
1849 icon_obj = elm_icon_add(obj);
1850 elm_icon_order_lookup_set(icon_obj, wd->lookup_order);
1851 if (!icon_obj) goto error_state_add;
1853 if (!_item_icon_set(icon_obj, "toolbar/", icon))
1855 evas_object_del(icon_obj);
1860 it_state = _item_state_new(label, icon, icon_obj, func, data);
1861 item->states = eina_list_append(item->states, it_state);
1862 item->func = _elm_toolbar_item_state_cb;
1863 item->base.data = NULL;
1868 if (item->states && !eina_list_next(item->states))
1870 eina_stringshare_del(item->label);
1871 eina_stringshare_del(item->icon_str);
1872 free(eina_list_data_get(item->states));
1873 eina_list_free(item->states);
1874 item->states = NULL;
1880 elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state)
1882 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1884 Eina_List *del_state;
1885 Elm_Toolbar_Item_State *it_state;
1886 Elm_Toolbar_Item *item;
1888 if (!state) return EINA_FALSE;
1890 item = (Elm_Toolbar_Item *) it;
1891 if (!item->states) return EINA_FALSE;
1893 del_state = eina_list_data_find_list(item->states, state);
1894 if (del_state == item->states) return EINA_FALSE;
1895 if (del_state == item->current_state)
1896 elm_toolbar_item_state_unset(it);
1898 eina_stringshare_del(state->label);
1899 eina_stringshare_del(state->icon_str);
1900 if (state->icon) evas_object_del(state->icon);
1902 item->states = eina_list_remove_list(item->states, del_state);
1903 if (item->states && !eina_list_next(item->states))
1905 it_state = eina_list_data_get(item->states);
1906 item->base.data = it_state->data;
1907 item->func = it_state->func;
1908 eina_stringshare_del(it_state->label);
1909 eina_stringshare_del(it_state->icon_str);
1910 free(eina_list_data_get(item->states));
1911 eina_list_free(item->states);
1912 item->states = NULL;
1918 elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state)
1920 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1923 Eina_List *next_state;
1924 Elm_Toolbar_Item_State *it_state;
1926 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1929 wd = elm_widget_data_get(obj);
1930 if (!wd) return EINA_FALSE;
1931 if (!item->states) return EINA_FALSE;
1935 next_state = eina_list_data_find_list(item->states, state);
1936 if (!next_state) return EINA_FALSE;
1939 next_state = item->states;
1941 if (next_state == item->current_state) return EINA_TRUE;
1943 it_state = eina_list_data_get(next_state);
1944 if (eina_list_data_find(item->current_state, state))
1946 _item_label_set(item, it_state->label, "elm,state,label_set,forward");
1947 _elm_toolbar_item_icon_obj_set(obj, item, it_state->icon, it_state->icon_str,
1948 wd->icon_size, "elm,state,icon_set,forward");
1952 _item_label_set(item, it_state->label, "elm,state,label_set,backward");
1953 _elm_toolbar_item_icon_obj_set(obj,
1958 "elm,state,icon_set,backward");
1960 if (elm_widget_item_disabled_get(item))
1961 elm_widget_signal_emit(item->icon, "elm,state,disabled", "elm");
1963 elm_widget_signal_emit(item->icon, "elm,state,enabled", "elm");
1965 item->current_state = next_state;
1970 elm_toolbar_item_state_unset(Elm_Object_Item *it)
1972 elm_toolbar_item_state_set(it, NULL);
1975 EAPI Elm_Toolbar_Item_State *
1976 elm_toolbar_item_state_get(const Elm_Object_Item *it)
1978 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1979 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1981 if ((!item->states) || (!item->current_state)) return NULL;
1982 if (item->current_state == item->states) return NULL;
1984 return eina_list_data_get(item->current_state);
1987 EAPI Elm_Toolbar_Item_State *
1988 elm_toolbar_item_state_next(Elm_Object_Item *it)
1990 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
1994 Eina_List *next_state;
1995 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
1998 wd = elm_widget_data_get(obj);
1999 if (!wd) return NULL;
2000 if (!item->states) return NULL;
2002 next_state = eina_list_next(item->current_state);
2004 next_state = eina_list_next(item->states);
2005 return eina_list_data_get(next_state);
2008 EAPI Elm_Toolbar_Item_State *
2009 elm_toolbar_item_state_prev(Elm_Object_Item *it)
2011 ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
2015 Eina_List *prev_state;
2016 Elm_Toolbar_Item *item = (Elm_Toolbar_Item *) it;
2019 wd = elm_widget_data_get(obj);
2020 if (!wd) return NULL;
2021 if (!item->states) return NULL;
2023 prev_state = eina_list_prev(item->current_state);
2024 if ((!prev_state) || (prev_state == item->states))
2025 prev_state = eina_list_last(item->states);
2026 return eina_list_data_get(prev_state);
2030 elm_toolbar_item_tooltip_text_set(Elm_Object_Item *it, const char *text)
2032 elm_object_item_tooltip_text_set(it, text);
2036 elm_toolbar_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
2038 elm_object_item_tooltip_content_cb_set(it, func, data, del_cb);
2042 elm_toolbar_item_tooltip_unset(Elm_Object_Item *it)
2044 elm_object_item_tooltip_unset(it);
2048 elm_toolbar_item_tooltip_style_set(Elm_Object_Item *it, const char *style)
2050 elm_object_item_tooltip_style_set(it, style);
2054 elm_toolbar_item_tooltip_style_get(const Elm_Object_Item *it)
2056 return elm_object_item_tooltip_style_get(it);
2060 elm_toolbar_item_cursor_set(Elm_Object_Item *it, const char *cursor)
2062 elm_object_item_cursor_set(it, cursor);
2066 elm_toolbar_item_cursor_get(const Elm_Object_Item *it)
2068 return elm_object_item_cursor_get(it);
2072 elm_toolbar_item_cursor_unset(Elm_Object_Item *it)
2074 elm_object_item_cursor_unset(it);
2078 elm_toolbar_item_cursor_style_set(Elm_Object_Item *it, const char *style)
2080 elm_object_item_cursor_style_set(it, style);
2084 elm_toolbar_item_cursor_style_get(const Elm_Object_Item *it)
2086 return elm_object_item_cursor_style_get(it);
2090 elm_toolbar_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
2092 elm_object_item_cursor_engine_only_set(it, engine_only);
2096 elm_toolbar_item_cursor_engine_only_get(const Elm_Object_Item *it)
2098 return elm_object_item_cursor_engine_only_get(it);
2102 elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select)
2104 ELM_CHECK_WIDTYPE(obj, widtype);
2105 Widget_Data *wd = elm_widget_data_get(obj);
2107 if (always_select && (!wd->always_select) && wd->items)
2108 _item_select(ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items));
2109 wd->always_select = always_select;
2113 elm_toolbar_always_select_mode_get(const Evas_Object *obj)
2115 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2116 Widget_Data *wd = elm_widget_data_get(obj);
2117 if (!wd) return EINA_FALSE;
2118 return wd->always_select;
2122 elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select)
2124 ELM_CHECK_WIDTYPE(obj, widtype);
2125 Widget_Data *wd = elm_widget_data_get(obj);
2127 wd->no_select = no_select;
2131 elm_toolbar_no_select_mode_get(const Evas_Object *obj)
2133 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2134 Widget_Data *wd = elm_widget_data_get(obj);
2135 if (!wd) return EINA_FALSE;
2136 return wd->no_select;
2140 elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order)
2142 ELM_CHECK_WIDTYPE(obj, widtype);
2143 Elm_Toolbar_Item *it;
2144 Widget_Data *wd = elm_widget_data_get(obj);
2147 wd->lookup_order = order;
2148 EINA_INLIST_FOREACH(wd->items, it)
2149 elm_icon_order_lookup_set(it->icon, order);
2151 elm_icon_order_lookup_set(wd->more_item->icon, order);
2154 EAPI Elm_Icon_Lookup_Order
2155 elm_toolbar_icon_order_lookup_get(const Evas_Object *obj)
2157 ELM_CHECK_WIDTYPE(obj, widtype) ELM_ICON_LOOKUP_THEME_FDO;
2158 Widget_Data *wd = elm_widget_data_get(obj);
2159 if (!wd) return ELM_ICON_LOOKUP_THEME_FDO;
2160 return wd->lookup_order;
2163 EINA_DEPRECATED EAPI void
2164 elm_toolbar_orientation_set(Evas_Object *obj, Eina_Bool vertical)
2166 elm_toolbar_horizontal_set(obj, !vertical);
2169 EINA_DEPRECATED EAPI Eina_Bool
2170 elm_toolbar_orientation_get(const Evas_Object *obj)
2172 return !elm_toolbar_horizontal_get(obj);
2176 elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
2178 ELM_CHECK_WIDTYPE(obj, widtype);
2179 Widget_Data *wd = elm_widget_data_get(obj);
2181 wd->vertical = !horizontal;
2183 evas_object_size_hint_align_set(wd->bx, 0.5, wd->align);
2185 evas_object_size_hint_align_set(wd->bx, wd->align, 0.5);
2190 elm_toolbar_horizontal_get(const Evas_Object *obj)
2192 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2193 Widget_Data *wd = elm_widget_data_get(obj);
2194 if (!wd) return EINA_FALSE;
2195 return !wd->vertical;
2199 elm_toolbar_items_count(const Evas_Object *obj)
2201 ELM_CHECK_WIDTYPE(obj, widtype) 0;
2202 Widget_Data *wd = elm_widget_data_get(obj);
2204 return wd->item_count;
2207 EINA_DEPRECATED EAPI void
2208 elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode)
2210 elm_toolbar_shrink_mode_set(obj, shrink_mode);
2213 EINA_DEPRECATED EAPI Elm_Toolbar_Shrink_Mode
2214 elm_toolbar_mode_shrink_get(const Evas_Object *obj)
2216 return elm_toolbar_shrink_mode_get(obj);