3 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
7 #include <Elementary.h>
11 * @defgroup Imageslider Imageslider
14 * By flicking images on the screen,
15 * you can see the images in specific path.
18 typedef struct _Widget_Data Widget_Data;
20 #define ANI_STEP (14 * elm_scale_get())
21 #define ANI_TIME (0.005)
22 #define ANI_TIME_MSEC (12)
23 #define CLICK_TIME_MAX (180)
24 #define CLICK_WIDTH_MIN (elm_finger_size_get() >> 1)
25 #define FLICK_TIME_MAX (200)
26 #define FLICK_WIDTH_MIN (elm_finger_size_get() >> 2)
28 #define STEP_WEIGHT_DEF (1)
29 #define STEP_WEIGHT_MAX (2)
30 #define STEP_WEIGHT_MIN (0)
31 #define MOVING_IMAGE_SIZE (128)
32 #define MAX_ZOOM_SIZE (6)
33 #define INTERVAL_WIDTH (15)
34 #define MULTITOUCHDEVICE (11)
36 // Enumeration for layout.
46 struct _Imageslider_Item
49 const char *photo_file;
50 void (*func) (void *data, Evas_Object *obj, void *event_info);
54 // Image Slider Widget Data.
57 Evas_Object *ly[BLOCK_MAX];
61 Evas_Coord x, y, w, h;
63 Ecore_Idler *queue_idler;
64 Ecore_Timer *anim_timer;
66 Evas_Coord_Point down_pos;
71 unsigned int timestamp;
78 // Global value declaration.
79 static const char *widtype = NULL;
81 static const char SIG_CLICKED[] = "clicked";
83 // Internal function declaration.
84 static void _del_hook(Evas_Object *obj);
86 static void _theme_hook(Evas_Object *obj);
88 static void _sizing_eval(Evas_Object *obj);
90 static void _imageslider_move(void *data, Evas * e, Evas_Object *obj, void *event_info);
91 static void _imageslider_resize(void *data, Evas * e, Evas_Object *obj, void *event_info);
92 static void _imageslider_show(void *data, Evas * e, Evas_Object *obj, void *event_info);
93 static void _imageslider_hide(void *data, Evas * e, Evas_Object *obj, void *event_info);
94 static void _imageslider_update(Widget_Data * wd);
96 static void _imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w);
98 static void _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left);
100 static void _imageslider_obj_move(Widget_Data * wd, Evas_Coord step);
102 static Eina_Bool _icon_to_image(void *data);
104 static int _check_drag(int state, void *data);
106 static void _anim(Widget_Data * wd);
108 static Eina_Bool _timer_cb(void *data);
110 static void _ev_imageslider_down_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
111 static void _ev_imageslider_up_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
112 static void _ev_imageslider_move_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
114 // Whenever the Image Slider item is deleted, Call this funtion.
116 _del_hook(Evas_Object *obj)
122 wd = elm_widget_data_get(obj);
128 eina_list_free(wd->its);
134 ecore_idler_del(wd->queue_idler);
135 wd->queue_idler = NULL;
140 ecore_timer_del(wd->anim_timer);
141 wd->anim_timer = NULL;
148 // Whenever require processing theme, Call this function
150 _theme_hook(Evas_Object *obj)
153 Widget_Data *wd = elm_widget_data_get(obj);
157 for (i = 0; i < BLOCK_MAX; i++)
160 elm_layout_theme_set(wd->ly[i], "imageslider", "base",
161 elm_object_style_get(obj));
162 evas_object_show(wd->ly[i]);
164 _imageslider_update(wd);
168 // Resize Image Slider item.
170 _sizing_eval(Evas_Object *obj)
174 Widget_Data *wd = elm_widget_data_get(obj);
179 e = evas_object_evas_get(wd->obj);
181 _imageslider_move(obj, e, obj, NULL);
182 _imageslider_resize(obj, e, obj, NULL);
186 // Whenever MOVE event occurs, Call this function.
188 _imageslider_move(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
197 wd = elm_widget_data_get((Evas_Object *) data);
201 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
205 _imageslider_update_pos(wd, wd->x, wd->y, wd->w);
209 // Whenever RESIZE event occurs, Call this fucntion.
211 _imageslider_resize(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
222 wd = elm_widget_data_get((Evas_Object *) data);
226 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
227 DBG("%d %d -resize\n", w, h);
231 for (i = 0; i < BLOCK_MAX; i++)
233 evas_object_resize(wd->ly[i], w, h);
236 _imageslider_update_pos(wd, wd->x, wd->y, wd->w);
240 // Whenever SHOW event occurs, Call this function.
242 _imageslider_show(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
251 wd = elm_widget_data_get((Evas_Object *) data);
254 evas_object_show(wd->clip);
257 // Whenever HIDE event occurs, Call this function.
259 _imageslider_hide(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
265 wd = elm_widget_data_get((Evas_Object *) data);
267 evas_object_hide(wd->clip);
270 // Update Image Slider item position.
272 _imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w)
274 evas_object_move(wd->ly[BLOCK_LEFT], x - (w + INTERVAL_WIDTH), y);
275 evas_object_move(wd->ly[BLOCK_CENTER], x, y);
276 evas_object_move(wd->ly[BLOCK_RIGHT], x + (w + INTERVAL_WIDTH), y);
279 // Shift next/previous Image Slider item in layouts.
281 _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left)
285 Evas_Object *ly_temp;
286 ly_temp = wd->ly[BLOCK_LEFT];
287 wd->ly[BLOCK_LEFT] = wd->ly[BLOCK_CENTER];
288 wd->ly[BLOCK_CENTER] = wd->ly[BLOCK_RIGHT];
289 wd->ly[BLOCK_RIGHT] = ly_temp;
290 elm_layout_content_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
294 Evas_Object *ly_temp;
295 ly_temp = wd->ly[BLOCK_RIGHT];
296 wd->ly[BLOCK_RIGHT] = wd->ly[BLOCK_CENTER];
297 wd->ly[BLOCK_CENTER] = wd->ly[BLOCK_LEFT];
298 wd->ly[BLOCK_LEFT] = ly_temp;
299 elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
303 // Move the current Image Slider item and update.
305 _imageslider_obj_move(Widget_Data * wd, Evas_Coord step)
309 wd->cur = eina_list_next(wd->cur);
312 wd->cur = eina_list_last(wd->its);
317 wd->step = -ANI_STEP;
319 _imageslider_obj_shift(wd, EINA_FALSE);
321 wd->moving = EINA_TRUE;
325 wd->cur = eina_list_prev(wd->cur);
329 wd->step = -ANI_STEP;
335 _imageslider_obj_shift(wd, EINA_TRUE);
337 wd->moving = EINA_TRUE;
344 wd->step = -ANI_STEP;
345 wd->moving = EINA_FALSE;
348 _imageslider_update(wd);
351 // Whenever MOUSE DOWN event occurs, Call this function.
353 _ev_imageslider_down_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info)
355 Widget_Data *wd = data;
356 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
357 Evas_Event_Mouse_Down *ev = event_info;
358 Evas_Object *eo = NULL;
363 wd->down_pos = ev->canvas;
364 wd->timestamp = ev->timestamp;
365 wd->move_cnt = MOVE_STEP;
369 // Whenever MOUSE UP event occurs, Call this function.
370 // And make Click Event also.
372 _ev_imageslider_up_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
374 Widget_Data *wd = data;
376 Evas_Event_Mouse_Up *ev = event_info;
382 if (wd->ani_lock) return;
384 step = wd->down_pos.x - ev->canvas.x;
385 interval = ev->timestamp - wd->timestamp;
386 if (step == 0 || interval == 0)
388 DBG("case1: emit CLICK event\n");
389 evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
392 if (interval < CLICK_TIME_MAX)
394 if (step < CLICK_WIDTH_MIN && step > CLICK_WIDTH_MIN)
396 DBG("case2: emit CLICK event\n");
397 evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
402 if (interval < FLICK_TIME_MAX)
404 if (step < FLICK_WIDTH_MIN && step > FLICK_WIDTH_MIN)
406 DBG("ev_imageslider_up_cb-black zone (1)\n");
408 _imageslider_obj_move(wd, 0);
412 DBG("ev_imageslider_up_cb-black zone (2)\n");
414 _imageslider_obj_move(wd, step);
420 step = (wd->x - wd->move_x) << 1;
421 if (step <= wd->w && step >= -(wd->w))
423 DBG("ev_imageslider_up_cb-white zone (1)\n");
425 _imageslider_obj_move(wd, 0);
429 DBG("ev_imageslider_up_cb-white zone (2)\n");
431 _imageslider_obj_move(wd, step);
437 // Whenever MOUSE MOVE event occurs, Call this
439 _ev_imageslider_move_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info)
447 Widget_Data *wd = data;
449 Evas_Event_Mouse_Move *ev = event_info;
451 Elm_Imageslider_Item *it;
456 if (wd->move_cnt == MOVE_STEP)
462 step = ev->cur.canvas.x - wd->down_pos.x;
468 wd->move_x = wd->x + ((ev->cur.canvas.x - wd->down_pos.x));
469 wd->move_y = wd->y + ((ev->cur.canvas.y - wd->down_pos.y));
470 _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
478 time_get(Evas_Coord x, Evas_Coord w)
482 time = (-sin(x / w) + 1) / 500;
491 _icon_to_image(void *data)
493 Widget_Data *wd = data;
496 _imageslider_update(wd);
499 wd->queue_idler = NULL;
500 return ECORE_CALLBACK_CANCEL;
504 _check_drag(int state, void *data)
506 Widget_Data *wd = data;
508 Elm_Imageslider_Item *it;
510 Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
512 double dx = 0, dy = 0;
514 Eina_List *l[BLOCK_MAX];
516 Evas_Object *eo = NULL;
518 l[BLOCK_LEFT] = eina_list_prev(wd->cur);
519 l[BLOCK_CENTER] = wd->cur;
520 l[BLOCK_RIGHT] = eina_list_next(wd->cur);
522 it = eina_list_data_get(l[state]);
524 eo = (Evas_Object*)elm_layout_content_get(wd->ly[state], "swl.photo");
526 evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
527 edje_object_part_drag_value_get(elm_layout_edje_get(wd->ly[state]), "swl.photo", &dx, &dy);
529 if ((iw != wd->w) || ((dx != 0) || (dy != 0)))
531 elm_layout_content_set(wd->ly[state], "swl.photo", NULL);
540 _timer_cb(void *data)
544 Elm_Imageslider_Item *it;
553 if (wd->ani_lock == EINA_FALSE)
556 gettimeofday(&tv, NULL);
558 t = (tv.tv_sec - wd->tv.tv_sec) * 1000 + (tv.tv_usec - wd->tv.tv_usec) / 1000;
559 gettimeofday(&wd->tv, NULL);
561 t = t / ANI_TIME_MSEC;
562 if (t <= STEP_WEIGHT_MIN)
564 else if (t > STEP_WEIGHT_MAX)
567 wd->move_x += (wd->step) * t;
569 if (wd->step < 0 && wd->move_x < wd->x)
571 else if (wd->step > 0 && wd->move_x > wd->x)
574 _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
576 if (wd->move_x == wd->x)
578 wd->ani_lock = EINA_FALSE;
581 it = eina_list_data_get(wd->cur);
583 it->func(it->data, wd->obj, it);
587 it = eina_list_data_get(wd->cur);
588 evas_object_smart_callback_call(wd->obj, "changed", it);
591 ret = _check_drag(BLOCK_LEFT, wd);
592 ret = _check_drag(BLOCK_RIGHT, wd);
594 if (!wd->queue_idler)
595 wd->queue_idler = ecore_idler_add(_icon_to_image, wd);
598 wd->anim_timer = NULL;
600 return ECORE_CALLBACK_CANCEL;
603 return ECORE_CALLBACK_RENEW;
607 _anim(Widget_Data * wd)
611 if (wd->x == wd->move_x)
613 _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
617 wd->ani_lock = EINA_TRUE;
620 gettimeofday(&wd->tv, NULL);
623 wd->anim_timer = ecore_timer_add(ANI_TIME, _timer_cb, wd);
626 // Update Image Slider Items.
628 _imageslider_update(Widget_Data * wd)
632 Eina_List *l[BLOCK_MAX];
634 Elm_Imageslider_Item *it;
641 if (!wd->cur) return;
643 l[BLOCK_LEFT] = eina_list_prev(wd->cur);
644 l[BLOCK_CENTER] = wd->cur;
645 l[BLOCK_RIGHT] = eina_list_next(wd->cur);
647 for (i = 0; i < BLOCK_MAX; i++)
649 eo = (Evas_Object*)elm_layout_content_get((const Evas_Object*)wd->ly[i], "swl.photo");
652 elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
656 it = eina_list_data_get(l[i]);
662 eo = elm_image_add(wd->obj);
663 //elm_image_prescale_set(eo, wd->w);
664 elm_image_file_set(eo, it->photo_file, NULL);
665 elm_layout_content_set(wd->ly[i], "swl.photo", eo);
674 * Add an Image Slider widget
676 * @param parent The parent object
677 * @return The new Image slider object or NULL if it cannot be created
679 * @ingroup Imageslider
682 elm_imageslider_add(Evas_Object *parent)
690 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
692 ELM_SET_WIDTYPE(widtype, "imageslider");
693 elm_widget_type_set(obj, "imageslider");
694 elm_widget_sub_object_add(parent, obj);
695 elm_widget_data_set(obj, wd);
696 elm_widget_del_hook_set(obj, _del_hook);
697 elm_widget_theme_hook_set(obj, _theme_hook);
699 wd->clip = evas_object_rectangle_add(e);
700 elm_widget_sub_object_add(obj, wd->clip);
701 elm_widget_resize_object_set(obj, wd->clip);
703 for (i = 0; i < BLOCK_MAX; i++)
705 wd->ly[i] = elm_layout_add(obj);
706 elm_layout_theme_set(wd->ly[i], "imageslider", "base", "default");
707 elm_widget_sub_object_add(obj, wd->ly[i]);
708 evas_object_smart_member_add(wd->ly[i], obj);
710 evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_DOWN, _ev_imageslider_down_cb, wd);
711 evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_UP, _ev_imageslider_up_cb, wd);
712 evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_MOVE, _ev_imageslider_move_cb, wd);
713 evas_object_clip_set(wd->ly[i], wd->clip);
714 evas_object_show(wd->ly[i]);
719 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _imageslider_resize, obj);
720 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _imageslider_move, obj);
721 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _imageslider_show, obj);
722 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _imageslider_hide, obj);
730 * Append an Image Slider item
732 * @param obj The Image Slider object
733 * @param photo_file photo file path
734 * @param func callback function
735 * @param data callback data
736 * @return The Image Slider item handle or NULL
738 * @ingroup Imageslider
740 EAPI Elm_Imageslider_Item *
741 elm_imageslider_item_append(Evas_Object *obj, const char *photo_file, Elm_Imageslider_Cb func, void *data)
743 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
746 Elm_Imageslider_Item *it;
748 if (!obj || !(wd = elm_widget_data_get(obj)))
751 it = (Elm_Imageslider_Item *) calloc(1, sizeof(Elm_Imageslider_Item));
754 it->photo_file = eina_stringshare_add(photo_file);
758 wd->its = eina_list_append(wd->its, it);
763 _imageslider_update(wd);
769 * Insert an Image Slider item into the Image Slider Widget by using the given index.
771 * @param obj The Image Slider object
772 * @param photo_file photo file path
773 * @param func callback function
774 * @param index required position
775 * @param data callback data
776 * @return The Image Slider item handle or NULL
778 * @ingroup Imageslider
780 EAPI Elm_Imageslider_Item *
781 elm_imageslider_item_append_relative(Evas_Object *obj, const char *photo_file, Elm_Imageslider_Cb func, unsigned int index, void *data)
783 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
786 Elm_Imageslider_Item *it;
788 DBG("New elm_imageslider_item_append_relative()\n");
790 if (!obj || !(wd = elm_widget_data_get(obj)))
793 it = (Elm_Imageslider_Item *) calloc(1, sizeof(Elm_Imageslider_Item));
798 it->photo_file = eina_stringshare_add(photo_file);
803 eina_list_append_relative(wd->its, it, eina_list_nth(wd->its, index - 2));
808 _imageslider_update(wd);
814 * Prepend Image Slider item
816 * @param obj The Image Slider object
817 * @param photo_file photo file path
818 * @param func callback function
819 * @param data callback data
820 * @return The imageslider item handle or NULL
822 * @ingroup Imageslider
824 EAPI Elm_Imageslider_Item *
825 elm_imageslider_item_prepend(Evas_Object *obj, const char *photo_file, Elm_Imageslider_Cb func, void *data)
827 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
830 Elm_Imageslider_Item *it;
832 if (!obj || !(wd = elm_widget_data_get(obj)))
835 it = (Elm_Imageslider_Item *) calloc(1, sizeof(Elm_Imageslider_Item));
836 it->photo_file = eina_stringshare_add(photo_file);
840 wd->its = eina_list_prepend(wd->its, it);
845 _imageslider_update(wd);
851 * Delete the selected Image Slider item
853 * @param it The selected Image Slider item handle
855 * @ingroup Imageslider
858 elm_imageslider_item_del(Elm_Imageslider_Item * it)
862 Elm_Imageslider_Item *_it;
866 if (!it || !(wd = elm_widget_data_get(it->obj)))
869 EINA_LIST_FOREACH(wd->its, l, _it)
874 wd->cur = eina_list_prev(wd->cur);
875 wd->its = eina_list_remove(wd->its, it);
882 _imageslider_update(wd);
887 * Get the selected Image Slider item
889 * @param obj The Image Slider object
890 * @return The selected Image Slider item or NULL
892 * @ingroup Imageslider
894 EAPI Elm_Imageslider_Item *
895 elm_imageslider_selected_item_get(Evas_Object *obj)
897 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
900 if (!obj || (!(wd = elm_widget_data_get(obj))))
906 return eina_list_data_get(wd->cur);
910 * Get whether an Image Slider item is selected or not
912 * @param it the selected Image Slider item
913 * @return EINA_TRUE or EINA_FALSE
915 * @ingroup Imageslider
918 elm_imageslider_item_selected_get(Elm_Imageslider_Item * it)
922 if (!it || !it->obj || (!(wd = elm_widget_data_get(it->obj))))
928 if (eina_list_data_get(wd->cur) == it)
936 * Set the selected Image Slider item
938 * @param it The Imaga Slider item
940 * @ingroup Imageslider
943 elm_imageslider_item_selected_set(Elm_Imageslider_Item * it)
949 Elm_Imageslider_Item *_it;
955 if (!it || !it->obj || (!(wd = elm_widget_data_get(it->obj))))
958 EINA_LIST_FOREACH(wd->its, l, _it)
964 for (i = 0; i < BLOCK_MAX; i++)
966 eo = (Evas_Object*)elm_layout_content_get(wd->ly[i], "swl.photo");
969 elm_layout_content_set(wd->ly[i], "swl.photo", NULL);
973 _imageslider_update(wd);
978 * Get the photo file path of given Image Slider item
980 * @param it The Image Slider item
981 * @return The photo file path or NULL;
983 * @ingroup Imageslider
986 elm_imageslider_item_photo_file_get(Elm_Imageslider_Item * it)
988 if (!it) return NULL;
990 return it->photo_file;
994 * Sets the photo file path of given Image Slider item
996 * @param it The Image Slider item
997 * @param photo_file The photo file path or NULL;
999 * @ingroup Imageslider
1002 elm_imageslider_item_photo_file_set(Elm_Imageslider_Item *it, const char *photo_file)
1005 ELM_CHECK_WIDTYPE(it->obj, widtype);
1009 eina_stringshare_replace(&(it->photo_file), photo_file);
1010 elm_imageslider_item_update(it);
1015 * Get the previous Image Slider item
1017 * @param it The Image Slider item
1018 * @return The previous Image Slider item or NULL
1020 * @ingroup Imageslider
1022 EAPI Elm_Imageslider_Item *
1023 elm_imageslider_item_prev(Elm_Imageslider_Item * it)
1027 Elm_Imageslider_Item *_it;
1031 if (!it || (!(wd = elm_widget_data_get(it->obj))))
1034 EINA_LIST_FOREACH(wd->its, l, _it)
1038 l = eina_list_prev(l);
1041 return eina_list_data_get(l);
1049 * Get the next Image Slider item
1051 * @param it The Image Slider item
1052 * @return The next Image Slider item or NULL
1054 * @ingroup Imageslider
1056 EAPI Elm_Imageslider_Item *
1057 elm_imageslider_item_next(Elm_Imageslider_Item * it)
1061 Elm_Imageslider_Item *_it;
1065 if (!it || (!(wd = elm_widget_data_get(it->obj))))
1068 EINA_LIST_FOREACH(wd->its, l, _it)
1072 l = eina_list_next(l);
1075 return eina_list_data_get(l);
1083 * Move to the previous Image Slider item
1085 * @param obj The Image Slider object
1087 * @ingroup Imageslider
1090 elm_imageslider_prev(Evas_Object *obj)
1092 ELM_CHECK_WIDTYPE(obj, widtype);
1095 if (!obj || (!(wd = elm_widget_data_get(obj))))
1101 _imageslider_obj_move(wd, -1);
1105 * Move to the next Image Slider item
1107 * @param obj The Image Slider object
1109 * @ingroup Imageslider
1112 elm_imageslider_next(Evas_Object * obj)
1114 ELM_CHECK_WIDTYPE(obj, widtype);
1117 if (!obj || (!(wd = elm_widget_data_get(obj))))
1123 _imageslider_obj_move(wd, 1);
1128 * Updates an Image Slider item
1130 * @param it The Image Slider item
1132 * @ingroup Imageslider
1135 elm_imageslider_item_update(Elm_Imageslider_Item *it)
1139 if (!it || (!(wd = elm_widget_data_get(it->obj)))) return;
1140 ELM_CHECK_WIDTYPE(it->obj, widtype);
1142 if (wd->ani_lock == EINA_TRUE) return;
1143 if (it == eina_list_data_get(eina_list_prev(wd->cur)))
1144 elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
1145 else if (it == eina_list_data_get(wd->cur))
1146 elm_layout_content_set(wd->ly[BLOCK_CENTER], "swl.photo", NULL);
1147 else if (it == eina_list_data_get(eina_list_next(wd->cur)))
1148 elm_layout_content_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
1149 _imageslider_update(wd);