aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-02 07:53:37 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-11-02 07:53:37 +0000
commit14e898b6a7592aa3fbe3c502343fcee48817ae39 (patch)
treea82c0b465e52126a0163caf9d18e95ee50b1ee52 /src/bin
parentfix entry crash (diff)
downloadenlightenment-14e898b6a7592aa3fbe3c502343fcee48817ae39.tar.gz
add shelf rename events
SVN revision: 78831
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/e_shelf.c15
-rw-r--r--src/bin/e_shelf.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c
index b063820ec..f4d75e081 100644
--- a/src/bin/e_shelf.c
+++ b/src/bin/e_shelf.c
@@ -37,6 +37,7 @@ static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj,
static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
static Eina_Bool _e_shelf_gadcon_populate_handler_cb(void *, int, void *);
static Eina_Bool _e_shelf_module_init_end_handler_cb(void *, int, void *);
+static void _e_shelf_event_rename_end_cb(void *data, E_Event_Shelf *ev);
static Eina_List *shelves = NULL;
static Eina_List *dummies = NULL;
@@ -80,6 +81,7 @@ static const char *orient_names[] =
[E_GADCON_ORIENT_CORNER_RB] = "Right-bottom Corner"
};
+EAPI int E_EVENT_SHELF_RENAME = -1;
EAPI int E_EVENT_SHELF_ADD = -1;
EAPI int E_EVENT_SHELF_DEL = -1;
static Ecore_Event_Handler *_e_shelf_gadcon_populate_handler = NULL;
@@ -90,6 +92,7 @@ static Ecore_Event_Handler *_e_shelf_zone_moveresize_handler = NULL;
EINTERN int
e_shelf_init(void)
{
+ E_EVENT_SHELF_RENAME = ecore_event_type_new();
E_EVENT_SHELF_ADD = ecore_event_type_new();
E_EVENT_SHELF_DEL = ecore_event_type_new();
_e_shelf_gadcon_populate_handler = ecore_event_handler_add(E_EVENT_GADCON_POPULATE, _e_shelf_gadcon_populate_handler_cb, NULL);
@@ -424,11 +427,16 @@ e_shelf_locked_set(E_Shelf *es, int lock)
EAPI void
e_shelf_name_set(E_Shelf *es, const char *name)
{
+ E_Event_Shelf *ev;
+
if (!es) return;
if (!name) return;
if (es->name == name) return;
eina_stringshare_replace(&es->name, name);
eina_stringshare_replace(&es->cfg->name, name);
+ ev = E_NEW(E_Event_Shelf, 1);
+ ev->shelf = es;
+ ecore_event_add(E_EVENT_SHELF_RENAME, ev, (Ecore_End_Cb)_e_shelf_event_rename_end_cb, NULL);
if (es->dummy) return;
e_gadcon_name_set(es->gadcon, name);
}
@@ -1176,6 +1184,13 @@ _e_shelf_del_cb(void *d)
}
static void
+_e_shelf_event_rename_end_cb(void *data __UNUSED__, E_Event_Shelf *ev)
+{
+ e_object_unref(E_OBJECT(ev->shelf));
+ free(ev);
+}
+
+static void
_e_shelf_free_cb(void *data __UNUSED__, void *event)
{
E_Event_Shelf *ev = event;
diff --git a/src/bin/e_shelf.h b/src/bin/e_shelf.h
index 72d908eaf..92b209810 100644
--- a/src/bin/e_shelf.h
+++ b/src/bin/e_shelf.h
@@ -56,9 +56,11 @@ typedef struct E_Event_Shelf
E_Shelf *shelf;
} E_Event_Shelf;
+typedef struct E_Event_Shelf E_Event_Shelf_Rename;
typedef struct E_Event_Shelf E_Event_Shelf_Add;
typedef struct E_Event_Shelf E_Event_Shelf_Del;
+EAPI extern int E_EVENT_SHELF_RENAME;
EAPI extern int E_EVENT_SHELF_ADD;
EAPI extern int E_EVENT_SHELF_DEL;