pax_global_header00006660000000000000000000000064117614062420014515gustar00rootroot0000000000000052 comment=aa48ef789187a9a8bbad605c299ce1622cce1783 libxcbutil-0.3.9/000075500000000000000000000000001176140624200136655ustar00rootroot00000000000000libxcbutil-0.3.9/.gitignore000064400000000000000000000017631176140624200156640ustar00rootroot00000000000000# # X.Org module default exclusion patterns # The next section if for module specific patterns # # Do not edit the following section # GNU Build System (Autotools) aclocal.m4 autom4te.cache/ autoscan.log ChangeLog compile config.guess config.h config.h.in config.log config-ml.in config.py config.status config.status.lineno config.sub configure configure.scan depcomp .deps/ INSTALL install-sh .libs/ libtool libtool.m4 ltmain.sh lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 Makefile Makefile.in mdate-sh missing mkinstalldirs *.pc py-compile stamp-h? symlink-tree texinfo.tex ylwrap # Do not edit the following section # Edit Compile Debug Document Distribute *~ *.[0-9] *.[0-9]x *.bak *.bin core *.dll *.exe *-ISO*.bdf *-JIS*.bdf *-KOI8*.bdf *.kld *.ko *.ko.cmd *.lai *.l[oa] *.[oa] *.obj *.patch *.so *.pcf.gz *.pdb *.tar.bz2 *.tar.gz # # Add & Override patterns for xinit # # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' # xcb_util_intro libxcbutil-0.3.9/.gitmodules000064400000000000000000000001301176140624200160340ustar00rootroot00000000000000[submodule "m4"] path = m4 url = git://anongit.freedesktop.org/xcb/util-common-m4.git libxcbutil-0.3.9/Makefile.am000064400000000000000000000004511176140624200157210ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src pkgconfig_DATA = \ xcb-atom.pc \ xcb-aux.pc \ xcb-event.pc \ xcb-util.pc MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL EXTRA_DIST = autogen.sh libxcbutil-0.3.9/NEWS000064400000000000000000000011721176140624200143650ustar00rootroot00000000000000Release 0.3.9 (2012-05-30) ========================== - Remove xcb_bitops.h. - Do not rely anymore on gperf and m4 following removal of deprecated atoms. Release 0.3.8 (2010-04-25) ========================== - Split up atom, aux event into their own repository. - Create a single shared library and header file. - Remove namespaceless pre-defined atoms. - Remove synchronous xcb_atom_get(). - Remove useless xcb_atom_get_fast*() and xcb_atom_get_name(). - Delete redundant core-protocol error codes. - Delete callback-based APIs for events, properties, and replies. - Link with -no-undefined. - Add AM_MAINTAINER_MODE for vendors. libxcbutil-0.3.9/README000064400000000000000000000027231176140624200145510ustar00rootroot00000000000000About XCB util modules ====================== The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions and interfaces which make the raw X protocol more usable. Some of the libraries also provide client-side code which is not strictly part of the X protocol but which have traditionally been provided by Xlib. If you find any of these libraries useful, please let us know what you're using and why you aren't in a mental hospital yet. We'd welcome patches/suggestions for enhancement and new libraries; Please report any issues you find to the freedesktop.org bug tracker, at: Discussion about XCB occurs on the XCB mailing list: About XCB util module ===================== XCB util module provides the following library: - aux: Convenient access to connection setup and some core requests. - atom: Standard core X atom constants and atom caching. - event: Some utilities that have little to do with events any more. You can obtain the latest development versions of XCB util using GIT. For anonymous checkouts, use: git clone --recursive git://anongit.freedesktop.org/git/xcb/util For developers, use: git clone --recursive git+ssh://git.freedesktop.org/git/xcb/util libxcbutil-0.3.9/autogen.sh000075500000000000000000000003031176140624200156620ustar00rootroot00000000000000#! /bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? $srcdir/configure --enable-maintainer-mode "$@" libxcbutil-0.3.9/configure.ac000064400000000000000000000006651176140624200161620ustar00rootroot00000000000000AC_PREREQ(2.59c) AC_INIT([xcb-util],0.3.9,[xcb@lists.freedesktop.org]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE XCB_UTIL_COMMON([1.4], [1.6]) AC_CHECK_FUNCS_ONCE(vasprintf) AC_TYPE_SSIZE_T PKG_CHECK_MODULES(XPROTO, xproto >= 7.0.8) AC_CONFIG_FILES([Makefile src/Makefile xcb-atom.pc xcb-aux.pc xcb-event.pc xcb-util.pc xcb_util_intro]) AC_OUTPUT libxcbutil-0.3.9/m4/000075500000000000000000000000001176140624200142055ustar00rootroot00000000000000libxcbutil-0.3.9/src/000075500000000000000000000000001176140624200144545ustar00rootroot00000000000000libxcbutil-0.3.9/src/Makefile.am000064400000000000000000000005041176140624200165070ustar00rootroot00000000000000lib_LTLIBRARIES = libxcb-util.la AM_CPPFLAGS = $(XCB_CFLAGS) AM_CFLAGS = $(CWARNFLAGS) libxcb_util_la_LIBADD = $(XCB_LIBS) libxcb_util_la_LDFLAGS = -version-info 1:0:0 -no-undefined libxcb_util_la_SOURCES = \ atoms.c \ event.c \ xcb_aux.c xcbinclude_HEADERS = \ xcb_util.h \ xcb_atom.h \ xcb_aux.h \ xcb_event.h libxcbutil-0.3.9/src/atoms.c000064400000000000000000000023171176140624200157460ustar00rootroot00000000000000/* Rely on vasprintf (GNU extension) instead of vsnprintf if possible... */ #ifdef HAVE_VASPRINTF #define _GNU_SOURCE #include #endif #include #include #include #include "xcb_atom.h" static char *makename(const char *fmt, ...) { char *ret; int n; va_list ap; #ifndef HAVE_VASPRINTF char *np; int size = 64; /* First allocate 'size' bytes, should be enough usually */ if((ret = malloc(size)) == NULL) return NULL; while(1) { va_start(ap, fmt); n = vsnprintf(ret, size, fmt, ap); va_end(ap); if(n < 0) return NULL; if(n < size) return ret; size = n + 1; if((np = realloc(ret, size)) == NULL) { free(ret); return NULL; } ret = np; } #else va_start(ap, fmt); n = vasprintf(&ret, fmt, ap); va_end(ap); if(n < 0) return NULL; return ret; #endif } char *xcb_atom_name_by_screen(const char *base, uint8_t screen) { return makename("%s_S%u", base, screen); } char *xcb_atom_name_by_resource(const char *base, uint32_t resource) { return makename("%s_R%08X", base, resource); } char *xcb_atom_name_unique(const char *base, uint32_t id) { if(base) return makename("%s_U%lu", base, id); else return makename("U%lu", id); } libxcbutil-0.3.9/src/event.c000064400000000000000000000132701176140624200157440ustar00rootroot00000000000000/* * Copyright © 2008-2009 Julien Danjou * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the names of the authors or * their institutions shall not be used in advertising or otherwise to * promote the sale, use or other dealings in this Software without * prior written authorization from the authors. */ #include #include #include #include "xcb_event.h" #ifdef HAVE_SYS_TYPES_H # include #endif #define ssizeof(foo) (ssize_t)sizeof(foo) #define countof(foo) (ssizeof(foo) / ssizeof(foo[0])) 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", }; const char * xcb_event_get_label(uint8_t type) { if(type < countof(labelEvent)) return labelEvent[type]; return NULL; } const char * xcb_event_get_error_label(uint8_t type) { if(type < countof(labelError)) return labelError[type]; return NULL; } const char * xcb_event_get_request_label(uint8_t type) { if(type < countof(labelRequest)) return labelRequest[type]; return NULL; } libxcbutil-0.3.9/src/xcb_atom.h000064400000000000000000000005511176140624200164220ustar00rootroot00000000000000#ifndef __XCB_ATOM_H__ #define __XCB_ATOM_H__ #include #ifdef __cplusplus extern "C" { #endif char *xcb_atom_name_by_screen(const char *base, uint8_t screen); char *xcb_atom_name_by_resource(const char *base, uint32_t resource); char *xcb_atom_name_unique(const char *base, uint32_t id); #ifdef __cplusplus } #endif #endif /* __XCB_ATOM_H__ */ libxcbutil-0.3.9/src/xcb_aux.c000064400000000000000000000264601176140624200162610ustar00rootroot00000000000000/* * Copyright © 2008 Bart Massey * Copyright © 2008 Ian Osgood * Copyright © 2008 Jamey Sharp * Copyright © 2008 Josh Triplett * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the names of the authors or * their institutions shall not be used in advertising or otherwise to * promote the sale, use or other dealings in this Software without * prior written authorization from the authors. */ #include #include #include #include #include "xcb_aux.h" /* Connection related functions */ uint8_t xcb_aux_get_depth (xcb_connection_t *c, xcb_screen_t *screen) { xcb_drawable_t drawable; xcb_get_geometry_reply_t *geom; int depth = 0; drawable = screen->root; geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0); if (geom) { depth = geom->depth; free (geom); } return depth; } uint8_t xcb_aux_get_depth_of_visual (xcb_screen_t *screen, xcb_visualid_t id) { xcb_depth_iterator_t i; xcb_visualtype_iterator_t j; for (i = xcb_screen_allowed_depths_iterator(screen); i.rem; xcb_depth_next(&i)) for (j = xcb_depth_visuals_iterator(i.data); j.rem; xcb_visualtype_next(&j)) if (j.data->visual_id == id) return i.data->depth; return 0; } xcb_screen_t * xcb_aux_get_screen (xcb_connection_t *c, int screen) { xcb_screen_iterator_t i = xcb_setup_roots_iterator(xcb_get_setup(c)); for (; i.rem; --screen, xcb_screen_next(&i)) if (screen == 0) return i.data; return 0; } xcb_visualtype_t * xcb_aux_get_visualtype (xcb_connection_t *c, int scr, xcb_visualid_t vid) { xcb_screen_t *screen; xcb_depth_t *depth; xcb_visualtype_iterator_t iter; int cur; screen = xcb_aux_get_screen (c, scr); if (!screen) return NULL; depth = xcb_screen_allowed_depths_iterator(screen).data; if (!depth) return NULL; iter = xcb_depth_visuals_iterator(depth); for (cur = 0 ; cur < iter.rem ; xcb_visualtype_next(&iter), ++cur) if (vid == iter.data->visual_id) return iter.data; return NULL; } xcb_visualtype_t * xcb_aux_find_visual_by_id (xcb_screen_t *screen, xcb_visualid_t id) { xcb_depth_iterator_t i; xcb_visualtype_iterator_t j; for (i = xcb_screen_allowed_depths_iterator(screen); i.rem; xcb_depth_next(&i)) for (j = xcb_depth_visuals_iterator(i.data); j.rem; xcb_visualtype_next(&j)) if (j.data->visual_id == id) return j.data; return 0; } xcb_visualtype_t * xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, int8_t class, int8_t depth) { xcb_depth_iterator_t i; xcb_visualtype_iterator_t j; for (i = xcb_screen_allowed_depths_iterator(screen); i.rem; xcb_depth_next(&i)) { if (depth != -1 && i.data->depth != depth) continue; for (j = xcb_depth_visuals_iterator(i.data); j.rem; xcb_visualtype_next(&j)) if (class == -1 || j.data->_class == class) return j.data; } return 0; } void xcb_aux_sync (xcb_connection_t *c) { free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL)); } /* structs instead of value lists */ /* TODO: generate the struct types and functions from protocol masks and descriptions */ /* This generic implementation of pack_list depends on: a) structs packed to uint32_t size b) structs consist of just uint32_t/int32_t fields in the same order as bitmask */ static void pack_list( uint32_t mask, const uint32_t *src, uint32_t *dest ) { for ( ; mask; mask >>= 1, src++) if (mask & 1) *dest++ = *src; } xcb_void_cookie_t xcb_aux_create_window (xcb_connection_t *c, uint8_t depth, xcb_window_t wid, xcb_window_t parent, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t border_width, uint16_t _class, xcb_visualid_t visual, uint32_t mask, const xcb_params_cw_t *params) { uint32_t value_list[16]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_create_window(c, depth, wid, parent, x, y, width, height, border_width, _class, visual, mask, value_list); } xcb_void_cookie_t xcb_aux_create_window_checked (xcb_connection_t *c, uint8_t depth, xcb_window_t wid, xcb_window_t parent, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t border_width, uint16_t _class, xcb_visualid_t visual, uint32_t mask, const xcb_params_cw_t *params) { uint32_t value_list[16]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_create_window_checked(c, depth, wid, parent, x, y, width, height, border_width, _class, visual, mask, value_list); } xcb_void_cookie_t xcb_aux_change_window_attributes_checked (xcb_connection_t *c, xcb_window_t window, uint32_t mask, const xcb_params_cw_t *params) { uint32_t value_list[16]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_change_window_attributes_checked( c, window, mask, value_list ); } xcb_void_cookie_t xcb_aux_change_window_attributes (xcb_connection_t *c, xcb_window_t window, uint32_t mask, const xcb_params_cw_t *params) { uint32_t value_list[16]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_change_window_attributes( c, window, mask, value_list ); } xcb_void_cookie_t xcb_aux_configure_window (xcb_connection_t *c, xcb_window_t window, uint16_t mask, const xcb_params_configure_window_t *params) { uint32_t value_list[8]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_configure_window( c, window, mask, value_list ); } xcb_void_cookie_t xcb_aux_create_gc (xcb_connection_t *c, xcb_gcontext_t gid, xcb_drawable_t drawable, uint32_t mask, const xcb_params_gc_t *params) { uint32_t value_list[32]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_create_gc( c, gid, drawable, mask, value_list ); } xcb_void_cookie_t xcb_aux_create_gc_checked (xcb_connection_t *c, xcb_gcontext_t gid, xcb_drawable_t drawable, uint32_t mask, const xcb_params_gc_t *params) { uint32_t value_list[32]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_create_gc_checked( c, gid, drawable, mask, value_list); } xcb_void_cookie_t xcb_aux_change_gc (xcb_connection_t *c, xcb_gcontext_t gc, uint32_t mask, const xcb_params_gc_t *params) { uint32_t value_list[32]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_change_gc( c, gc, mask, value_list ); } xcb_void_cookie_t xcb_aux_change_gc_checked (xcb_connection_t *c, xcb_gcontext_t gc, uint32_t mask, const xcb_params_gc_t *params) { uint32_t value_list[32]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_change_gc_checked( c, gc, mask, value_list ); } xcb_void_cookie_t xcb_aux_change_keyboard_control (xcb_connection_t *c, uint32_t mask, const xcb_params_keyboard_t *params) { uint32_t value_list[16]; pack_list(mask, (const uint32_t *)params, value_list); return xcb_change_keyboard_control( c, mask, value_list ); } /* Color related functions */ /* Return true if the given color name can be translated locally, in which case load the components. Otherwise, a lookup_color request will be needed, so return false. */ int xcb_aux_parse_color(char *color_name, uint16_t *red, uint16_t *green, uint16_t *blue) { int n, r, g, b, i; if (!color_name || *color_name != '#') return 0; /* * Excitingly weird RGB parsing code from Xlib. */ n = strlen (color_name); color_name++; n--; if (n != 3 && n != 6 && n != 9 && n != 12) return 0; n /= 3; g = b = 0; do { r = g; g = b; b = 0; for (i = n; --i >= 0; ) { char c = *color_name++; b <<= 4; if (c >= '0' && c <= '9') b |= c - '0'; else if (c >= 'A' && c <= 'F') b |= c - ('A' - 10); else if (c >= 'a' && c <= 'f') b |= c - ('a' - 10); else return 0; } } while (*color_name != '\0'); n <<= 2; n = 16 - n; *red = r << n; *green = g << n; *blue = b << n; return 1; } /* Drawing related functions */ /* Adapted from Xlib */ xcb_void_cookie_t xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, xcb_gcontext_t gc, uint16_t linewidth, int32_t linestyle, int32_t capstyle, int32_t joinstyle) { uint32_t mask = 0; xcb_params_gc_t gv; XCB_AUX_ADD_PARAM(&mask, &gv, line_width, linewidth); XCB_AUX_ADD_PARAM(&mask, &gv, line_style, linestyle); XCB_AUX_ADD_PARAM(&mask, &gv, cap_style, capstyle); XCB_AUX_ADD_PARAM(&mask, &gv, join_style, joinstyle); return xcb_aux_change_gc_checked(dpy, gc, mask, &gv); } /* Adapted from Xlib */ /* XXX It would be wiser for apps just to call clear_area() directly. */ xcb_void_cookie_t xcb_aux_clear_window(xcb_connection_t * dpy, xcb_window_t w) { return xcb_clear_area(dpy, 0, w, 0, 0, 0, 0); } libxcbutil-0.3.9/src/xcb_aux.h000064400000000000000000000152521176140624200162630ustar00rootroot00000000000000#ifndef __XCB_AUX_H__ #define __XCB_AUX_H__ #ifdef __cplusplus extern "C" { #endif uint8_t xcb_aux_get_depth (xcb_connection_t *c, xcb_screen_t *screen); uint8_t xcb_aux_get_depth_of_visual (xcb_screen_t *screen, xcb_visualid_t id); xcb_screen_t *xcb_aux_get_screen (xcb_connection_t *c, int screen); xcb_visualtype_t *xcb_aux_get_visualtype (xcb_connection_t *c, int screen, xcb_visualid_t vid); xcb_visualtype_t * xcb_aux_find_visual_by_id (xcb_screen_t *screen, xcb_visualid_t id); xcb_visualtype_t * xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, int8_t class_, int8_t depth); void xcb_aux_sync (xcb_connection_t *c); /* internal helper macro for XCB_AUX_ADD_PARAM It gives the offset of the field 'param' in the structure pointed to by 'paramsp' in multiples of an uint32_t's size. */ #define XCB_AUX_INTERNAL_OFFSETOF(paramsp, param) \ ((uint32_t const*)(&((paramsp)->param))-(uint32_t const*)(paramsp)) /* add an optional parameter to an xcb_params_* structure parameters: maskp: pointer to bitmask whos bits mark used parameters paramsp: pointer to structure with parameters param: parameter to set value: value to set the parameter to */ #define XCB_AUX_ADD_PARAM(maskp, paramsp, param, value) \ ((*(maskp)|=1<param=(value))) typedef struct { uint32_t back_pixmap; uint32_t back_pixel; uint32_t border_pixmap; uint32_t border_pixel; uint32_t bit_gravity; uint32_t win_gravity; uint32_t backing_store; uint32_t backing_planes; uint32_t backing_pixel; uint32_t override_redirect; uint32_t save_under; uint32_t event_mask; uint32_t dont_propagate; uint32_t colormap; uint32_t cursor; } xcb_params_cw_t; xcb_void_cookie_t xcb_aux_create_window (xcb_connection_t *c, uint8_t depth, xcb_window_t wid, xcb_window_t parent, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t border_width, uint16_t class_, xcb_visualid_t visual, uint32_t mask, const xcb_params_cw_t *params); xcb_void_cookie_t xcb_aux_create_window_checked (xcb_connection_t *c, uint8_t depth, xcb_window_t wid, xcb_window_t parent, int16_t x, int16_t y, uint16_t width, uint16_t height, uint16_t border_width, uint16_t class_, xcb_visualid_t visual, uint32_t mask, const xcb_params_cw_t *params); xcb_void_cookie_t xcb_aux_change_window_attributes (xcb_connection_t *c, xcb_window_t window, uint32_t mask, const xcb_params_cw_t *params); xcb_void_cookie_t xcb_aux_change_window_attributes_checked (xcb_connection_t *c, xcb_window_t window, uint32_t mask, const xcb_params_cw_t *params); typedef struct { int32_t x; int32_t y; uint32_t width; uint32_t height; uint32_t border_width; uint32_t sibling; uint32_t stack_mode; } xcb_params_configure_window_t; xcb_void_cookie_t xcb_aux_configure_window (xcb_connection_t *c, xcb_window_t window, uint16_t mask, const xcb_params_configure_window_t *params); typedef struct { uint32_t function; uint32_t plane_mask; uint32_t foreground; uint32_t background; uint32_t line_width; uint32_t line_style; uint32_t cap_style; uint32_t join_style; uint32_t fill_style; uint32_t fill_rule; uint32_t tile; uint32_t stipple; uint32_t tile_stipple_origin_x; uint32_t tile_stipple_origin_y; uint32_t font; uint32_t subwindow_mode; uint32_t graphics_exposures; uint32_t clip_originX; uint32_t clip_originY; uint32_t mask; uint32_t dash_offset; uint32_t dash_list; uint32_t arc_mode; } xcb_params_gc_t; xcb_void_cookie_t xcb_aux_create_gc (xcb_connection_t *c, xcb_gcontext_t cid, xcb_drawable_t drawable, uint32_t mask, const xcb_params_gc_t *params); xcb_void_cookie_t xcb_aux_create_gc_checked (xcb_connection_t *c, xcb_gcontext_t gid, xcb_drawable_t drawable, uint32_t mask, const xcb_params_gc_t *params); xcb_void_cookie_t xcb_aux_change_gc (xcb_connection_t *c, xcb_gcontext_t gc, uint32_t mask, const xcb_params_gc_t *params); xcb_void_cookie_t xcb_aux_change_gc_checked (xcb_connection_t *c, xcb_gcontext_t gc, uint32_t mask, const xcb_params_gc_t *params); typedef struct { uint32_t key_click_percent; uint32_t bell_percent; uint32_t bell_pitch; uint32_t bell_duration; uint32_t led; uint32_t led_mode; uint32_t key; uint32_t auto_repeat_mode; } xcb_params_keyboard_t; xcb_void_cookie_t xcb_aux_change_keyboard_control (xcb_connection_t *c, uint32_t mask, const xcb_params_keyboard_t *params); int xcb_aux_parse_color(char *color_name, uint16_t *red, uint16_t *green, uint16_t *blue); xcb_void_cookie_t xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, xcb_gcontext_t gc, uint16_t linewidth, int32_t linestyle, int32_t capstyle, int32_t joinstyle); xcb_void_cookie_t xcb_aux_clear_window(xcb_connection_t * dpy, xcb_window_t w); #ifdef __cplusplus } #endif #endif /* __XCB_AUX_H__ */ libxcbutil-0.3.9/src/xcb_event.h000064400000000000000000000056701176140624200166120ustar00rootroot00000000000000/* * Copyright (C) 2008-2009 Julien Danjou * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the names of the authors or * their institutions shall not be used in advertising or otherwise to * promote the sale, use or other dealings in this Software without * prior written authorization from the authors. */ /** * @defgroup xcb__event_t XCB Event Functions * * These functions ease the handling of X events received. * * @{ */ #ifndef __XCB_EVENT_H__ #define __XCB_EVENT_H__ #include #ifdef __cplusplus extern "C" { #endif /** * @brief Bit mask to find event type regardless of event source. * * Each event in the X11 protocol contains an 8-bit type code. * The most-significant bit in this code is set if the event was * generated from a SendEvent request. This mask can be used to * determine the type of event regardless of how the event was * generated. See the X11R6 protocol specification for details. */ #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) /** * @brief Convert an event response type to a label. * @param type The event type. * @return A string with the event name, or NULL if unknown. */ const char * xcb_event_get_label(uint8_t type); /** * @brief Convert an event error type to a label. * @param type The error type. * @return A string with the event name, or NULL if unknown or if the event is * not an error. */ const char * xcb_event_get_error_label(uint8_t type); /** * @brief Convert an event request type to a label. * @param type The request type. * @return A string with the event name, or NULL if unknown or if the event is * not an error. */ const char * xcb_event_get_request_label(uint8_t type); #ifdef __cplusplus } #endif /** * @} */ #endif /* __XCB_EVENT_H__ */ libxcbutil-0.3.9/src/xcb_util.h000064400000000000000000000002321176140624200164330ustar00rootroot00000000000000#ifndef __XCB_UTIL_H__ #define __XCB_UTIL_H__ #include #include #include #endif /* __XCB_UTIL_H__ */ libxcbutil-0.3.9/xcb-atom.pc.in000064400000000000000000000003441176140624200163310ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: XCB Atom library Description: XCB atom cache Version: @PACKAGE_VERSION@ Requires: xcb Libs: -L${libdir} -lxcb-util Cflags: -I${includedir} libxcbutil-0.3.9/xcb-aux.pc.in000064400000000000000000000003551176140624200161700ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: XCB Aux library Description: XCB convenient functions Version: @PACKAGE_VERSION@ Requires: xcb Libs: -L${libdir} -lxcb-util Cflags: -I${includedir} libxcbutil-0.3.9/xcb-event.pc.in000064400000000000000000000003631176140624200165130ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: XCB Event library Description: XCB event callback interface Version: @PACKAGE_VERSION@ Requires: xcb Libs: -L${libdir} -lxcb-util Cflags: -I${includedir} libxcbutil-0.3.9/xcb-util.pc.in000064400000000000000000000003621176140624200163460ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: XCB Util Core library Description: XCB util core interface Version: @PACKAGE_VERSION@ Requires: xcb Libs: -L${libdir} -lxcb-util Cflags: -I${includedir} libxcbutil-0.3.9/xcb_util_intro.in000064400000000000000000000010751176140624200172440ustar00rootroot00000000000000/** @file @brief XCB Utility functions These routines are used to facilitate the use of XCB in programs. */ /** @mainpage XCB Utility Documentation @version @PACKAGE_VERSION@ @author Ian Osgood @author Bart Massey @author Jamey Sharp @author Josh Triplett @author Keith Packard @author Vincent Torri @author Julien Danjou @author Arnaud Fontaine @date 2005-2008 @section intro What is available ? */