From 70e7f0e39a462d55617cda735339a2861d4e69ca Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 21 Nov 2016 00:37:10 -0800 Subject: [PATCH] Remove unused src/debug.c (#2575) --- Makefile.am | 1 - docs/hacking-howto | 3 - include/debug.h | 15 --- src/debug.c | 245 --------------------------------------------- 4 files changed, 264 deletions(-) delete mode 100644 include/debug.h delete mode 100644 src/debug.c diff --git a/Makefile.am b/Makefile.am index aea4256b..f35a2f2f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -518,7 +518,6 @@ i3_SOURCES = \ src/config.c \ src/config_directives.c \ src/config_parser.c \ - src/debug.c \ src/display_version.c \ src/ewmh.c \ src/fake_outputs.c \ diff --git a/docs/hacking-howto b/docs/hacking-howto index 74a690e7..2ba74917 100644 --- a/docs/hacking-howto +++ b/docs/hacking-howto @@ -119,9 +119,6 @@ src/config.c:: Contains all functions handling the configuration file (calling the parser src/config_parser.c) with the correct path, switching key bindings mode). -src/debug.c:: -Contains debugging functions to print unhandled X events. - src/ewmh.c:: Functions to get/set certain EWMH properties easily. diff --git a/include/debug.h b/include/debug.h deleted file mode 100644 index ab5f3808..00000000 --- a/include/debug.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * vim:ts=4:sw=4:expandtab - * - * i3 - an improved dynamic tiling window manager - * © 2009 Michael Stapelberg and contributors (see also: LICENSE) - * - * debug.c: Debugging functions, especially FormatEvent, which prints unhandled - * events. This code is from xcb-util. - * - */ -#pragma once - -#include - -int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e); diff --git a/src/debug.c b/src/debug.c deleted file mode 100644 index ea4ca997..00000000 --- a/src/debug.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * vim:ts=4:sw=4:expandtab - * - * i3 - an improved dynamic tiling window manager - * © 2009 Michael Stapelberg and contributors (see also: LICENSE) - * - * debug.c: Debugging functions, especially FormatEvent, which prints unhandled - * events. This code is from xcb-util. - * - */ -#include - -#include -#include - -#include "log.h" - -static const char *labelError[] = { - "Success", - "BadRequest", - "BadValue", - "BadWindow", - "BadPixmap", - "BadAtom", - "BadCursor", - "BadFont", - "BadMatch", - "BadDrawable", - "BadAccess", - "BadAlloc", - "BadColor", - "BadGC", - "BadIDChoice", - "BadName", - "BadLength", - "BadImplementation", -}; - -static const char *labelRequest[] = { - "no request", - "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", -}; - -static const char *labelEvent[] = { - "error", - "reply", - "KeyPress", - "KeyRelease", - "ButtonPress", - "ButtonRelease", - "MotionNotify", - "EnterNotify", - "LeaveNotify", - "FocusIn", - "FocusOut", - "KeymapNotify", - "Expose", - "GraphicsExpose", - "NoExpose", - "VisibilityNotify", - "CreateNotify", - "DestroyNotify", - "UnmapNotify", - "MapNotify", - "MapRequest", - "ReparentNotify", - "ConfigureNotify", - "ConfigureRequest", - "GravityNotify", - "ResizeRequest", - "CirculateNotify", - "CirculateRequest", - "PropertyNotify", - "SelectionClear", - "SelectionRequest", - "SelectionNotify", - "ColormapNotify", - "ClientMessage", - "MappingNotify", -}; - -static const char *labelSendEvent[] = { - "", - " (from SendEvent)", -}; - -int format_event(xcb_generic_event_t *e) { - uint8_t sendEvent; - uint16_t seqnum; - - sendEvent = (e->response_type & 0x80) ? 1 : 0; - e->response_type &= ~0x80; - seqnum = *((uint16_t *)e + 1); - - switch (e->response_type) { - case 0: - DLOG("Error %s on seqnum %d (%s).\n", - labelError[*((uint8_t *)e + 1)], - seqnum, - labelRequest[*((uint8_t *)e + 10)]); - break; - default: - if (e->response_type > sizeof(labelEvent) / sizeof(char *)) - break; - DLOG("Event %s following seqnum %d%s.\n", - labelEvent[e->response_type], - seqnum, - labelSendEvent[sendEvent]); - break; - case XCB_KEYMAP_NOTIFY: - DLOG("Event %s%s.\n", - labelEvent[e->response_type], - labelSendEvent[sendEvent]); - break; - } - - fflush(stdout); - return 1; -} -- 2.39.2