diff options
author | Julien Danjou <julien@danjou.info> | 2009-04-14 11:44:06 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2009-04-14 11:59:48 +0200 |
commit | 6ff3c2bfc5f8cd66ccf8cd9f4fe0626178372b3a (patch) | |
tree | 999c42c5422b6a730adaf22be31b08557fd2ea2a | |
parent | 84f8352b3726e45c4dcfb0ebd23bdad93abdf5b5 (diff) |
event: add define to get request and error types
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | event/event.c | 2 | ||||
-rw-r--r-- | event/xcb_event.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/event/event.c b/event/event.c index 743232b..ce83d6e 100644 --- a/event/event.c +++ b/event/event.c @@ -1,5 +1,5 @@ /* - * Copyright © 2008 Julien Danjou <julien@danjou.info> + * Copyright © 2008-2009 Julien Danjou <julien@danjou.info> * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/event/xcb_event.h b/event/xcb_event.h index 6326158..05b9cac 100644 --- a/event/xcb_event.h +++ b/event/xcb_event.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Julien Danjou <julien@danjou.info> + * Copyright (C) 2008-2009 Julien Danjou <julien@danjou.info> * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -55,6 +55,8 @@ extern "C" { #define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) #define XCB_EVENT_RESPONSE_TYPE(e) (e->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) #define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONSE_TYPE_MASK) +#define XCB_EVENT_ERROR_TYPE(e) (*((uint8_t *) e + 1)) +#define XCB_EVENT_REQUEST_TYPE(e) (*((uint8_t *) e + 10)) typedef int (*xcb_generic_event_handler_t)(void *data, xcb_connection_t *c, xcb_generic_event_t *event); typedef int (*xcb_generic_error_handler_t)(void *data, xcb_connection_t *c, xcb_generic_error_t *error); |