summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2018-08-02 09:10:41 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-02 09:10:41 -0400
commit9666f288ae606f181f676ad1768864d830d29ee3 (patch)
tree78687c5bc5a3a1583bb27b6cbc1170c4eacb01af
parent24f7285c391056b29dbbd506884fd6579fae3768 (diff)
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
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c9
-rw-r--r--src/lib/evas/canvas/evas_object_smart_clipped.c2
-rw-r--r--src/lib/evas/include/evas_private.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 37c8868..6223792 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -888,10 +888,17 @@ _efl_canvas_group_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Ein
888EOLIAN static void 888EOLIAN static void
889_efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Position2D pos) 889_efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Position2D pos)
890{ 890{
891 Eina_Bool is_overridden;
892 Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
893
891 if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y)) 894 if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
892 return; 895 return;
893 896
894 if (o->clipped) 897 is_overridden = (obj->is_smart && obj->smart.smart &&
898 obj->smart.smart->smart_class->move !=
899 (void *)evas_object_smart_clipped_smart_move);
900
901 if (o->clipped && !is_overridden)
895 _evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y); 902 _evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y);
896 efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos); 903 efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos);
897} 904}
diff --git a/src/lib/evas/canvas/evas_object_smart_clipped.c b/src/lib/evas/canvas/evas_object_smart_clipped.c
index 60cdc78..a904479 100644
--- a/src/lib/evas/canvas/evas_object_smart_clipped.c
+++ b/src/lib/evas/canvas/evas_object_smart_clipped.c
@@ -33,7 +33,7 @@ evas_object_smart_clipped_smart_del(Evas_Object *eo_obj)
33 cso->clipper = NULL; 33 cso->clipper = NULL;
34} 34}
35 35
36static void 36void
37evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y) 37evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y)
38{ 38{
39 if (!efl_isa(eo_obj, EFL_CANVAS_GROUP_CLASS)) return; 39 if (!efl_isa(eo_obj, EFL_CANVAS_GROUP_CLASS)) return;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index a63194d..b149c0b 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1633,6 +1633,7 @@ const Eina_List *evas_object_event_grabber_members_list(const Eo *eo_obj);
1633const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj); 1633const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
1634void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj); 1634void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj);
1635void _evas_object_smart_clipped_init(Evas_Object *eo_obj); 1635void _evas_object_smart_clipped_init(Evas_Object *eo_obj);
1636void evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
1636void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y); 1637void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
1637void evas_call_smarts_calculate(Evas *e); 1638void evas_call_smarts_calculate(Evas *e);
1638void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj); 1639void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);