edje embryo now supports reset_timer()

works the same as ecore_timer_reset()
This commit is contained in:
zmike 2014-02-03 17:18:52 -05:00
parent a5a907023d
commit 0ee6327035
3 changed files with 28 additions and 0 deletions

View File

@ -60,6 +60,7 @@ native Float:fetch_float (id, pos);
/********************/
native timer (Float:in, fname[], val);
native cancel_timer(id);
native reset_timer(id);
/*******************/
/* Edje anim calls */

View File

@ -66,6 +66,7 @@
* set_str(id, str[])
* timer(Float:in, fname[], val)
* cancel_timer(id)
* reset_timer(id)
* anim(Float:len, fname[], val)
* cancel_anim(id)
* emit(sig[], src[])
@ -635,6 +636,21 @@ _edje_embryo_fn_cancel_timer(Embryo_Program *ep, Embryo_Cell *params)
return 0;
}
/* reset_timer(id) */
static Embryo_Cell
_edje_embryo_fn_reset_timer(Embryo_Program *ep, Embryo_Cell *params)
{
Edje *ed;
int id;
CHKPARAM(1);
ed = embryo_program_data_get(ep);
id = params[1];
if (id <= 0) return 0;
_edje_var_timer_del(ed, id);
return 0;
}
/* anim(Float:len, fname[], val) */
static Embryo_Cell
_edje_embryo_fn_anim(Embryo_Program *ep, Embryo_Cell *params)
@ -3690,6 +3706,7 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
embryo_program_native_call_add(ep, "timer", _edje_embryo_fn_timer);
embryo_program_native_call_add(ep, "cancel_timer", _edje_embryo_fn_cancel_timer);
embryo_program_native_call_add(ep, "reset_timer", _edje_embryo_fn_reset_timer);
embryo_program_native_call_add(ep, "anim", _edje_embryo_fn_anim);
embryo_program_native_call_add(ep, "cancel_anim", _edje_embryo_fn_cancel_anim);

View File

@ -1022,6 +1022,16 @@ _edje_var_timer_del(Edje *ed, int id)
free(et);
}
void
_edje_var_timer_reset(Edje *ed, int id)
{
Edje_Var_Timer *et;
et = _edje_var_timer_find(ed, id);
if (et)
ecore_timer_reset(et->timer);
}
int
_edje_var_anim_add(Edje *ed, double len, const char *fname, int val)
{