diff options
author | Julien Danjou <julien@danjou.info> | 2009-04-14 11:16:52 +0200 |
---|---|---|
committer | Arnaud Fontaine <arnau@debian.org> | 2010-11-14 19:51:10 +0900 |
commit | 59b946a9429137cd9880e592e19f8db470dca049 (patch) | |
tree | 7f113c14ed7d5c0d3a6660eacce026ad80132853 | |
parent | 94a25d209e1cdfcdaf8e4bfd2cdb1bcb82042d84 (diff) |
event: simplify proto
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | event/event.c | 24 | ||||
-rw-r--r-- | event/xcb_event.h | 12 |
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 } |