Eina_List *effect_list;
Eina_List *objs;
Elm_Transit_Tween_Mode tween_mode;
- unsigned int effects_pending_del;
- int walking;
- struct
- {
+ struct {
void (*func) (void *data, Elm_Transit *transit);
void *arg;
} del_data;
- struct
- {
+ struct {
double duration;
double begin;
double current;
} time;
- struct
- {
+ struct {
int count;
int current;
Eina_Bool reverse;
} repeat;
- Eina_Bool auto_reverse:1;
- Eina_Bool event_enabled:1;
- Eina_Bool deleted:1;
+ unsigned int effects_pending_del;
+ int walking;
+ Eina_Bool auto_reverse : 1;
+ Eina_Bool event_enabled : 1;
+ Eina_Bool deleted : 1;
};
struct _Elm_Effect
void (*animation_op) (void *data, Elm_Transit *transit, double progress);
void (*user_data_free) (void *data, Elm_Transit *transit);
void *user_data;
- Eina_Bool deleted:1;
+ Eina_Bool deleted : 1;
};
struct _Elm_Obj_Data
Elm_Obj_Data *obj_data = evas_object_data_del(obj, _transit_key);
evas_object_pass_events_set(obj, obj_data->state);
free(obj_data);
-
transit->objs = eina_list_remove(transit->objs, obj);
-
- if (!transit->objs)
- elm_transit_del(transit);
+ if (!transit->objs) elm_transit_del(transit);
}
static void
_elm_transit_object_remove(Elm_Transit *transit, Evas_Object *obj)
{
Elm_Obj_Data *obj_data = evas_object_data_del(obj, _transit_key);
+
evas_object_pass_events_set(obj, obj_data->state);
free(obj_data);
-
transit->objs = eina_list_remove(transit->objs, obj);
-
evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
_elm_transit_object_remove_cb);
}
_elm_transit_effect_del(Elm_Transit *transit, Elm_Effect *effect, Eina_List *elist)
{
if (effect->user_data_free)
- effect->user_data_free(effect->user_data, transit);
+ effect->user_data_free(effect->user_data, transit);
transit->effect_list = eina_list_remove_list(transit->effect_list, elist);
free(effect);
_remove_dead_effects(Elm_Transit *transit)
{
Eina_List *elist, *elist_next;
-
Elm_Effect *effect;
EINA_LIST_FOREACH_SAFE(transit->effect_list, elist, elist_next, effect)
{
Eina_List *elist, *elist_next;
Elm_Effect *effect;
-
+
if (transit->del_data.func)
- transit->del_data.func(transit->del_data.arg, transit);
-
+ transit->del_data.func(transit->del_data.arg, transit);
+
ecore_animator_del(transit->animator);
-
+
EINA_LIST_FOREACH_SAFE(transit->effect_list, elist, elist_next, effect)
- _elm_transit_effect_del(transit, effect, elist);
-
+ _elm_transit_effect_del(transit, effect, elist);
+
while (transit->objs)
- _elm_transit_object_remove(transit, eina_list_data_get(transit->objs));
-
+ _elm_transit_object_remove(transit, eina_list_data_get(transit->objs));
+
EINA_MAGIC_SET(transit, EINA_MAGIC_NONE);
free(transit);
}
_transit_animate_op(Elm_Transit *transit, double progress)
{
Eina_List *elist;
-
Elm_Effect *effect;
transit->walking++;
EINA_LIST_FOREACH(transit->effect_list, elist, effect)
{
if (transit->deleted) break;
-
if (!effect->deleted)
- effect->animation_op(effect->user_data, transit, progress);
+ effect->animation_op(effect->user_data, transit, progress);
}
transit->walking--;
-
+
if (transit->walking) return;
-
+
if (transit->deleted) _elm_transit_del(transit);
else if (transit->effects_pending_del) _remove_dead_effects(transit);
}
_animator_animate_cb(void *data)
{
Elm_Transit *transit = data;
-
+ double elapsed_time, progress;
+
transit->time.current = ecore_loop_time_get();
- double elapsed_time = transit->time.current - transit->time.begin;
-
+ elapsed_time = transit->time.current - transit->time.begin;
+
if (elapsed_time > transit->time.duration)
- elapsed_time = transit->time.duration;
-
- double progress = elapsed_time / transit->time.duration;
+ elapsed_time = transit->time.duration;
+
+ progress = elapsed_time / transit->time.duration;
switch (transit->tween_mode)
{
case ELM_TRANSIT_TWEEN_MODE_ACCELERATE:
- progress = 1.0 - sin((ELM_PI / 2.0) + (progress * ELM_PI / 2.0));
- break;
+ progress = 1.0 - sin((ELM_PI / 2.0) + (progress * ELM_PI / 2.0));
+ break;
case ELM_TRANSIT_TWEEN_MODE_DECELERATE:
- progress = sin(progress * ELM_PI / 2.0);
- break;
+ progress = sin(progress * ELM_PI / 2.0);
+ break;
case ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL:
- progress = (1.0 - cos(progress * ELM_PI)) / 2.0;
- break;
+ progress = (1.0 - cos(progress * ELM_PI)) / 2.0;
+ break;
default:
- break;
- }
-
+ break;
+ }
+
/* Reverse? */
- if (transit->repeat.reverse)
- progress = 1 - progress;
-
- if (transit->time.duration > 0)
- _transit_animate_op(transit, progress);
-
+ if (transit->repeat.reverse) progress = 1 - progress;
+
+ if (transit->time.duration > 0) _transit_animate_op(transit, progress);
+
/* Not end. Keep going. */
- if (elapsed_time < transit->time.duration)
- return ECORE_CALLBACK_RENEW;
-
+ if (elapsed_time < transit->time.duration) return ECORE_CALLBACK_RENEW;
+
/* Repeat and reverse and time done! */
if ((transit->repeat.current == transit->repeat.count)
- && (!transit->auto_reverse || transit->repeat.reverse))
+ && (!transit->auto_reverse || transit->repeat.reverse))
{
elm_transit_del(transit);
return ECORE_CALLBACK_CANCEL;
}
-
+
/* Repeat Case */
if (!transit->auto_reverse || transit->repeat.reverse)
{
transit->repeat.reverse = EINA_FALSE;
}
else transit->repeat.reverse = EINA_TRUE;
-
+
transit->time.begin = ecore_loop_time_get();
-
+
return ECORE_CALLBACK_RENEW;
}
elm_transit_add(double duration)
{
Elm_Transit *transit = ELM_NEW(Elm_Transit);
-
+
if (!transit) return NULL;
-
+
EINA_MAGIC_SET(transit, ELM_TRANSIT_MAGIC);
elm_transit_tween_mode_set(transit, ELM_TRANSIT_TWEEN_MODE_LINEAR);
elm_transit_effect_add(Elm_Transit *transit, void (*cb)(void *data, Elm_Transit *transit, double progress), void *data, void (*data_free_cb)(void *data, Elm_Transit *transit))
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
EINA_SAFETY_ON_NULL_RETURN(cb);
-
Elm_Effect *effect;
-
Eina_List *elist;
EINA_LIST_FOREACH(transit->effect_list, elist, effect)
- if ((effect->animation_op == cb) && (effect->user_data == data)) return;
+ {
+ if ((effect->animation_op == cb) && (effect->user_data == data)) return;
+ }
effect = ELM_NEW(Elm_Effect);
if (!effect) return;
-
+
effect->user_data_free = data_free_cb;
effect->animation_op = cb;
effect->user_data = data;
elm_transit_effect_del(Elm_Transit *transit, void (*cb)(void *data, Elm_Transit *transit, double progress), void *data)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
EINA_SAFETY_ON_NULL_RETURN(cb);
-
Eina_List *elist, *elist_next;
Elm_Effect *effect;
elm_transit_object_add(Elm_Transit *transit, Evas_Object *obj)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
EINA_SAFETY_ON_NULL_RETURN(obj);
-
Elm_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key);
if (obj_data)
if (obj_data->transit == transit) return;
elm_transit_object_remove(obj_data->transit, obj);
}
-
+
obj_data = ELM_NEW(Elm_Obj_Data);
obj_data->state = evas_object_pass_events_get(obj);
obj_data->transit = transit;
evas_object_data_set(obj, _transit_key, obj_data);
-
+
transit->objs = eina_list_append(transit->objs, obj);
-
+
if (!transit->event_enabled)
- evas_object_pass_events_set(obj, EINA_TRUE);
-
+ evas_object_pass_events_set(obj, EINA_TRUE);
+
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
_elm_transit_object_remove_cb, transit);
}
elm_transit_object_remove(Elm_Transit *transit, Evas_Object *obj)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
EINA_SAFETY_ON_NULL_RETURN(obj);
-
Elm_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key);
-
if ((!obj_data) || (obj_data->transit != transit)) return;
_elm_transit_object_remove(transit, obj);
-
- if (!transit->objs)
- elm_transit_del(transit);
+ if (!transit->objs) elm_transit_del(transit);
}
/**
elm_transit_objects_get(const Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
return transit->objs;
}
elm_transit_event_enabled_set(Elm_Transit *transit, Eina_Bool enabled)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
- if (transit->event_enabled == enabled) return;
-
Evas_Object *obj;
Eina_List *elist;
Elm_Obj_Data *obj_data;
+ if (transit->event_enabled == enabled) return;
+
transit->event_enabled = enabled;
if (enabled)
else
{
EINA_LIST_FOREACH(transit->objs, elist, obj)
- evas_object_pass_events_set(obj, EINA_TRUE);
+ evas_object_pass_events_set(obj, EINA_TRUE);
}
}
elm_transit_del_cb_set(Elm_Transit *transit, void (*cb) (void *data, Elm_Transit *transit), void *data)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
transit->del_data.func = cb;
transit->del_data.arg = data;
}
elm_transit_auto_reverse_set(Elm_Transit *transit, Eina_Bool reverse)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
transit->auto_reverse = reverse;
}
elm_transit_auto_reverse_get(Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, EINA_FALSE);
-
return transit->auto_reverse;
}
elm_transit_repeat_times_set(Elm_Transit *transit, int repeat)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit);
-
transit->repeat.count = repeat;
transit->repeat.current = 0;
}
elm_transit_repeat_times_get(Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, 0);
-
return transit->repeat.count;
}
elm_transit_tween_mode_get(const Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, ELM_TRANSIT_TWEEN_MODE_LINEAR);
-
return transit->tween_mode;
}
struct _Elm_Fx_Resizing
{
- struct _size
- {
- Evas_Coord w, h;
- } from, to;
+ struct _size {
+ Evas_Coord w, h;
+ } from, to;
};
-void
+static void
_transit_effect_resizing_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
free(data);
}
-void
+static void
_transit_effect_resizing_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Evas_Coord w, h;
Evas_Object *obj;
Eina_List *elist;
-
Elm_Fx_Resizing *resizing = data;
w = resizing->from.w + (resizing->to.w * progress);
h = resizing->from.h + (resizing->to.h * progress);
-
+
EINA_LIST_FOREACH(transit->objs, elist, obj)
- evas_object_resize(obj, w, h);
+ evas_object_resize(obj, w, h);
}
-void *
+static void *
_transit_effect_resizing_context_new(Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h)
{
Elm_Fx_Resizing *resizing;
elm_transit_effect_resizing_add(Elm_Transit *transit, Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_resizing_context_new(from_w, from_h, to_w, to_h);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_resizing_op, effect_context,
_transit_effect_resizing_context_free);
struct _Elm_Fx_Translation
{
- struct _position_variation
- {
- Evas_Coord dx, dy;
- } from, to;
+ struct _position_variation {
+ Evas_Coord dx, dy;
+ } from, to;
Eina_List *nodes;
};
Elm_Fx_Translation *translation = data;
Eina_List *elist;
Elm_Fx_Translation_Node *translation_node;
-
+
EINA_LIST_FOREACH(translation->nodes, elist, translation_node)
{
- if (translation_node->obj != obj)
- continue;
-
+ if (translation_node->obj != obj) continue;
translation->nodes = eina_list_remove_list(translation->nodes, elist);
free(translation_node);
break;
Evas_Object *obj;
Eina_List *data_list = NULL;
const Eina_List *objs = elm_transit_objects_get(transit);
-
+
EINA_LIST_FOREACH(objs, elist, obj)
{
translation_node = ELM_NEW(Elm_Fx_Translation_Node);
&(translation_node->y), NULL, NULL);
data_list = eina_list_append(data_list, translation_node);
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _translation_object_del_cb, translation);
+ _translation_object_del_cb, translation);
}
-
return data_list;
}
_transit_effect_translation_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Elm_Fx_Translation *translation = data;
Eina_List *elist, *elist_next;
Elm_Fx_Translation_Node *translation_node;
elist, elist_next, translation_node)
{
evas_object_event_callback_del(translation_node->obj,
- EVAS_CALLBACK_DEL, _translation_object_del_cb);
+ EVAS_CALLBACK_DEL, _translation_object_del_cb);
translation->nodes = eina_list_remove_list(translation->nodes, elist);
free(translation_node);
}
_transit_effect_translation_op(void *data, Elm_Transit *transit, double progress __UNUSED__)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Evas_Coord x, y;
Elm_Fx_Translation *translation = data;
Elm_Fx_Translation_Node *translation_node;
Eina_List *elist;
-
+
if (!translation->nodes)
- translation->nodes = _translation_nodes_build(transit, translation);
-
+ translation->nodes = _translation_nodes_build(transit, translation);
+
EINA_LIST_FOREACH(translation->nodes, elist, translation_node)
{
- x = translation_node->x + translation->from.dx \
- + (translation->to.dx * progress);
- y = translation_node->y + translation->from.dy \
- + (translation->to.dy * progress);
+ x = translation_node->x + translation->from.dx
+ + (translation->to.dx * progress);
+ y = translation_node->y + translation->from.dy
+ + (translation->to.dy * progress);
evas_object_move(translation_node->obj, x, y);
}
}
-void *
+static void *
_transit_effect_translation_context_new(Evas_Coord from_dx, Evas_Coord from_dy, Evas_Coord to_dx, Evas_Coord to_dy)
{
Elm_Fx_Translation *translation;
translation = ELM_NEW(Elm_Fx_Translation);
-
if (!translation) return NULL;
translation->from.dx = from_dx;
elm_transit_effect_translation_add(Elm_Transit *transit, Evas_Coord from_dx, Evas_Coord from_dy, Evas_Coord to_dx, Evas_Coord to_dy)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_translation_context_new(from_dx, from_dy, to_dx, to_dy);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_translation_op, effect_context,
_transit_effect_translation_context_free);
free(data);
}
-void
+static void
_transit_effect_zoom_op(void *data, Elm_Transit *transit , double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Evas_Object *obj;
Eina_List *elist;
-
Elm_Fx_Zoom *zoom = data;
-
Evas_Map *map;
-
Evas_Coord x, y, w, h;
map = evas_map_new(4);
{
evas_object_geometry_get(obj, &x, &y, &w, &h);
evas_map_smooth_set(map, EINA_TRUE);
- evas_map_util_points_populate_from_object_full(map, obj, zoom->from + \
+ evas_map_util_points_populate_from_object_full(map, obj, zoom->from +
(progress * zoom->to));
evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, FOCAL);
evas_object_map_set(obj, map);
evas_map_free(map);
}
-void *
+static void *
_transit_effect_zoom_context_new(float from_rate, float to_rate)
{
Elm_Fx_Zoom *zoom;
elm_transit_effect_zoom_add(Elm_Transit *transit, float from_rate, float to_rate)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_zoom_context_new(from_rate, to_rate);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_zoom_op, effect_context,
_transit_effect_zoom_context_free);
struct _Elm_Fx_Flip
{
Elm_Fx_Flip_Axis axis;
- Eina_Bool cw:1;
+ Eina_Bool cw : 1;
};
-void
+static void
_transit_effect_flip_context_free(void *data, Elm_Transit *transit)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Evas_Object *front, *back;
int i;
-
int count = eina_list_count(transit->objs);
- for(i = 0; i < count-1; i+=2)
+
+ for (i = 0; i < (count - 1); i += 2)
{
front = eina_list_nth(transit->objs, i);
back = eina_list_nth(transit->objs, i+1);
evas_object_map_enable_set(front, EINA_FALSE);
evas_object_map_enable_set(back, EINA_FALSE);
}
-
free(data);
}
-void
+static void
_transit_effect_flip_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Evas_Object *obj, *front, *back;
- int count;
- int i;
-
+ int count, i;
Elm_Fx_Flip *flip = data;
-
Evas_Map *map;
-
float degree;
-
Evas_Coord x, y, w, h;
map = evas_map_new(4);
if (!map) return;
- if (flip->cw)
- degree = (float)(progress * 180);
- else
- degree = (float)(progress * -180);
-
+ if (flip->cw) degree = (float)(progress * 180);
+ else degree = (float)(progress * -180);
+
count = eina_list_count(transit->objs);
- for(i = 0; i < count-1; i+=2)
+ for (i = 0; i < (count - 1); i += 2)
{
+ Evas_Coord half_w, half_h;
+
front = eina_list_nth(transit->objs, i);
back = eina_list_nth(transit->objs, i+1);
-
+
if ((degree < 90) && (degree > -90))
{
obj = front;
evas_object_show(back);
}
}
-
+
evas_map_smooth_set(map, EINA_TRUE);
evas_map_util_points_populate_from_object_full(map, obj, 0);
evas_object_geometry_get(obj, &x, &y, &w, &h);
- Evas_Coord half_w = (w / 2);
-
- Evas_Coord half_h = (h / 2);
-
+ half_w = (w / 2);
+ half_h = (h / 2);
+
if (flip->axis == ELM_TRANSIT_EFFECT_FLIP_AXIS_Y)
{
if ((degree >= 90) || (degree <= -90))
evas_map_free(map);
}
-void *
+static void *
_transit_effect_flip_context_new(Elm_Fx_Flip_Axis axis, Eina_Bool cw)
{
Elm_Fx_Flip *flip;
elm_transit_effect_flip_add(Elm_Transit *transit, Elm_Fx_Flip_Axis axis, Eina_Bool cw)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_flip_context_new(axis, cw);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_flip_op, effect_context,
_transit_effect_flip_context_free);
{
Evas_Object *front;
Evas_Object *back;
- struct _vector2d
- {
- float x, y;
- } from_pos, from_size, to_pos, to_size;
+ struct _vector2d {
+ float x, y;
+ } from_pos, from_size, to_pos, to_size;
};
struct _Elm_Fx_Resizable_Flip
{
Eina_List *nodes;
- Eina_Bool cw:1;
+ Eina_Bool cw : 1;
Elm_Fx_Flip_Axis axis;
};
{
Elm_Fx_ResizableFlip_Node *resizable_flip_node;
Eina_List *data_list = NULL;
-
Evas_Coord front_x, front_y, front_w, front_h;
Evas_Coord back_x, back_y, back_w, back_h;
-
int i, count;
count = eina_list_count(transit->objs);
- for (i = 0; i < count-1; i+=2)
- {
- resizable_flip_node = ELM_NEW(Elm_Fx_ResizableFlip_Node);
- if (!resizable_flip_node)
- {
- eina_list_free(data_list);
- return NULL;
- }
-
- resizable_flip_node->front = eina_list_nth(transit->objs, i);
- resizable_flip_node->back = eina_list_nth(transit->objs, i+1);
-
- evas_object_geometry_get(resizable_flip_node->front,
- &front_x, &front_y, &front_w, &front_h);
- evas_object_geometry_get(resizable_flip_node->back,
- &back_x, &back_y, &back_w, &back_h);
-
- resizable_flip_node->from_pos.x = front_x;
- resizable_flip_node->from_pos.y = front_y;
- resizable_flip_node->to_pos.x = back_x - front_x;
- resizable_flip_node->to_pos.y = back_y - front_y;
-
- resizable_flip_node->from_size.x = front_w;
- resizable_flip_node->from_size.y = front_h;
- resizable_flip_node->to_size.x = back_w - front_w;
- resizable_flip_node->to_size.y = back_h - front_h;
-
- data_list = eina_list_append(data_list, resizable_flip_node);
-
- evas_object_event_callback_add(resizable_flip_node->back,
- EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip);
- evas_object_event_callback_add(resizable_flip_node->front,
- EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip);
- }
-
+ for (i = 0; i < (count - 1); i += 2)
+ {
+ resizable_flip_node = ELM_NEW(Elm_Fx_ResizableFlip_Node);
+ if (!resizable_flip_node)
+ {
+ eina_list_free(data_list);
+ return NULL;
+ }
+
+ resizable_flip_node->front = eina_list_nth(transit->objs, i);
+ resizable_flip_node->back = eina_list_nth(transit->objs, i+1);
+
+ evas_object_geometry_get(resizable_flip_node->front,
+ &front_x, &front_y, &front_w, &front_h);
+ evas_object_geometry_get(resizable_flip_node->back,
+ &back_x, &back_y, &back_w, &back_h);
+
+ resizable_flip_node->from_pos.x = front_x;
+ resizable_flip_node->from_pos.y = front_y;
+ resizable_flip_node->to_pos.x = back_x - front_x;
+ resizable_flip_node->to_pos.y = back_y - front_y;
+
+ resizable_flip_node->from_size.x = front_w;
+ resizable_flip_node->from_size.y = front_h;
+ resizable_flip_node->to_size.x = back_w - front_w;
+ resizable_flip_node->to_size.y = back_h - front_h;
+
+ data_list = eina_list_append(data_list, resizable_flip_node);
+
+ evas_object_event_callback_add(resizable_flip_node->back,
+ EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip);
+ evas_object_event_callback_add(resizable_flip_node->front,
+ EVAS_CALLBACK_DEL, _resizable_flip_object_del_cb, resizable_flip);
+ }
+
return data_list;
}
_transit_effect_resizable_flip_op(void *data, Elm_Transit *transit __UNUSED__, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Evas_Map *map;
Evas_Object *obj;
float x, y, w, h;
float degree;
Evas_Coord half_w, half_h;
-
Elm_Fx_ResizableFlip *resizable_flip = data;
Elm_Fx_ResizableFlip_Node *resizable_flip_node;
Eina_List *elist;
map = evas_map_new(4);
if (!map) return;
- if (resizable_flip->cw)
- degree = (float)(progress * 180);
- else
- degree = (float)(progress * -180);
-
+ if (resizable_flip->cw) degree = (float)(progress * 180);
+ else degree = (float)(progress * -180);
+
if (!resizable_flip->nodes)
- resizable_flip->nodes = _resizable_flip_nodes_build(transit,
- resizable_flip);
-
+ resizable_flip->nodes = _resizable_flip_nodes_build(transit,
+ resizable_flip);
+
EINA_LIST_FOREACH(resizable_flip->nodes, elist, resizable_flip_node)
{
if ((degree < 90) && (degree > -90))
evas_object_show(resizable_flip_node->back);
}
}
-
+
evas_map_smooth_set(map, EINA_TRUE);
-
- x = resizable_flip_node->from_pos.x + \
- (resizable_flip_node->to_pos.x * progress);
- y = resizable_flip_node->from_pos.y + \
- (resizable_flip_node->to_pos.y * progress);
- w = resizable_flip_node->from_size.x + \
- (resizable_flip_node->to_size.x * progress);
- h = resizable_flip_node->from_size.y + \
- (resizable_flip_node->to_size.y * progress);
+
+ x = resizable_flip_node->from_pos.x +
+ (resizable_flip_node->to_pos.x * progress);
+ y = resizable_flip_node->from_pos.y +
+ (resizable_flip_node->to_pos.y * progress);
+ w = resizable_flip_node->from_size.x +
+ (resizable_flip_node->to_size.x * progress);
+ h = resizable_flip_node->from_size.y +
+ (resizable_flip_node->to_size.y * progress);
evas_map_point_coord_set(map, 0, x, y, 0);
evas_map_point_coord_set(map, 1, x + w, y, 0);
evas_map_point_coord_set(map, 2, x + w, y + h, 0);
evas_map_point_coord_set(map, 3, x, y + h, 0);
-
- half_w = (Evas_Coord) (w / 2);
- half_h = (Evas_Coord) (h / 2);
-
+
+ half_w = (Evas_Coord)(w / 2);
+ half_h = (Evas_Coord)(h / 2);
+
if (resizable_flip->axis == ELM_TRANSIT_EFFECT_FLIP_AXIS_Y)
{
_set_image_uv_by_axis_y(map, resizable_flip_node, degree);
evas_map_util_3d_rotate(map, degree, 0,
0, x + half_w, y + half_h, 0);
}
-
+
evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, FOCAL);
evas_object_map_enable_set(resizable_flip_node->front, EINA_TRUE);
evas_object_map_enable_set(resizable_flip_node->back, EINA_TRUE);
evas_map_free(map);
}
-void *
+static void *
_transit_effect_resizable_flip_context_new(Elm_Fx_Flip_Axis axis, Eina_Bool cw)
{
Elm_Fx_ResizableFlip *resizable_flip;
-
+
resizable_flip = ELM_NEW(Elm_Fx_ResizableFlip);
if (!resizable_flip) return NULL;
elm_transit_effect_resizable_flip_add(Elm_Transit *transit, Elm_Fx_Flip_Axis axis, Eina_Bool cw)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_resizable_flip_context_new(axis, cw);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_resizable_flip_op, effect_context,
_transit_effect_resizable_flip_context_free);
default:
break;
}
-
evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, FOCAL);
}
default:
break;
}
-
evas_map_util_3d_perspective(map, x + (w / 2), y + (h / 2), 0, FOCAL);
}
-void
+static void
_transit_effect_wipe_context_free(void *data, Elm_Transit *transit)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Eina_List *elist;
Evas_Object *obj;
Elm_Fx_Wipe *wipe = data;
EINA_LIST_FOREACH(transit->objs, elist, obj)
{
if ((wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW && !reverse)
- || (wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE && reverse))
- evas_object_show(obj);
+ || (wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE && reverse))
+ evas_object_show(obj);
else evas_object_hide(obj);
evas_object_map_enable_set(obj, EINA_FALSE);
}
free(wipe);
}
-void
+static void
_transit_effect_wipe_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Elm_Fx_Wipe *wipe = data;
-
Evas_Map *map;
-
Evas_Coord _x, _y, _w, _h;
-
Eina_List *elist;
Evas_Object *obj;
map = evas_map_new(4);
if (!map) return;
-
+
evas_map_smooth_set(map, EINA_TRUE);
-
+
EINA_LIST_FOREACH(transit->objs, elist, obj)
{
evas_object_geometry_get(obj, &_x, &_y, &_w, &_h);
-
+
if (wipe->type == ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW)
_elm_fx_wipe_show(map, wipe->dir, _x, _y, _w, _h, (float)progress);
-
else
_elm_fx_wipe_hide(map, wipe->dir, _x, _y, _w, _h, (float)progress);
-
+
evas_object_map_enable_set(obj, EINA_TRUE);
evas_object_map_set(obj, map);
}
evas_map_free(map);
}
-void *
+static void *
_transit_effect_wipe_context_new(Elm_Fx_Wipe_Type type, Elm_Fx_Wipe_Dir dir)
{
Elm_Fx_Wipe *wipe;
-
+
wipe = ELM_NEW(Elm_Fx_Wipe);
if (!wipe) return NULL;
elm_transit_effect_wipe_add(Elm_Transit *transit, Elm_Fx_Wipe_Type type, Elm_Fx_Wipe_Dir dir)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_wipe_context_new(type, dir);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_wipe_op, effect_context,
_transit_effect_wipe_context_free);
struct _Elm_Fx_Color
{
- struct _unsigned_color
- {
- unsigned int r, g, b, a;
- } from;
- struct _signed_color
- {
- int r, g, b, a;
- } to;
+ struct _unsigned_color {
+ unsigned int r, g, b, a;
+ } from;
+ struct _signed_color {
+ int r, g, b, a;
+ } to;
};
-void
+static void
_transit_effect_color_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
free(data);
}
-void
+static void
_transit_effect_color_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Elm_Fx_Color *color = data;
Evas_Object *obj;
Eina_List *elist;
-
unsigned int r, g, b, a;
-
+
r = (color->from.r + (int)((float)color->to.r * progress));
g = (color->from.g + (int)((float)color->to.g * progress));
b = (color->from.b + (int)((float)color->to.b * progress));
a = (color->from.a + (int)((float)color->to.a * progress));
-
+
EINA_LIST_FOREACH(transit->objs, elist, obj)
- evas_object_color_set(obj, r, g, b, a);
+ evas_object_color_set(obj, r, g, b, a);
}
-void *
+static void *
_transit_effect_color_context_new(unsigned int from_r, unsigned int from_g, unsigned int from_b, unsigned int from_a, unsigned int to_r, unsigned int to_g, unsigned int to_b, unsigned int to_a)
{
Elm_Fx_Color *color;
-
+
color = ELM_NEW(Elm_Fx_Color);
if (!color) return NULL;
-
+
color->from.r = from_r;
color->from.g = from_g;
color->from.b = from_b;
color->to.g = to_g - from_g;
color->to.b = to_b - from_b;
color->to.a = to_a - from_a;
-
+
return color;
}
elm_transit_effect_color_add(Elm_Transit *transit, unsigned int from_r, unsigned int from_g, unsigned int from_b, unsigned int from_a, unsigned int to_r, unsigned int to_g, unsigned int to_b, unsigned int to_a)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_color_context_new(from_r, from_g, from_b, from_a, to_r, to_g, to_b, to_a);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_color_op, effect_context,
_transit_effect_color_context_free);
struct _signed_color before_color, after_color;
int before_alpha;
int after_alpha;
- Eina_Bool inversed:1;
+ Eina_Bool inversed : 1;
};
struct _Elm_Fx_Fade
EINA_LIST_FOREACH(fade->nodes, elist, fade_node)
{
if (fade_node->before == obj)
- evas_object_event_callback_del(fade_node->after,
- EVAS_CALLBACK_DEL, _fade_object_del_cb);
+ evas_object_event_callback_del(fade_node->after,
+ EVAS_CALLBACK_DEL, _fade_object_del_cb);
else if (fade_node->after == obj)
- evas_object_event_callback_del(fade_node->before,
- EVAS_CALLBACK_DEL, _fade_object_del_cb);
+ evas_object_event_callback_del(fade_node->before,
+ EVAS_CALLBACK_DEL, _fade_object_del_cb);
else continue;
-
+
fade->nodes = eina_list_remove_list(fade->nodes, elist);
free(fade_node);
break;
{
Elm_Fx_Fade_Node *fade;
Eina_List *data_list = NULL;
-
- int i; int count;
+ int i, count;
count = eina_list_count(transit->objs);
- for (i = 0; i < count-1; i+=2)
- {
- fade = ELM_NEW(Elm_Fx_Fade_Node);
- if (!fade)
- {
- eina_list_free(data_list);
- return NULL;
- }
-
- fade->before = eina_list_nth(transit->objs, i);
- fade->after = eina_list_nth(transit->objs, i+1);
-
- evas_object_color_get(fade->before,
- &fade->before_color.r, &fade->before_color.g,
- &fade->before_color.b, &fade->before_color.a);
- evas_object_color_get(fade->after,
- &fade->after_color.r, &fade->after_color.g,
- &fade->after_color.b, &fade->after_color.a);
-
- fade->before_alpha = (255 - fade->before_color.a);
- fade->after_alpha = (255 - fade->after_color.a);
-
- data_list = eina_list_append(data_list, fade);
-
- evas_object_event_callback_add(fade->before,
- EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data);
- evas_object_event_callback_add(fade->after,
- EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data);
- }
-
+ for (i = 0; i < (count - 1); i += 2)
+ {
+ fade = ELM_NEW(Elm_Fx_Fade_Node);
+ if (!fade)
+ {
+ eina_list_free(data_list);
+ return NULL;
+ }
+
+ fade->before = eina_list_nth(transit->objs, i);
+ fade->after = eina_list_nth(transit->objs, i+1);
+
+ evas_object_color_get(fade->before,
+ &fade->before_color.r, &fade->before_color.g,
+ &fade->before_color.b, &fade->before_color.a);
+ evas_object_color_get(fade->after,
+ &fade->after_color.r, &fade->after_color.g,
+ &fade->after_color.b, &fade->after_color.a);
+
+ fade->before_alpha = (255 - fade->before_color.a);
+ fade->after_alpha = (255 - fade->after_color.a);
+
+ data_list = eina_list_append(data_list, fade);
+
+ evas_object_event_callback_add(fade->before,
+ EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data);
+ evas_object_event_callback_add(fade->after,
+ EVAS_CALLBACK_DEL, _fade_object_del_cb, fade_data);
+ }
return data_list;
}
-void
+static void
_transit_effect_fade_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Elm_Fx_Fade *fade = data;
Elm_Fx_Fade_Node *fade_node;
Eina_List *elist, *elist_next;
-
+
EINA_LIST_FOREACH_SAFE(fade->nodes, elist, elist_next, fade_node)
{
evas_object_color_set(fade_node->before, fade_node->before_color.r,
free(fade);
}
-void
+static void
_transit_effect_fade_op(void *data, Elm_Transit *transit __UNUSED__, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Elm_Fx_Fade *fade = data;
Eina_List *elist;
Elm_Fx_Fade_Node *fade_node;
-
float _progress;
-
+
if (!fade->nodes)
- fade->nodes = _fade_nodes_build(transit, fade);
-
+ fade->nodes = _fade_nodes_build(transit, fade);
+
EINA_LIST_FOREACH(fade->nodes, elist, fade_node)
{
if (progress < 0.5)
evas_object_show(fade_node->before);
fade_node->inversed = EINA_TRUE;
}
-
+
_progress = (1 - (progress * 2));
-
+
evas_object_color_set(fade_node->before,
fade_node->before_color.r * _progress,
fade_node->before_color.g * _progress,
fade_node->before_color.b * _progress,
- fade_node->before_color.a + \
+ fade_node->before_color.a +
fade_node->before_alpha * (1 - _progress));
}
else
evas_object_show(fade_node->after);
fade_node->inversed = EINA_FALSE;
}
-
+
_progress = ((progress - 0.5) * 2);
-
+
evas_object_color_set(fade_node->after,
fade_node->after_color.r * _progress,
fade_node->after_color.g * _progress,
fade_node->after_color.b * _progress,
- fade_node->after_color.a + \
+ fade_node->after_color.a +
fade_node->after_alpha * (1 - _progress));
}
}
}
-void *
+static void *
_transit_effect_fade_context_new(void)
{
Elm_Fx_Fade *fade;
elm_transit_effect_fade_add(Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
+
void *effect_context = _transit_effect_fade_context_new();
- if(!effect_context) return NULL;
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_fade_op, effect_context,
_transit_effect_fade_context_free);
Elm_Fx_Blend *blend = data;
Eina_List *elist;
Elm_Fx_Blend_Node *blend_node;
-
+
EINA_LIST_FOREACH(blend->nodes, elist, blend_node)
{
if (blend_node->after == obj)
- evas_object_event_callback_del(blend_node->before,
- EVAS_CALLBACK_DEL, _blend_object_del_cb);
+ evas_object_event_callback_del(blend_node->before,
+ EVAS_CALLBACK_DEL, _blend_object_del_cb);
else if (blend_node->before == obj)
- evas_object_event_callback_del(blend_node->after,
- EVAS_CALLBACK_DEL, _blend_object_del_cb);
+ evas_object_event_callback_del(blend_node->after,
+ EVAS_CALLBACK_DEL, _blend_object_del_cb);
else continue;
-
+
blend->nodes = eina_list_remove_list(blend->nodes, elist);
free(blend_node);
break;
{
Elm_Fx_Blend_Node *blend_node;
Eina_List *data_list = NULL;
-
int i, count;
count = eina_list_count(transit->objs);
- for (i = 0; i < count-1; i+=2)
+ for (i = 0; i < (count - 1); i += 2)
{
- blend_node = ELM_NEW(Elm_Fx_Blend_Node);
- if (!blend_node)
- {
- eina_list_free(data_list);
- return NULL;
- }
-
- blend_node->before = eina_list_nth(transit->objs, i);
- blend_node->after = eina_list_nth(transit->objs, i+1);
- evas_object_show(blend_node->before);
- evas_object_show(blend_node->after);
-
- evas_object_color_get(blend_node->before, &blend_node->from.r,
- &blend_node->from.g, &blend_node->from.b,
- &blend_node->from.a);
- evas_object_color_get(blend_node->after, &blend_node->to.r,
- &blend_node->to.g, &blend_node->to.b,
- &blend_node->to.a);
-
- data_list = eina_list_append(data_list, blend_node);
-
- evas_object_event_callback_add(blend_node->before,
- EVAS_CALLBACK_DEL, _blend_object_del_cb, blend);
- evas_object_event_callback_add(blend_node->after,
- EVAS_CALLBACK_DEL, _blend_object_del_cb, blend);
+ blend_node = ELM_NEW(Elm_Fx_Blend_Node);
+ if (!blend_node)
+ {
+ eina_list_free(data_list);
+ return NULL;
+ }
+
+ blend_node->before = eina_list_nth(transit->objs, i);
+ blend_node->after = eina_list_nth(transit->objs, i + 1);
+ evas_object_show(blend_node->before);
+ evas_object_show(blend_node->after);
+
+ evas_object_color_get(blend_node->before, &blend_node->from.r,
+ &blend_node->from.g, &blend_node->from.b,
+ &blend_node->from.a);
+ evas_object_color_get(blend_node->after, &blend_node->to.r,
+ &blend_node->to.g, &blend_node->to.b,
+ &blend_node->to.a);
+
+ data_list = eina_list_append(data_list, blend_node);
+
+ evas_object_event_callback_add(blend_node->before,
+ EVAS_CALLBACK_DEL, _blend_object_del_cb, blend);
+ evas_object_event_callback_add(blend_node->after,
+ EVAS_CALLBACK_DEL, _blend_object_del_cb, blend);
}
return data_list;
}
_transit_effect_blend_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Elm_Fx_Blend *blend = data;
Elm_Fx_Blend_Node *blend_node;
Eina_List *elist, *elist_next;
evas_object_color_set(blend_node->after, blend_node->to.r,
blend_node->to.g, blend_node->to.b,
blend_node->to.a);
-
+
if (elm_transit_auto_reverse_get(transit))
- evas_object_hide(blend_node->after);
+ evas_object_hide(blend_node->after);
else
- evas_object_hide(blend_node->before);
-
+ evas_object_hide(blend_node->before);
+
blend->nodes = eina_list_remove_list(blend->nodes, elist);
-
+
evas_object_event_callback_del(blend_node->before,
- EVAS_CALLBACK_DEL, _blend_object_del_cb);
+ EVAS_CALLBACK_DEL, _blend_object_del_cb);
evas_object_event_callback_del(blend_node->after,
- EVAS_CALLBACK_DEL, _blend_object_del_cb);
+ EVAS_CALLBACK_DEL, _blend_object_del_cb);
free(blend_node);
}
free(data);
_transit_effect_blend_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Elm_Fx_Blend *blend = data;
Elm_Fx_Blend_Node *blend_node;
Eina_List *elist;
- if (!blend->nodes)
- blend->nodes = _blend_nodes_build(transit, blend);
-
+ if (!blend->nodes) blend->nodes = _blend_nodes_build(transit, blend);
+
EINA_LIST_FOREACH(blend->nodes, elist, blend_node)
{
evas_object_color_set(blend_node->before,
}
}
-void *
+static void *
_transit_effect_blend_context_new(void)
{
Elm_Fx_Blend *blend;
-
+
blend = ELM_NEW(Elm_Fx_Blend);
if (!blend) return NULL;
-
return blend;
}
elm_transit_effect_blend_add(Elm_Transit *transit)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_blend_context_new();
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_blend_op, effect_context,
_transit_effect_blend_context_free);
float from, to;
};
-void
+static void
_transit_effect_rotation_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
free(data);
}
-void
+static void
_transit_effect_rotation_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Elm_Fx_Rotation *rotation = data;
-
Evas_Map *map;
-
Evas_Coord x, y, w, h;
-
float degree;
-
float half_w, half_h;
-
Eina_List *elist;
Evas_Object *obj;
evas_map_util_points_populate_from_object_full(map, obj, 0);
degree = rotation->from + (float)(progress * rotation->to);
- if (!rotation->cw)
- degree *= -1;
-
+ if (!rotation->cw) degree *= -1;
+
evas_object_geometry_get(obj, &x, &y, &w, &h);
- half_w = (float)w *0.5;
-
- half_h = (float)h *0.5;
+ half_w = (float)w * 0.5;
+ half_h = (float)h * 0.5;
evas_map_util_3d_rotate(map, 0, 0, degree, x + half_w, y + half_h, 0);
evas_map_util_3d_perspective(map, x + half_w, y + half_h, 0, FOCAL);
evas_map_free(map);
}
-void *
+static void *
_transit_effect_rotation_context_new(float from_degree, float to_degree, Eina_Bool cw)
{
Elm_Fx_Rotation *rotation;
elm_transit_effect_rotation_add(Elm_Transit *transit, float from_degree, float to_degree, Eina_Bool cw)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_rotation_context_new(from_degree, to_degree, cw);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_rotation_op, effect_context,
_transit_effect_rotation_context_free);
Eina_List *images;
};
-void
+static void
_transit_effect_image_animation_context_free(void *data, Elm_Transit *transit __UNUSED__)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
Elm_Fx_Image_Animation *image_animation = data;
-
const char *image;
Eina_List *elist, *elist_next;
EINA_LIST_FOREACH_SAFE(image_animation->images, elist, elist_next, image)
{
- image_animation->images = \
- eina_list_remove_list(image_animation->images, elist);
+ image_animation->images =
+ eina_list_remove_list(image_animation->images, elist);
eina_stringshare_del(image);
}
free(data);
}
-void
+static void
_transit_effect_image_animation_op(void *data, Elm_Transit *transit, double progress)
{
EINA_SAFETY_ON_NULL_RETURN(data);
-
EINA_SAFETY_ON_NULL_RETURN(transit);
-
Eina_List *elist;
Evas_Object *obj;
const char *type;
-
- type = eina_stringshare_add("icon");
-
- Elm_Fx_Image_Animation *image_animation = (Elm_Fx_Image_Animation *) data;
-
+ Elm_Fx_Image_Animation *image_animation = data;
unsigned int count = 0;
- int len = eina_list_count(image_animation->images);
-
- if (!len)
- count = floor(progress * len);
- else
- count = floor(progress * (len - 1));
+ int len;
+ type = eina_stringshare_add("icon");
+ len = eina_list_count(image_animation->images);
+
+ if (!len) count = floor(progress * len);
+ else count = floor(progress * (len - 1));
+
EINA_LIST_FOREACH(transit->objs, elist, obj)
{
if (elm_widget_type_check(obj, type))
- elm_icon_file_set(obj,
- eina_list_nth(image_animation->images, count), NULL);
+ elm_icon_file_set(obj,
+ eina_list_nth(image_animation->images, count), NULL);
}
eina_stringshare_del(type);
}
-void *
+static void *
_transit_effect_image_animation_context_new(Eina_List *images)
{
Elm_Fx_Image_Animation *image_animation;
-
image_animation = ELM_NEW(Elm_Fx_Image_Animation);
if (!image_animation) return NULL;
-
image_animation->images = images;
-
return image_animation;
}
elm_transit_effect_image_animation_add(Elm_Transit *transit, Eina_List *images)
{
ELM_TRANSIT_CHECK_OR_RETURN(transit, NULL);
-
void *effect_context = _transit_effect_image_animation_context_new(images);
- if(!effect_context) return NULL;
+
+ if (!effect_context) return NULL;
elm_transit_effect_add(transit,
_transit_effect_image_animation_op, effect_context,
_transit_effect_image_animation_context_free);