mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
192 lines
4.2 KiB
C
192 lines
4.2 KiB
C
/*
|
|
* xcb_event_handler.c - xcb event handler
|
|
*
|
|
* Copyright © 2007-2008 Arnaud Fontaine <arnaud@andesi.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
*/
|
|
|
|
#include <assert.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "xcb_event_handler.h"
|
|
#include "common/util.h"
|
|
|
|
const char *x_label_error[] =
|
|
{
|
|
"Success",
|
|
"BadRequest",
|
|
"BadValue",
|
|
"BadWindow",
|
|
"BadPixmap",
|
|
"BadAtom",
|
|
"BadCursor",
|
|
"BadFont",
|
|
"BadMatch",
|
|
"BadDrawable",
|
|
"BadAccess",
|
|
"BadAlloc",
|
|
"BadColor",
|
|
"BadGC",
|
|
"BadIDChoice",
|
|
"BadName",
|
|
"BadLength",
|
|
"BadImplementation",
|
|
};
|
|
|
|
const char *x_label_request[] =
|
|
{
|
|
"XCB_NONE",
|
|
"CreateWindow",
|
|
"ChangeWindowAttributes",
|
|
"GetWindowAttributes",
|
|
"DestroyWindow",
|
|
"DestroySubwindows",
|
|
"ChangeSaveSet",
|
|
"ReparentWindow",
|
|
"MapWindow",
|
|
"MapSubwindows",
|
|
"UnmapWindow",
|
|
"UnmapSubwindows",
|
|
"ConfigureWindow",
|
|
"CirculateWindow",
|
|
"GetGeometry",
|
|
"QueryTree",
|
|
"InternAtom",
|
|
"GetAtomName",
|
|
"ChangeProperty",
|
|
"DeleteProperty",
|
|
"GetProperty",
|
|
"ListProperties",
|
|
"SetSelectionOwner",
|
|
"GetSelectionOwner",
|
|
"ConvertSelection",
|
|
"SendEvent",
|
|
"GrabPointer",
|
|
"UngrabPointer",
|
|
"GrabButton",
|
|
"UngrabButton",
|
|
"ChangeActivePointerGrab",
|
|
"GrabKeyboard",
|
|
"UngrabKeyboard",
|
|
"GrabKey",
|
|
"UngrabKey",
|
|
"AllowEvents",
|
|
"GrabServer",
|
|
"UngrabServer",
|
|
"QueryPointer",
|
|
"GetMotionEvents",
|
|
"TranslateCoords",
|
|
"WarpPointer",
|
|
"SetInputFocus",
|
|
"GetInputFocus",
|
|
"QueryKeymap",
|
|
"OpenFont",
|
|
"CloseFont",
|
|
"QueryFont",
|
|
"QueryTextExtents",
|
|
"ListFonts",
|
|
"ListFontsWithInfo",
|
|
"SetFontPath",
|
|
"GetFontPath",
|
|
"CreatePixmap",
|
|
"FreePixmap",
|
|
"CreateGC",
|
|
"ChangeGC",
|
|
"CopyGC",
|
|
"SetDashes",
|
|
"SetClipRectangles",
|
|
"FreeGC",
|
|
"ClearArea",
|
|
"CopyArea",
|
|
"CopyPlane",
|
|
"PolyPoint",
|
|
"PolyLine",
|
|
"PolySegment",
|
|
"PolyRectangle",
|
|
"PolyArc",
|
|
"FillPoly",
|
|
"PolyFillRectangle",
|
|
"PolyFillArc",
|
|
"PutImage",
|
|
"GetImage",
|
|
"PolyText",
|
|
"PolyText",
|
|
"ImageText",
|
|
"ImageText",
|
|
"CreateColormap",
|
|
"FreeColormap",
|
|
"CopyColormapAndFree",
|
|
"InstallColormap",
|
|
"UninstallColormap",
|
|
"ListInstalledColormaps",
|
|
"AllocColor",
|
|
"AllocNamedColor",
|
|
"AllocColorCells",
|
|
"AllocColorPlanes",
|
|
"FreeColors",
|
|
"StoreColors",
|
|
"StoreNamedColor",
|
|
"QueryColors",
|
|
"LookupColor",
|
|
"CreateCursor",
|
|
"CreateGlyphCursor",
|
|
"FreeCursor",
|
|
"RecolorCursor",
|
|
"QueryBestSize",
|
|
"QueryExtension",
|
|
"ListExtensions",
|
|
"ChangeKeyboardMapping",
|
|
"GetKeyboardMapping",
|
|
"ChangeKeyboardControl",
|
|
"GetKeyboardControl",
|
|
"Bell",
|
|
"ChangePointerControl",
|
|
"GetPointerControl",
|
|
"SetScreenSaver",
|
|
"GetScreenSaver",
|
|
"ChangeHosts",
|
|
"ListHosts",
|
|
"SetAccessControl",
|
|
"SetCloseDownMode",
|
|
"KillClient",
|
|
"RotateProperties",
|
|
"ForceScreenSaver",
|
|
"SetPointerMapping",
|
|
"GetPointerMapping",
|
|
"SetModifierMapping",
|
|
"GetModifierMapping",
|
|
"major 120",
|
|
"major 121",
|
|
"major 122",
|
|
"major 123",
|
|
"major 124",
|
|
"major 125",
|
|
"major 126",
|
|
"NoOperation",
|
|
};
|
|
|
|
/** Set the same handler for all errors
|
|
*/
|
|
void
|
|
xcb_set_error_handler_catch_all(xcb_event_handlers_t *evenths,
|
|
xcb_generic_error_handler_t handler,
|
|
void *data)
|
|
{
|
|
int err_num;
|
|
for(err_num = 0; err_num < ERRORS_NBR; err_num++)
|
|
xcb_set_error_handler(evenths, err_num, handler, data);
|
|
}
|