From a5e183ad5d1c4495c2149341b4a6e7c086b26e00 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 27 Feb 2019 13:17:37 -0500 Subject: [PATCH] efl.canvas.object: clip -> clipper && clipees -> clipped_objects Summary: also clipees_has -> clipped_objects_count ref T7555 Depends on D8039 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7555 Differential Revision: https://phab.enlightenment.org/D8040 --- .../evas/evas-object-manipulation-eo.c | 8 ++-- .../elementary/efl_page_transition_scroll.c | 38 +++++++++--------- src/lib/elementary/efl_ui_image.c | 8 ++-- src/lib/elementary/efl_ui_image.eo | 2 +- src/lib/elementary/efl_ui_pager.c | 20 +++++----- src/lib/elementary/efl_ui_text.c | 2 +- src/lib/elementary/efl_ui_widget.c | 6 +-- src/lib/elementary/efl_ui_widget.eo | 2 +- src/lib/evas/Evas_Legacy.h | 13 +++++++ src/lib/evas/canvas/efl_canvas_group.eo | 2 +- src/lib/evas/canvas/efl_canvas_object.eo | 19 ++++----- src/lib/evas/canvas/evas_clip.c | 39 +++++++++++-------- src/lib/evas/canvas/evas_object_intercept.c | 4 +- src/lib/evas/canvas/evas_object_main.c | 8 ++-- src/lib/evas/canvas/evas_object_smart.c | 14 +++---- src/lib/evas/include/evas_private.h | 6 +-- src/tests/edje/edje_test_features.c | 4 +- src/tests/evas/evas_test_mask.c | 2 +- 18 files changed, 109 insertions(+), 88 deletions(-) diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c index 081d063641..4d4c37fa90 100644 --- a/src/examples/evas/evas-object-manipulation-eo.c +++ b/src/examples/evas/evas-object-manipulation-eo.c @@ -122,15 +122,15 @@ _on_keydown(void *data EINA_UNUSED, printf("Toggling clipping "); Evas_Object *clip = NULL; - clip = efl_canvas_object_clip_get(d.img); + clip = efl_canvas_object_clipper_get(d.img); if (clip == d.clipper) { - efl_canvas_object_clip_set(d.img, NULL); + efl_canvas_object_clipper_set(d.img, NULL); printf("off\n"); } else { - efl_canvas_object_clip_set(d.img, d.clipper); + efl_canvas_object_clipper_set(d.img, d.clipper); printf("on\n"); } return; @@ -237,7 +237,7 @@ main(void) efl_gfx_entity_size_set(d.clipper, EINA_SIZE2D(WIDTH / 2, HEIGHT / 2)); efl_gfx_entity_visible_set(d.clipper, EINA_TRUE); - efl_canvas_object_clip_set(d.img, d.clipper); + efl_canvas_object_clipper_set(d.img, d.clipper); printf("%s", commands); diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c index 34209aea63..4979206153 100644 --- a/src/lib/elementary/efl_page_transition_scroll.c +++ b/src/lib/elementary/efl_page_transition_scroll.c @@ -116,10 +116,10 @@ _page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd, { if (curr->visible) { - efl_canvas_object_clip_set(curr->obj, pd->backclip); + efl_canvas_object_clipper_set(curr->obj, pd->backclip); efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); curr->content_num = -1; curr->content = NULL; @@ -140,10 +140,10 @@ _page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd, { tmp = efl_pack_content_get(spd->pager.obj, tmp_id); - efl_canvas_object_clip_set(curr->obj, pd->foreclip); + efl_canvas_object_clipper_set(curr->obj, pd->foreclip); efl_pack(curr->obj, tmp); - efl_canvas_object_clip_set(tmp, pd->foreclip); + efl_canvas_object_clipper_set(tmp, pd->foreclip); curr->content_num = tmp_id; curr->content = tmp; @@ -152,10 +152,10 @@ _page_info_geometry_change(Efl_Page_Transition_Scroll_Data *pd, } else if (curr->content) { - efl_canvas_object_clip_set(curr->obj, pd->backclip); + efl_canvas_object_clipper_set(curr->obj, pd->backclip); efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); curr->content_num = -1; curr->content = NULL; @@ -249,7 +249,7 @@ _efl_page_transition_scroll_efl_page_transition_bind(Eo *obj, for (i = 0; i < cnt; i++) { item = efl_pack_content_get(spd->pager.obj, i); - efl_canvas_object_clip_set(item, pd->backclip); + efl_canvas_object_clipper_set(item, pd->backclip); } _page_info_allocate(pd, spd); _page_info_geometry_change(pd, spd); @@ -314,9 +314,9 @@ _efl_page_transition_scroll_update(Eo *obj, if (dummy->visible) { - efl_canvas_object_clip_set(dummy->obj, pd->backclip); + efl_canvas_object_clipper_set(dummy->obj, pd->backclip); efl_pack_unpack(dummy->obj, dummy->content); - efl_canvas_object_clip_set(dummy->content, pd->backclip); + efl_canvas_object_clipper_set(dummy->content, pd->backclip); dummy->content_num = -1; dummy->content = NULL; @@ -340,10 +340,10 @@ _efl_page_transition_scroll_update(Eo *obj, { if (curr->visible) { - efl_canvas_object_clip_set(curr->obj, pd->backclip); + efl_canvas_object_clipper_set(curr->obj, pd->backclip); efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); curr->content_num = -1; curr->content = NULL; @@ -367,13 +367,13 @@ _efl_page_transition_scroll_update(Eo *obj, if (curr->content) { efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); } - efl_canvas_object_clip_set(curr->obj, pd->foreclip); + efl_canvas_object_clipper_set(curr->obj, pd->foreclip); efl_pack(curr->obj, tmp); - efl_canvas_object_clip_set(tmp, pd->foreclip); + efl_canvas_object_clipper_set(tmp, pd->foreclip); curr->content_num = tmp_id; curr->content = tmp; @@ -382,10 +382,10 @@ _efl_page_transition_scroll_update(Eo *obj, } else if (curr->content) { - efl_canvas_object_clip_set(curr->obj, pd->backclip); + efl_canvas_object_clipper_set(curr->obj, pd->backclip); efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); curr->content_num = -1; curr->content = NULL; @@ -480,7 +480,7 @@ _add_item(Efl_Page_Transition_Scroll_Data *pd, Efl_Page_Transition_Data *spd) static void _remove_item(Page_Info *pi, Efl_Page_Transition_Scroll_Data *pd) { - efl_canvas_object_clip_set(pi->content, pd->backclip); + efl_canvas_object_clipper_set(pi->content, pd->backclip); efl_pack_unpack(pi->obj, pi->content); efl_del(pi->obj); pi->prev->next = pi->next; @@ -583,7 +583,7 @@ _efl_page_transition_scroll_loop_set(Eo *obj, tmp = efl_pack_content_get(spd->pager.obj, tmp_id); efl_pack(curr->obj, tmp); - efl_canvas_object_clip_set(tmp, pd->foreclip); + efl_canvas_object_clipper_set(tmp, pd->foreclip); curr->content_num = tmp_id; curr->content = tmp; @@ -593,7 +593,7 @@ _efl_page_transition_scroll_loop_set(Eo *obj, case EFL_UI_PAGER_LOOP_DISABLED: efl_pack_unpack(curr->obj, curr->content); - efl_canvas_object_clip_set(curr->content, pd->backclip); + efl_canvas_object_clipper_set(curr->content, pd->backclip); curr->content_num = -1; curr->content = NULL; diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index d4089edd1f..479f1e4d4a 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -81,8 +81,8 @@ static void _recover_status(Eo *obj, Efl_Ui_Image_Data *sd) { int r, g, b, a; - Evas_Object *pclip = efl_canvas_object_clip_get(obj); - if (pclip) efl_canvas_object_clip_set(sd->img, pclip); + Evas_Object *pclip = efl_canvas_object_clipper_get(obj); + if (pclip) efl_canvas_object_clipper_set(sd->img, pclip); efl_gfx_color_get(obj, &r, &g, &b, &a); efl_gfx_color_set(sd->img, r, g, b, a); @@ -706,12 +706,12 @@ _efl_ui_image_efl_gfx_color_color_set(Eo *obj, Efl_Ui_Image_Data *sd, int r, int } EOLIAN static void -_efl_ui_image_efl_canvas_object_clip_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *clip) +_efl_ui_image_efl_canvas_object_clipper_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *clip) { if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(obj, MY_CLASS), clip); if (sd->img) evas_object_clip_set(sd->img, clip); if (sd->prev_img) evas_object_clip_set(sd->prev_img, clip); diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo index 109ef76d57..688a9479d9 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -115,7 +115,7 @@ class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl. Efl.Layout.Calc.calc_size_min; Efl.Layout.Calc.calc_parts_extends; Efl.Layout.Calc.calc_force; - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { set; } Efl.Canvas.Group.group_member_add; Efl.Ui.Draggable.drag_target { get; set; } Efl.Ui.Property_Bind.property_bind; diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c index d97bea8ad9..cacdac5c4b 100644 --- a/src/lib/elementary/efl_ui_pager.c +++ b/src/lib/elementary/efl_ui_pager.c @@ -366,7 +366,7 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, evas_object_evas_get(obj)); efl_canvas_group_member_add(pd->page_root, pd->foreclip); evas_object_static_clip_set(pd->foreclip, EINA_TRUE); - efl_canvas_object_clip_set(pd->page_box, pd->foreclip); + efl_canvas_object_clipper_set(pd->page_box, pd->foreclip); pd->backclip = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(obj)); @@ -402,7 +402,7 @@ _efl_ui_pager_efl_pack_linear_pack_begin(Eo *obj EINA_UNUSED, { if (pd->cnt == 1) efl_pack(pd->page_box, subobj); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); } if (pd->indicator) @@ -429,7 +429,7 @@ _efl_ui_pager_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, { if (pd->cnt == 1) efl_pack(pd->page_box, subobj); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); } if (pd->indicator) @@ -456,7 +456,7 @@ _efl_ui_pager_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, if (pd->transition) efl_page_transition_update(pd->transition, pd->curr.pos); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); if (pd->indicator) efl_page_indicator_pack(pd->indicator, index); @@ -482,7 +482,7 @@ _efl_ui_pager_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, if (pd->transition) efl_page_transition_update(pd->transition, pd->curr.pos); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); if (pd->indicator) efl_page_indicator_pack(pd->indicator, (index + 1)); @@ -519,7 +519,7 @@ _efl_ui_pager_efl_pack_linear_pack_at(Eo *obj, if (pd->transition) efl_page_transition_update(pd->transition, pd->curr.pos); - else efl_canvas_object_clip_set(subobj, pd->backclip); + else efl_canvas_object_clipper_set(subobj, pd->backclip); if (pd->indicator) efl_page_indicator_pack(pd->indicator, index); @@ -566,7 +566,7 @@ _efl_ui_pager_current_page_set(Eo *obj, curr = eina_list_nth(pd->content_list, pd->curr.page); efl_pack_unpack(pd->page_box, curr); - efl_canvas_object_clip_set(curr, pd->backclip); + efl_canvas_object_clipper_set(curr, pd->backclip); pd->curr.page = index; curr = eina_list_nth(pd->content_list, pd->curr.page); @@ -611,7 +611,7 @@ _efl_ui_pager_transition_set(Eo *obj, curr = eina_list_nth(pd->content_list, pd->curr.page); efl_pack_unpack(pd->page_box, curr); - efl_canvas_object_clip_set(pd->page_box, pd->backclip); + efl_canvas_object_clipper_set(pd->page_box, pd->backclip); } pd->transition = transition; @@ -628,11 +628,11 @@ _efl_ui_pager_transition_set(Eo *obj, _event_handler_del(obj, pd); - efl_canvas_object_clip_set(pd->page_box, pd->foreclip); + efl_canvas_object_clipper_set(pd->page_box, pd->foreclip); EINA_LIST_FOREACH(pd->content_list, list, curr) { - efl_canvas_object_clip_set(curr, pd->backclip); + efl_canvas_object_clipper_set(curr, pd->backclip); } curr = eina_list_nth(pd->content_list, pd->curr.page); diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 57c29784a8..c6655ac93d 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -3739,7 +3739,7 @@ _anchors_update(Eo *obj, Efl_Ui_Text_Data *sd) { efl_canvas_group_member_add(smart, ob); efl_gfx_stack_above(ob, obj); - efl_canvas_object_clip_set(ob, clip); + efl_canvas_object_clipper_set(ob, clip); efl_canvas_object_pass_events_set(ob, EINA_TRUE); rect->obj = ob; } diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index a101040b86..3c6b429dfe 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1021,7 +1021,7 @@ _efl_ui_widget_efl_canvas_object_is_frame_object_set(Eo *obj, Elm_Widget_Smart_D } EOLIAN static void -_efl_ui_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip) +_efl_ui_widget_efl_canvas_object_clipper_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip) { Eina_Iterator *it; Evas_Object *o; @@ -1029,7 +1029,7 @@ _efl_ui_widget_efl_canvas_object_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EI if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(obj, MY_CLASS), clip); it = evas_object_smart_iterator_new(obj); EINA_ITERATOR_FOREACH(it, o) @@ -5870,7 +5870,7 @@ _widget_shadow_update(Widget_Shadow *ws) return; } - efl_canvas_object_clip_set(ws->surface, efl_canvas_object_clip_get(ws->widget)); + efl_canvas_object_clipper_set(ws->surface, efl_canvas_object_clipper_get(ws->widget)); efl_canvas_group_member_add(efl_canvas_object_render_parent_get(ws->widget), ws->surface); efl_gfx_entity_geometry_set(ws->surface, srect); efl_gfx_stack_below(ws->surface, ws->widget); diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index 15de2ce24b..09e2303f11 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -625,7 +625,7 @@ abstract @beta Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Obje Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } Efl.Gfx.Entity.scale { set; get; } - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { set; } Efl.Canvas.Object.no_render { set; } Efl.Canvas.Group.group_calculate; Efl.Canvas.Group.group_member_remove; diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 57f9ec1a65..22b2d0c135 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -2130,6 +2130,19 @@ EAPI void evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip */ EAPI const Eina_List *evas_object_clipees_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; +/** + * @brief Test if any object is clipped by @c obj. + * + * @param[in] obj The object. + * + * @return @c true if any object is clipped by @c obj, @c false otherwise + * + * @since 1.8 + * + * @ingroup Evas_Object + */ +EAPI Eina_Bool evas_object_clipees_has(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; + /** How the object should be rendered to output. * * @ingroup Evas diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo index 2602729f44..c89b6d1f4a 100644 --- a/src/lib/evas/canvas/efl_canvas_group.eo +++ b/src/lib/evas/canvas/efl_canvas_group.eo @@ -136,7 +136,7 @@ class @beta Efl.Canvas.Group extends Efl.Canvas.Object Efl.Gfx.Color.color { set; } Efl.Gfx.Entity.visible { set; } Efl.Gfx.Entity.position { set; } - Efl.Canvas.Object.clip { set; } + Efl.Canvas.Object.clipper { set; } Efl.Canvas.Object.no_render { set; } Efl.Canvas.Object.paragraph_direction { get; set; } } diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo index e97c0195a3..0390f92c13 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -86,7 +86,7 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En render_op: Efl.Gfx.Render_Op; [[Blend or copy.]] } } - @property clip { + @property clipper { set { [[Clip one object to another. @@ -128,6 +128,7 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En Note: Only rectangle and image (masks) objects can be used as clippers. Anything else will result in undefined behaviour. ]] + legacy: evas_object_clip_set; } get { [[Get the object clipping $obj (if any). @@ -136,9 +137,10 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En not being clipped at all, $null is returned. The object $obj must be a valid Evas_Object. ]] + legacy: evas_object_clip_get; } values { - clip: Efl.Canvas.Object @nonull; [[The object to clip $obj by.]] + clipper: Efl.Canvas.Object @nonull; [[The object to clip $obj by.]] } } @property repeat_events { @@ -348,7 +350,7 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En $false otherwise.]] } } - @property clipees { + @property clipped_objects { get { [[Return a list of objects currently clipped by $obj. @@ -363,7 +365,7 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En anymore after that point. Any use of the list after this may have undefined results, possibly leading to crashes. - See also @.clip. + See also @.clipper. ]] legacy: null; return: iterator @warn_unused; [[An iterator over the @@ -396,12 +398,11 @@ abstract @beta Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.En dir: Efl.Text_Bidirectional_Type; [[Paragraph direction for the given object.]] } } - clipees_has @const { - [[Test if any object is clipped by $obj. - - @since 1.8 + clipped_objects_count @const { + [[Returns the number of objects clipped by $obj ]] - return: bool @warn_unused; [[$true if any object is clipped by $obj, $false otherwise]] + legacy: null; + return: uint @warn_unused; [[The number of objects clipped by $obj]] } key_grab { /* FIXME: can't reference Eolian object, .eo file not being installed */ diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index 27ed00e604..3678d4aa82 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -190,7 +190,7 @@ evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_D } static void -_efl_canvas_object_clip_mask_unset(Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_mask_unset(Evas_Object_Protected_Data *obj) { EVAS_OBJECT_DATA_VALID_CHECK(obj); if (!obj->mask->is_mask) return; @@ -218,7 +218,7 @@ extern const char *o_image_type; static void _clipper_invalidated_cb(void *data, const Efl_Event *event); Eina_Bool -_efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, +_efl_canvas_object_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip) { if (!obj) obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); @@ -259,7 +259,7 @@ err_type: } static inline void -_efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn) +_efl_canvas_object_clipper_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool warn) { Evas_Object_Protected_Data *clip = obj->cur->clipper; @@ -302,7 +302,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool } } - _efl_canvas_object_clip_mask_unset(clip); + _efl_canvas_object_clipper_mask_unset(clip); } evas_object_change(clip->object, clip); if (obj->prev->clipper != clip) @@ -315,7 +315,7 @@ _efl_canvas_object_clip_unset_common(Evas_Object_Protected_Data *obj, Eina_Bool } EOLIAN void -_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip) +_efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip) { Evas_Object_Protected_Data *clip; @@ -331,7 +331,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob return; } - if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_clip, clip)) return; + if (_efl_canvas_object_clipper_set_block(eo_obj, obj, eo_clip, clip)) return; if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, eo_clip)) return; if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && @@ -341,7 +341,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob } /* unset cur clipper */ - _efl_canvas_object_clip_unset_common(obj, EINA_TRUE); + _efl_canvas_object_clipper_unset_common(obj, EINA_TRUE); /* image object clipper */ if (clip->type == o_image_type) @@ -391,7 +391,7 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob } EOLIAN Evas_Object * -_efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { EVAS_OBJECT_DATA_ALIVE_CHECK(obj, NULL); if (obj->cur->clipper) @@ -400,7 +400,7 @@ _efl_canvas_object_clip_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_ } Eina_Bool -_efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipper_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { if (!obj->cur->clipper) return EINA_TRUE; @@ -414,14 +414,14 @@ _efl_canvas_object_clip_unset_block(Eo *eo_obj EINA_UNUSED, Evas_Object_Protecte static void _clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj) { - if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) return; + if (_efl_canvas_object_clipper_unset_block(eo_obj, obj)) return; if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return; if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class && obj->smart.smart->smart_class->clip_unset) { obj->smart.smart->smart_class->clip_unset(eo_obj); } - _efl_canvas_object_clip_unset_common(obj, EINA_FALSE); + _efl_canvas_object_clipper_unset_common(obj, EINA_FALSE); evas_object_update_bounding_box(eo_obj, obj, NULL); evas_object_change(eo_obj, obj); evas_object_clip_dirty(eo_obj, obj); @@ -469,7 +469,7 @@ _clipper_invalidated_cb(void *data, const Efl_Event *event) } void -_efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev) +_efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev) { if (obj->prev->clipper) { @@ -502,6 +502,13 @@ evas_object_clipees_get(const Evas_Object *eo_obj) return answer; } +EAPI Eina_Bool +evas_object_clipees_has(const Evas_Object *eo_obj) +{ + Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE); + return !!obj->clip.clipees; +} + typedef struct { Eina_Iterator iterator; @@ -536,7 +543,7 @@ _clipee_iterator_free(Clipee_Iterator *it) } EOLIAN Eina_Iterator * -_efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj) +_efl_canvas_object_clipped_objects_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj) { Clipee_Iterator *it; @@ -556,10 +563,10 @@ _efl_canvas_object_clipees_get(const Eo *eo_obj, Evas_Object_Protected_Data *obj return &it->iterator; } -EOLIAN Eina_Bool -_efl_canvas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +EOLIAN unsigned int +_efl_canvas_object_clipped_objects_count(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { - return (obj->clip.clipees ? EINA_TRUE : EINA_FALSE); + return eina_list_count(obj->clip.clipees); } EOLIAN void diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c index cc4232b3df..2f45448823 100644 --- a/src/lib/evas/canvas/evas_object_intercept.c +++ b/src/lib/evas/canvas/evas_object_intercept.c @@ -194,7 +194,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj, { if (!internal) { - if (_efl_canvas_object_clip_set_block(eo_obj, obj, eo_other, NULL)) + if (_efl_canvas_object_clipper_set_block(eo_obj, obj, eo_other, NULL)) return 1; } if (!obj->interceptors) return 0; @@ -204,7 +204,7 @@ _evas_object_intercept_call_internal(Evas_Object *eo_obj, { if (!internal) { - if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) + if (_efl_canvas_object_clipper_unset_block(eo_obj, obj)) return 1; } if (!obj->interceptors) return 0; diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index f26744baf4..d97b833cd7 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -422,7 +422,7 @@ evas_object_cur_prev(Evas_Object_Protected_Data *obj) map_write->prev = map_write->cur; EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); } - _efl_canvas_object_clip_prev_reset(obj, EINA_TRUE); + _efl_canvas_object_clipper_prev_reset(obj, EINA_TRUE); eina_cow_memcpy(evas_object_state_cow, (const Eina_Cow_Data **) &obj->prev, obj->cur); } @@ -1095,7 +1095,7 @@ _efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data } if (obj->cur && obj->cur->clipper) evas_object_clip_unset(eo_obj); - if (obj->prev) _efl_canvas_object_clip_prev_reset(obj, EINA_FALSE); + if (obj->prev) _efl_canvas_object_clipper_prev_reset(obj, EINA_FALSE); if (obj->map) evas_object_map_set(eo_obj, NULL); @@ -2126,7 +2126,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat pass_event = efl_canvas_object_pass_events_get(eo_obj); repeat_event = efl_canvas_object_repeat_events_get(eo_obj); propagate_event = efl_canvas_object_propagate_events_get(eo_obj); - clipees_has = efl_canvas_object_clipees_has(eo_obj); + clipees_has = evas_object_clipees_has(eo_obj); EFL_DBG_INFO_APPEND(group, "Visibility", EINA_VALUE_TYPE_CHAR, visible); @@ -2205,7 +2205,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat EFL_DBG_INFO_APPEND(group, "Has clipees", EINA_VALUE_TYPE_CHAR, clipees_has); Evas_Object *clipper = NULL; - clipper = efl_canvas_object_clip_get(eo_obj); + clipper = efl_canvas_object_clipper_get(eo_obj); EFL_DBG_INFO_APPEND(group, "Clipper", EINA_VALUE_TYPE_UINT64, (uintptr_t) clipper); const Evas_Map *map = evas_object_map_get(eo_obj); diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 147e28526d..64f352ff88 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -307,7 +307,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec if (o->clipped) { Evas_Object *clipper = _smart_clipper_get(o); - Eina_Bool had_clippees = efl_canvas_object_clipees_has(clipper); + Eina_Bool had_clippees = evas_object_clipees_has(clipper); if (EINA_UNLIKELY(!clipper && !o->constructed)) { @@ -318,7 +318,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec if (clipper != eo_obj) { EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(eo_obj, clipper); + efl_canvas_object_clipper_set(eo_obj, clipper); if (!had_clippees && smart->cur->visible) efl_gfx_entity_visible_set(clipper, 1); } @@ -369,8 +369,8 @@ _efl_canvas_group_group_member_remove(Eo *smart_obj, Evas_Smart_Data *_pd EINA_U Evas_Object *clipper = _smart_clipper_get(o); EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(eo_obj, NULL); - if (!efl_canvas_object_clipees_has(clipper)) + efl_canvas_object_clipper_set(eo_obj, NULL); + if (!evas_object_clipees_has(clipper)) efl_gfx_entity_visible_set(clipper, 0); } @@ -922,20 +922,20 @@ _efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Ei } EOLIAN static void -_efl_canvas_group_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Smart_Data *o, Evas_Object *clip) +_efl_canvas_group_efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Smart_Data *o, Evas_Object *clip) { EINA_SAFETY_ON_FALSE_RETURN(!clip || efl_isa(clip, EFL_CANVAS_OBJECT_CLASS)); if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip)) return; - efl_canvas_object_clip_set(efl_super(eo_obj, MY_CLASS), clip); + efl_canvas_object_clipper_set(efl_super(eo_obj, MY_CLASS), clip); if (o->clipped) { Evas_Object *clipper = _smart_clipper_get(o); EINA_SAFETY_ON_NULL_RETURN(clipper); - efl_canvas_object_clip_set(clipper, clip); + efl_canvas_object_clipper_set(clipper, clip); } } diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index e641b74063..208f0e1000 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1667,10 +1667,10 @@ void evas_font_draw_async_check(Evas_Object_Protected_Data *obj, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props, Eina_Bool do_async); -void _efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev); +void _efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev); -Eina_Bool _efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip); -Eina_Bool _efl_canvas_object_clip_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj); +Eina_Bool _efl_canvas_object_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip); +Eina_Bool _efl_canvas_object_clipper_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj); Eina_Bool _efl_canvas_object_efl_gfx_entity_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h, Eina_Bool internal); void _evas_focus_device_invalidate_cb(void *data, const Efl_Event *ev); diff --git a/src/tests/edje/edje_test_features.c b/src/tests/edje/edje_test_features.c index 1cff283835..449e97e587 100644 --- a/src/tests/edje/edje_test_features.c +++ b/src/tests/edje/edje_test_features.c @@ -42,13 +42,13 @@ EFL_START_TEST(edje_test_masking) edje_object_freeze(obj); sub = edje_object_part_object_get(obj, "text"); edje_object_thaw(obj); - fail_if(!efl_canvas_object_clip_get(sub)); + fail_if(!efl_canvas_object_clipper_get(sub)); /* test description.clip_to override */ edje_object_freeze(obj); sub = edje_object_part_object_get(obj, "noclip"); edje_object_thaw(obj); - clip2 = efl_canvas_object_clip_get(sub); + clip2 = efl_canvas_object_clipper_get(sub); fail_if(clip != clip2); evas_free(evas); diff --git a/src/tests/evas/evas_test_mask.c b/src/tests/evas/evas_test_mask.c index bdb3b627dd..917c4c3496 100644 --- a/src/tests/evas/evas_test_mask.c +++ b/src/tests/evas/evas_test_mask.c @@ -80,7 +80,7 @@ EFL_START_TEST(evas_mask_test_setget) } fail_if(i != 1); - it = efl_canvas_object_clipees_get(mask); + it = efl_canvas_object_clipped_objects_get(mask); i = 0; EINA_ITERATOR_FOREACH(it, o) {