summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2009-04-14 11:44:06 +0200
committerJulien Danjou <julien@danjou.info>2009-04-14 11:59:48 +0200
commita752684075a0fff5564d11ebb0ef6280a791b2e8 (patch)
tree8d150bdf7ee3259d40c51aa6ed78217c3185fe59
parentbda58238aa3bf9c37074a626b0573bc61ec0c11d (diff)
event: add define to get request and error types
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--event/event.c2
-rw-r--r--event/xcb_event.h4
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);