2 * @defgroup Diskselector
4 * A diskselector is a kind of list widget. It scrolls horizontally,
5 * and can contain label and icon objects. Three items are displayed
6 * with the selected on the middle.
8 * It can act like a circular list with round mode and labels can be
9 * reduced for a defined length for side items.
11 * Signals that you can add callbacks for are:
13 * "selected" - when item is selected (scroller stops)
16 #include <Elementary.h>
20 # define MAX(a, b) (((a) > (b)) ? (a) : (b))
24 #define CEIL(a) (((a) % 2 != 0) ? ((a) / 2 + 1) : ((a) / 2))
27 #define DISPLAY_ITEM_NUM_MIN 3
29 typedef struct _Widget_Data Widget_Data;
34 Evas_Object *scroller;
35 Evas_Object *main_box;
36 Evas_Object *left_blank;
37 Evas_Object *right_blank;
38 Elm_Diskselector_Item *selected_item;
39 Elm_Diskselector_Item *first;
40 Elm_Diskselector_Item *second;
41 Elm_Diskselector_Item *s_last;
42 Elm_Diskselector_Item *last;
45 Eina_List *over_items;
46 Eina_List *under_items;
47 int item_count, len_threshold, len_side, display_item_num;
49 Ecore_Idler *check_idler;
50 Evas_Coord minw, minh;
53 Eina_Bool display_item_num_by_api:1;
56 struct _Elm_Diskselector_Item
65 static const char *widtype = NULL;
67 #define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
68 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
69 ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
71 static Eina_Bool _move_scroller(void *data);
72 static void _del_hook(Evas_Object * obj);
73 static void _del_pre_hook(Evas_Object * obj);
74 static void _sizing_eval(Evas_Object * obj);
75 static void _theme_hook(Evas_Object * obj);
76 static void _on_focus_hook(void *data, Evas_Object *obj);
77 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info);
78 static void _sub_del(void *data, Evas_Object * obj, void *event_info);
79 static void _round_items_del(Widget_Data *wd);
80 static void _scroller_move_cb(void *data, Evas_Object *obj, void *event_info);
81 static void _item_click_cb(void *data, Evas_Object *obj __UNUSED__,
82 const char *emission __UNUSED__,
83 const char *source __UNUSED__);
84 static void _selected_item_indicate(Elm_Diskselector_Item *it);
86 static const char SIG_SELECTED[] = "selected";
87 static const Evas_Smart_Cb_Description _signals[] = {
93 _diskselector_object_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
98 wd = elm_widget_data_get(data);
101 if (wd->minw == -1 && wd->minh == -1) elm_coords_finger_size_adjust(6, &wd->minw, 1, &wd->minh);
102 edje_object_size_min_restricted_calc(elm_smart_scroller_edje_object_get(
103 wd->scroller), &wd->minw, &wd->minh, wd->minw, wd->minh);
104 evas_object_size_hint_min_set(obj, wd->minw, wd->minh);
105 evas_object_size_hint_max_set(obj, -1, -1);
107 evas_object_geometry_get(wd->scroller, NULL, NULL, &w, &h);
109 evas_object_resize(wd->main_box, (w / wd->display_item_num) * (wd->item_count + (CEIL(wd->display_item_num) * 2)), h);
111 evas_object_resize(wd->main_box, (w / wd->display_item_num) * (wd->item_count + CEIL(wd->display_item_num)), h);
113 elm_smart_scroller_paging_set(wd->scroller, 0, 0,
114 (int)(w / wd->display_item_num), 0);
117 wd->idler = ecore_idler_add(_move_scroller, data);
120 static Elm_Diskselector_Item *
121 _item_new(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data)
123 Elm_Diskselector_Item *it;
124 const char *style = elm_widget_style_get(obj);
126 it = elm_widget_item_new(obj, Elm_Diskselector_Item);
127 if (!it) return NULL;
129 it->label = eina_stringshare_add(label);
132 it->base.data = data;
133 it->base.view = edje_object_add(evas_object_evas_get(obj));
134 _elm_theme_object_set(obj, it->base.view, "diskselector", "item", style);
135 evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND,
137 evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL,
139 evas_object_show(it->base.view);
143 edje_object_part_text_set(it->base.view, "elm.text", it->label);
144 edje_object_signal_callback_add(it->base.view, "elm,action,click", "", _item_click_cb, it);
148 evas_object_size_hint_min_set(it->icon, 24, 24);
149 evas_object_size_hint_max_set(it->icon, 40, 40);
150 edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
151 evas_object_show(it->icon);
152 elm_widget_sub_object_add(obj, it->icon);
158 _item_del(Elm_Diskselector_Item *item)
161 eina_stringshare_del(item->label);
163 evas_object_del(item->icon);
164 elm_widget_item_del(item);
168 _theme_data_get(Widget_Data *wd)
172 str = edje_object_data_get(wd->right_blank, "len_threshold");
173 if (str) wd->len_threshold = MAX(0, atoi(str));
174 else wd->len_threshold = 0;
176 if (!wd->display_item_num_by_api)
178 str = edje_object_data_get(wd->right_blank, "display_item_num");
179 if (str) wd->display_item_num = MAX(DISPLAY_ITEM_NUM_MIN, atoi(str));
180 else wd->display_item_num = DISPLAY_ITEM_NUM_MIN;
183 str = edje_object_data_get(wd->right_blank, "min_width");
184 if (str) wd->minw = MAX(-1, atoi(str));
187 parent = elm_widget_parent_widget_get(wd->self);
188 if (!parent) wd->minw = -1;
189 else evas_object_geometry_get(parent, NULL, NULL, &wd->minw, NULL);
192 str = edje_object_data_get(wd->right_blank, "min_height");
193 if (str) wd->minh = MAX(-1, atoi(str));
198 _default_display_item_num_set(Widget_Data *wd)
201 str = edje_object_data_get(wd->right_blank, "display_item_num");
202 if (str) wd->display_item_num = MAX(DISPLAY_ITEM_NUM_MIN, atoi(str));
203 else wd->display_item_num = DISPLAY_ITEM_NUM_MIN;
207 _del_hook(Evas_Object * obj)
209 Widget_Data *wd = elm_widget_data_get(obj);
215 _del_pre_hook(Evas_Object * obj)
217 Elm_Diskselector_Item *it;
220 Widget_Data *wd = elm_widget_data_get(obj);
224 evas_object_del(wd->left_blank);
226 evas_object_del(wd->right_blank);
229 eina_stringshare_del(wd->last->label);
230 evas_object_del(wd->last->base.view);
235 eina_stringshare_del(wd->s_last->label);
236 evas_object_del(wd->s_last->base.view);
241 eina_stringshare_del(wd->second->label);
242 evas_object_del(wd->second->base.view);
247 eina_stringshare_del(wd->first->label);
248 evas_object_del(wd->first->base.view);
252 EINA_LIST_FOREACH(wd->under_items, l, it)
256 eina_stringshare_del(it->label);
257 evas_object_del(wd->first->base.view);
262 EINA_LIST_FOREACH(wd->over_items, l, it)
266 eina_stringshare_del(it->label);
267 evas_object_del(wd->first->base.view);
272 EINA_LIST_FREE(wd->items, it) _item_del(it);
273 eina_list_free(wd->r_items);
277 _sizing_eval(Evas_Object * obj)
279 Widget_Data *wd = elm_widget_data_get(obj);
281 _diskselector_object_resize(obj, NULL, obj, NULL);
285 _theme_hook(Evas_Object * obj)
288 Elm_Diskselector_Item *it;
289 Widget_Data *wd = elm_widget_data_get(obj);
293 elm_smart_scroller_object_theme_set(obj, wd->scroller, "diskselector",
294 "base", elm_widget_style_get(obj));
297 EINA_LIST_FOREACH(wd->r_items, l, it)
299 _elm_theme_object_set(obj, it->base.view, "diskselector", "item",
300 elm_widget_style_get(obj));
301 edje_object_part_text_set(it->base.view, "elm.text", it->label);
306 EINA_LIST_FOREACH(wd->items, l, it)
308 _elm_theme_object_set(obj, it->base.view, "diskselector", "item",
309 elm_widget_style_get(obj));
310 edje_object_part_text_set(it->base.view, "elm.text", it->label);
313 _elm_theme_object_set(obj, wd->right_blank, "diskselector", "item",
314 elm_widget_style_get(obj));
320 _sub_del(void *data __UNUSED__, Evas_Object * obj, void *event_info)
322 Widget_Data *wd = elm_widget_data_get(obj);
323 Evas_Object *sub = event_info;
324 Elm_Diskselector_Item *it;
329 if (sub == wd->scroller)
333 EINA_LIST_FOREACH(wd->items, l, it)
346 _select_item(Elm_Diskselector_Item *it)
349 Widget_Data *wd = elm_widget_data_get(it->base.widget);
350 wd->selected_item = it;
351 _selected_item_indicate(wd->selected_item);
352 if (it->func) it->func((void *)it->base.data, it->base.widget, it);
353 evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
357 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
359 Widget_Data *wd = elm_widget_data_get(obj);
363 if (elm_widget_focus_get(obj))
365 edje_object_signal_emit(wd->self, "elm,action,focus", "elm");
366 evas_object_focus_set(wd->self, EINA_TRUE);
370 edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm");
371 evas_object_focus_set(wd->self, EINA_FALSE);
376 _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
378 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
379 Evas_Event_Key_Down *ev = event_info;
380 Widget_Data *wd = elm_widget_data_get(obj);
381 if (!wd) return EINA_FALSE;
382 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
383 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
385 Elm_Diskselector_Item *it = NULL;
388 if (!wd->selected_item) {
389 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
393 if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")) ||
394 (!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
396 l = wd->selected_item->node->prev;
397 if ((!l) && (wd->round))
398 l = eina_list_last(wd->items);
400 else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")) ||
401 (!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
403 l = wd->selected_item->node->next;
404 if ((!l) && (wd->round))
407 else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home")))
409 else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End")))
410 l = eina_list_last(wd->items);
411 else return EINA_FALSE;
414 it = eina_list_data_get(l);
418 wd->selected_item = it;
420 wd->idler = ecore_idler_add(_move_scroller, obj);
423 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
428 _count_letter(const char *str)
433 for (chnum = 0; ; chnum++)
435 pos = evas_string_char_next_get(str, pos, &code);
436 if (code == 0) break;
442 _check_letter(const char *str, int length)
447 for (chnum = 0; ; chnum++)
449 if (chnum == length) break;
450 pos = evas_string_char_next_get(str, pos, &code);
451 if (code == 0) break;
457 _check_string(void *data)
459 int mid, steps, length, diff;
460 Elm_Diskselector_Item *it;
464 Widget_Data *wd = data;
466 evas_object_geometry_get(wd->scroller, &ox, NULL, &ow, NULL);
476 EINA_LIST_FOREACH(list, l, it)
480 evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL);
481 /* item not visible */
482 if ((x + w <= ox) || (x >= ox + ow))
485 len = _count_letter(it->label);
486 // // FIXME: len should be # of ut8f letters. ie count using utf8 string walk, not stringshare len
487 // len = eina_stringshare_strlen(it->label);
490 edje_object_signal_emit(it->base.view, "elm,state,left_side",
492 else if (x + w >= ox + ow - 5)
493 edje_object_signal_emit(it->base.view, "elm,state,right_side",
497 if ((wd->len_threshold) && (len > wd->len_threshold))
498 edje_object_signal_emit(it->base.view, "elm,state,center_small",
501 edje_object_signal_emit(it->base.view, "elm,state,center",
505 // if len is les that the limit len, skip anyway
506 if (len <= wd->len_side)
509 steps = len - wd->len_side + 1;
511 if (mid <= ox + ow / 2)
512 diff = (ox + ow / 2) - mid;
514 diff = mid - (ox + ow / 2);
516 length = len - (int)(diff * steps / (ow / 3));
517 length = MAX(length, wd->len_side);
518 // limit string len to "length" ut8f chars
519 length = _check_letter(it->label, length);
520 // cut it off at byte mark returned form _check_letter
521 strncpy(buf, it->label, length);
523 edje_object_part_text_set(it->base.view, "elm.text", buf);
527 ecore_idler_del(wd->check_idler);
528 wd->check_idler = NULL;
533 _selected_item_indicate(Elm_Diskselector_Item *it)
535 Elm_Diskselector_Item *item;
538 wd = elm_widget_data_get(it->base.widget);
542 EINA_LIST_FOREACH(wd->r_items, l, item)
544 if (!strcmp(item->label, it->label)) edje_object_signal_emit(item->base.view, "elm,state,selected", "elm");
546 edje_object_signal_emit(item->base.view, "elm,state,default", "elm");
551 _item_click_cb(void *data, Evas_Object *obj __UNUSED__,
552 const char *emission __UNUSED__, const char *source __UNUSED__)
554 Elm_Diskselector_Item *it = data;
559 wd = elm_widget_data_get(it->base.widget);
563 if (wd->selected_item != it)
565 wd->selected_item = it;
566 _selected_item_indicate(wd->selected_item);
569 if (it->func) it->func((void *)it->base.data, it->base.widget, it);
573 _scroller_move_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
575 Evas_Coord x, y, w, h, bw;
576 Widget_Data *wd = data;
579 elm_smart_scroller_child_pos_get(obj, &x, &y);
580 elm_smart_scroller_child_viewport_size_get(obj, &w, &h);
583 evas_object_geometry_get(wd->main_box, NULL, NULL, &bw, NULL);
584 if (x > ((w / wd->display_item_num) * (wd->item_count + (wd->display_item_num % 2))))
585 elm_smart_scroller_child_region_show(wd->scroller,
586 x - ((w / wd->display_item_num) * wd->item_count),
589 elm_smart_scroller_child_region_show(wd->scroller,
590 x + ((w / wd->display_item_num) * wd->item_count),
596 _scroller_stop_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
598 Elm_Diskselector_Item *it;
599 Widget_Data *wd = data;
611 evas_object_geometry_get(wd->scroller, NULL, NULL, &ow, NULL);
612 EINA_LIST_FOREACH(list, l, it)
614 evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL);
615 if (abs((int)(ow / 2 - (int)(x + w / 2))) < 10)
626 _move_scroller(void *data)
628 Evas_Object *obj = data;
631 Elm_Diskselector_Item *dit;
635 wd = elm_widget_data_get(obj);
636 if (!wd) return EINA_FALSE;
643 EINA_LIST_FOREACH(wd->items, l, dit)
645 if (wd->selected_item == dit)
652 (Elm_Diskselector_Item *) eina_list_nth(wd->items, 0);
656 evas_object_geometry_get(wd->scroller, NULL, &y, &w, &h);
657 elm_smart_scroller_child_region_show(wd->scroller, w / wd->display_item_num * i, y, w, h);
661 ecore_idler_del(wd->idler);
664 wd->init = EINA_TRUE;
671 _round_item_del(Widget_Data *wd, Elm_Diskselector_Item *it)
674 elm_box_unpack(wd->main_box, it->base.view);
675 wd->r_items = eina_list_remove(wd->r_items, it);
676 eina_stringshare_del(it->label);
677 evas_object_del(it->base.view);
682 _round_items_del(Widget_Data *wd)
685 Elm_Diskselector_Item * it;
687 _round_item_del(wd, wd->last);
689 _round_item_del(wd, wd->s_last);
691 _round_item_del(wd, wd->second);
693 _round_item_del(wd, wd->first);
696 EINA_LIST_FOREACH(wd->under_items, l, it)
698 _round_item_del(wd, it);
702 EINA_LIST_FOREACH(wd->over_items, l, it)
704 _round_item_del(wd, it);
710 _round_items_add(Widget_Data *wd)
712 Elm_Diskselector_Item *dit;
713 Elm_Diskselector_Item *it;
714 Elm_Diskselector_Item *temp_it;
716 dit = it = eina_list_nth(wd->items, 0);
721 wd->first = _item_new(it->base.widget, it->icon, it->label, it->func,
723 wd->first->node = it->node;
724 wd->r_items = eina_list_append(wd->r_items, wd->first);
727 it = eina_list_nth(wd->items, 1);
732 wd->second = _item_new(it->base.widget, it->icon, it->label, it->func,
734 wd->second->node = it->node;
735 wd->r_items = eina_list_append(wd->r_items, wd->second);
738 // if more than 3 itmes should be displayed
739 for (i = 2; i < CEIL(wd->display_item_num); i++)
741 it = eina_list_nth(wd->items, i);
743 temp_it = _item_new(it->base.widget, it->icon, it->label, it->func, it->base.data);
744 wd->over_items = eina_list_append(wd->over_items, temp_it);
745 wd->r_items = eina_list_append(wd->r_items, temp_it);
748 it = eina_list_nth(wd->items, wd->item_count - 1);
753 wd->last = _item_new(it->base.widget, it->icon, it->label, it->func,
755 wd->last->node = it->node;
756 wd->r_items = eina_list_prepend(wd->r_items, wd->last);
759 it = eina_list_nth(wd->items, wd->item_count - 2);
764 wd->s_last = _item_new(it->base.widget, it->icon, it->label, it->func,
766 wd->s_last->node = it->node;
767 wd->r_items = eina_list_prepend(wd->r_items, wd->s_last);
770 // if more than 3 itmes should be displayed
771 for (i = 3; i <= CEIL(wd->display_item_num); i++)
773 it = eina_list_nth(wd->items, wd->item_count - i);
775 temp_it = _item_new(it->base.widget, it->icon, it->label, it->func, it->base.data);
776 wd->under_items = eina_list_append(wd->under_items, temp_it);
777 wd->r_items = eina_list_prepend(wd->r_items, temp_it);
782 * Add a new diskselector object
784 * @param parent The parent object
785 * @return The new object or NULL if it cannot be created
787 * @ingroup Diskselector
790 elm_diskselector_add(Evas_Object *parent)
796 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
798 ELM_SET_WIDTYPE(widtype, "diskselector");
799 elm_widget_type_set(obj, "diskselector");
800 elm_widget_sub_object_add(parent, obj);
801 elm_widget_data_set(obj, wd);
802 elm_widget_del_hook_set(obj, _del_hook);
803 elm_widget_del_pre_hook_set(obj, _del_pre_hook);
804 elm_widget_theme_hook_set(obj, _theme_hook);
805 elm_widget_can_focus_set(obj, EINA_TRUE);
806 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
807 elm_widget_event_hook_set(obj, _event_hook);
811 wd->round = EINA_FALSE;
812 wd->init = EINA_FALSE;
814 wd->display_item_num_by_api = EINA_FALSE;
816 wd->scroller = elm_smart_scroller_add(e);
817 elm_smart_scroller_widget_set(wd->scroller, obj);
819 elm_widget_resize_object_set(obj, wd->scroller);
820 elm_smart_scroller_policy_set(wd->scroller, ELM_SMART_SCROLLER_POLICY_OFF,
821 ELM_SMART_SCROLLER_POLICY_OFF);
822 elm_smart_scroller_bounce_allow_set(wd->scroller, EINA_TRUE, EINA_FALSE);
823 evas_object_smart_callback_add(wd->scroller, "scroll", _scroller_move_cb,
825 evas_object_smart_callback_add(wd->scroller, "animate,stop",
826 _scroller_stop_cb, wd);
827 _elm_theme_object_set(obj, wd->scroller, "diskselector", "base",
829 evas_object_event_callback_add(wd->scroller, EVAS_CALLBACK_RESIZE,
830 _diskselector_object_resize, obj);
832 wd->main_box = elm_box_add(parent);
833 elm_box_horizontal_set(wd->main_box, EINA_TRUE);
834 elm_box_homogeneous_set(wd->main_box, EINA_TRUE);
835 evas_object_size_hint_weight_set(wd->main_box, EVAS_HINT_EXPAND,
837 evas_object_size_hint_align_set(wd->main_box, EVAS_HINT_FILL,
839 _elm_theme_object_set(obj, wd->main_box, "diskselector", "base",
841 elm_widget_sub_object_add(obj, wd->main_box);
843 elm_smart_scroller_child_set(wd->scroller, wd->main_box);
845 wd->left_blank = edje_object_add(evas_object_evas_get(obj));
846 _elm_theme_object_set(obj, wd->left_blank, "diskselector", "item",
848 evas_object_size_hint_weight_set(wd->left_blank, EVAS_HINT_EXPAND,
850 evas_object_size_hint_align_set(wd->left_blank, EVAS_HINT_FILL,
852 elm_box_pack_end(wd->main_box, wd->left_blank);
853 evas_object_show(wd->left_blank);
855 wd->right_blank = edje_object_add(evas_object_evas_get(obj));
856 _elm_theme_object_set(obj, wd->right_blank, "diskselector", "item",
858 evas_object_size_hint_weight_set(wd->right_blank, EVAS_HINT_EXPAND,
860 evas_object_size_hint_align_set(wd->right_blank, EVAS_HINT_FILL,
862 elm_box_pack_end(wd->main_box, wd->right_blank);
863 evas_object_show(wd->right_blank);
867 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
868 evas_object_smart_callbacks_descriptions_set(obj, _signals);
876 * If round mode is activated the items list will work like a circle list,
877 * so when the user reaches the last item, the first one will popup.
879 * @param obj The diskselector object
880 * @return if or not set round mode or false if not a valid diskselector
882 * @ingroup Diskselector
885 elm_diskselector_round_get(const Evas_Object *obj)
887 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
888 Widget_Data *wd = elm_widget_data_get(obj);
889 if (!wd) return EINA_FALSE;
896 * If round mode is activated the items list will work like a circle list,
897 * so when the user reaches the last item, the first one will popup.
899 * @param it The item of diskselector
900 * @param if or not set round mode
902 * @ingroup Diskselector
905 elm_diskselector_round_set(Evas_Object * obj, Eina_Bool round)
908 Elm_Diskselector_Item *it;
910 ELM_CHECK_WIDTYPE(obj, widtype);
911 Widget_Data *wd = elm_widget_data_get(obj);
914 if (wd->round == round)
920 wd->r_items = eina_list_clone(wd->items);
921 elm_box_unpack(wd->main_box, wd->left_blank);
922 evas_object_hide(wd->left_blank);
923 elm_box_unpack(wd->main_box, wd->right_blank);
924 evas_object_hide(wd->right_blank);
928 _round_items_add(wd);
931 elm_box_pack_start(wd->main_box, wd->last->base.view);
933 elm_box_pack_start(wd->main_box, wd->s_last->base.view);
935 // if more than 3 items should be displayed
936 EINA_LIST_FOREACH(wd->under_items, elist, it)
937 elm_box_pack_start(wd->main_box, it->base.view);
940 elm_box_pack_end(wd->main_box, wd->first->base.view);
942 elm_box_pack_end(wd->main_box, wd->second->base.view);
944 // if more than 3 items should be displayed
945 EINA_LIST_FOREACH(wd->over_items, elist, it)
946 elm_box_pack_end(wd->main_box, it->base.view);
950 _round_items_del(wd);
951 elm_box_pack_start(wd->main_box, wd->left_blank);
952 elm_box_pack_end(wd->main_box, wd->right_blank);
953 eina_list_free(wd->r_items);
957 _selected_item_indicate(wd->selected_item);
962 * Get the side labels max length
964 * @param obj The diskselector object
965 * @return The max length defined for side labels, or 0 if not a valid
968 * @ingroup Diskselector
971 elm_diskselector_side_label_length_get(const Evas_Object *obj)
973 ELM_CHECK_WIDTYPE(obj, widtype) 0;
974 Widget_Data *wd = elm_widget_data_get(obj);
980 * Set the side labels max length
982 * @param obj The diskselector object
983 * @param len The max length defined for side labels
985 * @ingroup Diskselector
988 elm_diskselector_side_label_length_set(Evas_Object *obj, int len)
990 ELM_CHECK_WIDTYPE(obj, widtype);
991 Widget_Data *wd = elm_widget_data_get(obj);
997 elm_diskselector_side_label_lenght_set(Evas_Object *obj, int len)
999 return elm_diskselector_side_label_length_set(obj, len);
1003 elm_diskselector_side_label_lenght_get(const Evas_Object *obj)
1005 return elm_diskselector_side_label_length_get(obj);
1011 * This will enable or disable the scroller bounce mode for the diskselector.
1012 * See elm_scroller_bounce_set() for details. Horizontal bounce is enabled by
1015 * @param obj The diskselector object
1016 * @param h_bounce Allow bounce horizontally
1017 * @param v_bounce Allow bounce vertically
1019 * @ingroup Diskselector
1022 elm_diskselector_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
1024 ELM_CHECK_WIDTYPE(obj, widtype);
1025 Widget_Data *wd = elm_widget_data_get(obj);
1028 elm_smart_scroller_bounce_allow_set(wd->scroller, h_bounce, v_bounce);
1032 * Get the bounce mode
1034 * @param obj The Diskselector object
1035 * @param h_bounce Allow bounce horizontally
1036 * @param v_bounce Allow bounce vertically
1038 * @ingroup Diskselector
1041 elm_diskselector_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
1043 ELM_CHECK_WIDTYPE(obj, widtype);
1044 Widget_Data *wd = elm_widget_data_get(obj);
1046 elm_smart_scroller_bounce_allow_get(wd->scroller, h_bounce, v_bounce);
1050 * Get the scrollbar policy
1052 * This sets the scrollbar visibility policy for the given scroller.
1053 * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it
1054 * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns
1055 * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off.
1056 * This applies respectively for the horizontal and vertical scrollbars.
1057 * The both are disabled by default.
1059 * @param obj The diskselector object
1060 * @param policy_h Horizontal scrollbar policy
1061 * @param policy_v Vertical scrollbar policy
1063 * @ingroup Diskselector
1067 elm_diskselector_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
1069 ELM_CHECK_WIDTYPE(obj, widtype);
1070 Elm_Smart_Scroller_Policy s_policy_h, s_policy_v;
1071 Widget_Data *wd = elm_widget_data_get(obj);
1072 if ((!wd) || (!wd->scroller)) return;
1073 elm_smart_scroller_policy_get(wd->scroller, &s_policy_h, &s_policy_v);
1074 *policy_h = (Elm_Scroller_Policy) s_policy_h;
1075 *policy_v = (Elm_Scroller_Policy) s_policy_v;
1080 * Set the scrollbar policy
1082 * This sets the scrollbar visibility policy for the given scroller.
1083 * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it
1084 * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns
1085 * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off.
1086 * This applies respectively for the horizontal and vertical scrollbars.
1087 * The both are disabled by default.
1089 * @param obj The diskselector object
1090 * @param policy_h Horizontal scrollbar policy
1091 * @param policy_v Vertical scrollbar policy
1093 * @ingroup Diskselector
1096 elm_diskselector_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
1098 ELM_CHECK_WIDTYPE(obj, widtype);
1099 Widget_Data *wd = elm_widget_data_get(obj);
1101 if ((policy_h >= 3) || (policy_v >= 3)) return;
1103 elm_smart_scroller_policy_set(wd->scroller, policy_h, policy_v);
1107 * Clears a diskselector of all items.
1109 * @param obj The diskselector object
1111 * @ingroup Diskselector
1114 elm_diskselector_clear(Evas_Object *obj)
1116 ELM_CHECK_WIDTYPE(obj, widtype);
1117 Widget_Data *wd = elm_widget_data_get(obj);
1118 Elm_Diskselector_Item *it;
1121 if (!wd->items) return;
1123 wd->selected_item = NULL;
1124 EINA_LIST_FREE(wd->items, it) _item_del(it);
1125 _round_items_del(wd);
1130 * Returns a list of all the diskselector items.
1132 * @param obj The diskselector object
1133 * @return An Eina_List* of the diskselector items, or NULL on failure
1135 * @ingroup Diskselector
1137 EAPI const Eina_List *
1138 elm_diskselector_items_get(const Evas_Object *obj)
1140 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1141 Widget_Data *wd = elm_widget_data_get(obj);
1142 if (!wd) return NULL;
1147 * Appends an item to the diskselector object.
1149 * @param obj The diskselector object
1150 * @param label The label of the diskselector item
1151 * @param icon The icon object to use for the left side of the item
1152 * @param func The function to call when the item is selected
1153 * @param data The data to associate with the item for related callbacks
1155 * @return The created item or NULL upon failure
1157 * @ingroup Diskselector
1159 EAPI Elm_Diskselector_Item *
1160 elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data)
1162 Elm_Diskselector_Item *it;
1163 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1164 Widget_Data *wd = elm_widget_data_get(obj);
1165 if (!wd) return NULL;
1167 it = _item_new(obj, icon, label, func, data);
1168 wd->items = eina_list_append(wd->items, it);
1169 it->node = eina_list_last(wd->items);
1173 _round_items_del(wd);
1174 wd->r_items = eina_list_append(wd->r_items, it);
1175 _round_items_add(wd);
1177 elm_box_pack_start(wd->main_box, wd->last->base.view);
1179 elm_box_pack_start(wd->main_box, wd->s_last->base.view);
1180 elm_box_pack_end(wd->main_box, it->base.view);
1182 elm_box_pack_end(wd->main_box, wd->first->base.view);
1184 elm_box_pack_end(wd->main_box, wd->second->base.view);
1188 elm_box_unpack(wd->main_box, wd->right_blank);
1189 elm_box_pack_end(wd->main_box, it->base.view);
1190 elm_box_pack_end(wd->main_box, wd->right_blank);
1192 if (!wd->selected_item)
1193 wd->selected_item = it;
1195 wd->idler = ecore_idler_add(_move_scroller, obj);
1203 * @param it The item of diskselector
1205 * @ingroup Diskselector
1208 elm_diskselector_item_del(Elm_Diskselector_Item * it)
1210 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1211 Elm_Diskselector_Item *dit;
1212 Elm_Diskselector_Item *item;
1215 Widget_Data *wd = elm_widget_data_get(it->base.widget);
1218 elm_box_unpack(wd->main_box, it->base.view);
1221 wd->r_items = eina_list_remove(wd->r_items, it);
1223 wd->items = eina_list_remove(wd->items, it);
1225 if (wd->selected_item == it)
1227 dit = (Elm_Diskselector_Item *) eina_list_nth(wd->items, 0);
1229 wd->selected_item = dit;
1231 wd->selected_item = eina_list_nth(wd->items, 1);
1233 _selected_item_indicate(wd->selected_item);
1237 wd->item_count -= 1;
1241 if (!wd->item_count)
1243 evas_object_hide(wd->first->base.view);
1244 evas_object_hide(wd->second->base.view);
1245 evas_object_hide(wd->last->base.view);
1246 evas_object_hide(wd->s_last->base.view);
1248 EINA_LIST_FOREACH(wd->under_items, l, item)
1249 evas_object_hide(item->base.view);
1251 EINA_LIST_FOREACH(wd->over_items, l, item)
1252 evas_object_hide(item->base.view);
1256 dit = eina_list_nth(wd->items, 0);
1259 eina_stringshare_replace(&wd->first->label, dit->label);
1260 edje_object_part_text_set(wd->first->base.view, "elm.text",
1263 dit = eina_list_nth(wd->items, 1);
1266 eina_stringshare_replace(&wd->second->label, dit->label);
1267 edje_object_part_text_set(wd->second->base.view, "elm.text",
1270 // if more than 3 itmes should be displayed
1271 for (i = 2; i < CEIL(wd->display_item_num); i++)
1273 dit = eina_list_nth(wd->items, i);
1274 item = eina_list_nth(wd->over_items, i - 2);
1275 eina_stringshare_replace(&item->label, dit->label);
1276 edje_object_part_text_set(item->base.view, "elm.text", item->label);
1279 dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 1);
1282 eina_stringshare_replace(&wd->last->label, dit->label);
1283 edje_object_part_text_set(wd->last->base.view, "elm.text",
1286 dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 2);
1289 eina_stringshare_replace(&wd->s_last->label, dit->label);
1290 edje_object_part_text_set(wd->s_last->base.view, "elm.text",
1293 // if more than 3 itmes should be displayed
1294 for (i = 3; i <= CEIL(wd->display_item_num); i++)
1296 dit = eina_list_nth(wd->items, wd->item_count - i);
1297 item = eina_list_nth(wd->under_items, i - 3);
1298 eina_stringshare_replace(&item->label, dit->label);
1299 edje_object_part_text_set(item->base.view, "elm.text", item->label);
1303 wd->check_idler = ecore_idler_add(_check_string, wd);
1304 _sizing_eval(wd->self);
1308 * Get the label of item
1310 * @param it The item of diskselector
1311 * @return The label of item
1313 * @ingroup Diskselector
1316 elm_diskselector_item_label_get(const Elm_Diskselector_Item * it)
1318 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1323 * Set the label of item
1325 * @param it The item of diskselector
1326 * @param label The label of item
1328 * @ingroup Diskselector
1331 elm_diskselector_item_label_set(Elm_Diskselector_Item * it, const char *label)
1333 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1334 eina_stringshare_replace(&it->label, label);
1335 edje_object_part_text_set(it->base.view, "elm.text", it->label);
1339 * Get the selected item
1341 * @param obj The diskselector object
1342 * @return The selected diskselector item
1344 * @ingroup Diskselector
1346 EAPI Elm_Diskselector_Item *
1347 elm_diskselector_selected_item_get(const Evas_Object *obj)
1349 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1350 Widget_Data *wd = elm_widget_data_get(obj);
1351 if (!wd) return NULL;
1352 return wd->selected_item;
1356 * Set the selected state of an item
1358 * This sets the selected state (EINA_TRUE selected, EINA_FALSE not selected)
1359 * of the given item @p it.
1360 * If a new item is selected the previosly selected will be unselected.
1361 * If the item @p it is unselected, the first item will be selected.
1363 * @param it The diskselector item
1364 * @param selected The selected state
1366 * @ingroup Diskselector
1369 elm_diskselector_item_selected_set(Elm_Diskselector_Item *it, Eina_Bool selected)
1371 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1373 wd = elm_widget_data_get(it->base.widget);
1376 if ((wd->selected_item == it) && (selected))
1379 if ((wd->selected_item == it) && (!selected))
1380 wd->selected_item = eina_list_data_get(wd->items);
1383 wd->selected_item = it;
1384 _selected_item_indicate(wd->selected_item);
1388 ecore_idler_add(_move_scroller, it->base.widget);
1392 * Get the selected state of @p item.
1394 * @param it The diskselector item
1395 * @return If true, the item is selected
1397 * @ingroup Diskselector
1400 elm_diskselector_item_selected_get(const Elm_Diskselector_Item *it)
1402 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
1405 wd = elm_widget_data_get(it->base.widget);
1406 if (!wd) return EINA_FALSE;
1407 return (wd->selected_item == it);
1411 * Set the function called when a diskselector item is freed.
1413 * @param it The item to set the callback on
1414 * @param func The function called
1416 * @ingroup Diskselector
1419 elm_diskselector_item_del_cb_set(Elm_Diskselector_Item *it, Evas_Smart_Cb func)
1421 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1422 elm_widget_item_del_cb_set(it, func);
1426 * Returns the data associated with the item.
1428 * @param it The diskselector item
1429 * @return The data associated with @p it
1431 * @ingroup Diskselector
1434 elm_diskselector_item_data_get(const Elm_Diskselector_Item *it)
1436 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1437 return elm_widget_item_data_get(it);
1441 * Returns the icon associated with the item.
1443 * @param it The diskselector item
1444 * @return The icon associated with @p it
1446 * @ingroup Diskselector
1449 elm_diskselector_item_icon_get(const Elm_Diskselector_Item *it)
1451 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1456 * Sets the icon associated with the item.
1458 * Once the icon object is set, a previously set one will be deleted.
1459 * You probably don't want, then, to have the <b>same</b> icon object set
1460 * for more than one item of the diskselector.
1462 * @param it The diskselector item
1463 * @param icon The icon object to associate with @p it
1465 * @ingroup Diskselector
1468 elm_diskselector_item_icon_set(Elm_Diskselector_Item *it, Evas_Object *icon)
1470 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it);
1471 if (it->icon == icon) return;
1473 evas_object_del(it->icon);
1476 edje_object_part_swallow(it->base.view, "elm.swallow.icon", icon);
1480 * Gets the item before @p it in the list.
1482 * @param it The diskselector item
1483 * @return The item before @p it, or NULL on failure
1485 * @ingroup Diskselector
1487 EAPI Elm_Diskselector_Item *
1488 elm_diskselector_item_prev_get(const Elm_Diskselector_Item *it)
1490 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1491 if (it->node->prev) return it->node->prev->data;
1496 * Gets the item after @p it in the list.
1498 * @param it The diskselector item
1499 * @return The item after @p it, or NULL on failure
1501 * @ingroup Diskselector
1503 EAPI Elm_Diskselector_Item *
1504 elm_diskselector_item_next_get(const Elm_Diskselector_Item *it)
1506 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL);
1507 if (it->node->next) return it->node->next->data;
1512 * Get the first item in the diskselector
1514 * @param obj The diskselector object
1515 * @return The first item, or NULL if none
1517 * @ingroup Diskselector
1519 EAPI Elm_Diskselector_Item *
1520 elm_diskselector_first_item_get(const Evas_Object *obj)
1522 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1525 wd = elm_widget_data_get(obj);
1526 if (!wd || !wd->items)
1529 return eina_list_data_get(wd->items);
1533 * Get the last item in the diskselector
1535 * @param obj The diskselector object
1536 * @return The last item, or NULL if none
1538 * @ingroup Diskselector
1540 EAPI Elm_Diskselector_Item *
1541 elm_diskselector_last_item_get(const Evas_Object *obj)
1543 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1546 wd = elm_widget_data_get(obj);
1547 if (!wd || !wd->items)
1550 return eina_list_data_get(eina_list_last(wd->items));
1554 * Set the text to be shown in the diskselector item.
1556 * @param item Target item
1557 * @param text The text to set in the content
1559 * Setup the text as tooltip to object. The item can have only one tooltip,
1560 * so any previous tooltip data is removed.
1562 * @ingroup Diskselector
1565 elm_diskselector_item_tooltip_text_set(Elm_Diskselector_Item *item, const char *text)
1567 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1568 elm_widget_item_tooltip_text_set(item, text);
1572 * Set the content to be shown in the tooltip item
1574 * Setup the tooltip to item. The item can have only one tooltip,
1575 * so any previous tooltip data is removed. @p func(with @p data) will
1576 * be called every time that need show the tooltip and it should
1577 * return a valid Evas_Object. This object is then managed fully by
1578 * tooltip system and is deleted when the tooltip is gone.
1580 * @param item the diskselector item being attached a tooltip.
1581 * @param func the function used to create the tooltip contents.
1582 * @param data what to provide to @a func as callback data/context.
1583 * @param del_cb called when data is not needed anymore, either when
1584 * another callback replaces @func, the tooltip is unset with
1585 * elm_diskselector_item_tooltip_unset() or the owner @a item
1586 * dies. This callback receives as the first parameter the
1587 * given @a data, and @c event_info is the item.
1589 * @ingroup Diskselector
1592 elm_diskselector_item_tooltip_content_cb_set(Elm_Diskselector_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
1594 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1595 elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb);
1599 * Unset tooltip from item
1601 * @param item diskselector item to remove previously set tooltip.
1603 * Remove tooltip from item. The callback provided as del_cb to
1604 * elm_diskselector_item_tooltip_content_cb_set() will be called to notify
1605 * it is not used anymore.
1607 * @see elm_diskselector_item_tooltip_content_cb_set()
1609 * @ingroup Diskselector
1612 elm_diskselector_item_tooltip_unset(Elm_Diskselector_Item *item)
1614 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1615 elm_widget_item_tooltip_unset(item);
1619 * Sets a different style for this item tooltip.
1621 * @note before you set a style you should define a tooltip with
1622 * elm_diskselector_item_tooltip_content_cb_set() or
1623 * elm_diskselector_item_tooltip_text_set()
1625 * @param item diskselector item with tooltip already set.
1626 * @param style the theme style to use (default, transparent, ...)
1628 * @ingroup Diskselector
1631 elm_diskselector_item_tooltip_style_set(Elm_Diskselector_Item *item, const char *style)
1633 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1634 elm_widget_item_tooltip_style_set(item, style);
1638 * Get the style for this item tooltip.
1640 * @param item diskselector item with tooltip already set.
1641 * @return style the theme style in use, defaults to "default". If the
1642 * object does not have a tooltip set, then NULL is returned.
1644 * @ingroup Diskselector
1647 elm_diskselector_item_tooltip_style_get(const Elm_Diskselector_Item *item)
1649 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL);
1650 return elm_widget_item_tooltip_style_get(item);
1654 * Set the cursor to be shown when mouse is over the diskselector item
1656 * @param item Target item
1657 * @param cursor the cursor name to be used.
1659 * @see elm_object_cursor_set()
1660 * @ingroup Diskselector
1663 elm_diskselector_item_cursor_set(Elm_Diskselector_Item *item, const char *cursor)
1665 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1666 elm_widget_item_cursor_set(item, cursor);
1670 * Get the cursor to be shown when mouse is over the diskselector item
1672 * @param item diskselector item with cursor already set.
1673 * @return the cursor name.
1675 * @ingroup Diskselector
1678 elm_diskselector_item_cursor_get(const Elm_Diskselector_Item *item)
1680 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL);
1681 return elm_widget_item_cursor_get(item);
1685 * Unset the cursor to be shown when mouse is over the diskselector item
1687 * @param item Target item
1689 * @see elm_object_cursor_unset()
1690 * @ingroup Diskselector
1693 elm_diskselector_item_cursor_unset(Elm_Diskselector_Item *item)
1695 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1696 elm_widget_item_cursor_unset(item);
1700 * Sets a different style for this item cursor.
1702 * @note before you set a style you should define a cursor with
1703 * elm_diskselector_item_cursor_set()
1705 * @param item diskselector item with cursor already set.
1706 * @param style the theme style to use (default, transparent, ...)
1708 * @ingroup Diskselector
1711 elm_diskselector_item_cursor_style_set(Elm_Diskselector_Item *item, const char *style)
1713 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1714 elm_widget_item_cursor_style_set(item, style);
1718 * Get the style for this item cursor.
1720 * @param item diskselector item with cursor already set.
1721 * @return style the theme style in use, defaults to "default". If the
1722 * object does not have a cursor set, then NULL is returned.
1724 * @ingroup Diskselector
1727 elm_diskselector_item_cursor_style_get(const Elm_Diskselector_Item *item)
1729 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL);
1730 return elm_widget_item_cursor_style_get(item);
1734 * Set if the cursor set should be searched on the theme or should use
1735 * the provided by the engine, only.
1737 * @note before you set if should look on theme you should define a cursor
1738 * with elm_object_cursor_set(). By default it will only look for cursors
1739 * provided by the engine.
1741 * @param item widget item with cursor already set.
1742 * @param engine_only boolean to define it cursors should be looked only
1743 * between the provided by the engine or searched on widget's theme as well.
1745 * @ingroup Diskselector
1748 elm_diskselector_item_cursor_engine_only_set(Elm_Diskselector_Item *item, Eina_Bool engine_only)
1750 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item);
1751 elm_widget_item_cursor_engine_only_set(item, engine_only);
1755 * Get the cursor engine only usage for this item cursor.
1757 * @param item widget item with cursor already set.
1758 * @return engine_only boolean to define it cursors should be looked only
1759 * between the provided by the engine or searched on widget's theme as well. If
1760 * the object does not have a cursor set, then EINA_FALSE is returned.
1762 * @ingroup Diskselector
1765 elm_diskselector_item_cursor_engine_only_get(const Elm_Diskselector_Item *item)
1767 ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
1768 return elm_widget_item_cursor_engine_only_get(item);
1771 * Set the number of items to be displayed
1773 * @param obj The diskselector object
1774 * @param num The number of itmes that diskselector will display
1776 * @ingroup Diskselector
1779 elm_diskselector_display_item_num_set(Evas_Object *obj, int num)
1781 ELM_CHECK_WIDTYPE(obj, widtype);
1782 Widget_Data *wd = elm_widget_data_get(obj);
1784 if (num < DISPLAY_ITEM_NUM_MIN) num = DISPLAY_ITEM_NUM_MIN;
1785 wd->display_item_num = num;
1786 wd->display_item_num_by_api = EINA_TRUE;