From e828519e97274206673576f70dddcdc96088206a Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Sun, 16 May 2010 06:21:48 +0000 Subject: [PATCH] Change acpi event structure to be able to pass more info. SVN revision: 48912 --- src/bin/e_acpi.c | 12 ++++++++---- src/bin/e_acpi.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/bin/e_acpi.c b/src/bin/e_acpi.c index 304d2e8a4..d67fd58d3 100644 --- a/src/bin/e_acpi.c +++ b/src/bin/e_acpi.c @@ -100,9 +100,9 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event) E_Event_Acpi *acpi_event; acpi_event = E_NEW(E_Event_Acpi, 1); - acpi_event->device = "battery"; - acpi_event->bus_id = "BAT0"; - acpi_event->event_type = "BATTERY_STATUS_CHANGED"; // make these standard E_ACPI enums + acpi_event->device = eina_stringshare_add("battery"); + acpi_event->bus_id = eina_stringshare_add("BAT0"); + acpi_event->event_type = E_ACPI_BATTERY_STATUS_CHANGED; // make these standard E_ACPI enums acpi_event->event_data = 1; // change to something more meaningful ecore_event_add(E_EVENT_ACPI_LID, acpi_event, _e_acpi_cb_event_free, NULL); */ @@ -113,7 +113,11 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event) static void _e_acpi_cb_event_free(void *data __UNUSED__, void *event) { - E_FREE(event); + E_Event_Acpi *ev; + + if (ev->device) eina_stringshare_del(ev->device); + if (ev->bus_id) eina_stringshare_del(ev->bus_id); + E_FREE(ev); } diff --git a/src/bin/e_acpi.h b/src/bin/e_acpi.h index 6025b393d..7275fcbd9 100644 --- a/src/bin/e_acpi.h +++ b/src/bin/e_acpi.h @@ -20,8 +20,8 @@ typedef struct _E_Event_Acpi E_Event_Acpi; struct _E_Event_Acpi { - void *data; - int size; + const char *device, *bus_id; + int type, data; }; EAPI int e_acpi_init(void);