Efl.Canvas.Group: use desired function

Summary:
If a smart class overrides Evas_Smart_Class.move as below,
then original behavior must not be used for the smart class.

   Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("MyClass");
   evas_object_smart_clipped_smart_set(&sc);
   sc.move = &myMove;

But current implementation makes original behavior work.
So before using the original method, this patch is checking if the original
method is changed or not.

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: woohyun, jypark, cedric, raster, jpeg, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6468
This commit is contained in:
Shinwoo Kim 2018-08-02 09:10:41 -04:00 committed by Mike Blumenkrantz
parent 24f7285c39
commit 9666f288ae
3 changed files with 10 additions and 2 deletions

View File

@ -888,10 +888,17 @@ _efl_canvas_group_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Ein
EOLIAN static void
_efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Position2D pos)
{
Eina_Bool is_overridden;
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
if (o->clipped)
is_overridden = (obj->is_smart && obj->smart.smart &&
obj->smart.smart->smart_class->move !=
(void *)evas_object_smart_clipped_smart_move);
if (o->clipped && !is_overridden)
_evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y);
efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos);
}

View File

@ -33,7 +33,7 @@ evas_object_smart_clipped_smart_del(Evas_Object *eo_obj)
cso->clipper = NULL;
}
static void
void
evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y)
{
if (!efl_isa(eo_obj, EFL_CANVAS_GROUP_CLASS)) return;

View File

@ -1633,6 +1633,7 @@ const Eina_List *evas_object_event_grabber_members_list(const Eo *eo_obj);
const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj);
void _evas_object_smart_clipped_init(Evas_Object *eo_obj);
void evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
void evas_call_smarts_calculate(Evas *e);
void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);