From 30885daafa1e217bf43fd649312d502b927e28e3 Mon Sep 17 00:00:00 2001 From: Vorobiov Vitalii Date: Wed, 4 Jun 2014 20:01:40 +0200 Subject: [PATCH] edje: Edje_Edit - add edje_edit_part_precide_is_inside functions. Summary: Add two main functions - edje_edit_part_precise_is_inside_get - edje_edit_part_precise_is_inside_set Also support precise_is_inside into part's source code generation. @feature Reviewers: cedric, seoz, Hermet, raster CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D945 Signed-off-by: Cedric BAIL --- src/lib/edje/Edje_Edit.h | 19 +++++++++++++++++++ src/lib/edje/edje_edit.c | 23 ++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 6712d8cecb..eda66c09b9 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -1215,6 +1215,25 @@ EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *pa */ EAPI Eina_Bool edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events); +/** Get precise_is_inside for part. + * + * @param obj Object being edited. + * @param part Part to get if it will enable point collision detection for the part. + * + * @return EINA_TRUE if point collision detection for the part is enabled, EINA_FALSE otherwise + */ +EAPI Eina_Bool edje_edit_part_precise_is_inside_get(Evas_Object *obj, const char *part); + +/** Set precise_is_inside for part. + * + * @param obj Object being edited. + * @param part Part to set if it will enable point collision detection for the part. + * @param precise_is_inside EINA_TRUE if point collision detection for the part is enabled, EINA_FALSE otherwise + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. + */ +EAPI Eina_Bool edje_edit_part_precise_is_inside_set(Evas_Object *obj, const char *part, Eina_Bool precise_is_inside); + /** Get ignore_flags for part. * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 38e1c020b3..ff020dac33 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -2895,6 +2895,26 @@ edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool r return EINA_TRUE; } + +EAPI Eina_Bool +edje_edit_part_precise_is_inside_get(Evas_Object *obj, const char *part) +{ + GET_RP_OR_RETURN(0); + + return rp->part->precise_is_inside; +} + +EAPI Eina_Bool +edje_edit_part_precise_is_inside_set(Evas_Object *obj, const char *part, Eina_Bool precise_is_inside) +{ + GET_RP_OR_RETURN(EINA_FALSE); + + if (!rp->object) return EINA_FALSE; + + rp->part->precise_is_inside = precise_is_inside; + return EINA_TRUE; +} + EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part) { @@ -8094,7 +8114,8 @@ _edje_generate_source_of_part(Evas_Object *obj, Edje_Part *ep, Eina_Strbuf *buf) //TODO Support ignore_flags if (edje_edit_part_pointer_mode_get(obj, part) == EVAS_OBJECT_POINTER_MODE_NOGRAB) BUF_APPEND(I4"pointer_mode: NOGRAB;\n"); - //TODO Support precise_is_inside + if (edje_edit_part_precise_is_inside_get(obj, part)) + BUF_APPEND(I4"precise_is_inside: 1;\n"); //TODO Support use_alternate_font_metrics if ((str = edje_edit_part_clip_to_get(obj, part))) {