From 246b9215144698d16b5eb55f74548119020f4d07 Mon Sep 17 00:00:00 2001 From: codewarrior Date: Fri, 14 Oct 2005 11:51:30 +0000 Subject: [PATCH] - add ability to freeze / thaw clip so we can scroll without moving it with us SVN revision: 17537 --- src/bin/e_icon_layout.c | 31 +++++++++++++++++++++++++++++-- src/bin/e_icon_layout.h | 2 ++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/bin/e_icon_layout.c b/src/bin/e_icon_layout.c index 5feba0204..5b0c79415 100644 --- a/src/bin/e_icon_layout.c +++ b/src/bin/e_icon_layout.c @@ -16,6 +16,7 @@ struct _E_Smart_Data Evas_Object *clip; Evas_Object *obj; int frozen; + int clip_frozen; unsigned char changed : 1; Evas_List *items; }; @@ -252,6 +253,28 @@ e_icon_layout_reset(Evas_Object *obj) } } +void +e_icon_layout_clip_freeze(Evas_Object *obj) +{ + E_Smart_Data *sd; + + if ((!obj) || !(sd = evas_object_smart_data_get(obj))) + return; + + sd->clip_frozen = 1; +} + +void +e_icon_layout_clip_thaw(Evas_Object *obj) +{ + E_Smart_Data *sd; + + if ((!obj) || !(sd = evas_object_smart_data_get(obj))) + return; + + sd->clip_frozen = 0; +} + /* local subsystem functions */ static E_Icon_Layout_Item * _e_icon_layout_smart_adopt(E_Smart_Data *sd, Evas_Object *obj) @@ -398,8 +421,8 @@ _e_icon_layout_smart_add(Evas_Object *obj) sd->yc = 0; sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(sd->clip, obj); - evas_object_move(sd->clip, -100000, -100000); - evas_object_resize(sd->clip, 200000, 200000); + evas_object_move(sd->clip, 0, 0); + evas_object_resize(sd->clip, 0, 0); evas_object_color_set(sd->clip, 255, 255, 255, 255); evas_object_smart_data_set(obj, sd); } @@ -516,6 +539,9 @@ _e_icon_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) Evas_List *l; Evas_Coord dx, dy; + if(!sd->clip_frozen) + evas_object_move(sd->clip, x, y); + dx = x - sd->x; dy = y - sd->y; for (l = sd->items; l; l = l->next) @@ -538,6 +564,7 @@ _e_icon_layout_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) sd = evas_object_smart_data_get(obj); if (!sd) return; if ((w == sd->w) && (h == sd->h)) return; + evas_object_resize(sd->clip, w, h); sd->w = w; sd->h = h; sd->changed = 1; diff --git a/src/bin/e_icon_layout.h b/src/bin/e_icon_layout.h index 96b9b09ba..78e11d320 100644 --- a/src/bin/e_icon_layout.h +++ b/src/bin/e_icon_layout.h @@ -18,6 +18,8 @@ EAPI void e_icon_layout_child_stack_below (Evas_Object *obj, Evas_Object EAPI void e_icon_layout_unpack (Evas_Object *obj); EAPI void e_icon_layout_spacing_set(Evas_Object *obj, Evas_Coord xs, Evas_Coord ys); EAPI void e_icon_layout_redraw_force (Evas_Object *obj); +EAPI void e_icon_layout_clip_freeze (Evas_Object *obj); +EAPI void e_icon_layout_clip_thaw (Evas_Object *obj); #endif #endif