summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2009-04-14 11:16:52 +0200
committerJulien Danjou <julien@danjou.info>2009-04-14 11:59:47 +0200
commit36fff7edb3c417b85487a71f33f3c8d4752b8628 (patch)
tree6588cb70ce61c8df8de3a8d49534ab95098434c5
parent061cabcde14c8aa3e1fcbd151c2ca41ddac9da94 (diff)
event: simplify proto
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--event/event.c24
-rw-r--r--event/xcb_event.h12
2 files changed, 13 insertions, 23 deletions
diff --git a/event/event.c b/event/event.c
index 3d8fd7c..743232b 100644
--- a/event/event.c
+++ b/event/event.c
@@ -311,35 +311,25 @@ static const char *labelEvent[] =
};
const char *
-xcb_event_get_label(const xcb_generic_event_t *e)
+xcb_event_get_label(uint8_t type)
{
- uint32_t type = XCB_EVENT_RESPONSE_TYPE(e);
if(type < countof(labelEvent))
return labelEvent[type];
return NULL;
}
const char *
-xcb_event_get_error_label(const xcb_generic_event_t *e)
+xcb_event_get_error_label(uint8_t type)
{
- /* Check that it's an error */
- if(e->response_type == 0)
- {
- uint32_t type = XCB_EVENT_RESPONSE_TYPE(e) + 1;
- if(type < countof(labelError))
- return labelError[type];
- }
+ if(type < countof(labelError))
+ return labelError[type];
return NULL;
}
const char *
-xcb_event_get_request_label(const xcb_generic_event_t *e)
+xcb_event_get_request_label(uint8_t type)
{
- if(e->response_type == 0)
- {
- uint32_t type = XCB_EVENT_RESPONSE_TYPE(e) + 10;
- if(type < countof(labelRequest))
- return labelRequest[type];
- }
+ if(type < countof(labelRequest))
+ return labelRequest[type];
return NULL;
}
diff --git a/event/xcb_event.h b/event/xcb_event.h
index 4324931..0be19bc 100644
--- a/event/xcb_event.h
+++ b/event/xcb_event.h
@@ -170,26 +170,26 @@ XCB_EVENT_MAKE_EVENT_HANDLER(mapping_notify, MAPPING_NOTIFY)
/**
* @brief Convert an event reponse type to a label.
- * @param e The event.
+ * @param type The event type.
* @return A string with the event name, or NULL if unknown.
*/
-const char * xcb_event_get_label(const xcb_generic_event_t *e);
+const char * xcb_event_get_label(uint8_t type);
/**
* @brief Convert an event error type to a label.
- * @param e The event.
+ * @param type The erro type.
* @return A string with the event name, or NULL if unknown or if the event is
* not an error.
*/
-const char * xcb_event_get_error_label(const xcb_generic_event_t *e);
+const char * xcb_event_get_error_label(uint8_t type);
/**
* @brief Convert an event request type to a label.
- * @param e The event.
+ * @param type The request type.
* @return A string with the event name, or NULL if unknown or if the event is
* not an error.
*/
-const char * xcb_event_get_request_label(const xcb_generic_event_t *e);
+const char * xcb_event_get_request_label(uint8_t type);
#ifdef __cplusplus
}