1 #include <Elementary.h>
5 * @defgroup Transit Transit
8 * Transit is designed to set the various effects for the Evas_Object such like translation,
9 * rotation, etc. For using Effects, Create transit and insert the some of effects which are
10 * interested. Each effects has the type of Elm_Effect and those can be inserted into transit.
11 * Once effects are inserted into transit, transit will manage those effects.(ex) deleting).
16 Elm_Animator *animator;
17 Eina_List *effect_list;
18 Evas_Object *block_rect;
19 void (*completion_op) (void *data, Elm_Transit *transit);
21 Eina_Bool reserved_del:1;
26 void (*animation_op) (void *data, Elm_Animator *animator, double frame);
27 void (*begin_op) (void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt);
28 void (*end_op) (void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt);
29 void (*del_op) (void* data);
30 unsigned int shared_cnt;
34 static Evas_Object *_create_block_rect(Evas_Object *parent);
35 static void _transit_animate_cb(void *data, Elm_Animator *animator,
37 static void _transit_fx_begin(Elm_Transit *transit);
38 static void _transit_fx_end(Elm_Transit *transit);
39 static void _transit_complete_cb(void *data);
40 static void _transit_fx_del(Elm_Effect *effect);
41 //static void _transit_parent_del(void *data);
45 _animator_parent_del(void *data)
47 Elm_Transit *transit = data;
48 elm_transit_del(data);
53 _create_block_rect(Evas_Object *parent)
59 rect = evas_object_rectangle_add(evas_object_evas_get(parent));
60 evas_output_size_get(evas_object_evas_get(parent), &w, &h);
61 evas_object_resize(rect, w, h);
62 evas_object_color_set(rect, 0, 0, 0, 0);
67 _transit_animate_cb(void *data, Elm_Animator *animator, double frame)
73 Elm_Transit *transit = data;
75 EINA_LIST_FOREACH(transit->effect_list, elist, effect)
77 effect->animation_op(effect->user_data, animator, frame);
82 _transit_fx_begin(Elm_Transit *transit)
88 Eina_Bool auto_reverse;
90 unsigned int repeat_cnt;
92 auto_reverse = elm_animator_auto_reverse_get(transit->animator);
93 repeat_cnt = elm_animator_repeat_get(transit->animator);
95 EINA_LIST_FOREACH(transit->effect_list, elist, effect)
98 effect->begin_op(effect->user_data, auto_reverse, repeat_cnt);
103 _transit_fx_end(Elm_Transit *transit)
109 Eina_Bool auto_reverse;
111 unsigned int repeat_cnt;
113 auto_reverse = elm_animator_auto_reverse_get(transit->animator);
114 repeat_cnt = elm_animator_repeat_get(transit->animator);
116 EINA_LIST_FOREACH(transit->effect_list, elist, effect)
119 effect->end_op(effect->user_data, auto_reverse, repeat_cnt);
124 _transit_complete_cb(void *data)
126 Elm_Transit *transit = (Elm_Transit *) data;
128 evas_render(evas_object_evas_get(transit->parent));
130 _transit_fx_end(transit);
132 if (transit->block_rect)
133 evas_object_hide(transit->block_rect);
135 if (transit->completion_op)
136 transit->completion_op(transit->completion_arg, transit);
138 if (transit->reserved_del)
140 transit->reserved_del = EINA_FALSE;
141 elm_transit_del(transit);
146 _transit_fx_del(Elm_Effect *effect)
151 --effect->shared_cnt;
153 if (effect->shared_cnt > 0)
157 (*effect->del_op)(effect->user_data);
159 if (effect->user_data)
160 free(effect->user_data);
165 * Set the event blocked when transit is operating.
167 * @param[in] transit Transit object
168 * @param[in] disabled Disable or enable
173 elm_transit_event_block_disabled_set(Elm_Transit *transit, Eina_Bool disabled)
180 if (transit->block_rect)
182 evas_object_del(transit->block_rect);
183 transit->block_rect = NULL;
188 if (!transit->block_rect)
189 transit->block_rect = _create_block_rect(transit->parent);
194 * Get the value of event blockd status.
196 * @param[in] transit Transit
197 * @return EINA_TRUE, when event block is disabled
202 elm_transit_event_block_disabled_get(Elm_Transit *transit)
206 return transit->block_rect ? EINA_TRUE : EINA_FALSE;
210 * Remove effect from transit.
212 * @param[in] transit Transit
213 * @param[in] effect Effect to be removed
214 * @return EINA_TRUE, if the effect is removed
215 * @warning If removed effect does not inserted in any transit, it will be deleted.
220 elm_transit_fx_remove(Elm_Transit *transit, Elm_Effect *effect)
229 EINA_LIST_FOREACH(transit->effect_list, elist, _effect)
231 if (_effect == effect)
233 transit->effect_list =
234 eina_list_remove(transit->effect_list, _effect);
235 _transit_fx_del(_effect);
243 * Remove all current inserted effects.
245 * @param[in] transit Transit
250 elm_transit_fx_clear(Elm_Transit *transit)
259 EINA_LIST_FOREACH(transit->effect_list, elist, effect)
261 transit->effect_list = eina_list_remove(transit->effect_list, effect);
262 _transit_fx_del(effect);
267 * Get the list of current inseted effects.
269 * @param[in] transit Transit
270 * @return Effect list
274 EAPI const Eina_List *
275 elm_transit_fx_get(Elm_Transit *transit)
279 return transit->effect_list;
283 * Set the user-callback function when the transit operation is done.
285 * @param[in] transit Transit
286 * @param[in] op Callback function pointer
287 * @param[in] data Callback funtion user data
292 elm_transit_completion_callback_set(Elm_Transit *transit,
293 void (*op) (void *data,
294 Elm_Transit *transit),
299 transit->completion_op = op;
300 transit->completion_arg = data;
306 * @param[in] transit Transit to be deleted
311 elm_transit_del(Elm_Transit *transit)
315 if (elm_animator_operating_get(transit->animator))
317 transit->reserved_del = EINA_TRUE;
321 if (transit->block_rect)
322 evas_object_del(transit->block_rect);
324 elm_animator_del(transit->animator);
325 elm_transit_fx_clear(transit);
327 // if(transit->parent)
329 // evas_object_event_callback_del(transit->parent, EVAS_CALLBACK_DEL, _transit_parent_del);
336 * Set the transit animation acceleration style.
338 * @param transit Transit
339 * @param cs Curve style(Please refer elm_animator_curve_style_set)
344 elm_transit_curve_style_set(Elm_Transit *transit, Elm_Animator_Curve_Style cs)
348 elm_animator_curve_style_set(transit->animator, cs);
355 * @param[in] parent Parent object
361 elm_transit_add(Evas_Object *parent)
363 Elm_Transit *transit = calloc(1, sizeof(Elm_Transit));
368 transit->animator = elm_animator_add(parent);
370 if (!transit->animator)
376 transit->parent = parent;
377 elm_animator_operation_callback_set(transit->animator, _transit_animate_cb,
379 elm_animator_completion_callback_set(transit->animator, _transit_complete_cb,
381 elm_transit_event_block_disabled_set(transit, EINA_FALSE);
385 evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL, _transit_parent_del,
393 * Set reverse effect automatically.
395 * @param[in] transit Transit
396 * @param[in] reverse EINA_TRUE is reverse.
401 elm_transit_auto_reverse_set(Elm_Transit *transit, Eina_Bool reverse)
405 elm_animator_auto_reverse_set(transit->animator, reverse);
409 * Insert an effect into the transit.
411 * @param[in] transit Transit
412 * @param[in] effect Effect to be inserted
413 * @return EINA_TRUE is success
418 elm_transit_fx_insert(Elm_Transit *transit, Elm_Effect *effect)
427 EINA_LIST_FOREACH(transit->effect_list, elist, _effect)
429 if (_effect == effect)
433 ++effect->shared_cnt;
434 transit->effect_list = eina_list_append(transit->effect_list, effect);
440 * Set the transit repeat count. Effect will be repeated by repeat count.
442 * @param[in] transit Transit
443 * @param[in] repeat Repeat count
448 elm_transit_repeat_set(Elm_Transit *transit, unsigned int repeat)
452 elm_animator_repeat_set(transit->animator, repeat);
456 * Stop the current transit, if the transit is operating.
458 * @param[in] transit Transit
463 elm_transit_stop(Elm_Transit *transit)
467 elm_animator_stop(transit->animator);
471 * Run the all the inserted effects.
473 * @param[in] transit Transit
474 * @param[in] duration Transit time in seconds
479 elm_transit_run(Elm_Transit *transit, double duration)
483 _transit_fx_begin(transit);
484 elm_animator_duration_set(transit->animator, duration);
487 if (transit->block_rect)
488 evas_object_show(transit->block_rect);
490 elm_animator_animate(transit->animator);
492 //If failed to animate.
493 if (!elm_animator_operating_get(transit->animator))
495 if (transit->block_rect)
496 evas_object_hide(transit->block_rect);
497 _transit_fx_end(transit);
504 * @param[in] transit Transit
509 elm_transit_pause(Elm_Transit *transit)
514 elm_animator_pause(transit->animator);
520 * @param[in] transit Transit
525 elm_transit_resume(Elm_Transit *transit)
530 elm_animator_resume(transit->animator);
535 /////////////////////////////////////////////////////////////////////////////////////
537 /////////////////////////////////////////////////////////////////////////////////////
538 typedef struct _resizing Elm_Fx_Resizing;
539 static void _elm_fx_resizing_op(void *data, Elm_Animator *animator,
541 static void _elm_fx_resizing_begin(void *data, Eina_Bool auto_reverse,
542 unsigned int repeat_cnt);
554 _elm_fx_resizing_begin(void *data, Eina_Bool auto_reverse,
555 unsigned int repeat_cnt)
557 Elm_Fx_Resizing *resizing = data;
559 evas_object_show(resizing->obj);
560 evas_object_resize(resizing->obj, resizing->from.w, resizing->from.h);
564 _elm_fx_resizing_op(void *data, Elm_Animator *animator, double frame)
568 Elm_Fx_Resizing *resizing = data;
570 w = resizing->from.w + (Evas_Coord) ((float)resizing->to.h * (float)frame);
571 h = resizing->from.h + (Evas_Coord) ((float)resizing->to.w * (float)frame);
572 evas_object_resize(resizing->obj, w, h);
576 * Add Resizing effect.
578 * @param[in] obj Evas_Object that effect is applying to
579 * @param[in] from_w Object width size when effect begins
580 * @param[in] from_h Object height size when effect begins
581 * @param[in] to_w Object width size when effect ends
582 * @param[in] to_h Object height size when effect ends
583 * @return Resizing effect
588 elm_fx_resizing_add(Evas_Object *obj, Evas_Coord from_w, Evas_Coord from_h,
589 Evas_Coord to_w, Evas_Coord to_h)
593 Elm_Fx_Resizing *resizing;
598 effect = calloc(1, sizeof(Elm_Effect));
602 resizing = calloc(1, sizeof(Elm_Fx_Resizing));
610 resizing->from.w = from_w;
611 resizing->from.h = from_h;
612 resizing->to.w = to_w - from_w;
613 resizing->to.h = to_h - from_h;
615 effect->begin_op = _elm_fx_resizing_begin;
616 effect->animation_op = _elm_fx_resizing_op;
617 effect->user_data = resizing;
622 /////////////////////////////////////////////////////////////////////////////////////
624 /////////////////////////////////////////////////////////////////////////////////////
625 typedef struct _translation Elm_Fx_Translation;
626 static void _elm_fx_translation_op(void *data, Elm_Animator *animator,
628 static void _elm_fx_translation_begin(void *data, Eina_Bool auto_reverse,
629 unsigned int repeat_cnt);
630 static void _elm_fx_translation_end(void *data, Eina_Bool auto_reverse,
631 unsigned int repeat_cnt);
643 _elm_fx_translation_begin(void *data, Eina_Bool auto_reverse,
644 unsigned int repeat_cnt)
646 Elm_Fx_Translation *translation = data;
648 evas_object_show(translation->obj);
649 evas_object_move(translation->obj, translation->from.x, translation->from.y);
653 _elm_fx_translation_end(void *data, Eina_Bool auto_reverse,
654 unsigned int repeat_cnt)
656 Elm_Fx_Translation *translation = data;
658 evas_object_move(translation->obj, translation->from.x + translation->to.x,
659 translation->from.y + translation->to.y);
663 _elm_fx_translation_op(void *data, Elm_Animator *animator, double frame)
667 Elm_Fx_Translation *translation = data;
669 x = translation->from.x +
670 (Evas_Coord) ((float)translation->to.x * (float)frame);
671 y = translation->from.y +
672 (Evas_Coord) ((float)translation->to.y * (float)frame);
673 evas_object_move(translation->obj, x, y);
677 * Add Translation effect.
679 * @param[in] obj Evas_Object that effect is applying to
680 * @param[in] from_x Position X when effect begins
681 * @param[in] from_y Position Y when effect begins
682 * @param[in] to_x Position X when effect ends
683 * @param[in] to_y Position Y when effect ends
684 * @return Translation effect
689 elm_fx_translation_add(Evas_Object *obj, Evas_Coord from_x, Evas_Coord from_y,
690 Evas_Coord to_x, Evas_Coord to_y)
694 Elm_Fx_Translation *translation;
699 effect = calloc(1, sizeof(Elm_Effect));
703 translation = calloc(1, sizeof(Elm_Fx_Translation));
711 translation->obj = obj;
712 translation->from.x = from_x;
713 translation->from.y = from_y;
714 translation->to.x = to_x - from_x;
715 translation->to.y = to_y - from_y;
717 effect->begin_op = _elm_fx_translation_begin;
718 effect->end_op = _elm_fx_translation_end;
719 effect->animation_op = _elm_fx_translation_op;
720 effect->user_data = translation;
725 /////////////////////////////////////////////////////////////////////////////////////
727 /////////////////////////////////////////////////////////////////////////////////////
728 typedef struct _zoom Elm_Fx_Zoom;
729 static void _elm_fx_zoom_op(void *data, Elm_Animator * animator,
731 static void _elm_fx_zoom_begin(void *data, Eina_Bool reverse,
732 unsigned int repeat);
733 static void _elm_fx_zoom_end(void *data, Eina_Bool reverse,
734 unsigned int repeat);
743 _elm_fx_zoom_begin(void *data, Eina_Bool reverse, unsigned int repeat)
745 Elm_Fx_Zoom *zoom = data;
747 evas_object_show(zoom->obj);
748 _elm_fx_zoom_op(data, NULL, 0);
752 _elm_fx_zoom_end(void *data, Eina_Bool reverse, unsigned int repeat)
754 Elm_Fx_Zoom *zoom = data;
756 evas_object_map_enable_set(zoom->obj, EINA_FALSE);
760 _elm_fx_zoom_op(void *data, Elm_Animator *animator, double frame)
766 Evas_Coord x, y, w, h;
768 map = evas_map_new(4);
773 evas_object_geometry_get(zoom->obj, &x, &y, &w, &h);
774 evas_map_smooth_set(map, EINA_TRUE);
775 evas_map_util_points_populate_from_object_full(map, zoom->obj,
778 evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, 10000);
779 evas_object_map_set(zoom->obj, map);
780 evas_object_map_enable_set(zoom->obj, EINA_TRUE);
787 * @param[in] obj Evas_Object that effect is applying to
788 * @param[in] from_rate Scale rate when effect begins (1 is current rate)
789 * @param[in] to_rate Scale rate when effect ends
790 * @return Zoom effect
795 elm_fx_zoom_add(Evas_Object *obj, float from_rate, float to_rate)
804 effect = calloc(1, sizeof(Elm_Effect));
808 zoom = calloc(1, sizeof(Elm_Fx_Zoom));
816 zoom->from = (10000 - (from_rate * 10000)) * (1 / from_rate);
817 zoom->to = ((10000 - (to_rate * 10000)) * (1 / to_rate)) - zoom->from;
818 effect->begin_op = _elm_fx_zoom_begin;
819 effect->end_op = _elm_fx_zoom_end;
820 effect->animation_op = _elm_fx_zoom_op;
821 effect->user_data = zoom;
827 /////////////////////////////////////////////////////////////////////////////////////
829 /////////////////////////////////////////////////////////////////////////////////////
830 typedef struct _flip Elm_Fx_Flip;
831 static void _elm_fx_flip_op(void *data, Elm_Animator *animator,
833 static void _elm_fx_flip_end(void *data, Eina_Bool auto_reverse,
834 unsigned int repeat_cnt);
840 Elm_Fx_Flip_Axis axis;
845 _elm_fx_flip_end(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
847 Elm_Fx_Flip *flip = data;
849 evas_object_map_enable_set(flip->front, EINA_FALSE);
850 evas_object_map_enable_set(flip->back, EINA_FALSE);
854 _elm_fx_flip_op(void *data, Elm_Animator *animator, double frame)
864 Evas_Coord x, y, w, h;
866 map = evas_map_new(4);
873 degree = (float)(frame * 180);
875 degree = (float)(frame * -180);
877 if (degree < 90 && degree > -90)
880 if(flip->back != flip->front) {
881 evas_object_hide(flip->back);
882 evas_object_show(flip->front);
888 if(flip->back != flip->front) {
889 evas_object_hide(flip->front);
890 evas_object_show(flip->back);
894 evas_map_smooth_set(map, EINA_TRUE);
895 evas_map_util_points_populate_from_object_full(map, obj, 0);
896 evas_object_geometry_get(obj, &x, &y, &w, &h);
897 Evas_Coord half_w = (w / 2);
899 Evas_Coord half_h = (h / 2);
901 if (flip->axis == ELM_FX_FLIP_AXIS_Y)
903 if ((degree >= 90) || (degree <= -90))
905 evas_map_point_image_uv_set(map, 0, w, 0);
906 evas_map_point_image_uv_set(map, 1, 0, 0);
907 evas_map_point_image_uv_set(map, 2, 0, h);
908 evas_map_point_image_uv_set(map, 3, w, h);
910 evas_map_util_3d_rotate(map, 0, degree, 0, x + half_w, y + half_h, 0);
914 if ((degree >= 90) || (degree <= -90))
916 evas_map_point_image_uv_set(map, 0, 0, h);
917 evas_map_point_image_uv_set(map, 1, w, h);
918 evas_map_point_image_uv_set(map, 2, w, 0);
919 evas_map_point_image_uv_set(map, 3, 0, 0);
921 evas_map_util_3d_rotate(map, degree, 0, 0, x + half_w, y + half_h, 0);
923 evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, 10000);
924 evas_object_map_enable_set(flip->front, EINA_TRUE);
925 evas_object_map_enable_set(flip->back, EINA_TRUE);
926 evas_object_map_set(obj, map);
933 * @param[in] front Front surface object
934 * @param[in] back Back surface object
935 * @param[in] axis Flipping Axis(X or Y)
936 * @param[in] cw Flipping Direction. EINA_TRUE is clock-wise
937 * @return Flip effect
942 elm_fx_flip_add(Evas_Object *front, Evas_Object *back, Elm_Fx_Flip_Axis axis,
949 if ((!front) || (!back))
952 effect = calloc(1, sizeof(Elm_Effect));
956 flip = calloc(1, sizeof(Elm_Fx_Flip));
968 effect->end_op = _elm_fx_flip_end;
969 effect->animation_op = _elm_fx_flip_op;
970 effect->user_data = flip;
975 /////////////////////////////////////////////////////////////////////////////////////
977 /////////////////////////////////////////////////////////////////////////////////////
978 typedef struct _resizable_flip Elm_Fx_ResizableFlip;
979 static void _elm_fx_resizable_flip_begin(void *data, Eina_Bool reverse,
980 unsigned int repeat);
981 static void _elm_fx_resizable_flip_end(void *data, Eina_Bool auto_reverse,
982 unsigned int repeat_cnt);
983 static void _elm_fx_resizable_flip_op(void *data, Elm_Animator *animator,
985 static void _set_image_uv_by_axis_y(Evas_Map *map, Elm_Fx_ResizableFlip *flip,
987 static void _set_image_uv_by_axis_x(Evas_Map *map, Elm_Fx_ResizableFlip *flip,
990 struct _resizable_flip
994 Elm_Fx_Flip_Axis axis;
998 } from_pos, from_size, to_pos, to_size;
1003 _elm_fx_resizable_flip_begin(void *data, Eina_Bool reverse, unsigned int repeat)
1005 Elm_Fx_ResizableFlip *resizable_flip = data;
1007 evas_object_show(resizable_flip->front);
1008 _elm_fx_resizable_flip_op(data, NULL, 0);
1012 _elm_fx_resizable_flip_end(void *data, Eina_Bool auto_reverse,
1013 unsigned int repeat_cnt)
1015 Elm_Fx_ResizableFlip *resizable_flip = data;
1017 evas_object_map_enable_set(resizable_flip->front, EINA_FALSE);
1018 evas_object_map_enable_set(resizable_flip->back, EINA_FALSE);
1022 _set_image_uv_by_axis_y(Evas_Map *map, Elm_Fx_ResizableFlip *flip,
1025 if ((degree >= 90) || (degree <= -90))
1027 evas_map_point_image_uv_set(map, 0,
1028 (flip->from_size.x * 2) + flip->to_size.x,
1030 evas_map_point_image_uv_set(map, 1, 0, 0);
1031 evas_map_point_image_uv_set(map, 2, 0,
1032 (flip->from_size.y * 2) + flip->to_size.y);
1033 evas_map_point_image_uv_set(map, 3,
1034 (flip->from_size.x * 2) + flip->to_size.x,
1035 (flip->from_size.y * 2) + flip->to_size.y);
1039 evas_map_point_image_uv_set(map, 0, 0, 0);
1040 evas_map_point_image_uv_set(map, 1, flip->from_size.x, 0);
1041 evas_map_point_image_uv_set(map, 2, flip->from_size.x,
1043 evas_map_point_image_uv_set(map, 3, 0, flip->from_size.y);
1048 _set_image_uv_by_axis_x(Evas_Map *map, Elm_Fx_ResizableFlip *flip,
1051 if ((degree >= 90) || (degree <= -90))
1053 evas_map_point_image_uv_set(map, 0, 0,
1054 (flip->from_size.y * 2) + flip->to_size.y);
1055 evas_map_point_image_uv_set(map, 1,
1056 (flip->from_size.x * 2) + flip->to_size.x,
1057 (flip->from_size.y * 2) + flip->to_size.y);
1058 evas_map_point_image_uv_set(map, 2,
1059 (flip->from_size.x * 2) + flip->to_size.x,
1061 evas_map_point_image_uv_set(map, 3, 0, 0);
1065 evas_map_point_image_uv_set(map, 0, 0, 0);
1066 evas_map_point_image_uv_set(map, 1, flip->from_size.x, 0);
1067 evas_map_point_image_uv_set(map, 2, flip->from_size.x,
1069 evas_map_point_image_uv_set(map, 3, 0, flip->to_size.y);
1074 _elm_fx_resizable_flip_op(void *data, Elm_Animator *animator, double frame)
1076 Elm_Fx_ResizableFlip *resizable_flip;
1086 Evas_Coord half_w, half_h;
1088 map = evas_map_new(4);
1092 resizable_flip = data;
1094 if (resizable_flip->cw)
1095 degree = (float)(frame * 180);
1097 degree = (float)(frame * -180);
1099 if ((degree < 90) && (degree > -90))
1101 obj = resizable_flip->front;
1102 if(resizable_flip->back != resizable_flip->front) {
1103 evas_object_hide(resizable_flip->back);
1104 evas_object_show(resizable_flip->front);
1109 obj = resizable_flip->back;
1110 if(resizable_flip->back != resizable_flip->front) {
1111 evas_object_hide(resizable_flip->front);
1112 evas_object_show(resizable_flip->back);
1115 evas_map_smooth_set(map, EINA_TRUE);
1117 x = resizable_flip->from_pos.x + (resizable_flip->to_pos.x * frame);
1118 y = resizable_flip->from_pos.y + (resizable_flip->to_pos.y * frame);
1119 w = resizable_flip->from_size.x + (resizable_flip->to_size.x * frame);
1120 h = resizable_flip->from_size.y + (resizable_flip->to_size.y * frame);
1121 evas_map_point_coord_set(map, 0, x, y, 0);
1122 evas_map_point_coord_set(map, 1, x + w, y, 0);
1123 evas_map_point_coord_set(map, 2, x + w, y + h, 0);
1124 evas_map_point_coord_set(map, 3, x, y + h, 0);
1126 half_w = (Evas_Coord) (w / 2);
1127 half_h = (Evas_Coord) (h / 2);
1129 if (resizable_flip->axis == ELM_FX_FLIP_AXIS_Y)
1131 _set_image_uv_by_axis_y(map, resizable_flip, degree);
1132 evas_map_util_3d_rotate(map, 0, degree, 0, x + half_w, y + half_h, 0);
1136 _set_image_uv_by_axis_x(map, resizable_flip, degree);
1137 evas_map_util_3d_rotate(map, degree, 0, 0, x + half_w, y + half_h, 0);
1140 evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, 10000);
1141 evas_object_map_enable_set(resizable_flip->front, EINA_TRUE);
1142 evas_object_map_enable_set(resizable_flip->back, EINA_TRUE);
1143 evas_object_map_set(obj, map);
1148 * Add ResizbleFlip effect. the size of each surface objects are interpolated automatically.
1150 * @param[in] front Front surface object
1151 * @param[in] back Back surface object
1152 * @param[in] axis Flipping Axis.(X or Y)
1153 * @param[in] cw Flipping Direction. EINA_TRUE is clock-wise
1154 * @return Flip effect
1159 elm_fx_resizable_flip_add(Evas_Object *front, Evas_Object *back,
1160 Elm_Fx_Flip_Axis axis, Eina_Bool cw)
1162 Elm_Fx_ResizableFlip *resizable_flip;
1166 Evas_Coord front_x, front_y, front_w, front_h;
1168 Evas_Coord back_x, back_y, back_w, back_h;
1170 if (!front || !back)
1173 effect = calloc(1, sizeof(Elm_Effect));
1177 resizable_flip = calloc(1, sizeof(Elm_Fx_ResizableFlip));
1179 if (!resizable_flip)
1185 resizable_flip->front = front;
1186 resizable_flip->back = back;
1187 resizable_flip->cw = cw;
1188 resizable_flip->axis = axis;
1190 evas_object_geometry_get(resizable_flip->front, &front_x, &front_y, &front_w,
1192 evas_object_geometry_get(resizable_flip->back, &back_x, &back_y, &back_w,
1195 resizable_flip->from_pos.x = front_x;
1196 resizable_flip->from_pos.y = front_y;
1197 resizable_flip->to_pos.x = back_x - front_x;
1198 resizable_flip->to_pos.y = back_y - front_y;
1200 resizable_flip->from_size.x = front_w;
1201 resizable_flip->from_size.y = front_h;
1202 resizable_flip->to_size.x = back_w - front_w;
1203 resizable_flip->to_size.y = back_h - front_h;
1205 effect->begin_op = _elm_fx_resizable_flip_begin;
1206 effect->end_op = _elm_fx_resizable_flip_end;
1207 effect->animation_op = _elm_fx_resizable_flip_op;
1208 effect->user_data = resizable_flip;
1213 /////////////////////////////////////////////////////////////////////////////////////
1215 /////////////////////////////////////////////////////////////////////////////////////
1216 typedef struct _wipe Elm_Fx_Wipe;
1217 static void _elm_fx_wipe_op(void *data, Elm_Animator *animator,
1219 static void _elm_fx_wipe_begin(void *data, Eina_Bool auto_repeat,
1220 unsigned int repeat_cnt);
1221 static void _elm_fx_wipe_end(void *data, Eina_Bool auto_repeat,
1222 unsigned int repeat_cnt);
1223 static void _elm_fx_wipe_hide(Evas_Map * map, Elm_Fx_Wipe_Dir dir,
1224 float x, float y, float w, float h, float frame);
1225 static void _elm_fx_wipe_show(Evas_Map *map, Elm_Fx_Wipe_Dir dir,
1226 float x, float y, float w, float h, float frame);
1231 Elm_Fx_Wipe_Type type;
1232 Elm_Fx_Wipe_Dir dir;
1236 _elm_fx_wipe_begin(void *data, Eina_Bool auto_repeat, unsigned int repeat_cnt)
1238 Elm_Fx_Wipe *wipe = data;
1240 evas_object_show(wipe->obj);
1241 _elm_fx_wipe_op(data, NULL, 0);
1245 _elm_fx_wipe_end(void *data, Eina_Bool auto_repeat, unsigned int repeat_cnt)
1247 Elm_Fx_Wipe *wipe = data;
1249 evas_object_map_enable_set(wipe->obj, EINA_FALSE);
1253 _elm_fx_wipe_hide(Evas_Map * map, Elm_Fx_Wipe_Dir dir, float x, float y,
1254 float w, float h, float frame)
1260 case ELM_FX_WIPE_DIR_UP:
1262 h2 = y + h - (h * frame);
1263 evas_map_point_image_uv_set(map, 0, 0, 0);
1264 evas_map_point_image_uv_set(map, 1, w, 0);
1265 evas_map_point_image_uv_set(map, 2, w, h2);
1266 evas_map_point_image_uv_set(map, 3, 0, h2);
1267 evas_map_point_coord_set(map, 0, x, y, 0);
1268 evas_map_point_coord_set(map, 1, w2, y, 0);
1269 evas_map_point_coord_set(map, 2, w2, h2, 0);
1270 evas_map_point_coord_set(map, 3, x, h2, 0);
1272 case ELM_FX_WIPE_DIR_LEFT:
1273 w2 = w - (w * frame);
1275 evas_map_point_image_uv_set(map, 0, 0, 0);
1276 evas_map_point_image_uv_set(map, 1, w2, 0);
1277 evas_map_point_image_uv_set(map, 2, w2, h);
1278 evas_map_point_image_uv_set(map, 3, 0, h);
1279 evas_map_point_coord_set(map, 0, x, y, 0);
1280 evas_map_point_coord_set(map, 1, x + w2, y, 0);
1281 evas_map_point_coord_set(map, 2, x + w2, h2, 0);
1282 evas_map_point_coord_set(map, 3, x, h2, 0);
1284 case ELM_FX_WIPE_DIR_RIGHT:
1287 evas_map_point_image_uv_set(map, 0, w2, 0);
1288 evas_map_point_image_uv_set(map, 1, w, 0);
1289 evas_map_point_image_uv_set(map, 2, w, h);
1290 evas_map_point_image_uv_set(map, 3, w2, h);
1291 evas_map_point_coord_set(map, 0, x + w2, y, 0);
1292 evas_map_point_coord_set(map, 1, x + w, y, 0);
1293 evas_map_point_coord_set(map, 2, x + w, h2, 0);
1294 evas_map_point_coord_set(map, 3, x + w2, h2, 0);
1296 case ELM_FX_WIPE_DIR_DOWN:
1299 evas_map_point_image_uv_set(map, 0, 0, h2);
1300 evas_map_point_image_uv_set(map, 1, w, h2);
1301 evas_map_point_image_uv_set(map, 2, w, h);
1302 evas_map_point_image_uv_set(map, 3, 0, h);
1303 evas_map_point_coord_set(map, 0, x, y + h2, 0);
1304 evas_map_point_coord_set(map, 1, w2, y + h2, 0);
1305 evas_map_point_coord_set(map, 2, w2, y + h, 0);
1306 evas_map_point_coord_set(map, 3, x, y + h, 0);
1307 fprintf(stderr, "%f %f %f %f\n", x, y, w, h);
1313 evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, 10000);
1317 _elm_fx_wipe_show(Evas_Map *map, Elm_Fx_Wipe_Dir dir, float x, float y,
1318 float w, float h, float frame)
1324 case ELM_FX_WIPE_DIR_UP:
1326 h2 = (h - (h * frame));
1327 evas_map_point_image_uv_set(map, 0, 0, h2);
1328 evas_map_point_image_uv_set(map, 1, w, h2);
1329 evas_map_point_image_uv_set(map, 2, w, h);
1330 evas_map_point_image_uv_set(map, 3, 0, h);
1331 evas_map_point_coord_set(map, 0, x, y + h2, 0);
1332 evas_map_point_coord_set(map, 1, w2, y + h2, 0);
1333 evas_map_point_coord_set(map, 2, w2, y + h, 0);
1334 evas_map_point_coord_set(map, 3, x, y + h, 0);
1336 case ELM_FX_WIPE_DIR_LEFT:
1337 w2 = (w - (w * frame));
1339 evas_map_point_image_uv_set(map, 0, w2, 0);
1340 evas_map_point_image_uv_set(map, 1, w, 0);
1341 evas_map_point_image_uv_set(map, 2, w, h);
1342 evas_map_point_image_uv_set(map, 3, w2, h);
1343 evas_map_point_coord_set(map, 0, x + w2, y, 0);
1344 evas_map_point_coord_set(map, 1, x + w, y, 0);
1345 evas_map_point_coord_set(map, 2, x +w, h2, 0);
1346 evas_map_point_coord_set(map, 3, x + w2, h2, 0);
1348 case ELM_FX_WIPE_DIR_RIGHT:
1351 evas_map_point_image_uv_set(map, 0, 0, 0);
1352 evas_map_point_image_uv_set(map, 1, w2, 0);
1353 evas_map_point_image_uv_set(map, 2, w2, h);
1354 evas_map_point_image_uv_set(map, 3, 0, h);
1355 evas_map_point_coord_set(map, 0, x, y, 0);
1356 evas_map_point_coord_set(map, 1, x + w2, y, 0);
1357 evas_map_point_coord_set(map, 2, x + w2, h2, 0);
1358 evas_map_point_coord_set(map, 3, x, h2, 0);
1360 case ELM_FX_WIPE_DIR_DOWN:
1363 evas_map_point_image_uv_set(map, 0, 0, 0);
1364 evas_map_point_image_uv_set(map, 1, w, 0);
1365 evas_map_point_image_uv_set(map, 2, w, h2);
1366 evas_map_point_image_uv_set(map, 3, 0, h2);
1367 evas_map_point_coord_set(map, 0, x, y, 0);
1368 evas_map_point_coord_set(map, 1, w2, y, 0);
1369 evas_map_point_coord_set(map, 2, w2, y + h2, 0);
1370 evas_map_point_coord_set(map, 3, x, y + h2, 0);
1376 evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, 10000);
1380 _elm_fx_wipe_op(void *data, Elm_Animator *animator, double frame)
1386 Evas_Coord _x, _y, _w, _h;
1388 map = evas_map_new(4);
1393 evas_map_smooth_set(map, EINA_TRUE);
1394 evas_object_geometry_get(wipe->obj, &_x, &_y, &_w, &_h);
1396 if (wipe->type == ELM_FX_WIPE_TYPE_SHOW)
1397 _elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)frame);
1399 _elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)frame);
1401 evas_object_map_enable_set(wipe->obj, EINA_TRUE);
1402 evas_object_map_set(wipe->obj, map);
1409 * @param[in] obj Evas_Object that effect is applying to
1410 * @param[in] type Wipe type. Hide or show
1411 * @param[in] dir Wipe Direction
1412 * @return Wipe effect
1417 elm_fx_wipe_add(Evas_Object *obj, Elm_Fx_Wipe_Type type, Elm_Fx_Wipe_Dir dir)
1426 effect = calloc(1, sizeof(Elm_Effect));
1430 wipe = calloc(1, sizeof(Elm_Fx_Wipe));
1440 effect->begin_op = _elm_fx_wipe_begin;
1441 effect->end_op = _elm_fx_wipe_end;
1442 effect->animation_op = _elm_fx_wipe_op;
1443 effect->user_data = wipe;
1448 /////////////////////////////////////////////////////////////////////////////////////
1450 /////////////////////////////////////////////////////////////////////////////////////
1451 typedef struct _color Elm_Fx_Color;
1452 static void _elm_fx_color_begin(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt);
1453 static void _elm_fx_color_op(void *data, Elm_Animator *animator, double frame);
1458 struct _unsigned_color
1460 unsigned int r, g, b, a;
1462 struct _signed_color
1469 _elm_fx_color_begin(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
1471 Elm_Fx_Color *color = data;
1473 evas_object_show(color->obj);
1477 _elm_fx_color_op(void *data, Elm_Animator *animator, double frame)
1479 Elm_Fx_Color *color;
1481 unsigned int r, g, b, a;
1484 r = (color->from.r + (int)((float)color->to.r * frame));
1485 g = (color->from.g + (int)((float)color->to.g * frame));
1486 b = (color->from.b + (int)((float)color->to.b * frame));
1487 a = (color->from.a + (int)((float)color->to.a * frame));
1489 evas_object_color_set(color->obj, r, g, b, a);
1495 * @param[in] obj Evas_Object that effect is applying to
1496 * @param[in] from_r RGB R when effect begins
1497 * @param[in] from_g RGB G when effect begins
1498 * @param[in] from_b RGB B when effect begins
1499 * @param[in] from_a RGB A when effect begins
1500 * @param[in] to_r RGB R when effect ends
1501 * @param[in] to_g RGB G when effect ends
1502 * @param[in] to_b RGB B when effect ends
1503 * @param[in] to_a RGB A when effect ends
1504 * @return Color Effect
1509 elm_fx_color_add(Evas_Object *obj, unsigned int from_r, unsigned int from_g,
1510 unsigned int from_b, unsigned int from_a, unsigned int to_r,
1511 unsigned int to_g, unsigned int to_b, unsigned int to_a)
1515 Elm_Fx_Color *color;
1520 effect = calloc(1, sizeof(Elm_Effect));
1524 color = calloc(1, sizeof(Elm_Fx_Color));
1532 color->from.r = from_r;
1533 color->from.g = from_g;
1534 color->from.b = from_b;
1535 color->from.a = from_a;
1536 color->to.r = to_r - from_r;
1537 color->to.g = to_g - from_g;
1538 color->to.b = to_b - from_b;
1539 color->to.a = to_a - from_a;
1541 effect->begin_op = _elm_fx_color_begin;
1542 effect->animation_op = _elm_fx_color_op;
1543 effect->user_data = color;
1548 /////////////////////////////////////////////////////////////////////////////////////
1550 /////////////////////////////////////////////////////////////////////////////////////
1551 typedef struct _fade Elm_Fx_Fade;
1552 static void _elm_fx_fade_begin(void *data, Eina_Bool auto_reverse,
1553 unsigned int repeat_cnt);
1554 static void _elm_fx_fade_end(void *data, Eina_Bool auto_reverse,
1555 unsigned int repeat_cnt);
1556 static void _elm_fx_fade_op(void *data, Elm_Animator *animator,
1561 Evas_Object *before;
1563 struct _signed_color before_color, after_color;
1566 Eina_Bool inversed:1;
1570 _elm_fx_fade_begin(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
1572 Elm_Fx_Fade *fade = data;
1574 fade->inversed = EINA_FALSE;
1578 _elm_fx_fade_end(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
1580 Elm_Fx_Fade *fade = data;
1582 evas_object_color_set(fade->before, fade->before_color.r,
1583 fade->before_color.g, fade->before_color.b,
1584 fade->before_color.a);
1585 evas_object_color_set(fade->after, fade->after_color.r, fade->after_color.g,
1586 fade->after_color.b, fade->after_color.a);
1590 _elm_fx_fade_op(void *data, Elm_Animator *animator, double frame)
1600 if (!fade->inversed)
1602 evas_object_hide(fade->after);
1603 evas_object_show(fade->before);
1604 fade->inversed = EINA_TRUE;
1607 _frame = (1 - (frame * 2));
1609 evas_object_color_set(fade->before, fade->before_color.r * _frame,
1610 fade->before_color.g * _frame,
1611 fade->before_color.b * _frame,
1612 fade->before_color.a + fade->before_alpha * (1 -
1619 evas_object_hide(fade->before);
1620 evas_object_show(fade->after);
1621 fade->inversed = EINA_FALSE;
1624 _frame = ((frame - 0.5) * 2);
1626 evas_object_color_set(fade->after, fade->after_color.r * _frame,
1627 fade->after_color.g * _frame,
1628 fade->after_color.b * _frame,
1629 fade->after_color.a + fade->after_alpha * (1 -
1638 * @param[in] before Evas Object before fade in
1639 * @param[in] after Evas Object after fade out
1640 * @return Fade effect
1645 elm_fx_fade_add(Evas_Object *before, Evas_Object *after)
1651 if ((!before) && (!after))
1654 effect = calloc(1, sizeof(Elm_Effect));
1658 fade = calloc(1, sizeof(Elm_Fx_Fade));
1666 evas_object_color_get(before, &fade->before_color.r, &fade->before_color.g,
1667 &fade->before_color.b, &fade->before_color.a);
1668 evas_object_color_get(after, &fade->after_color.r, &fade->after_color.g,
1669 &fade->after_color.b, &fade->after_color.a);
1671 fade->before = before;
1672 fade->after = after;
1673 fade->before_alpha = (255 - fade->before_color.a);
1674 fade->after_alpha = (255 - fade->after_color.a);
1676 effect->begin_op = _elm_fx_fade_begin;
1677 effect->end_op = _elm_fx_fade_end;
1678 effect->animation_op = _elm_fx_fade_op;
1679 effect->user_data = fade;
1684 /////////////////////////////////////////////////////////////////////////////////////
1686 /////////////////////////////////////////////////////////////////////////////////////
1687 typedef struct _blend Elm_Fx_Blend;
1688 static void _elm_fx_blend_begin(void *data, Eina_Bool auto_reverse,
1689 unsigned int repeat_cnt);
1690 static void _elm_fx_blend_end(void *data, Eina_Bool auto_reverse,
1691 unsigned int repeat_cnt);
1692 static void _elm_fx_blend_op(void *data, Elm_Animator *animator,
1697 Evas_Object *before;
1699 struct _signed_color from, to;
1703 _elm_fx_blend_begin(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
1705 Elm_Fx_Blend *blend = data;
1707 evas_object_show(blend->before);
1711 _elm_fx_blend_end(void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt)
1713 Elm_Fx_Blend *blend = data;
1715 evas_object_color_set(blend->before, blend->from.r, blend->from.g,
1716 blend->from.b, blend->from.a);
1717 evas_object_color_set(blend->after, blend->to.r, blend->to.g, blend->to.b,
1720 evas_object_hide(blend->before);
1722 evas_object_hide(blend->after);
1726 _elm_fx_blend_op(void *data, Elm_Animator *animator, double frame)
1728 Elm_Fx_Blend *blend = data;
1730 evas_object_show(blend->after);
1731 evas_object_color_set(blend->before, (int)(blend->from.r * (1 - frame)),
1732 (int)(blend->from.g * (1 - frame)),
1733 (int)(blend->from.b * (1 - frame)),
1734 (int)(blend->from.a * (1 - frame)));
1735 evas_object_color_set(blend->after, (int)(blend->to.r * frame),
1736 (int)(blend->to.g * frame), (int)(blend->to.b * frame),
1737 (int)(blend->to.a * frame));
1743 * @param[in] before Evas Object before blending
1744 * @param[in] after Evas Object after blending
1745 * @return Blend effect
1750 elm_fx_blend_add(Evas_Object *before, Evas_Object *after)
1754 Elm_Fx_Blend *blend;
1756 if ((!before) && (!after))
1759 effect = calloc(1, sizeof(Elm_Effect));
1763 blend = calloc(1, sizeof(Elm_Fx_Blend));
1770 blend->before = before;
1771 blend->after = after;
1772 evas_object_color_get(before, &blend->from.r, &blend->from.g, &blend->from.b,
1774 evas_object_color_get(after, &blend->to.r, &blend->to.g, &blend->to.b,
1777 effect->begin_op = _elm_fx_blend_begin;
1778 effect->end_op = _elm_fx_blend_end;
1779 effect->animation_op = _elm_fx_blend_op;
1780 effect->user_data = blend;
1785 /////////////////////////////////////////////////////////////////////////////////////
1787 /////////////////////////////////////////////////////////////////////////////////////
1788 typedef struct _rotation Elm_Fx_Rotation;
1789 static void _elm_fx_rotation_begin(void *data, Eina_Bool auto_reverse,
1790 unsigned int repeat_cnt);
1791 static void _elm_fx_rotation_end(void *data, Eina_Bool auto_reverse,
1792 unsigned int repeat_cnt);
1793 static void _elm_fx_rotation_op(void *data, Elm_Animator *animator,
1804 _elm_fx_rotation_begin(void *data, Eina_Bool auto_reverse,
1805 unsigned int repeat_cnt)
1807 Elm_Fx_Rotation *rotation = data;
1809 evas_object_show(rotation->obj);
1813 _elm_fx_rotation_end(void *data, Eina_Bool auto_reverse,
1814 unsigned int repeat_cnt)
1816 Elm_Fx_Rotation *rotation = data;
1818 evas_object_map_enable_set(rotation->obj, EINA_FALSE);
1822 _elm_fx_rotation_op(void *data, Elm_Animator *animator, double frame)
1824 Elm_Fx_Rotation *rotation;
1828 Evas_Coord x, y, w, h;
1832 float half_w, half_h;
1834 map = evas_map_new(4);
1840 evas_map_smooth_set(map, EINA_TRUE);
1841 evas_map_util_points_populate_from_object_full(map, rotation->obj, 0);
1842 degree = rotation->from + (float)(frame * rotation->to);
1847 evas_object_geometry_get(rotation->obj, &x, &y, &w, &h);
1849 half_w = (float)w *0.5;
1851 half_h = (float)h *0.5;
1853 evas_map_util_3d_rotate(map, 0, 0, degree, x + half_w, y + half_h, 0);
1854 evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, 10000);
1855 evas_object_map_enable_set(rotation->obj, EINA_TRUE);
1856 evas_object_map_set(rotation->obj, map);
1861 * Add Rotation effect
1863 * @param[in] obj Evas_Object that effect is applying to
1864 * @param[in] from degree Degree when effect begins
1865 * @param[in] to_degree Degree when effect is ends
1866 * @param[in] cw Rotation direction. EINA_TRUE is clock wise
1867 * @return Rotation effect
1872 elm_fx_rotation_add(Evas_Object *obj, float from_degree, float to_degree,
1877 Elm_Fx_Rotation *rotation;
1882 effect = calloc(1, sizeof(Elm_Effect));
1886 rotation = calloc(1, sizeof(Elm_Fx_Rotation));
1894 rotation->obj = obj;
1895 rotation->from = from_degree;
1896 rotation->to = to_degree - from_degree;
1899 effect->begin_op = _elm_fx_rotation_begin;
1900 effect->end_op = _elm_fx_rotation_end;
1901 effect->animation_op = _elm_fx_rotation_op;
1902 effect->user_data = rotation;
1907 /////////////////////////////////////////////////////////////////////////////////////
1908 // ImageAnimation FX
1909 /////////////////////////////////////////////////////////////////////////////////////
1910 typedef struct _image_animation Elm_Fx_Image_Animation;
1911 static void _elm_fx_image_animation_begin(void *data, Eina_Bool auto_reverse,
1912 unsigned int repeat_cnt);
1913 static void _elm_fx_image_animation_op(void *data, Elm_Animator *animator,
1915 EAPI Elm_Effect *elm_fx_image_animation_add(Evas_Object *obj, const char **images,
1916 unsigned int item_num);
1918 struct _image_animation
1927 _elm_fx_image_animation_begin(void *data, Eina_Bool auto_reverse,
1928 unsigned int repeat_cnt)
1930 Elm_Fx_Image_Animation *image_animation = data;
1931 evas_object_show(image_animation->obj);
1936 _elm_fx_image_animation_op(void *data, Elm_Animator *animator, double frame)
1938 Elm_Fx_Image_Animation *image_animation = (Elm_Fx_Image_Animation *) data;
1940 elm_icon_file_set(image_animation->obj,
1941 image_animation->images[ (int) floor(frame * (image_animation->img_cnt-1)) ], NULL);
1945 _elm_fx_image_animation_del(void *data)
1948 Elm_Fx_Image_Animation *image_animation = data;
1950 for(idx = 0; idx < image_animation->img_cnt; ++idx ) {
1951 eina_stringshare_del(image_animation->images[ idx ]);
1954 free(image_animation->images);
1958 * Add image_animation effect.
1960 * @param[in] obj Icon object
1961 * @param[in] images Array of image file path.
1962 * @param[in] img_cnt Count of image.
1963 * @return ImageAnimation effect.
1968 elm_fx_image_animation_add(Evas_Object *obj, const char **images,
1969 unsigned int img_cnt)
1972 Elm_Fx_Image_Animation *image_animation;
1975 if ((!obj) || !images || !(*images))
1978 effect = calloc(1, sizeof(Elm_Effect));
1982 image_animation = calloc(1, sizeof(Elm_Fx_Image_Animation));
1984 if (!image_animation)
1990 image_animation->obj = obj;
1991 image_animation->images = calloc( img_cnt, sizeof(char*));
1992 for(idx = 0; idx < img_cnt; ++idx )
1993 image_animation->images[ idx ] = eina_stringshare_add( images[ idx ] );
1995 image_animation->img_cnt = img_cnt;
1997 effect->begin_op = _elm_fx_image_animation_begin;
1998 effect->animation_op = _elm_fx_image_animation_op;
1999 effect->del_op = _elm_fx_image_animation_del;
2000 effect->user_data = image_animation;