antognolli pushed a commit to branch master.
commit 6006432c3f50a564097e8a001cbad0c3fce81e7c
Author: Rafael Antognolli <[email protected]>
Date: Tue Mar 26 14:51:05 2013 -0300
evas/wayland: Several fixes to make the framespace behave correctly.
- mark all children of a given smart object as "is_frame" if the smart
object is also marked as a frame;
- when moving a smart object, use the originally requested move
coordinate to calculate the offset that the children should be moved
too;
- _smart_move_children_relative will fetch the child position with
geometry_get(), this way getting the corrected object position, before
adding the offset.
---
src/lib/evas/canvas/evas_object_main.c | 42 ++++++++++++++++---------
src/lib/evas/canvas/evas_object_smart_clipped.c | 8 ++---
2 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/src/lib/evas/canvas/evas_object_main.c
b/src/lib/evas/canvas/evas_object_main.c
index b7a0e11..6009244 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -833,11 +833,8 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
{
- if ((!obj->smart.parent) && (obj->is_smart))
- {
- nx += evas->framespace.x;
- ny += evas->framespace.y;
- }
+ nx += evas->framespace.x;
+ ny += evas->framespace.y;
}
if (evas_object_intercept_call_move(eo_obj, obj, nx, ny)) return;
@@ -864,7 +861,7 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
if (obj->is_smart)
{
- eo_do(eo_obj, evas_obj_smart_move(nx, ny));
+ eo_do(eo_obj, evas_obj_smart_move(x, y));
}
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -1027,11 +1024,8 @@ _position_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list
*list)
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
{
- if ((!obj->smart.parent) && (obj->is_smart))
- {
- if (nx > 0) nx -= evas->framespace.x;
- if (ny > 0) ny -= evas->framespace.y;
- }
+ if (nx > 0) nx -= evas->framespace.x;
+ if (ny > 0) ny -= evas->framespace.y;
}
if (x) *x = nx;
@@ -2455,11 +2449,31 @@ evas_object_is_frame_object_set(Evas_Object *eo_obj,
Eina_Bool is_frame)
}
static void
-_is_frame_object_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+_is_frame_flag_set(Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
{
- Evas_Object_Protected_Data *obj = _pd;
- Eina_Bool is_frame = va_arg(*list, int);
+ const Eina_Inlist *l;
+ Evas_Object_Protected_Data *child;
+
obj->is_frame = is_frame;
+
+ l = evas_object_smart_members_get_direct(obj->object);
+
+ EINA_INLIST_FOREACH(l, child)
+ _is_frame_flag_set(child, is_frame);
+}
+
+static void
+_is_frame_object_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ Eina_Bool is_frame = va_arg(*list, int);
+ Evas_Object_Protected_Data *obj = _pd;
+ Evas_Coord x, y;
+
+ evas_object_geometry_get(eo_obj, &x, &y, NULL, NULL);
+
+ _is_frame_flag_set(obj, is_frame);
+
+ evas_object_move(eo_obj, x, y);
}
EAPI Eina_Bool
diff --git a/src/lib/evas/canvas/evas_object_smart_clipped.c
b/src/lib/evas/canvas/evas_object_smart_clipped.c
index edd1339..3c1c29c 100644
--- a/src/lib/evas/canvas/evas_object_smart_clipped.c
+++ b/src/lib/evas/canvas/evas_object_smart_clipped.c
@@ -37,12 +37,12 @@ _smart_move_children_relative(Eo *eo_obj, void *_pd
EINA_UNUSED, va_list *list)
{
Evas_Coord orig_x, orig_y;
- // shortcut as we are in evas
- // evas_object_geometry_get(child, &orig_x, &orig_y, NULL, NULL);
if (child->delete_me) continue;
if (child->is_static_clip) continue;
- orig_x = child->cur->geometry.x;
- orig_y = child->cur->geometry.y;
+ // TODO: shortcut again, as we are in evas
+ evas_object_geometry_get(child->object, &orig_x, &orig_y, NULL, NULL);
+ // orig_x = child->cur->geometry.x;
+ // orig_y = child->cur->geometry.y;
evas_object_move(child->object, orig_x + dx, orig_y + dy);
}
}
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html