From aec1fcd2201e9c2df9062f5ee103e22d91fcf6d1 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Wed, 3 Nov 2010 18:30:48 +0000 Subject: [PATCH] Calling callback 'unrealized' when an item is unrealized. Patch by: Otavio Pontes SVN revision: 54129 --- legacy/elementary/src/lib/Elementary.h.in | 1 + legacy/elementary/src/lib/elm_gengrid.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index 64824eaf8a..47fb61ccd6 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -846,6 +846,7 @@ extern "C" { * unselected - User has unselected a item. * clicked - User has double-clicked a item. * realized - An evas object for a item was built. + * unrealized - An evas object for a item was deleted. * scroll - the content has been scrolled (moved). * "scroll,drag,start" - dragging the contents around has started. * "scroll,drat,stop" - dragging the contents around has stopped. diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index aa9bd98f97..187969846e 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -27,6 +27,9 @@ * from elm_gengrid_item_object_get() in a way where it may point to * freed objects. * + * unrealized - This is called when the real evas object for this item is + * deleted. event_info is the Gengrid item that was created. + * * drag,start,up - Called when the item in the Gengrid has been dragged (not * scrolled) up. * @@ -1022,11 +1025,10 @@ _item_place(Elm_Gengrid_Item *item, Evas_Coord cx, Evas_Coord cy) x = cx * item->wd->item_width - item->wd->pan_x + ox + alignw; y = cy * item->wd->item_height - item->wd->pan_y + oy + alignh; + Eina_Bool was_realized = item->realized; if (ELM_RECTS_INTERSECT(x, y, item->wd->item_width, item->wd->item_height, cvx, cvy, cvw, cvh)) { - Eina_Bool was_realized = item->realized; - _item_realize(item); if (!was_realized) evas_object_smart_callback_call(item->wd->self, "realized", item); @@ -1035,7 +1037,11 @@ _item_place(Elm_Gengrid_Item *item, Evas_Coord cx, Evas_Coord cy) item->wd->item_height); } else - _item_unrealize(item); + { + _item_unrealize(item); + if (was_realized) + evas_object_smart_callback_call(item->wd->self, "unrealized", item); + } } static Elm_Gengrid_Item *