From e63f8c7f4dd6c30d40c62745276f53b0fd7d8c83 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 17 Aug 2012 08:23:09 +0000 Subject: [PATCH] add event for shelf deletion SVN revision: 75371 --- src/bin/e_shelf.c | 15 ++++++++++++++- src/bin/e_shelf.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index 52ee9523d..199c113be 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -40,12 +40,14 @@ static Eina_List *dummies = NULL; static Eina_Hash *winid_shelves = NULL; EAPI int E_EVENT_SHELF_ADD = -1; +EAPI int E_EVENT_SHELF_DEL = -1; /* externally accessible functions */ EINTERN int e_shelf_init(void) { E_EVENT_SHELF_ADD = ecore_event_type_new(); + E_EVENT_SHELF_DEL = ecore_event_type_new(); return 1; } @@ -954,8 +956,9 @@ _e_shelf_del_cb(void *d) } static void -_e_shelf_free(E_Shelf *es) +_e_shelf_free_cb(void *data __UNUSED__, void *ev) { + E_Shelf *es = ev; if (!es->dummy) _e_shelf_bindings_del(es); @@ -1019,6 +1022,16 @@ _e_shelf_free(E_Shelf *es) free(es); } +static void +_e_shelf_free(E_Shelf *es) +{ + E_Event_Shelf *ev; + + ev = E_NEW(E_Event_Shelf, 1); + ev->shelf = es; + ecore_event_add(E_EVENT_SHELF_DEL, ev, _e_shelf_free_cb, NULL); +} + static void _e_shelf_gadcon_min_size_request(void *data __UNUSED__, E_Gadcon *gc __UNUSED__, Evas_Coord w __UNUSED__, Evas_Coord h __UNUSED__) { diff --git a/src/bin/e_shelf.h b/src/bin/e_shelf.h index ba00fce09..9d58211b1 100644 --- a/src/bin/e_shelf.h +++ b/src/bin/e_shelf.h @@ -56,6 +56,7 @@ typedef struct E_Event_Shelf typedef struct E_Event_Shelf E_Event_Shelf_Add; EAPI extern int E_EVENT_SHELF_ADD; +EAPI extern int E_EVENT_SHELF_DEL; EINTERN int e_shelf_init(void); EINTERN int e_shelf_shutdown(void);