1 #include <Elementary.h>
5 * @defgroup Slideshow Slideshow
7 * This object display a list of object (generally a list of images) and some actions like
8 * next/previous are used to navigate. The animations are defined in the theme,
9 * consequently new animations can be added without having to update the
12 * The slideshow use 2 callbacks to create and delete the objects displayed. When an item
13 * is displayed the function itc->func.get() is called. This function should create the object,
14 * for example the object can be an evas_object_image or a photocam. When an object is no more
15 * displayed the function itc->func.del() is called, the user can delete the dana associated to the item.
17 * Signals that you can add callbacks for are:
19 * "changed" - when the slideshow switch to another item
22 typedef struct _Widget_Data Widget_Data;
24 struct _Elm_Slideshow_Item
28 Eina_List *l, *l_built;
30 const Elm_Slideshow_Item_Class *itc;
35 Evas_Object *slideshow;
37 // list of Elm_Slideshow_Item*
39 Eina_List *items_built;
41 Elm_Slideshow_Item *current;
42 Elm_Slideshow_Item *previous;
44 Eina_List *transitions;
45 const char *transition;
47 int count_item_pre_before;
48 int count_item_pre_after;
55 Eina_List *list; //list of const char *
59 static const char *widtype = NULL;
60 static void _del_hook(Evas_Object *obj);
61 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
62 static void _theme_hook(Evas_Object *obj);
63 static void _sizing_eval(Evas_Object *obj);
64 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
65 static Eina_Bool _timer_cb(void *data);
66 static void _on_focus_hook(void *data, Evas_Object *obj);
67 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
68 Evas_Callback_Type type, void *event_info);
70 static const char SIG_CHANGED[] = "changed";
72 static const Evas_Smart_Cb_Description _signals[] = {
78 _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
80 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
81 Evas_Event_Key_Down *ev = event_info;
82 Widget_Data *wd = elm_widget_data_get(obj);
83 if (!wd) return EINA_FALSE;
84 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
85 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
86 if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
88 elm_slideshow_previous(obj);
89 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
92 if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
94 elm_slideshow_next(obj);
95 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
98 if ((!strcmp(ev->keyname, "Return")) ||
99 (!strcmp(ev->keyname, "KP_Enter")) ||
100 (!strcmp(ev->keyname, "space")))
106 ecore_timer_del(wd->timer);
110 elm_slideshow_timeout_set(obj, wd->timeout);
112 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
119 _del_hook(Evas_Object *obj)
122 Widget_Data *wd = elm_widget_data_get(obj);
124 elm_slideshow_clear(obj);
125 elm_widget_stringlist_free(wd->transitions);
126 if (wd->timer) ecore_timer_del(wd->timer);
127 EINA_LIST_FREE(wd->layout.list, layout)
128 eina_stringshare_del(layout);
133 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
135 Widget_Data *wd = elm_widget_data_get(obj);
137 if (elm_widget_focus_get(obj))
139 edje_object_signal_emit(wd->slideshow, "elm,action,focus", "elm");
140 evas_object_focus_set(wd->slideshow, EINA_TRUE);
144 edje_object_signal_emit(wd->slideshow, "elm,action,unfocus", "elm");
145 evas_object_focus_set(wd->slideshow, EINA_FALSE);
150 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
152 Widget_Data *wd = elm_widget_data_get(obj);
154 edje_object_mirrored_set(wd->slideshow, rtl);
158 _theme_hook(Evas_Object *obj)
160 Widget_Data *wd = elm_widget_data_get(obj);
162 _elm_widget_mirrored_reload(obj);
163 _mirrored_set(obj, elm_widget_mirrored_get(obj));
164 _elm_theme_object_set(obj, wd->slideshow, "slideshow", "base", elm_widget_style_get(obj));
165 edje_object_scale_set(wd->slideshow, elm_widget_scale_get(obj) *
171 _sizing_eval(Evas_Object *obj)
173 Widget_Data *wd = elm_widget_data_get(obj);
174 Evas_Coord minw = -1, minh = -1;
176 edje_object_size_min_calc(wd->slideshow, &minw, &minh);
177 evas_object_size_hint_min_set(obj, minw, minh);
178 evas_object_size_hint_max_set(obj, minw, minh);
182 static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item)
184 Widget_Data *wd = elm_widget_data_get(item->base.widget);
185 Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l));
186 if ((!prev) && (wd->loop))
187 prev = eina_list_data_get(eina_list_last(item->l));
191 static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item)
193 Widget_Data *wd = elm_widget_data_get(item->base.widget);
194 Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l));
195 if ((!next) && (wd->loop))
196 next = eina_list_data_get(wd->items);
201 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
207 _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
213 _item_realize(Elm_Slideshow_Item *item)
215 Elm_Slideshow_Item *_item_prev, *_item_next;
216 Evas_Object *obj = item->base.widget;
217 Widget_Data *wd = elm_widget_data_get(obj);
221 if ((!item->base.view) && (item->itc->func.get))
223 item->base.view = item->itc->func.get((void*)item->base.data, obj);
224 evas_object_smart_member_add(item->base.view, obj);
225 item->l_built = eina_list_append(NULL, item);
226 wd->items_built = eina_list_merge(wd->items_built, item->l_built);
227 evas_object_hide(item->base.view);
229 else if (item->l_built)
230 wd->items_built = eina_list_demote_list(wd->items_built, item->l_built);
232 //pre-create previous and next item
233 ac = wd->count_item_pre_after;
235 bc = wd->count_item_pre_before;
237 lc = eina_list_count(wd->items) - 1;
238 while (lc > 0 && ((ac > 0) || (bc > 0)))
240 if (lc > 0 && ac > 0)
244 _item_next = _item_next_get(_item_next);
246 && (!_item_next->base.view)
247 && (_item_next->itc->func.get))
249 _item_next->base.view =
250 _item_next->itc->func.get((void*)_item_next->base.data,
252 evas_object_smart_member_add(_item_next->base.view, obj);
253 _item_next->l_built = eina_list_append(NULL, _item_next);
254 wd->items_built = eina_list_merge(wd->items_built,
255 _item_next->l_built);
256 evas_object_hide(_item_next->base.view);
258 else if (_item_next && _item_next->l_built)
259 wd->items_built = eina_list_demote_list(wd->items_built,
260 _item_next->l_built);
263 if (lc > 0 && bc > 0)
267 _item_prev = _item_prev_get(_item_prev);
269 && (!_item_prev->base.view)
270 && (_item_prev->itc->func.get))
272 _item_prev->base.view =
273 _item_prev->itc->func.get((void*)_item_prev->base.data,
275 evas_object_smart_member_add(_item_prev->base.view, obj);
276 _item_prev->l_built = eina_list_append(NULL, _item_prev);
277 wd->items_built = eina_list_merge(wd->items_built,
278 _item_prev->l_built);
279 evas_object_hide(_item_prev->base.view);
281 else if (_item_prev && _item_prev->l_built)
282 wd->items_built = eina_list_demote_list(wd->items_built,
283 _item_prev->l_built);
287 //delete unused items
288 lc = wd->count_item_pre_before + wd->count_item_pre_after + 1;
289 while ((int)eina_list_count(wd->items_built) > lc)
291 item = eina_list_data_get(wd->items_built);
292 wd->items_built = eina_list_remove_list(wd->items_built,
294 if (item->itc->func.del)
295 item->itc->func.del((void*)item->base.data, item->base.view);
296 evas_object_del(item->base.view);
297 item->base.view = NULL;
302 _end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
304 Elm_Slideshow_Item *item;
305 Widget_Data *wd = elm_widget_data_get(data);
311 edje_object_part_unswallow(NULL, item->base.view);
312 evas_object_hide(item->base.view);
318 if ((!item) || (!item->base.view)) return;
321 edje_object_part_unswallow(NULL, item->base.view);
322 evas_object_show(item->base.view);
324 edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow");
325 edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view);
329 _timer_cb(void *data)
331 Evas_Object *obj = data;
332 Widget_Data *wd = elm_widget_data_get(obj);
333 if (!wd) return ECORE_CALLBACK_CANCEL;
335 elm_slideshow_next(obj);
336 return ECORE_CALLBACK_CANCEL;
340 * Add a new slideshow to the parent
342 * @param parent The parent object
343 * @return The new object or NULL if it cannot be created
348 elm_slideshow_add(Evas_Object *parent)
354 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
356 ELM_SET_WIDTYPE(widtype, "slideshow");
357 elm_widget_type_set(obj, "slideshow");
358 elm_widget_sub_object_add(parent, obj);
359 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
360 elm_widget_data_set(obj, wd);
361 elm_widget_del_hook_set(obj, _del_hook);
362 elm_widget_theme_hook_set(obj, _theme_hook);
363 elm_widget_can_focus_set(obj, EINA_TRUE);
364 elm_widget_event_hook_set(obj, _event_hook);
369 wd->slideshow = edje_object_add(e);
370 _elm_theme_object_set(obj, wd->slideshow, "slideshow", "base", "default");
371 evas_object_smart_member_add(wd->slideshow, obj);
372 wd->count_item_pre_before = 2;
373 wd->count_item_pre_after = 2;
374 elm_widget_resize_object_set(obj, wd->slideshow);
375 evas_object_show(wd->slideshow);
377 wd->transitions = elm_widget_stringlist_get(edje_object_data_get(wd->slideshow, "transitions"));
378 if (eina_list_count(wd->transitions) > 0)
379 wd->transition = eina_stringshare_add(eina_list_data_get(wd->transitions));
381 wd->layout.list = elm_widget_stringlist_get(edje_object_data_get(wd->slideshow, "layouts"));
382 if (eina_list_count(wd->layout.list) > 0)
383 wd->layout.current = eina_list_data_get(wd->layout.list);
385 edje_object_signal_callback_add(wd->slideshow, "end", "slideshow", _end, obj);
387 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
388 evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
390 evas_object_smart_callbacks_descriptions_set(obj, _signals);
392 _mirrored_set(obj, elm_widget_mirrored_get(obj));
398 * Add an object in the list. The object can be a evas object image or a elm photo for example.
400 * @param obj The slideshow object
401 * @aram itc Callbacks used to create the object and delete the data associated when the item is deleted.
402 * @param data Data used by the user to identified the item
403 * @return Returns The slideshow item
407 EAPI Elm_Slideshow_Item*
408 elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data)
410 Elm_Slideshow_Item *item;
411 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
412 Widget_Data *wd = elm_widget_data_get(obj);
414 if (!wd) return NULL;
415 item = elm_widget_item_new(obj, Elm_Slideshow_Item);
416 item->base.data = data;
418 item->l = eina_list_append(item->l, item);
420 wd->items = eina_list_merge(wd->items, item->l);
422 if (!wd->current) elm_slideshow_show(item);
428 * Insert an object in the list. The object can be a evas object image or a elm photo for example.
430 * @param obj The slideshow object
431 * @aram itc Callbacks used to create the object and delete the data associated when the item is deleted.
432 * @param data Data used by the user to identified the item
433 * @param func The function to compare data
434 * @return Returns The slideshow item
438 EAPI Elm_Slideshow_Item*
439 elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func)
441 Elm_Slideshow_Item *item;
442 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
443 Widget_Data *wd = elm_widget_data_get(obj);
445 if (!wd) return NULL;
446 item = elm_widget_item_new(obj, Elm_Slideshow_Item);
447 item->base.data = data;
449 item->l = eina_list_append(item->l, item);
451 wd->items = eina_list_sorted_merge(wd->items, item->l, func);
453 if (!wd->current) elm_slideshow_show(item);
461 * @param obj The slideshow object
462 * @param item The item
467 elm_slideshow_show(Elm_Slideshow_Item *item)
470 Elm_Slideshow_Item *next = NULL;
472 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
473 wd = elm_widget_data_get(item->base.widget);
476 if (item == wd->current)
480 _end(item->base.widget, item->base.widget, NULL, NULL);
482 if (wd->timer) ecore_timer_del(wd->timer);
483 if (wd->timeout > 0.0)
484 wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget);
486 edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
487 evas_object_show(next->base.view);
488 snprintf(buf, sizeof(buf), "%s,next", wd->transition);
489 edje_object_signal_emit(wd->slideshow, buf, "slideshow");
490 wd->previous = wd->current;
492 evas_object_smart_callback_call(item->base.widget, SIG_CHANGED, wd->current);
496 * Go to the next item
498 * @param obj The slideshow object
503 elm_slideshow_next(Evas_Object *obj)
506 Elm_Slideshow_Item *next = NULL;
507 ELM_CHECK_WIDTYPE(obj, widtype);
508 Widget_Data *wd = elm_widget_data_get(obj);
513 next = _item_next_get(wd->current);
515 if ((!next) || (next == wd->current)) return;
517 _end(obj, obj, NULL, NULL);
519 if (wd->timer) ecore_timer_del(wd->timer);
520 if (wd->timeout > 0.0)
521 wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
525 edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view);
526 evas_object_show(next->base.view);
528 snprintf(buf, sizeof(buf), "%s,next", wd->transition);
529 edje_object_signal_emit(wd->slideshow, buf, "slideshow");
531 wd->previous = wd->current;
533 evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
537 * Go to the previous item
539 * @param obj The slideshow object
544 elm_slideshow_previous(Evas_Object *obj)
547 Elm_Slideshow_Item *prev = NULL;
548 ELM_CHECK_WIDTYPE(obj, widtype);
549 Widget_Data *wd = elm_widget_data_get(obj);
554 prev = _item_prev_get(wd->current);
556 if ((!prev) || (prev == wd->current)) return;
558 _end(obj, obj, NULL, NULL);
560 if (wd->timer) ecore_timer_del(wd->timer);
561 if (wd->timeout > 0.0)
562 wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
566 edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->base.view);
567 evas_object_show(prev->base.view);
569 snprintf(buf, 1024, "%s,previous", wd->transition);
570 edje_object_signal_emit(wd->slideshow, buf, "slideshow");
572 wd->previous = wd->current;
574 evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
578 * Returns the list of transitions available.
580 * @param obj The slideshow object
581 * @return Returns the list of transitions (list of const char*)
585 EAPI const Eina_List *
586 elm_slideshow_transitions_get(const Evas_Object *obj)
588 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
589 Widget_Data *wd = elm_widget_data_get(obj);
590 if (!wd) return NULL;
591 return wd->transitions;
595 * Returns the list of layouts available.
597 * @param obj The slideshow object
598 * @return Returns the list of layout (list of const char*)
602 EAPI const Eina_List *
603 elm_slideshow_layouts_get(const Evas_Object *obj)
605 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
606 Widget_Data *wd = elm_widget_data_get(obj);
607 if (!wd) return NULL;
608 return wd->layout.list;
612 * Set the transition to use
614 * @param obj The slideshow object
615 * @param transition the new transition
620 elm_slideshow_transition_set(Evas_Object *obj, const char *transition)
622 ELM_CHECK_WIDTYPE(obj, widtype);
623 Widget_Data *wd = elm_widget_data_get(obj);
625 eina_stringshare_replace(&wd->transition, transition);
629 * Returns the transition to use
631 * @param obj The slideshow object
632 * @return the transition set
637 elm_slideshow_transition_get(const Evas_Object *obj)
639 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
640 Widget_Data *wd = elm_widget_data_get(obj);
641 if (!wd) return NULL;
642 return wd->transition;
646 * The slideshow can go to the next item automatically after a few seconds.
647 * This method set the timeout to use. A timeout <=0 disable the timer.
649 * @param obj The slideshow object
650 * @param timeout The new timeout
655 elm_slideshow_timeout_set(Evas_Object *obj, double timeout)
657 ELM_CHECK_WIDTYPE(obj, widtype);
658 Widget_Data *wd = elm_widget_data_get(obj);
660 wd->timeout = timeout;
661 if (wd->timer) ecore_timer_del(wd->timer);
664 wd->timer = ecore_timer_add(timeout, _timer_cb, obj);
668 * Returns the timeout value
670 * @param obj The slideshow object
671 * @return Returns the timeout
676 elm_slideshow_timeout_get(const Evas_Object *obj)
678 ELM_CHECK_WIDTYPE(obj, widtype) -1.0;
679 Widget_Data *wd = elm_widget_data_get(obj);
680 if (!wd) return -1.0;
685 * Set if the first item should follow the last and vice versa
687 * @param obj The slideshow object
688 * @param loop if EINA_TRUE, the first item will follow the last and vice versa
693 elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop)
695 ELM_CHECK_WIDTYPE(obj, widtype);
696 Widget_Data *wd = elm_widget_data_get(obj);
702 * Returns the current layout name
704 * @param obj The slideshow object
705 * @returns Returns the layout name
710 elm_slideshow_layout_get(const Evas_Object *obj)
712 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
713 Widget_Data *wd = elm_widget_data_get(obj);
714 if (!wd) return EINA_FALSE;
715 return wd->layout.current;
721 * @param obj The slideshow object
722 * @param layout the new layout
727 elm_slideshow_layout_set(Evas_Object *obj, const char *layout)
730 ELM_CHECK_WIDTYPE(obj, widtype);
731 Widget_Data *wd = elm_widget_data_get(obj);
734 wd->layout.current = layout;
735 snprintf(buf, sizeof(buf), "layout,%s", layout);
736 edje_object_signal_emit(wd->slideshow, buf, "slideshow");
740 * Return if the first item should follow the last and vice versa
742 * @param obj The slideshow object
743 * @returns Returns the loop flag
748 elm_slideshow_loop_get(const Evas_Object *obj)
750 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
751 Widget_Data *wd = elm_widget_data_get(obj);
752 if (!wd) return EINA_FALSE;
757 * Delete all the items
759 * @param obj The slideshow object
764 elm_slideshow_clear(Evas_Object *obj)
766 Elm_Slideshow_Item *item;
767 ELM_CHECK_WIDTYPE(obj, widtype);
768 Widget_Data *wd = elm_widget_data_get(obj);
772 EINA_LIST_FREE(wd->items_built, item)
774 if (item->itc->func.del)
775 item->itc->func.del((void*)item->base.data, item->base.view);
776 evas_object_del(item->base.view);
777 item->base.view = NULL;
780 EINA_LIST_FREE(wd->items, item)
782 elm_widget_item_del(item);
789 * @param item The slideshow item
794 elm_slideshow_item_del(Elm_Slideshow_Item *item)
796 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item);
797 Widget_Data *wd = elm_widget_data_get(item->base.widget);
799 if (wd->previous == item) wd->previous = NULL;
800 if (wd->current == item)
802 Eina_List *l = eina_list_data_find_list(wd->items, item);
803 Eina_List *l2 = eina_list_next(l);
806 l2 = eina_list_nth_list(wd->items, eina_list_count(wd->items) - 1);
808 elm_slideshow_show(eina_list_data_get(l2));
811 wd->items = eina_list_remove_list(wd->items, item->l);
812 wd->items_built = eina_list_remove_list(wd->items_built, item->l_built);
814 if ((item->base.view) && (item->itc->func.del))
815 item->itc->func.del((void*)item->base.data, item->base.view);
817 evas_object_del(item->base.view);
822 * Returns the list of items
823 * @param obj The slideshow object
824 * @return Returns the list of items (list of Elm_Slideshow_Item).
828 EAPI const Eina_List *
829 elm_slideshow_items_get(const Evas_Object *obj)
831 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
832 Widget_Data *wd = elm_widget_data_get(obj);
833 if (!wd) return NULL;
838 * Returns the current item displayed
840 * @param obj The slideshow object
841 * @return Returns the current item displayed
845 EAPI Elm_Slideshow_Item *
846 elm_slideshow_item_current_get(const Evas_Object *obj)
848 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
849 Widget_Data *wd = elm_widget_data_get(obj);
850 if (!wd) return NULL;
855 * Returns the evas object associated to an item
857 * @param item The slideshow item
858 * @return Returns the evas object associated to this item
863 elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
865 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
866 return item->base.view;
870 * Returns the data associated to an item
872 * @param item The slideshow item
873 * @return Returns the data associated to this item
878 elm_slideshow_item_data_get(const Elm_Slideshow_Item * item)
880 ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL);
881 return elm_widget_item_data_get(item);
885 * Returns max amount of cached items before current
887 * @param obj The slideshow object
888 * @return Returns max amount of cached items
893 elm_slideshow_cache_before_get(const Evas_Object *obj)
895 ELM_CHECK_WIDTYPE(obj, widtype) -1;
896 Widget_Data *wd = elm_widget_data_get(obj);
898 return wd->count_item_pre_before;
902 * Set max amount of cached items before current
904 * @param obj The slideshow object
905 * @param count Max amount of cached items
910 elm_slideshow_cache_before_set(Evas_Object *obj, int count)
912 ELM_CHECK_WIDTYPE(obj, widtype);
913 Widget_Data *wd = elm_widget_data_get(obj);
915 if (count < 0) count = 0;
916 wd->count_item_pre_before = count;
920 * Returns max amount of cached items after current
922 * @param obj The slideshow object
923 * @return Returns max amount of cached items
928 elm_slideshow_cache_after_get(const Evas_Object *obj)
930 ELM_CHECK_WIDTYPE(obj, widtype) -1;
931 Widget_Data *wd = elm_widget_data_get(obj);
933 return wd->count_item_pre_after;
937 * Set max amount of cached items after current
939 * @param obj The slideshow object
940 * @param count max amount of cached items
945 elm_slideshow_cache_after_set(Evas_Object *obj, int count)
947 ELM_CHECK_WIDTYPE(obj, widtype);
948 Widget_Data *wd = elm_widget_data_get(obj);
950 if (count < 0) count = 0;
951 wd->count_item_pre_after = count;