summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_embryo.c
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2015-06-25 15:56:48 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-25 17:21:09 +0200
commitef491e697e60a6e79bec27164342bfb103d2c95a (patch)
treef88a47eb729816224266c7394dc82bdffa2c19a5 /src/lib/edje/edje_embryo.c
parent70e5687f6c43ffd3a66de592e625ff59c15909b6 (diff)
edje: implement methods for mouse_events with edje_part for Edje Embryo script.
Summary: In edje_embryo.c, there are the list for supported methods in script. However, methods listed from line 175 to 188 don't exist actually. This patch implements 4 methods among them. set_mouse_events(part_id, ev) get_mouse_events(part_id) set_repeat_events(part_id, rep) get_repeat_events(part_id) Reviewers: Hermet, woohyun, cedric Reviewed By: cedric Subscribers: cedric, Hermet Differential Revision: https://phab.enlightenment.org/D2766 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r--src/lib/edje/edje_embryo.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index 2977a544d4..ddf4ebdfda 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -3462,6 +3462,96 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
3462 return 0; 3462 return 0;
3463} 3463}
3464 3464
3465/* set_mouse_events(part_id, ev) */
3466static Embryo_Cell
3467_edje_embryo_fn_set_mouse_events(Embryo_Program *ep, Embryo_Cell *params)
3468{
3469 int part_id = 0;
3470 Edje *ed;
3471 Edje_Real_Part *rp;
3472
3473 CHKPARAM(2);
3474
3475 part_id = params[1];
3476 if (part_id < 0) return 0;
3477
3478 ed = embryo_program_data_get(ep);
3479 rp = ed->table_parts[part_id % ed->table_parts_size];
3480
3481 if (rp)
3482 _edje_part_mouse_events_set(ed, rp, params[2]);
3483
3484 return 0;
3485}
3486
3487/* get_mouse_events(part_id) */
3488static Embryo_Cell
3489_edje_embryo_fn_get_mouse_events(Embryo_Program *ep, Embryo_Cell *params)
3490{
3491 int part_id = 0;
3492 Edje *ed;
3493 Edje_Real_Part *rp;
3494
3495 CHKPARAM(1);
3496
3497 part_id = params[1];
3498 if (part_id < 0) return 0;
3499
3500 ed = embryo_program_data_get(ep);
3501 rp = ed->table_parts[part_id % ed->table_parts_size];
3502
3503 if (rp)
3504 return (Embryo_Cell)_edje_var_int_get(ed, (int)_edje_part_mouse_events_get(ed, rp));
3505
3506 return 0;
3507
3508}
3509
3510/* set_repeat_events(part_id, rep) */
3511static Embryo_Cell
3512_edje_embryo_fn_set_repeat_events(Embryo_Program *ep, Embryo_Cell *params)
3513{
3514 int part_id = 0;
3515 Edje *ed;
3516 Edje_Real_Part *rp;
3517
3518 CHKPARAM(2);
3519
3520 part_id = params[1];
3521 if (part_id < 0) return 0;
3522
3523 ed = embryo_program_data_get(ep);
3524 rp = ed->table_parts[part_id % ed->table_parts_size];
3525
3526 if (rp)
3527 _edje_part_repeat_events_set(ed, rp, params[2]);
3528
3529 return 0;
3530}
3531
3532/* get_repeat_events(part_id) */
3533static Embryo_Cell
3534_edje_embryo_fn_get_repeat_events(Embryo_Program *ep, Embryo_Cell *params)
3535{
3536 int part_id = 0;
3537 Edje *ed;
3538 Edje_Real_Part *rp;
3539
3540 CHKPARAM(1);
3541
3542 part_id = params[1];
3543 if (part_id < 0) return 0;
3544
3545 ed = embryo_program_data_get(ep);
3546 rp = ed->table_parts[part_id % ed->table_parts_size];
3547
3548 if (rp)
3549 return (Embryo_Cell)_edje_var_int_get(ed, (int)_edje_part_repeat_events_get(ed, rp));
3550
3551 return 0;
3552
3553}
3554
3465/* part_swallow(part_id, group_name) */ 3555/* part_swallow(part_id, group_name) */
3466static Embryo_Cell 3556static Embryo_Cell
3467_edje_embryo_fn_part_swallow(Embryo_Program *ep, Embryo_Cell *params) 3557_edje_embryo_fn_part_swallow(Embryo_Program *ep, Embryo_Cell *params)
@@ -4191,6 +4281,11 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
4191 embryo_program_native_call_add(ep, "get_state_val", _edje_embryo_fn_get_state_val); 4281 embryo_program_native_call_add(ep, "get_state_val", _edje_embryo_fn_get_state_val);
4192 embryo_program_native_call_add(ep, "set_state_anim", _edje_embryo_fn_set_state_anim); 4282 embryo_program_native_call_add(ep, "set_state_anim", _edje_embryo_fn_set_state_anim);
4193 4283
4284 embryo_program_native_call_add(ep, "set_mouse_events", _edje_embryo_fn_set_mouse_events);
4285 embryo_program_native_call_add(ep, "get_mouse_events", _edje_embryo_fn_get_mouse_events);
4286 embryo_program_native_call_add(ep, "set_repeat_events", _edje_embryo_fn_set_repeat_events);
4287 embryo_program_native_call_add(ep, "get_repeat_events", _edje_embryo_fn_get_repeat_events);
4288
4194 embryo_program_native_call_add(ep, "part_swallow", _edje_embryo_fn_part_swallow); 4289 embryo_program_native_call_add(ep, "part_swallow", _edje_embryo_fn_part_swallow);
4195 4290
4196 embryo_program_native_call_add(ep, "external_param_get_int", _edje_embryo_fn_external_param_get_int); 4291 embryo_program_native_call_add(ep, "external_param_get_int", _edje_embryo_fn_external_param_get_int);