forked from enlightenment/efl
edje embryo: Now supports get_anim_pos_map
Summary: works just like ecore_animator_pos_map(). @feature Reviewers: seoz, Hermet, cedric, raster Subscribers: cedric, seoz Differential Revision: https://phab.enlightenment.org/D1211
This commit is contained in:
parent
77ad5e3297
commit
17e2c4bc06
|
@ -68,6 +68,22 @@ native reset_timer(id);
|
||||||
native anim (Float:len, fname[], val);
|
native anim (Float:len, fname[], val);
|
||||||
native cancel_anim(id);
|
native cancel_anim(id);
|
||||||
|
|
||||||
|
enum Tween_Mode_Type
|
||||||
|
{
|
||||||
|
TWEEN_MODE_LINEAR,
|
||||||
|
TWEEN_MODE_ACCELERATE,
|
||||||
|
TWEEN_MODE_DECELERATE,
|
||||||
|
TWEEN_MODE_SINUSOIDAL,
|
||||||
|
TWEEN_MODE_ACCELERATE_FACTOR,
|
||||||
|
TWEEN_MODE_DECELERATE_FACTOR,
|
||||||
|
TWEEN_MODE_SINUSOIDAL_FACTOR,
|
||||||
|
TWEEN_MODE_DIVISOR_INTERP,
|
||||||
|
TWEEN_MODE_BOUNCE,
|
||||||
|
TWEEN_MODE_SPRING
|
||||||
|
};
|
||||||
|
|
||||||
|
native get_anim_pos_map(Float:pos, Tween_Mode_Type:tween, Float:v1, Float:v2, &Float:ret);
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
/* Edje utility calls for dealing with edjes/programs etc. */
|
/* Edje utility calls for dealing with edjes/programs etc. */
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
|
@ -687,6 +687,54 @@ _edje_embryo_fn_cancel_anim(Embryo_Program *ep, Embryo_Cell *params)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get_anim_pos_map(Float:pos, Tween_Mode_Type:tween, Float:v1, Float:v2, &Float:ret) */
|
||||||
|
static Embryo_Cell
|
||||||
|
_edje_embryo_fn_get_anim_pos_map(Embryo_Program *ep, Embryo_Cell *params)
|
||||||
|
{
|
||||||
|
double pos;
|
||||||
|
Ecore_Pos_Map tween;
|
||||||
|
double v1, v2;
|
||||||
|
|
||||||
|
CHKPARAM(5);
|
||||||
|
pos = EMBRYO_CELL_TO_FLOAT(params[1]);
|
||||||
|
tween = params[2];
|
||||||
|
v1 = EMBRYO_CELL_TO_FLOAT(params[3]);
|
||||||
|
v2 = EMBRYO_CELL_TO_FLOAT(params[4]);
|
||||||
|
|
||||||
|
switch(tween)
|
||||||
|
{
|
||||||
|
case ECORE_POS_MAP_LINEAR:
|
||||||
|
case ECORE_POS_MAP_ACCELERATE:
|
||||||
|
case ECORE_POS_MAP_DECELERATE:
|
||||||
|
case ECORE_POS_MAP_SINUSOIDAL:
|
||||||
|
pos = ecore_animator_pos_map(pos, tween, 0, 0);
|
||||||
|
break;
|
||||||
|
case ECORE_POS_MAP_ACCELERATE_FACTOR:
|
||||||
|
pos = ecore_animator_pos_map(pos, ECORE_POS_MAP_ACCELERATE_FACTOR,
|
||||||
|
v1, 0);
|
||||||
|
break;
|
||||||
|
case ECORE_POS_MAP_DECELERATE_FACTOR:
|
||||||
|
pos = ecore_animator_pos_map(pos, ECORE_POS_MAP_DECELERATE_FACTOR,
|
||||||
|
v1, 0);
|
||||||
|
break;
|
||||||
|
case ECORE_POS_MAP_SINUSOIDAL_FACTOR:
|
||||||
|
pos = ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL_FACTOR,
|
||||||
|
v1, 0);
|
||||||
|
break;
|
||||||
|
case ECORE_POS_MAP_DIVISOR_INTERP:
|
||||||
|
case ECORE_POS_MAP_BOUNCE:
|
||||||
|
case ECORE_POS_MAP_SPRING:
|
||||||
|
pos = ecore_animator_pos_map(pos, tween, v1, v2);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SETFLOAT(pos, params[5]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* set_min_size(Float:w, Float:h) */
|
/* set_min_size(Float:w, Float:h) */
|
||||||
static Embryo_Cell
|
static Embryo_Cell
|
||||||
_edje_embryo_fn_set_min_size(Embryo_Program *ep, Embryo_Cell *params)
|
_edje_embryo_fn_set_min_size(Embryo_Program *ep, Embryo_Cell *params)
|
||||||
|
@ -3741,6 +3789,7 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
|
||||||
|
|
||||||
embryo_program_native_call_add(ep, "anim", _edje_embryo_fn_anim);
|
embryo_program_native_call_add(ep, "anim", _edje_embryo_fn_anim);
|
||||||
embryo_program_native_call_add(ep, "cancel_anim", _edje_embryo_fn_cancel_anim);
|
embryo_program_native_call_add(ep, "cancel_anim", _edje_embryo_fn_cancel_anim);
|
||||||
|
embryo_program_native_call_add(ep, "get_anim_pos_map", _edje_embryo_fn_get_anim_pos_map);
|
||||||
|
|
||||||
embryo_program_native_call_add(ep, "emit", _edje_embryo_fn_emit);
|
embryo_program_native_call_add(ep, "emit", _edje_embryo_fn_emit);
|
||||||
embryo_program_native_call_add(ep, "get_part_id", _edje_embryo_fn_get_part_id);
|
embryo_program_native_call_add(ep, "get_part_id", _edje_embryo_fn_get_part_id);
|
||||||
|
|
Loading…
Reference in New Issue