2 * Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * Except as contained in this notice, the names of the authors or
24 * their institutions shall not be used in advertising or otherwise to
25 * promote the sale, use or other dealings in this Software without
26 * prior written authorization from the authors.
33 #include "xcb_event.h"
35 #ifdef HAVE_SYS_TYPES_H
36 # include <sys/types.h>
39 #define ssizeof(foo) (ssize_t)sizeof(foo)
40 #define countof(foo) (ssizeof(foo) / ssizeof(foo[0]))
42 static const char *labelError[] =
64 static const char *labelRequest[] =
68 "ChangeWindowAttributes",
69 "GetWindowAttributes",
96 "ChangeActivePointerGrab",
146 "CopyColormapAndFree",
149 "ListInstalledColormaps",
166 "ChangeKeyboardMapping",
167 "GetKeyboardMapping",
168 "ChangeKeyboardControl",
169 "GetKeyboardControl",
171 "ChangePointerControl",
184 "SetModifierMapping",
185 "GetModifierMapping",
196 static const char *labelEvent[] =
236 xcb_event_get_label(uint8_t type)
238 if(type < countof(labelEvent))
239 return labelEvent[type];
244 xcb_event_get_error_label(uint8_t type)
246 if(type < countof(labelError))
247 return labelError[type];
252 xcb_event_get_request_label(uint8_t type)
254 if(type < countof(labelRequest))
255 return labelRequest[type];