summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-02-03 17:18:52 -0500
committerzmike <michael.blumenkrantz@gmail.com>2014-02-03 17:19:31 -0500
commit0ee6327035ea1109fddfe929547c3c1c6e521429 (patch)
tree494dcd8e02c256351e7edf5eee17c4963d3a7238
parenta5a907023dd7e7abdc75c20117eeacfa3992d776 (diff)
edje embryo now supports reset_timer()
works the same as ecore_timer_reset()
-rw-r--r--data/edje/include/edje.inc1
-rw-r--r--src/lib/edje/edje_embryo.c17
-rw-r--r--src/lib/edje/edje_var.c10
3 files changed, 28 insertions, 0 deletions
diff --git a/data/edje/include/edje.inc b/data/edje/include/edje.inc
index a75e3cf267..1cf7b89f84 100644
--- a/data/edje/include/edje.inc
+++ b/data/edje/include/edje.inc
@@ -60,6 +60,7 @@ native Float:fetch_float (id, pos);
60/********************/ 60/********************/
61native timer (Float:in, fname[], val); 61native timer (Float:in, fname[], val);
62native cancel_timer(id); 62native cancel_timer(id);
63native reset_timer(id);
63 64
64/*******************/ 65/*******************/
65/* Edje anim calls */ 66/* Edje anim calls */
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index 5fa5ba308e..a22bc31b35 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -66,6 +66,7 @@
66 * set_str(id, str[]) 66 * set_str(id, str[])
67 * timer(Float:in, fname[], val) 67 * timer(Float:in, fname[], val)
68 * cancel_timer(id) 68 * cancel_timer(id)
69 * reset_timer(id)
69 * anim(Float:len, fname[], val) 70 * anim(Float:len, fname[], val)
70 * cancel_anim(id) 71 * cancel_anim(id)
71 * emit(sig[], src[]) 72 * emit(sig[], src[])
@@ -635,6 +636,21 @@ _edje_embryo_fn_cancel_timer(Embryo_Program *ep, Embryo_Cell *params)
635 return 0; 636 return 0;
636} 637}
637 638
639/* reset_timer(id) */
640static Embryo_Cell
641_edje_embryo_fn_reset_timer(Embryo_Program *ep, Embryo_Cell *params)
642{
643 Edje *ed;
644 int id;
645
646 CHKPARAM(1);
647 ed = embryo_program_data_get(ep);
648 id = params[1];
649 if (id <= 0) return 0;
650 _edje_var_timer_del(ed, id);
651 return 0;
652}
653
638/* anim(Float:len, fname[], val) */ 654/* anim(Float:len, fname[], val) */
639static Embryo_Cell 655static Embryo_Cell
640_edje_embryo_fn_anim(Embryo_Program *ep, Embryo_Cell *params) 656_edje_embryo_fn_anim(Embryo_Program *ep, Embryo_Cell *params)
@@ -3690,6 +3706,7 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
3690 3706
3691 embryo_program_native_call_add(ep, "timer", _edje_embryo_fn_timer); 3707 embryo_program_native_call_add(ep, "timer", _edje_embryo_fn_timer);
3692 embryo_program_native_call_add(ep, "cancel_timer", _edje_embryo_fn_cancel_timer); 3708 embryo_program_native_call_add(ep, "cancel_timer", _edje_embryo_fn_cancel_timer);
3709 embryo_program_native_call_add(ep, "reset_timer", _edje_embryo_fn_reset_timer);
3693 3710
3694 embryo_program_native_call_add(ep, "anim", _edje_embryo_fn_anim); 3711 embryo_program_native_call_add(ep, "anim", _edje_embryo_fn_anim);
3695 embryo_program_native_call_add(ep, "cancel_anim", _edje_embryo_fn_cancel_anim); 3712 embryo_program_native_call_add(ep, "cancel_anim", _edje_embryo_fn_cancel_anim);
diff --git a/src/lib/edje/edje_var.c b/src/lib/edje/edje_var.c
index 5e40f627c7..10ac2dd64d 100644
--- a/src/lib/edje/edje_var.c
+++ b/src/lib/edje/edje_var.c
@@ -1022,6 +1022,16 @@ _edje_var_timer_del(Edje *ed, int id)
1022 free(et); 1022 free(et);
1023} 1023}
1024 1024
1025void
1026_edje_var_timer_reset(Edje *ed, int id)
1027{
1028 Edje_Var_Timer *et;
1029
1030 et = _edje_var_timer_find(ed, id);
1031 if (et)
1032 ecore_timer_reset(et->timer);
1033}
1034
1025int 1035int
1026_edje_var_anim_add(Edje *ed, double len, const char *fname, int val) 1036_edje_var_anim_add(Edje *ed, double len, const char *fname, int val)
1027{ 1037{