From 1fbaf30e9578431fbb022ff0c61a71f4f7d1e8d8 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 15 May 2010 12:25:33 +0000 Subject: [PATCH] add names to popups SVN revision: 48888 --- src/bin/e_popup.c | 8 ++++++++ src/bin/e_popup.h | 2 ++ src/bin/e_shelf.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/bin/e_popup.c b/src/bin/e_popup.c index cbf392221..764744f0c 100644 --- a/src/bin/e_popup.c +++ b/src/bin/e_popup.c @@ -71,6 +71,13 @@ e_popup_new(E_Zone *zone, int x, int y, int w, int h) return pop; } +EAPI void +e_popup_name_set(E_Popup *pop, const char *name) +{ + if (eina_stringshare_replace(&pop->name, name)) + ecore_evas_name_class_set(pop->ecore_evas, "E", pop->name); +} + EAPI void e_popup_show(E_Popup *pop) { @@ -303,6 +310,7 @@ _e_popup_free(E_Popup *pop) pop->zone->popups = eina_list_remove(pop->zone->popups, pop); _e_popup_list = eina_list_remove(_e_popup_list, pop); eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop); + if (pop->name) eina_stringshare_del(pop->name); free(pop); } diff --git a/src/bin/e_popup.h b/src/bin/e_popup.h index 6cb08df4d..48ac41e20 100644 --- a/src/bin/e_popup.h +++ b/src/bin/e_popup.h @@ -26,6 +26,7 @@ struct _E_Popup Ecore_X_Window evas_win; E_Container_Shape *shape; E_Zone *zone; + const char *name; int shape_rects_num; Ecore_X_Rectangle *shape_rects; Ecore_Idle_Enterer *idle_enterer; @@ -35,6 +36,7 @@ EAPI int e_popup_init(void); EAPI int e_popup_shutdown(void); EAPI E_Popup *e_popup_new(E_Zone *zone, int x, int y, int w, int h); +EAPI void e_popup_name_set(E_Popup *pop, const char *name); EAPI void e_popup_show(E_Popup *pop); EAPI void e_popup_hide(E_Popup *pop); EAPI void e_popup_move(E_Popup *pop, int x, int y); diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index f873cd891..ebc86747e 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -111,6 +111,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i if (popup) { es->popup = e_popup_new(zone, es->x, es->y, es->w, es->h); + e_popup_name_set(es->popup, "shelf"); e_popup_layer_set(es->popup, layer); es->ee = es->popup->ecore_evas; es->evas = es->popup->evas; @@ -684,6 +685,7 @@ e_shelf_popup_set(E_Shelf *es, int popup) if (popup) { es->popup = e_popup_new(es->zone, es->x, es->y, es->w, es->h); + e_popup_name_set(es->popup, "shelf"); e_popup_layer_set(es->popup, es->cfg->layer); es->ee = es->popup->ecore_evas;