aboutsummaryrefslogtreecommitdiffstats
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
parentelementary bg: fix to guarantee compatibility. (diff)
downloadefl-9666f288ae606f181f676ad1768864d830d29ee3.tar.gz
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 37c8868479..6223792cae 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
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);
}
diff --git a/src/lib/evas/canvas/evas_object_smart_clipped.c b/src/lib/evas/canvas/evas_object_smart_clipped.c
index 60cdc78e7d..a904479c01 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)
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;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index a63194df3f..b149c0b19e 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);
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);