summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2015-07-29 22:29:41 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-04 17:34:30 +0200
commit815ebc0b0eb513072ae35ac801304a3228f208e2 (patch)
tree6d02b4c04bd44682a6e15044a727cf7f7e591a62 /src/lib/edje
parentbe33840b6b703f2b1e64c8e4788f968ad8c7f87b (diff)
edje_embryo: add methods to handle event flags.
Summary: Add embryo methods that change the state whether Edje_Part will handle Evas_Event or not. Reviewers: Hermet, woohyun, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2807 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_embryo.c98
-rw-r--r--src/lib/edje/edje_private.h4
-rw-r--r--src/lib/edje/edje_util.c32
3 files changed, 134 insertions, 0 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index 2b1a666bf1..b272594489 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -184,6 +184,10 @@
184 * get_mouse_events(part_id) 184 * get_mouse_events(part_id)
185 * set_repeat_events(part_id, rep) 185 * set_repeat_events(part_id, rep)
186 * get_repeat_events(part_id) 186 * get_repeat_events(part_id)
187 * set_ignore_flags(part_id, flags)
188 * get_ignore_flags(part_id)
189 * set_mask_flags(part_id, flags)
190 * get_mask_flags(part_id)
187 * set_clip(part_id, clip_part_id) 191 * set_clip(part_id, clip_part_id)
188 * get_clip(part_id) 192 * get_clip(part_id)
189 * 193 *
@@ -3552,6 +3556,96 @@ _edje_embryo_fn_get_repeat_events(Embryo_Program *ep, Embryo_Cell *params)
3552 3556
3553} 3557}
3554 3558
3559/* set_ignore_flags(part_id, flags) */
3560static Embryo_Cell
3561_edje_embryo_fn_set_ignore_flags(Embryo_Program *ep, Embryo_Cell *params)
3562{
3563 int part_id = 0;
3564 Edje *ed;
3565 Edje_Real_Part *rp;
3566
3567 CHKPARAM(2);
3568
3569 part_id = params[1];
3570 if (part_id < 0) return 0;
3571
3572 ed = embryo_program_data_get(ep);
3573 rp = ed->table_parts[part_id % ed->table_parts_size];
3574
3575 if (rp)
3576 _edje_part_ignore_flags_set(ed, rp, params[2]);
3577
3578 return 0;
3579}
3580
3581/* get_ignore_flags(part_id) */
3582static Embryo_Cell
3583_edje_embryo_fn_get_ignore_flags(Embryo_Program *ep, Embryo_Cell *params)
3584{
3585 int part_id = 0;
3586 Edje *ed;
3587 Edje_Real_Part *rp;
3588
3589 CHKPARAM(1);
3590
3591 part_id = params[1];
3592 if (part_id < 0) return 0;
3593
3594 ed = embryo_program_data_get(ep);
3595 rp = ed->table_parts[part_id % ed->table_parts_size];
3596
3597 if (rp)
3598 return (Embryo_Cell)_edje_var_int_get(ed, (int)_edje_part_ignore_flags_get(ed, rp));
3599
3600 return 0;
3601
3602}
3603
3604/* set_mask_flags(part_id, flags) */
3605static Embryo_Cell
3606_edje_embryo_fn_set_mask_flags(Embryo_Program *ep, Embryo_Cell *params)
3607{
3608 int part_id = 0;
3609 Edje *ed;
3610 Edje_Real_Part *rp;
3611
3612 CHKPARAM(2);
3613
3614 part_id = params[1];
3615 if (part_id < 0) return 0;
3616
3617 ed = embryo_program_data_get(ep);
3618 rp = ed->table_parts[part_id % ed->table_parts_size];
3619
3620 if (rp)
3621 _edje_part_mask_flags_set(ed, rp, params[2]);
3622
3623 return 0;
3624}
3625
3626/* get_mask_flags(part_id) */
3627static Embryo_Cell
3628_edje_embryo_fn_get_mask_flags(Embryo_Program *ep, Embryo_Cell *params)
3629{
3630 int part_id = 0;
3631 Edje *ed;
3632 Edje_Real_Part *rp;
3633
3634 CHKPARAM(1);
3635
3636 part_id = params[1];
3637 if (part_id < 0) return 0;
3638
3639 ed = embryo_program_data_get(ep);
3640 rp = ed->table_parts[part_id % ed->table_parts_size];
3641
3642 if (rp)
3643 return (Embryo_Cell)_edje_var_int_get(ed, (int)_edje_part_mask_flags_get(ed, rp));
3644
3645 return 0;
3646
3647}
3648
3555/* part_swallow(part_id, group_name) */ 3649/* part_swallow(part_id, group_name) */
3556static Embryo_Cell 3650static Embryo_Cell
3557_edje_embryo_fn_part_swallow(Embryo_Program *ep, Embryo_Cell *params) 3651_edje_embryo_fn_part_swallow(Embryo_Program *ep, Embryo_Cell *params)
@@ -4285,6 +4379,10 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
4285 embryo_program_native_call_add(ep, "get_mouse_events", _edje_embryo_fn_get_mouse_events); 4379 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); 4380 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); 4381 embryo_program_native_call_add(ep, "get_repeat_events", _edje_embryo_fn_get_repeat_events);
4382 embryo_program_native_call_add(ep, "set_ignore_flags", _edje_embryo_fn_set_ignore_flags);
4383 embryo_program_native_call_add(ep, "get_ignore_flags", _edje_embryo_fn_get_ignore_flags);
4384 embryo_program_native_call_add(ep, "set_mask_flags", _edje_embryo_fn_set_mask_flags);
4385 embryo_program_native_call_add(ep, "get_mask_flags", _edje_embryo_fn_get_mask_flags);
4288 4386
4289 embryo_program_native_call_add(ep, "part_swallow", _edje_embryo_fn_part_swallow); 4387 embryo_program_native_call_add(ep, "part_swallow", _edje_embryo_fn_part_swallow);
4290 4388
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 5044413b77..e629923596 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2881,6 +2881,10 @@ Eina_Bool _edje_part_mouse_events_get(Edje *ed, Edje_Real_Part *rp);
2881void _edje_part_mouse_events_set(Edje *ed, Edje_Real_Part *rp, Eina_Bool mouse_events); 2881void _edje_part_mouse_events_set(Edje *ed, Edje_Real_Part *rp, Eina_Bool mouse_events);
2882Eina_Bool _edje_part_repeat_events_get(Edje *ed, Edje_Real_Part *rp); 2882Eina_Bool _edje_part_repeat_events_get(Edje *ed, Edje_Real_Part *rp);
2883void _edje_part_repeat_events_set(Edje *ed, Edje_Real_Part *rp, Eina_Bool repeat_events); 2883void _edje_part_repeat_events_set(Edje *ed, Edje_Real_Part *rp, Eina_Bool repeat_events);
2884Evas_Event_Flags _edje_part_ignore_flags_get(Edje *ed, Edje_Real_Part *rp);
2885void _edje_part_ignore_flags_set(Edje *ed, Edje_Real_Part *rp, Evas_Event_Flags ignore_flags);
2886Evas_Event_Flags _edje_part_mask_flags_get(Edje *ed, Edje_Real_Part *rp);
2887void _edje_part_mask_flags_set(Edje *ed, Edje_Real_Part *rp, Evas_Event_Flags mask_flags);
2884 2888
2885#ifdef HAVE_LIBREMIX 2889#ifdef HAVE_LIBREMIX
2886#include <remix/remix.h> 2890#include <remix/remix.h>
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index c7913ecbac..c0bb3f512c 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -5765,4 +5765,36 @@ _edje_part_repeat_events_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Eina_Bool
5765 evas_object_repeat_events_set(rp->object, 0); 5765 evas_object_repeat_events_set(rp->object, 0);
5766} 5766}
5767 5767
5768Evas_Event_Flags
5769_edje_part_ignore_flags_get(Edje *ed EINA_UNUSED, Edje_Real_Part *rp)
5770{
5771 if (!rp) return EVAS_EVENT_FLAG_NONE;
5772
5773 return rp->part->ignore_flags;
5774}
5775
5776void
5777_edje_part_ignore_flags_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Evas_Event_Flags ignore_flags)
5778{
5779 if (!rp) return;
5780
5781 rp->part->ignore_flags = ignore_flags;
5782}
5783
5784Evas_Event_Flags
5785_edje_part_mask_flags_get(Edje *ed EINA_UNUSED, Edje_Real_Part *rp)
5786{
5787 if (!rp) return EVAS_EVENT_FLAG_NONE;
5788
5789 return rp->part->mask_flags;
5790}
5791
5792void
5793_edje_part_mask_flags_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Evas_Event_Flags mask_flags)
5794{
5795 if (!rp) return;
5796
5797 rp->part->mask_flags = mask_flags;
5798}
5799
5768/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 5800/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/