--- /dev/null
+Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.
+All Rights Reserved.
+
+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.
--- /dev/null
+SUBDIRS=src tests doc
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+pkgconfig_DATA = xcb.pc
+
+if BUILD_COMPOSITE
+pkgconfig_DATA += xcb-composite.pc
+endif
+if BUILD_DAMAGE
+pkgconfig_DATA += xcb-damage.pc
+endif
+if BUILD_DPMS
+pkgconfig_DATA += xcb-dpms.pc
+endif
+if BUILD_DRI2
+pkgconfig_DATA += xcb-dri2.pc
+endif
+if BUILD_GLX
+pkgconfig_DATA += xcb-glx.pc
+endif
+if BUILD_RANDR
+pkgconfig_DATA += xcb-randr.pc
+endif
+if BUILD_RECORD
+pkgconfig_DATA += xcb-record.pc
+endif
+if BUILD_RENDER
+pkgconfig_DATA += xcb-render.pc
+endif
+if BUILD_RESOURCE
+pkgconfig_DATA += xcb-res.pc
+endif
+if BUILD_SCREENSAVER
+pkgconfig_DATA += xcb-screensaver.pc
+endif
+if BUILD_SHAPE
+pkgconfig_DATA += xcb-shape.pc
+endif
+if BUILD_SHM
+pkgconfig_DATA += xcb-shm.pc
+endif
+if BUILD_SYNC
+pkgconfig_DATA += xcb-sync.pc
+endif
+if BUILD_XEVIE
+pkgconfig_DATA += xcb-xevie.pc
+endif
+if BUILD_XFREE86_DRI
+pkgconfig_DATA += xcb-xf86dri.pc
+endif
+if BUILD_XFIXES
+pkgconfig_DATA += xcb-xfixes.pc
+endif
+if BUILD_XINERAMA
+pkgconfig_DATA += xcb-xinerama.pc
+endif
+if BUILD_XINPUT
+pkgconfig_DATA += xcb-xinput.pc
+endif
+if BUILD_XPRINT
+pkgconfig_DATA += xcb-xprint.pc
+endif
+if BUILD_SELINUX
+pkgconfig_DATA += xcb-xselinux.pc
+endif
+if BUILD_XTEST
+pkgconfig_DATA += xcb-xtest.pc
+endif
+if BUILD_XV
+pkgconfig_DATA += xcb-xv.pc
+endif
+if BUILD_XVMC
+pkgconfig_DATA += xcb-xvmc.pc
+endif
+
+
+EXTRA_DIST = \
+tools/README \
+tools/api_conv.pl \
+tools/constants \
+autogen.sh
--- /dev/null
+Release 1.7 (2010-08-13)
+========================
+- Always wake up readers after writing
+- Get rid of PATH_MAX and MAXPATHLEN
+- Add ~ operator support in code generator
+- xcb_open: Improve protocol/host parsing
+- xcb_connect_to_display_with_auth_info: Fix memory leak
+- Report which extensions are being built
+
+Release 1.6 (2010-04-09)
+========================
+- darwin: xnu doesn't support poll on ttys on the master side
+- Fix descriptor leak on memory error path
+- Support xcb_discard_reply
+- Open the X11 socket with close-on-exec flag
+- Fix authentication on hpux and Hurd
+
+Release 1.5 (2009-12-03)
+========================
+- setsockopt(SO_KEEPALIVE) on TCP display connections
+- Add DRI2 support
+- Fix check dependency
+- Cygwin build fix: Add -no-undefined to libtool flags
+
+Release 1.4 (2009-07-15)
+========================
+* Add majorCode, minorCode and resourceID fields to X generic error
+* Fix precedence bug: wrong length for big-requests preceded by sync
+* Fix libxcb-randr version info
+
+Release 1.3 (2009-05-29)
+========================
+* Copy full IPv4 mapping (Bug #20665)
+* Fix XID allocation
+* Use poll() instead of select() when available
+* Fix local socket connection on Hurd
+* Fix XDM-AUTHORIZATION-1
+* Disable Nagle on TCP socket
+
+Release 1.2 (2009-02-17)
+========================
+* Stop packaging auto-generated C files into tarball.
+
+Release 1.1.93 (2008-12-11)
+===========================
+Enhancements:
+* Apple: Enable support for launchd DISPLAY socket
+* Treat XIDs the same as other cardinal values.
+
+Release 1.1.92 (2008-11-01)
+===========================
+Enhancements:
+* Added small fix to support trailing fixed fields; also warning for non-pad fixed fields
+* Fixed overly aggressive warning about fixed field following variable
+* Added generation of extern "C" for compatibility with C++
+* Remove libxcb-xlib and xcbxlib.h.
+* Inline _xcb_lock_io, _xcb_unlock_io, and _xcb_wait_io.
+* Track 64-bit sequence numbers internally.
+* Use sequence number ranges in pending replies
+* Remove duplicate XCB_EXTENSION calls for Composite extension
+* Factorize m4 macros and add one to set X extensions
+* Allow compile-time setting for XCB queue buffer size
+* Support handing off socket write permission to external code.
+* Add support for the abstract socket namespace under Linux
+
+Bug fixes:
+* Fix tiny memory leak in read_packet
+* Fix some fd leaks in _xcb_open_*()
+
+Release 1.1 (2007-11-04)
+========================
+
+This release requires xcb-proto 1.1, due to the addition of the
+extension-multiword attribute to the XML schema.
+
+This release contains several important bug fixes, summarized below. It
+also contains a patch much like Novell's libxcb-sloppy-lock.diff.
+Rationale from the commit message follows. The patch and this rationale
+were authored by Jamey Sharp <jamey@minilop.net>, with agreement from
+Josh Triplett <josh@freedesktop.org>.
+
+ I strongly opposed proposals like this one for a long time.
+ Originally I had a very good reason: libX11, when compiled to use
+ XCB, would crash soon after a locking correctness violation, so it
+ was better to have an informative assert failure than a mystifying
+ crash soon after.
+
+ It took some time for me to realize that I'd changed the libX11
+ implementation (for unrelated reasons) so that it could survive most
+ invalid locking situations, as long as it wasn't actually being used
+ from multiple threads concurrently.
+
+ The other thing that has changed is that most of the code with
+ incorrect locking has now been fixed. The value of the assert is
+ accordingly lower.
+
+ However, remaining broken callers do need to be fixed. That's why
+ libXCB will still noisily print a stacktrace (if possible) on each
+ assertion failure, even when assert isn't actually invoked to
+ abort() the program; and that's why aborting is still default. This
+ environment variable is provided only for use as a temporary
+ workaround for broken applications.
+
+Enhancements:
+* Print a backtrace, if possible, on locking assertion failures.
+* Skip abort() on locking assertions if LIBXCB_ALLOW_SLOPPY_LOCK is set.
+* xcb_poll_for_event: Return already-read events before reading again.
+* Output a configuration summary at the end of ./configure.
+
+Bug fixes:
+* Don't hold the xlib-xcb lock while sleeping: that allows deadlock.
+* Allow unix:<screen> style display names again.
+* Bug #9119: test xcb_popcount
+* Fix unit tests for FreeBSD
+* NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available.
+* Require libXau >= 0.99.2; earlier versions have a broken .pc file
+* Use substitition variables in xcb-xinerama.pc.in
+* Update autogen.sh to one that does objdir != srcdir
+* Add tools/* and autogen.sh to EXTRA_DIST.
+* Doxygen can now be fully disabled if desired.
+
+Documentation improvements:
+* Many fixes and updates to the tutorial.
+* Iterators, requests, and replies get partial Doxygen documentation.
+
+
+Release 1.0 (2006-11-23)
+========================
+
+The "Thanksgiving" release: We feel thankful to have it released. Five years
+have passed since XCB's initial commit on September 3rd, 2001:
+ <http://gitweb.freedesktop.org/?p=xcb.git;a=commit;h=09e54c4a3c>
+
+* Support IPv6. XCB now supports displays with IPv6 addresses, with or without
+ enclosing square brackets, or with hosts which resolve to IPv6 addresses, by
+ using getaddrinfo instead of gethostbyname, and by including support for
+ authentication for such connections. This allows such displays as "::1:1.1".
+
+* XCB now uses the libpthread-stubs, to properly support optional use of
+ pthreads even on platforms which do not have all the necessary pthread stubs
+ in libc or otherwise available by default.
+
+* Switch from the old AM_PATH_CHECK macro to pkg-config. check 0.9.4 is now
+ required to build XCB's unit tests. The version that we were requiring was
+ not actually new enough to let our unit tests compile, and the AM_PATH_CHECK
+ macro is now considered deprecated. We know that versions of check using
+ pkg-config are new enough to work, and the check dependency was optional
+ anyway, so we've dropped support for older versions.
+
+* Provide a xcb_prefetch_maximum_request_length counterpart to
+ xcb_get_maximum_request_length.
+
+* Fix Bug #5958: zero out padding bytes in requests.
+
+* Change xcb_connect to pass the display number to _xcb_get_auth_info, which
+ passes it to get_authptr. This allows get_authptr to stop hacking the
+ display number out of the sockaddrs of various address families, such as
+ port - X_TCP_PORT, or the number after the last X in the UNIX socket path.
+
+* Remove --with-opt and --with-debug options from configure.ac; configure
+ supports the use of custom CFLAGS, so please use that instead.
+
+* Reove support for the <localfield> tag in protocol descriptions, since they
+ no longer use it, and since new protocol descriptions should not need it
+ either.
+
+* xcb-proto has no libraries or headers, so don't use XCBPROTO_CFLAGS or
+ XCBPROTO_LIBS.
+
+* XCB builds which use xdmcp now include it in Requires.private, to support
+ static linking.
+
+* Replace "long" with uint32_t when used for a 32-bit quantity
+
+* Various enhancements to the generation of documentation with Doxygen:
+ * Check for doxygen in configure.ac
+ * Fix some Doxygen warnings.
+ * Install documentation.
+ * Handle out-of-tree builds, with srcdir != builddir. xcb.doxygen now gets
+ generated from xcb.doxygen.in, so that it can use top_builddir and
+ top_srcdir to find source and to output documentation.
+ * Fill in PROJECT_NUMBER from @VERSION@, now that we have it readily
+ available via autoconf.
+
+
+Release 1.0 RC3 (2006-11-02)
+============================
+
+Note: Version 0.9.4 of the test suite tool "check" provides a broken
+version of the AM_PATH_CHECK macro, which causes autoconf to fail due to
+insufficient quoting on the macro names it prints in its deprecation
+message. We have written a patch to fix this problem, available at:
+<http://bugs.debian.org/cgi-bin/bugreport.cgi/check-m4-am-path-check-use-quadrigraphs-in-macro-names-to-unbreak-autoconf.patch?bug=395466;msg=20;att=1>
+Version 0.9.4-2 of the Debian package for check includes this patch.
+Users of other distributions who want to re-autotool libxcb will need to
+apply this patch, use an older version of check, or wait for a fixed
+upstream version. This bug does not affect users who use the distributed
+tarballs and do not re-autotool.
+
+* Add library support for xcb-xinerama, using new protocol description
+ from xcb-proto.
+* In the generated protocol code, define and use constants for opcode
+ numbers rather than hard-coding them.
+* In the API conversion script, match only XCB-namespaced XID generators
+ when converting to xcb_generate_id.
+* Quit treating xproto specially in Makefile.am: handle it like all the
+ extensions.
+* Generate Doxygen documentation comments in the protocol stubs, and
+ provide a Doxygen config file for building HTML documentation for XCB.
+* Add note to xcbxlib.h that nothing except Xlib/XCB should use it.
+* Extend test suite to test xcb_parse_display with NULL argument and
+ display in $DISPLAY.
+
+
+Release 1.0 RC2 (2006-10-07)
+============================
+
+API changes
+-----------
+
+In our announcement of XCB 1.0 RC1, we proposed two API changes for
+community feedback:
+
+ We would greatly appreciate API review in this final release
+ candidate period. We've had some limited feedback that our attempts
+ to impose static type safety on XIDs in C pose more a hindrance than
+ a help, so we would appreciate discussion over whether this
+ constitutes a "serious issue with the API". Some question also
+ remains of whether xcb_poll_for_event should have the out-parameter
+ 'error', now that XCB has a more uniform mechanism for reporting
+ connection errors. Speak now on these points or leave us alone. ;-)
+
+Since we've received feedback agreeing with our proposed changes, and no
+objections or requests to keep the existing API, we made both changes
+and bumped the soname to libxcb.so.1.0.0 in preparation for the release
+of XCB 1.0.
+
+* Remove XID wrapper structures and replace them with uint32_t typedefs.
+ XID union types like xcb_drawable_t and xcb_fontable_t also become
+ uint32_t typedefs. The API conversion script now replaces xcb_*_new
+ with calls directly to xcb_generate_id. This change makes
+ xcb_generate_id part of the client API rather than the extension API,
+ so move xcb_generate_id from xcbext.h to xcb.h.
+
+* Remove the 'int *error' out-parameter for xcb_poll_for_event.
+ xcb_poll_for_event now shuts down the xcb_connection_t on fatal
+ errors; use xcb_connection_has_error to check.
+
+The Xlib-specific API in libxcb-xlib also changed:
+
+* Stop exposing the XCB IO lock for Xlib's benefit, by removing
+ xcb_get_io_lock from the Xlib-specific XCB API; instead, libxcb-xlib
+ now provides xcb_xlib_lock and xcb_xlib_unlock.
+
+Code generation changes
+-----------------------
+
+* The code generator no longer implicitly imports xproto for extensions.
+ xcb-proto 1.0 RC2 includes the corresponding change to explicitly
+ import xproto in extensions that need it
+
+* The generated protocol headers now declare "struct foo", "union foo"
+ or "enum foo", not just the typedef "foo" of an unnamed
+ struct/union/enum type.
+
+Bug Fixes
+---------
+
+* Make Plan 7 'checked' requests work correctly.
+
+Documentation improvements
+--------------------------
+
+* Document xcb_generate_id.
+
+* Tutorial enhancements.
+
+
+Release 1.0 RC1 (2006-09-25)
+============================
+
+The Great XCB Renaming
+----------------------
+
+Rename API to follow a new naming convention:
+
+* XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES
+* xcb_functions_lowercase_with_underscores
+* xcb_types_lowercase_with_underscores_and_suffix_t
+* expand all abbreviations like "req", "rep", and "iter"
+
+Word boundaries for the names in the protocol descriptions fall:
+
+* Wherever the protocol descriptions already have an underscore
+* Between a lowercase letter and a subsequent uppercase letter
+* Before the last uppercase letter in a string of uppercase letters
+ followed by a lowercase letter (such as in LSBFirst between LSB and
+ First)
+* Before and after a string of digits (with exceptions for sized types
+ like xcb_char2b_t and xcb_glx_float32_t to match the stdint.h
+ convention)
+
+Also fix up some particular naming issues:
+
+* Rename shape_op and shape_kind to drop the "shape_" prefix, since
+ otherwise these types end up as xcb_shape_shape_{op,kind}_t.
+* Remove leading underscores from enums in the GLX protocol description,
+ previously needed to ensure a word separator, but now redundant.
+
+This renaming breaks code written for the previous API naming
+convention. The scripts in XCB's tools directory will convert code
+written for the old API to use the new API; they work well enough that
+we used them to convert the non-program-generated code in XCB, and when
+run on the old program-generated code, they almost exactly reproduce the
+new program-generated code (modulo whitespace and bugs in the old code
+generator).
+
+Authors: Vincent Torri, Thomas Hunger, Josh Triplett
+
+In addition to the API renaming, the library SONAMEs have changed to
+libxcb.so and libxcb-extname.so. The library major version remains at 0,
+to become version 1 before 1.0 is released; the SONAME lowercasing means
+that this will not conflict with XCB 0.9 libraries.
+
+The header files have moved from /usr/include/X11/XCB/ to
+/usr/include/xcb/. The XML-XCB protocol descriptions have moved to
+/usr/share/xcb, with extension descriptions no longer relegated to an
+extensions/ subdirectory. The API conversion script api_conv.pl will fix
+references to the header files, and packages using pkg-config will
+automatically use the new library names.
+
+Error handling Plan 7
+---------------------
+
+All request functions now come in an "unchecked" and "checked" variant.
+The checked variant allows callers to handle errors inline where they
+obtain the reply, or by calling xcb_request_check for requests with no
+reply. The unchecked variant uses the event queue for errors. Requests
+with replies default to checked, because the caller must already make a
+function call to retrieve the reply and can see the error at that time;
+the unchecked variant uses the suffix _unchecked. Requests without
+replies default to unchecked, because the caller will not necessarily
+expect to handle a response, and the checked variant uses the suffix
+_checked.
+
+Connection error handling
+-------------------------
+
+Fatal connection errors now put the xcb_connection_t object into an
+error state, at which point all further operations on that connection
+will fail. Callers can use the new xcb_connection_has_error function to
+check for this state in a connection. Functions that return a
+connection, such as the xcb_connect function, may instead return an
+xcb_connection_t already in an error state.
+
+In the future we expect to add additional API for getting more
+information about the error condition that caused the connection to get
+into an error state.
+
+Smaller API changes
+-------------------
+
+All functions that have been marked 'deprecated' up to now have been
+removed for this release. After XCB 1.0 is released, functions marked
+'deprecated' will be preserved until the end of time to maintain
+compatibility.
+
+XCB no longer provides a sync function. Most callers of this function
+should use xcb_flush instead, which usually provides the intended
+functionality and does not require a round-trip to the server. If you
+really need this functionality, either use xcb_get_input_focus like sync
+used to do, or use the xcb_aux_sync function from the xcb-aux library in
+xcb-util. However, note that we do not consider the libraries in
+xcb-util remotely stable yet.
+
+XCB no longer provides xcb_[extension_name]_init functions for each
+extension. These functions previously caused XCB to issue and process a
+QueryExtension request. Callers should now directly call
+xcb_get_extension_data on the xcb_[extension_name]_id, or use
+xcb_prefetch_extension_data if they do not need to force a round-trip
+immediately.
+
+The compatibility functions in xcbxlib.h, provided solely for use by
+Xlib/XCB, now exist in a separate library libxcb-xlib. We don't want to
+have to change the libxcb soname if we later change or remove the Xlib
+compatibility functions, and nothing except Xlib/XCB should ever use
+them. (Applications which use Xlib/XCB do not need this library either;
+Xlib/XCB only uses it internally.)
+
+The descriptions of several extensions have been updated to match the
+latest versions implemented in the X.org X server.
+
+GIT Repository split
+--------------------
+
+Previously, several XCB-related projects all existed under the umbrella
+of a single monolithic GIT repository with per-project subdirectories.
+We have split this repository into individual per-project repositories.
+
+Josh Triplett and Jamey Sharp wrote a tool called git-split to
+accomplish this repository split. git-split reconstructs the history of
+a sub-project previously stored in a subdirectory of a larger
+repository. It constructs new commit objects based on the existing tree
+objects for the subtree in each commit, and discards commits which do
+not affect the history of the sub-project, as well as merges made
+unnecessary due to these discarded commits.
+
+We would like to acknowledge the work of the gobby team in creating a
+collaborative editor which greatly aided the development of git-split
+(as well as these release notes).
+
+Build and implementation fixes
+------------------------------
+
+XCB no longer needs proto/x11 from X.org; the XCB header xproto.h
+provides the definitions from X.h, named according to XCB conventions.
+
+XCB should now build with non-GNU implementations of Make.
+
+XCB properly handles 32-bit wrap of sequence numbers, and thus now
+supports issuing more than 2**32 requests in one connection.
+
+Fixed bugs #7001, #7261.
--- /dev/null
+About libxcb
+============
+
+libxcb provides an interface to the X Window System protocol, which
+replaces the current Xlib interface. It has several advantages over
+Xlib, including:
+- size: small, simple library, and lower memory footprint
+- latency hiding: batch several requests and wait for the replies later
+- direct protocol access: interface and protocol correspond exactly
+- proven thread support: transparently access XCB from multiple threads
+- easy extension implementation: interfaces auto-generated from XML-XCB
+
+Xlib can also use XCB as a transport layer, allowing software to make
+requests and receive responses with both, which eases porting to XCB.
+However, client programs, libraries, and toolkits will gain the most
+benefit from a native XCB port.
+
+
+Please report any issues you find to the freedesktop.org bug tracker,
+at:
+
+ <https://bugs.freedesktop.org/enter_bug.cgi?product=XCB>
+
+Discussion about XCB occurs on the XCB mailing list:
+
+ <mailto:xcb at lists.freedesktop.org>
+ <http://lists.freedesktop.org/mailman/listinfo/xcb>
+
+You can obtain the latest development versions of XCB using GIT.
+For anonymous checkouts, use:
+
+ git clone git://anongit.freedesktop.org/git/xcb/libxcb
+
+For developers, use:
+
+ git clone git+ssh://git.freedesktop.org/git/xcb/libxcb
--- /dev/null
+dnl Detection and configuration of the visibility feature of gcc
+dnl Vincent Torri 2006-02-11
+dnl
+dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Check the visibility feature of gcc
+dnl
+AC_DEFUN([XCB_CHECK_VISIBILITY],
+[
+AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
+
+save_CFLAGS=${CFLAGS}
+CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#pragma GCC visibility push(hidden)
+extern void f(int);
+#pragma GCC visibility pop
+ ]],
+ [[]]
+ )],
+ [AC_DEFINE(
+ GCC_HAS_VISIBILITY,
+ [],
+ [Defined if GCC supports the visibility feature])
+ m4_if([$1], [], [:], [$1])
+ AC_MSG_RESULT(yes)],
+ [m4_if([$2], [], [:], [$2])
+ AC_MSG_RESULT(no)])
+
+CFLAGS=${save_CFLAGS}
+])
+
+dnl Configure script for doxygen
+dnl Vincent Torri 2006-05-11
+dnl
+dnl XCB_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN.
+dnl
+AC_DEFUN([XCB_CHECK_DOXYGEN],
+[
+DOXYGEN="doxygen"
+
+dnl
+dnl Disable the build of the documentation
+dnl
+AC_ARG_ENABLE(
+ [build_docs],
+ AC_HELP_STRING(
+ [--disable-build-docs],
+ [Disable the build of the documentation]),
+ [if test x"$enableval" != x"yes" ; then
+ enable_build_docs="no"
+ else
+ enable_build_docs="yes"
+ fi],
+ [enable_build_docs="yes"])
+
+if test "$enable_build_docs" = "no" ; then
+ BUILD_DOCS=no
+else
+dnl
+dnl Get the prefix where doxygen is installed.
+dnl
+AC_ARG_WITH(
+ [doxygen],
+ AC_HELP_STRING(
+ [--with-doxygen=FILE],
+ [doxygen program to use (eg /usr/bin/doxygen)]),
+ dnl
+ dnl Check the given doxygen program.
+ dnl
+ [DOXYGEN=${withval}
+ AC_CHECK_PROG(
+ [BUILD_DOCS],
+ [${DOXYGEN}],
+ [yes],
+ [no])
+ if test $BUILD_DOCS = no; then
+ echo "WARNING:"
+ echo "The doxygen program you specified:"
+ echo "$DOXYGEN"
+ echo "was not found. Please check the path and make sure "
+ echo "the program exists and is executable."
+ AC_MSG_WARN(
+ [Warning: no doxygen detected. Documentation will not be built])
+ fi],
+ [AC_CHECK_PROG(
+ [BUILD_DOCS],
+ [${DOXYGEN}],
+ [yes],
+ [no])
+ if test ${BUILD_DOCS} = no; then
+ echo "WARNING:"
+ echo "The doxygen program was not found in your execute"
+ echo "You may have doxygen installed somewhere not covered by your path."
+ echo ""
+ echo "If this is the case make sure you have the packages installed, AND"
+ echo "that the doxygen program is in your execute path (see your"
+ echo "shell manual page on setting the \$PATH environment variable), OR"
+ echo "alternatively, specify the program to use with --with-doxygen."
+ AC_MSG_WARN(
+ [Warning: no doxygen detected. Documentation will not be built])
+ fi])
+ AC_PATH_PROG(DOT, dot, no)
+ if test "$DOT" = "no"; then
+ AC_MSG_WARN([Warning: no dot detected. Documentation will not be built])
+ BUILD_DOCS="no"
+ fi
+fi
+AC_MSG_CHECKING([whether documentation is built])
+AC_MSG_RESULT([${BUILD_DOCS}])
+
+dnl
+dnl Substitution
+dnl
+AC_SUBST([DOXYGEN])
+
+AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
+
+])
+
+dnl Detection and configuration of the visibility feature of gcc
+dnl Vincent Torri 2006-02-11
+dnl
+dnl XCB_EXTENSION(name, default)
+dnl set the X extension
+dnl
+AC_DEFUN([XCB_EXTENSION],
+[
+pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
+pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
+
+AC_ARG_ENABLE(DOWN,
+ [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
+ [BUILD_[]UP=$enableval],
+ [BUILD_[]UP=$2])
+
+AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
+])
+
+dnl End of acinclude.m4
--- /dev/null
+#! /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 "$@"
--- /dev/null
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.57)
+AC_INIT([libxcb],
+ 1.7,
+ [xcb@lists.freedesktop.org])
+AC_CONFIG_SRCDIR([xcb.pc.in])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+
+AM_PATH_PYTHON([2.5])
+
+PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
+AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes)
+
+AC_CONFIG_HEADERS([src/config.h])
+
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+AC_PATH_PROG(XSLTPROC, xsltproc, no)
+if test "$XSLTPROC" = "no"; then
+ AC_MSG_ERROR([XCB requires xsltproc.])
+fi
+
+HTML_CHECK_RESULT=false
+if test x"$HAVE_CHECK" = xyes; then
+ if test x"$XSLTPROC" != xno; then
+ HTML_CHECK_RESULT=true
+ fi
+fi
+AC_SUBST(HTML_CHECK_RESULT)
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.6)
+NEEDED="pthread-stubs xau >= 0.99.2"
+PKG_CHECK_MODULES(NEEDED, $NEEDED)
+
+have_xdmcp="no"
+PKG_CHECK_MODULES(XDMCP, xdmcp,
+ AC_CHECK_LIB(Xdmcp, XdmcpWrap,
+ [
+ AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols])
+ NEEDED="$NEEDED xdmcp"
+ have_xdmcp="yes"
+ ],
+ [
+ XDMCP_CFLAGS=
+ XDMCP_LIBS=
+ ], [$XDMCP_LIBS]),
+ [AC_MSG_RESULT(no)])
+
+AC_SUBST(NEEDED)
+
+# Find the xcb-proto protocol descriptions
+AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
+XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
+AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
+AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
+
+# Find the xcb-proto version
+XCBPROTO_VERSION=`$PKG_CONFIG --modversion xcb-proto`
+AC_SUBST(XCBPROTO_VERSION)
+
+# Find the xcbgen Python package
+AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
+XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
+AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
+AC_SUBST(XCBPROTO_XCBPYTHONDIR)
+
+AC_HEADER_STDC
+AC_SEARCH_LIBS(getaddrinfo, socket)
+AC_SEARCH_LIBS(connect, socket)
+
+case $host_os in
+linux*)
+ AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets])
+ ;;
+esac
+
+dnl define buffer queue size
+AC_ARG_WITH([queue-size],
+ AC_HELP_STRING([--with-queue-size=SIZE],
+ [Set the XCB buffer queue size (default is 16384)]),
+ [xcb_queue_buffer_size="$withval"],
+ [xcb_queue_buffer_size=16384])
+AC_DEFINE_UNQUOTED(XCB_QUEUE_BUFFER_SIZE, [$xcb_queue_buffer_size],
+ [XCB buffer queue size])
+
+dnl check for the sockaddr_un.sun_len member
+AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
+ [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])],
+ [],
+ [ #include <sys/types.h>
+ #include <sys/un.h>
+ ])
+
+xcbincludedir='${includedir}/xcb'
+AC_SUBST(xcbincludedir)
+
+if test "x$GCC" = xyes ; then
+ CWARNFLAGS="-Wall -pedantic -Wpointer-arith \
+ -Wstrict-prototypes -Wmissing-declarations -Wnested-externs"
+else
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ if test "x$SUNCC" = "xyes"; then
+ CWARNFLAGS="-v"
+ fi
+fi
+AC_SUBST(CWARNFLAGS)
+
+XCB_CHECK_VISIBILITY()
+
+# htmldir is not defined prior to autoconf 2.59c, so on earlier versions
+# set an equivalent value.
+AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
+ ['${datadir}/doc/${PACKAGE_TARNAME}'],
+ ['${datadir}/doc/${PACKAGE}'])
+])])
+
+XCB_CHECK_DOXYGEN()
+
+case $host_os in
+ # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
+ darwin*) ;;
+ *)
+ AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
+ ;;
+esac
+
+XCB_EXTENSION(Composite, "yes")
+XCB_EXTENSION(Damage, "yes")
+XCB_EXTENSION(DPMS, "yes")
+XCB_EXTENSION(DRI2, "yes")
+XCB_EXTENSION(GLX, "yes")
+XCB_EXTENSION(RandR, "yes")
+XCB_EXTENSION(Record, "yes")
+XCB_EXTENSION(Render, "yes")
+XCB_EXTENSION(Resource, "yes")
+XCB_EXTENSION(Screensaver, "yes")
+XCB_EXTENSION(Shape, "yes")
+XCB_EXTENSION(Shm, "yes")
+XCB_EXTENSION(Sync, "yes")
+XCB_EXTENSION(Xevie, "yes")
+XCB_EXTENSION(XFixes, "yes")
+XCB_EXTENSION(XFree86-DRI, "yes")
+XCB_EXTENSION(Xinerama, "yes")
+XCB_EXTENSION(XInput, "no")
+XCB_EXTENSION(Xprint, "yes")
+XCB_EXTENSION(SELinux, "no")
+XCB_EXTENSION(XTest, "yes")
+XCB_EXTENSION(Xv, "yes")
+XCB_EXTENSION(XvMC, "yes")
+
+AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
+if test "x$LAUNCHD" = xauto; then
+ unset LAUNCHD
+ AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
+fi
+
+if test "x$LAUNCHD" = xyes ; then
+ AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
+fi
+
+AC_CONFIG_FILES([
+Makefile
+doc/Makefile
+src/Makefile
+tests/Makefile
+])
+
+AC_CONFIG_FILES([
+xcb.pc
+xcb-composite.pc
+xcb-damage.pc
+xcb-dpms.pc
+xcb-dri2.pc
+xcb-glx.pc
+xcb-randr.pc
+xcb-record.pc
+xcb-render.pc
+xcb-res.pc
+xcb-screensaver.pc
+xcb-shape.pc
+xcb-shm.pc
+xcb-sync.pc
+xcb-xevie.pc
+xcb-xf86dri.pc
+xcb-xfixes.pc
+xcb-xinerama.pc
+xcb-xinput.pc
+xcb-xprint.pc
+xcb-xselinux.pc
+xcb-xtest.pc
+xcb-xv.pc
+xcb-xvmc.pc
+])
+
+AC_CONFIG_FILES([
+doc/xcb.doxygen
+])
+
+AC_OUTPUT
+
+dnl Configuration output
+
+echo ""
+echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
+echo ""
+echo " Configuration"
+echo " XDM support.........: ${have_xdmcp}"
+echo " Build unit tests....: ${HAVE_CHECK}"
+echo " XCB buffer size.....: ${xcb_queue_buffer_size}"
+echo ""
+echo " X11 extensions"
+echo " Composite...........: ${BUILD_COMPOSITE}"
+echo " Damage..............: ${BUILD_DAMAGE}"
+echo " Dpms................: ${BUILD_DPMS}"
+echo " Dri2................: ${BUILD_DRI2}"
+echo " Glx.................: ${BUILD_GLX}"
+echo " Randr...............: ${BUILD_RANDR}"
+echo " Record..............: ${BUILD_RECORD}"
+echo " Render..............: ${BUILD_RENDER}"
+echo " Resource............: ${BUILD_RESOURCE}"
+echo " Screensaver.........: ${BUILD_SCREENSAVER}"
+echo " selinux.............: ${BUILD_SELINUX}"
+echo " Shape...............: ${BUILD_SHAPE}"
+echo " Shm.................: ${BUILD_SHM}"
+echo " Sync................: ${BUILD_SYNC}"
+echo " Xevie...............: ${BUILD_XEVIE}"
+echo " Xfixes..............: ${BUILD_XFIXES}"
+echo " Xfree86-dri.........: ${BUILD_XFREE86_DRI}"
+echo " xinerama............: ${BUILD_XINERAMA}"
+echo " xinput..............: ${BUILD_XINPUT}"
+echo " xprint..............: ${BUILD_XPRINT}"
+echo " xtest...............: ${BUILD_XTEST}"
+echo " xv..................: ${BUILD_XV}"
+echo " xvmc................: ${BUILD_XVMC}"
+echo ""
+echo " Used CFLAGS:"
+echo " CPPFLAGS............: ${CPPFLAGS}"
+echo " CFLAGS..............: ${CFLAGS}"
+echo " Warning CFLAGS......: ${CWARNFLAGS}"
+echo ""
+echo " Installation:"
+echo " Prefix..............: ${prefix}"
+echo ""
--- /dev/null
+libxcb (1.7-1slp2) unstable; urgency=low
+
+ * [X11R7.6] upgrade package
+ * Git: 165.213.180.234:slp/pkgs/xorg/xcb/libxcb
+ * Tag: libxcb_1.7-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Tue, 04 Jan 2011 14:58:30 +0900
+
+libxcb (1.6-1) unstable; urgency=low
+
+ * New upstream release.
+ * Bump Build-Depends on xcb-proto (from 1.5 to 1.6) accordingly.
+ * debian/libxcb1.symbols: Add xcb_discard_reply@Base, new in this
+ release.
+
+ -- Cyril Brulebois <kibi@debian.org> Tue, 13 Apr 2010 17:20:59 +0200
+
+libxcb (1.5-3) unstable; urgency=low
+
+ * Add udeb needed for the graphical installer: libxcb1-udeb.
+ * Version the B-D on libxau-dev to ensure libxcb1-udeb gets a dependency
+ on libxau6-udeb.
+ * Version the B-D on libxdmcp-dev to ensure libxcb1-udeb gets a
+ dependency on libxdmcp6-udeb.
+ * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed).
+ * Remove Jamey Sharp from Uploaders (Closes: #568277), with many thanks
+ for your work!
+ * Add myself to Uploaders.
+
+ -- Cyril Brulebois <kibi@debian.org> Wed, 10 Mar 2010 21:45:48 +0100
+
+libxcb (1.5-2) unstable; urgency=low
+
+ * Add libxcb-dri2-0
+
+ -- Julien Danjou <acid@debian.org> Thu, 03 Dec 2009 11:26:51 +0100
+
+libxcb (1.5-1) unstable; urgency=low
+
+ * New upstream release
+ * Bump standard version
+
+ -- Julien Danjou <acid@debian.org> Thu, 03 Dec 2009 10:17:51 +0100
+
+libxcb (1.4-6slp2) unstable; urgency=low
+
+ * Reupload package to rebuild on new version of x11proto-xext
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/xcb/libxcb
+ * Tag: libxcb_1.4-6slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Sat, 27 Nov 2010 18:31:53 +0900
+
+libxcb (1.4-5slp2) unstable; urgency=low
+
+ * Apply XI2 sendevent patch and enable _F_ENABLE_XI2_SENDEVENT_ macro
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/xcb/libxcb
+ * Tag: libxcb_1.4-5slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Sat, 27 Nov 2010 16:59:36 +0900
+
+libxcb (1.4-4slp3) unstable; urgency=low
+
+ * add --as-needed
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/xcb/libxcb
+ * Tag: libxcb_1.4-4slp3
+
+ -- SooChan Lim <sc1.lim@samsung.com> Thu, 18 Nov 2010 14:31:01 +0900
+
+libxcb (1.4-4slp2) unstable; urgency=low
+
+ * Update maintainer section
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+ * Tag: libxcb_1.4-4slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Tue, 20 Apr 2010 16:54:47 +0900
+
+libxcb (1.4-3slp2) unstable; urgency=low
+
+ * modify the package name
+
+ -- SooChan Lim <sc1.lim@samsung.com> Thu, 25 Mar 2010 17:42:42 +0900
+
+libxcb (1.4-2) unstable; urgency=low
+
+ * Import debian package
+ * Modify debian/rules and some *.install file to install files properly
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Mon, 07 Dec 2009 17:20:04 +0900
+
+libxcb (1.4-1) unstable; urgency=low
+
+ [ Julien Danjou ]
+ * New upstream release
+ * Bump build-dep on xcb-proto to 1.5 (Closes: #536188)
+ * Bump standard version
+
+ [ Julien Cristau ]
+ * libxcb-randr0-dev needs to depend on libxcb-render0-dev (closes: #532688).
+ Thanks, Remi Denis-Courmont!
+ * Fix generation of dbg packages (closes: #537584).
+
+ -- Julien Danjou <acid@debian.org> Mon, 27 Jul 2009 15:49:47 +0200
+
+libxcb (1.3-2) unstable; urgency=low
+
+ * Revert the libxcb-randr SONAME bump, which was accidental.
+ * Add symbols files for all libraries, to help us catch ABI changes.
+ * Use debhelper 7 and get rid of cdbs, reducing build time by a lot.
+ * Tighten the glob in *.install files to catch SONAME changes.
+
+ -- Julien Cristau <jcristau@debian.org> Fri, 29 May 2009 14:58:44 +0200
+
+libxcb (1.3-1) unstable; urgency=low
+
+ [ Julien Cristau ]
+ * Use Breaks instead of Conflicts, as the buildds should no longer choke on
+ that (closes: #526111). Thanks, Steve Langasek!
+ * Fix Vcs-{Git,Browser}, thanks again to Steve Langasek (closes: #526107).
+
+ [ Julien Danjou ]
+ * New upstream release.
+ + disables Nagle on tcp sockets, closes: #487635
+ + fixes local socket connections on hurd, closes: #522708
+ + fixes XID generation bug, closes: #527591
+ * Bump standard version
+ * Move -dbg packages to section debug
+ * Switch libxcb-randr0 to libxcb-randr1
+
+ -- Julien Danjou <acid@debian.org> Fri, 29 May 2009 11:38:20 +0200
+
+libxcb (1.2-1) unstable; urgency=low
+
+ * New upstream release.
+ * Conflicts libxcb-xlib0
+
+ -- Julien Danjou <acid@debian.org> Tue, 17 Feb 2009 14:09:31 +0100
+
+libxcb (1.1.93-1) experimental; urgency=low
+
+ * New upstream release.
+ * Add myself as uploader.
+ * Bump standards version.
+ * Add missing ${misc:Depends} in various deps.
+ * Relax some build-deps to ease backporting.
+
+ -- Julien Danjou <acid@debian.org> Sat, 07 Feb 2009 16:20:33 +0100
+
+libxcb (1.1.92-0.1) experimental; urgency=low
+
+ * New upstream release.
+ - implements a socket handoff mechanism for use by Xlib
+ * libxcb-xlib is no more.
+ * Add build-dep on python-xcbgen.
+ * Drop obsolete versioned binutils build-dep.
+ * Bump libxcb1 shlibs.
+ * Run autoreconf at build time; build-dep on automake and libtool.
+
+ -- Julien Cristau <jcristau@debian.org> Mon, 01 Dec 2008 21:29:57 +0100
+
+libxcb (1.1-1.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Turn sloppy locking on by default (closes: #481745). It can be disabled
+ by setting the LIBXCB_DISABLE_SLOPPY_LOCK environment variable (to any
+ value).
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 28 May 2008 15:16:42 +0200
+
+libxcb (1.1-1) unstable; urgency=low
+
+ * New upstream release.
+ * Depend on xcb-proto between 1.1 and 2.0.
+ * Lintian fix: ${binary:Version}, not ${Source-Version}.
+ * Update Vcs-* and Homepage: headers for dpkg 1.14.6.
+
+ -- Jamey Sharp <sharpone@debian.org> Sat, 24 Nov 2007 14:59:42 -0800
+
+libxcb (1.0-3) unstable; urgency=low
+
+ * libxcb1-dev: Add Conflicts and Replaces for old libxcb0-dev packages
+ from experimental. (Closes: #407376)
+
+ -- Josh Triplett <josh@freedesktop.org> Tue, 22 May 2007 12:01:50 -0700
+
+libxcb (1.0-2) unstable; urgency=low
+
+ * Incorporate NMU by Julien Cristau; thanks, Julien!
+ * Add XS-Vcs-Browser field to debian/control.
+ * Cherry-pick post-1.0 changes from master:
+ * " Fix unit tests for FreeBSD"
+ * Upload to unstable.
+
+ -- Josh Triplett <josh@freedesktop.org> Mon, 21 May 2007 12:48:40 -0700
+
+libxcb (1.0-1.1) experimental; urgency=low
+
+ * Non-maintainer upload.
+ * libxcb1-dev needs a dependency on libpthread-stubs0-dev and versioned
+ dependencies on libxau-dev and libxdmcp-dev, because they are needed by
+ anything using xcb.pc (closes: #408409).
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org> Wed, 31 Jan 2007 03:42:13 +0100
+
+libxcb (1.0-1) experimental; urgency=low
+
+ * New upstream version.
+ * The "Thanksgiving" release: We feel thankful to have it released.
+ * Bump versioned Build-Depends on xcb-proto to 1.0, to match configure.ac.
+ * Add version to Build-Depends on check, requiring 0.9.4-2 or newer, when
+ check first started shipping the pkg-config file.
+ * Add Build-Depends on libpthread-stubs0-dev. Use a versioned
+ Build-Depends, to help buildds find it in experimental.
+ * Add version to Build-Depends on xsltproc, requiring 1.1.19-1 or newer, to
+ get the fix for bug 398327.
+ * Add XS-Vcs-Git field.
+ * Cherry-pick post-1.0 changes from master:
+ * "NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available."
+ * "Use substitition variables in xcb-xinerama.pc.in, not instances of their
+ values"
+ * Add new library, -dev, and -dbg packages for libxcb-xinerama.
+ * Install pkg-config files to /usr/lib/pkgconfig, not
+ /usr/share/pkgconfig.
+
+ -- Josh Triplett <josh@freedesktop.org> Sun, 10 Dec 2006 16:27:28 -0800
+
+libxcb (0.9.92-1) experimental; urgency=low
+
+ * New upstream version.
+
+ [ Josh Triplett ]
+ * No longer installs files to /usr/include/X11, so remove Pre-Depends on
+ x11-common.
+ * Update to Standards-Version 3.7.2 (no changes required).
+ * Point specifically to http://xcb.freedesktop.org/dist in copyright file,
+ rather than http://xcb.freedesktop.org .
+ * Add debian/watch file.
+ * Install pkgconfig files to /usr/share/pkgconfig.
+ * Version Build-Depends on xcb-proto as (>= 0.9.92)
+ * Change libxcb0{,-dev,-dbg} to libxcb1{,-dev,-dbg} to match soname bump, and
+ update Depends of other library -dev packages.
+ * Add debian/control stanzas and debhelper install files for new library
+ libxcb-xlib0.
+ * Change libxcb${ext}0{,-dev,-dbg} to libxcb-${ext}0{,-dev,-dbg}, to match
+ the sonames of the libraries.
+ * cdbs >= 0.4.40 now builds -dbg packages for each library package, without
+ requiring DEB_DBG_PACKAGE_libxcb* for each one. Remove assignments to
+ these variables in debian/rules, and version cdbs Build-Depends accordingly.
+ * Change -dbg package priorities from optional to extra.
+
+ -- Jamey Sharp <sharpone@debian.org> Sun, 08 Oct 2006 01:19:28 -0700
+
+libxcb (0.9-3) experimental; urgency=low
+
+ * Stop running autoreconf in debian/rules, and remove Build-Depends for
+ autoconf, automake, and libtool.
+ * Update -dbg package handling to work with debhelper compat level 5.
+ Increase minimum version on debhelper Build-Depends to 5.0.0.
+ * Stop installing the libtool .la files.
+ * Add Build-Depends on libxdmcp-dev.
+ * Debian X11R7 transition:
+ * Change Depends and Build-Depends on x-dev to x11proto-core-dev.
+ * Install headers to /usr/include/X11, not /usr/X11R6/include/X11.
+ * Pre-Depends: x11-common (>= 1:1.09).
+ * Create library, -dev, and -dbg packages for each new extension library.
+ * Drop library version from source package name.
+ * Add a Section field for the source package in debian/control.
+ * Set DEB_MAKE_CHECK_TARGET=check in debian/rules.
+ * Stop setting DEB_CONFIGURE_EXTRA_FLAGS = --with-opt in debian/rules;
+ cdbs does the right thing on its own, and correctly handles
+ DEB_BUILD_OPTS.
+ * Work around the unsetting of CFLAGS in src/Makefile.am, by passing CFLAGS
+ to make via DEB_MAKE_INVOKE in debian/rules.
+ * Remove Bugs field in control, so bugs go to the Debian BTS.
+ * Set distribution to experimental.
+
+ -- Josh Triplett <josh@freedesktop.org> Sat, 29 Apr 2006 15:57:15 -0700
+
+libxcb0 (0.9-2) unstable; urgency=low
+
+ * Split into libxcb0 and libxcb0-dev.
+ * Change control file for new packages.
+ * Add install and dirs files for new packages.
+ * Update Build-Depends for renaming of fd.o-xau, fd.o-xproto, and
+ fd.o-xcb-proto.
+ * Remove fd.o prefix from package name.
+ * Change Maintainer to xcb@lists.freedesktop.org, move myself to
+ Uploaders, and add Jamey Sharp to Uploaders. Update copyright.debian
+ accordingly.
+ * Add Bugs field pointing to xcb@lists.freedesktop.org.
+ * Update homepage URL in description and copyright.debian to
+ http://xcb.freedesktop.org, and put it in a Homepage: field in the
+ description.
+ * Add libxcb0-dbg package.
+
+ -- Josh Triplett <josh@freedesktop.org> Tue, 17 May 2005 12:53:53 -0700
+
+fd.o-xcb (0.9-1) unstable; urgency=low
+
+ * New version using XSLT; works with XML descriptions in xcb-proto 0.9.
+ * Updated Debian packaging.
+
+ -- Josh Triplett <josh@freedesktop.org> Fri, 29 Oct 2004 15:11:09 -0700
+
+fd.o-xcb (0.8-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Jamey Sharp <sharpone@debian.org> Thu, 18 Mar 2004 00:09:03 -0800
+
--- /dev/null
+Source: libxcb
+Priority: optional
+Section: libdevel
+Maintainer: Sung-Jin Park <sj76.park@samsung.com>, SangJin Lee <lsj119@samsung.com>, XCB Developers <xcb@lists.freedesktop.org>
+Uploaders: Sung-Jin Park <sj76.park@samsung.com>, SooChan Lim <sc1.lim@samsung.com>, JJosh Triplett <josh@freedesktop.org>, Julien Danjou <acid@debian.org>, Cyril Brulebois <kibi@debian.org>
+Build-Depends: libxau-dev (>= 1:1.0.5-2), libxdmcp-dev (>= 1:1.0.3-2), xcb-proto (>= 1.6), xcb-proto (<< 2.0), libpthread-stubs0-dev (>= 0.1), debhelper (>= 5), pkg-config, xsltproc (>= 1.1.19), check (>= 0.9.4-2), python-xcbgen, libtool, automake, python, dctrl-tools
+Standards-Version: 3.8.4
+Homepage: http://xcb.freedesktop.org
+Vcs-Git: git://git.debian.org/git/collab-maint/libxcb
+Vcs-Browser: http://git.debian.org/?p=collab-maint/libxcb.git
+
+Package: libxcb1
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Breaks: libxcb-xlib0
+Description: X C Binding
+ This package contains the library files needed to run software using libxcb,
+ the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+#Package: libxcb1-udeb
+#XC-Package-Type: udeb
+#Section: debian-installer
+#Architecture: any
+#Depends: ${misc:Depends}, ${shlibs:Depends}
+#Description: X C Binding
+# This is a udeb, or a microdeb, for the debian-installer.
+
+Package: libxcb1-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb1 (= ${binary:Version}), libpthread-stubs0-dev, libxau-dev (>= 1:1.0.0-1), libxdmcp-dev (>= 1:1.0.0-1)
+Conflicts: libxcb0-dev
+Replaces: libxcb0-dev
+Description: X C Binding, development files
+ This package contains the header and library files needed to build software
+ using libxcb, the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb1-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb1 (= ${binary:Version})
+Description: X C Binding, debugging symbols
+ This package contains the debugging symbols associated with libxcb, the X C
+ Binding. gdb will automatically use these symbols when debugging libxcb.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-composite0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, composite extension
+ This package contains the library files needed to run software using
+ libxcb-composite, the composite extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-composite0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-composite0 (= ${binary:Version}), libxcb1-dev, libxcb-xfixes0-dev
+Description: X C Binding, composite extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-composite, the composite extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-composite0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-composite0 (= ${binary:Version})
+Description: X C Binding, composite extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-composite, the composite extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-composite.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-damage0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, damage extension
+ This package contains the library files needed to run software using
+ libxcb-damage, the damage extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-damage0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-damage0 (= ${binary:Version}), libxcb1-dev, libxcb-xfixes0-dev
+Description: X C Binding, damage extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-damage, the damage extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-damage0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-damage0 (= ${binary:Version})
+Description: X C Binding, damage extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-damage, the damage extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-damage.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dpms0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, dpms extension
+ This package contains the library files needed to run software using
+ libxcb-dpms, the dpms extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dpms0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-dpms0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, dpms extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-dpms, the dpms extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dpms0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-dpms0 (= ${binary:Version})
+Description: X C Binding, dpms extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-dpms, the dpms extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-dpms.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-glx0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, glx extension
+ This package contains the library files needed to run software using
+ libxcb-glx, the glx extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-glx0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-glx0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, glx extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-glx, the glx extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-glx0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-glx0 (= ${binary:Version})
+Description: X C Binding, glx extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-glx, the glx extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-glx.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-randr0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, randr extension
+ This package contains the library files needed to run software using
+ libxcb-randr, the randr extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-randr0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-randr0 (= ${binary:Version}), libxcb1-dev, libxcb-render0-dev
+Description: X C Binding, randr extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-randr, the randr extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-randr0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-randr0 (= ${binary:Version})
+Description: X C Binding, randr extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-randr, the randr extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-randr.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-record0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, record extension
+ This package contains the library files needed to run software using
+ libxcb-record, the record extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-record0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-record0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, record extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-record, the record extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-record0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-record0 (= ${binary:Version})
+Description: X C Binding, record extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-record, the record extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-record.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-render0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, render extension
+ This package contains the library files needed to run software using
+ libxcb-render, the render extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-render0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-render0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, render extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-render, the render extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-render0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-render0 (= ${binary:Version})
+Description: X C Binding, render extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-render, the render extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-render.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-res0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, res extension
+ This package contains the library files needed to run software using
+ libxcb-res, the res extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-res0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-res0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, res extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-res, the res extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-res0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-res0 (= ${binary:Version})
+Description: X C Binding, res extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-res, the res extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-res.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-screensaver0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, screensaver extension
+ This package contains the library files needed to run software using
+ libxcb-screensaver, the screensaver extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-screensaver0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-screensaver0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, screensaver extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-screensaver, the screensaver extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-screensaver0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-screensaver0 (= ${binary:Version})
+Description: X C Binding, screensaver extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-screensaver, the screensaver extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-screensaver.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shape0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, shape extension
+ This package contains the library files needed to run software using
+ libxcb-shape, the shape extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shape0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-shape0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, shape extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-shape, the shape extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shape0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-shape0 (= ${binary:Version})
+Description: X C Binding, shape extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-shape, the shape extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-shape.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shm0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, shm extension
+ This package contains the library files needed to run software using
+ libxcb-shm, the shm extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shm0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-shm0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, shm extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-shm, the shm extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-shm0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-shm0 (= ${binary:Version})
+Description: X C Binding, shm extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-shm, the shm extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-shm.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-sync0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, sync extension
+ This package contains the library files needed to run software using
+ libxcb-sync, the sync extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-sync0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-sync0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, sync extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-sync, the sync extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-sync0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-sync0 (= ${binary:Version})
+Description: X C Binding, sync extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-sync, the sync extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-sync.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xevie0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xevie extension
+ This package contains the library files needed to run software using
+ libxcb-xevie, the xevie extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xevie0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xevie0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, xevie extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xevie, the xevie extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xevie0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xevie0 (= ${binary:Version})
+Description: X C Binding, xevie extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xevie, the xevie extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xevie.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xf86dri0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xf86dri extension
+ This package contains the library files needed to run software using
+ libxcb-xf86dri, the xf86dri extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xf86dri0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xf86dri0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, xf86dri extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xf86dri, the xf86dri extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xf86dri0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xf86dri0 (= ${binary:Version})
+Description: X C Binding, xf86dri extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xf86dri, the xf86dri extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xf86dri.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xfixes0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xfixes extension
+ This package contains the library files needed to run software using
+ libxcb-xfixes, the xfixes extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xfixes0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xfixes0 (= ${binary:Version}), libxcb1-dev, libxcb-render0-dev, libxcb-shape0-dev
+Description: X C Binding, xfixes extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xfixes, the xfixes extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xfixes0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xfixes0 (= ${binary:Version})
+Description: X C Binding, xfixes extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xfixes, the xfixes extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xfixes.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xinerama0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xinerama extension
+ This package contains the library files needed to run software using
+ libxcb-xinerama, the xinerama extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xinerama0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xinerama0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, xinerama extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xinerama, the xinerama extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xinerama0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xinerama0 (= ${binary:Version})
+Description: X C Binding, xinerama extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xinerama, the xinerama extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xinerama.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xprint0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xprint extension
+ This package contains the library files needed to run software using
+ libxcb-xprint, the xprint extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xprint0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xprint0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, xprint extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xprint, the xprint extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xprint0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xprint0 (= ${binary:Version})
+Description: X C Binding, xprint extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xprint, the xprint extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xprint.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xtest0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xtest extension
+ This package contains the library files needed to run software using
+ libxcb-xtest, the xtest extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xtest0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xtest0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, xtest extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xtest, the xtest extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xtest0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xtest0 (= ${binary:Version})
+Description: X C Binding, xtest extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xtest, the xtest extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xtest.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xv0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xv extension
+ This package contains the library files needed to run software using
+ libxcb-xv, the xv extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xv0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xv0 (= ${binary:Version}), libxcb1-dev, libxcb-shm0-dev
+Description: X C Binding, xv extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xv, the xv extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xv0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xv0 (= ${binary:Version})
+Description: X C Binding, xv extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xv, the xv extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xv.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xvmc0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, xvmc extension
+ This package contains the library files needed to run software using
+ libxcb-xvmc, the xvmc extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xvmc0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xvmc0 (= ${binary:Version}), libxcb1-dev, libxcb-xv0-dev
+Description: X C Binding, xvmc extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xvmc, the xvmc extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-xvmc0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-xvmc0 (= ${binary:Version})
+Description: X C Binding, xvmc extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-xvmc, the xvmc extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-xvmc.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dri2-0
+Section: libs
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: X C Binding, dri2 extension
+ This package contains the library files needed to run software using
+ libxcb-dri2, the dri2 extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dri2-0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends}, libxcb-dri2-0 (= ${binary:Version}), libxcb1-dev
+Description: X C Binding, dri2 extension, development files
+ This package contains the header and library files needed to build software
+ using libxcb-dri2, the dri2 extension for the X C Binding.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+
+Package: libxcb-dri2-0-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Depends: ${misc:Depends}, libxcb-dri2-0 (= ${binary:Version})
+Description: X C Binding, dri2 extension, debugging symbols
+ This package contains the debugging symbols associated with
+ libxcb-dri2, the dri2 extension for the X C Binding. gdb will
+ automatically use these symbols when debugging libxcb-dri2.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
--- /dev/null
+This package was debianized by Jamey Sharp <sharpone@debian.org> on
+Thu, 18 Mar 2004 00:48:42 -0800, and later updated by Josh Triplett
+<josh@freedesktop.org>. The package is co-maintained by the XCB developers
+via the XCB mailing list <xcb@lists.freedesktop.org>.
+
+It was downloaded from http://xcb.freedesktop.org/dist
+
+Upstream Authors: Jamey Sharp <sharpone@debian.org>
+ Josh Triplett <josh@freedesktop.org>
+
+Copyright:
+
--- /dev/null
+usr/include/xcb/composite.h
+usr/lib/libxcb-composite.a
+usr/lib/libxcb-composite.so
+usr/lib/libxcb-composite.la
+usr/lib/pkgconfig/xcb-composite.pc
--- /dev/null
+usr/lib/libxcb-composite.so.0*
--- /dev/null
+libxcb-composite.so.0 libxcb-composite0 #MINVER#
+ xcb_composite_create_region_from_border_clip@Base 0
+ xcb_composite_create_region_from_border_clip_checked@Base 0
+ xcb_composite_get_overlay_window@Base 0
+ xcb_composite_get_overlay_window_reply@Base 0
+ xcb_composite_get_overlay_window_unchecked@Base 0
+ xcb_composite_id@Base 0
+ xcb_composite_name_window_pixmap@Base 0
+ xcb_composite_name_window_pixmap_checked@Base 0
+ xcb_composite_query_version@Base 0
+ xcb_composite_query_version_reply@Base 0
+ xcb_composite_query_version_unchecked@Base 0
+ xcb_composite_redirect_subwindows@Base 0
+ xcb_composite_redirect_subwindows_checked@Base 0
+ xcb_composite_redirect_window@Base 0
+ xcb_composite_redirect_window_checked@Base 0
+ xcb_composite_release_overlay_window@Base 0
+ xcb_composite_release_overlay_window_checked@Base 0
+ xcb_composite_unredirect_subwindows@Base 0
+ xcb_composite_unredirect_subwindows_checked@Base 0
+ xcb_composite_unredirect_window@Base 0
+ xcb_composite_unredirect_window_checked@Base 0
--- /dev/null
+usr/include/xcb/damage.h
+usr/lib/libxcb-damage.a
+usr/lib/libxcb-damage.so
+usr/lib/libxcb-damage.la
+usr/lib/pkgconfig/xcb-damage.pc
--- /dev/null
+usr/lib/libxcb-damage.so.0*
--- /dev/null
+libxcb-damage.so.0 libxcb-damage0 #MINVER#
+ xcb_damage_add@Base 1.1
+ xcb_damage_add_checked@Base 1.1
+ xcb_damage_create@Base 0
+ xcb_damage_create_checked@Base 0
+ xcb_damage_damage_end@Base 0
+ xcb_damage_damage_next@Base 0
+ xcb_damage_destroy@Base 0
+ xcb_damage_destroy_checked@Base 0
+ xcb_damage_id@Base 0
+ xcb_damage_query_version@Base 0
+ xcb_damage_query_version_reply@Base 0
+ xcb_damage_query_version_unchecked@Base 0
+ xcb_damage_subtract@Base 0
+ xcb_damage_subtract_checked@Base 0
--- /dev/null
+usr/include/xcb/dpms.h
+usr/lib/libxcb-dpms.a
+usr/lib/libxcb-dpms.so
+usr/lib/libxcb-dpms.la
+usr/lib/pkgconfig/xcb-dpms.pc
--- /dev/null
+usr/lib/libxcb-dpms.so.0*
--- /dev/null
+libxcb-dpms.so.0 libxcb-dpms0 #MINVER#
+ xcb_dpms_capable@Base 0
+ xcb_dpms_capable_reply@Base 0
+ xcb_dpms_capable_unchecked@Base 0
+ xcb_dpms_disable@Base 0
+ xcb_dpms_disable_checked@Base 0
+ xcb_dpms_enable@Base 0
+ xcb_dpms_enable_checked@Base 0
+ xcb_dpms_force_level@Base 0
+ xcb_dpms_force_level_checked@Base 0
+ xcb_dpms_get_timeouts@Base 0
+ xcb_dpms_get_timeouts_reply@Base 0
+ xcb_dpms_get_timeouts_unchecked@Base 0
+ xcb_dpms_get_version@Base 0
+ xcb_dpms_get_version_reply@Base 0
+ xcb_dpms_get_version_unchecked@Base 0
+ xcb_dpms_id@Base 0
+ xcb_dpms_info@Base 0
+ xcb_dpms_info_reply@Base 0
+ xcb_dpms_info_unchecked@Base 0
+ xcb_dpms_set_timeouts@Base 0
+ xcb_dpms_set_timeouts_checked@Base 0
--- /dev/null
+usr/include/xcb/dri2.h
+usr/lib/libxcb-dri2.a
+usr/lib/libxcb-dri2.la
+usr/lib/libxcb-dri2.so
+usr/lib/pkgconfig/xcb-dri2.pc
--- /dev/null
+usr/lib/libxcb-dri2.so.0*
--- /dev/null
+libxcb-dri2.so.0 libxcb-dri2-0 #MINVER#
+ xcb_dri2_attach_format_end@Base 0
+ xcb_dri2_attach_format_next@Base 0
+ xcb_dri2_authenticate@Base 0
+ xcb_dri2_authenticate_reply@Base 0
+ xcb_dri2_authenticate_unchecked@Base 0
+ xcb_dri2_connect@Base 0
+ xcb_dri2_connect_device_name@Base 0
+ xcb_dri2_connect_device_name_end@Base 0
+ xcb_dri2_connect_device_name_length@Base 0
+ xcb_dri2_connect_driver_name@Base 0
+ xcb_dri2_connect_driver_name_end@Base 0
+ xcb_dri2_connect_driver_name_length@Base 0
+ xcb_dri2_connect_reply@Base 0
+ xcb_dri2_connect_unchecked@Base 0
+ xcb_dri2_copy_region@Base 0
+ xcb_dri2_copy_region_reply@Base 0
+ xcb_dri2_copy_region_unchecked@Base 0
+ xcb_dri2_create_drawable@Base 0
+ xcb_dri2_create_drawable_checked@Base 0
+ xcb_dri2_destroy_drawable@Base 0
+ xcb_dri2_destroy_drawable_checked@Base 0
+ xcb_dri2_dri2_buffer_end@Base 0
+ xcb_dri2_dri2_buffer_next@Base 0
+ xcb_dri2_get_buffers@Base 0
+ xcb_dri2_get_buffers_buffers@Base 0
+ xcb_dri2_get_buffers_buffers_iterator@Base 0
+ xcb_dri2_get_buffers_buffers_length@Base 0
+ xcb_dri2_get_buffers_reply@Base 0
+ xcb_dri2_get_buffers_unchecked@Base 0
+ xcb_dri2_get_buffers_with_format@Base 0
+ xcb_dri2_get_buffers_with_format_buffers@Base 0
+ xcb_dri2_get_buffers_with_format_buffers_iterator@Base 0
+ xcb_dri2_get_buffers_with_format_buffers_length@Base 0
+ xcb_dri2_get_buffers_with_format_reply@Base 0
+ xcb_dri2_get_buffers_with_format_unchecked@Base 0
+ xcb_dri2_id@Base 0
+ xcb_dri2_query_version@Base 0
+ xcb_dri2_query_version_reply@Base 0
+ xcb_dri2_query_version_unchecked@Base 0
--- /dev/null
+usr/include/xcb/glx.h
+usr/lib/libxcb-glx.a
+usr/lib/libxcb-glx.so
+usr/lib/libxcb-glx.la
+usr/lib/pkgconfig/xcb-glx.pc
--- /dev/null
+usr/lib/libxcb-glx.so.0*
--- /dev/null
+libxcb-glx.so.0 libxcb-glx0 #MINVER#
+ xcb_glx_are_textures_resident@Base 0
+ xcb_glx_are_textures_resident_data@Base 0
+ xcb_glx_are_textures_resident_data_end@Base 0
+ xcb_glx_are_textures_resident_data_length@Base 0
+ xcb_glx_are_textures_resident_reply@Base 0
+ xcb_glx_are_textures_resident_unchecked@Base 0
+ xcb_glx_bool32_end@Base 0
+ xcb_glx_bool32_next@Base 0
+ xcb_glx_change_drawable_attributes@Base 0
+ xcb_glx_change_drawable_attributes_checked@Base 0
+ xcb_glx_client_info@Base 0
+ xcb_glx_client_info_checked@Base 0
+ xcb_glx_context_end@Base 0
+ xcb_glx_context_next@Base 0
+ xcb_glx_context_tag_end@Base 0
+ xcb_glx_context_tag_next@Base 0
+ xcb_glx_copy_context@Base 0
+ xcb_glx_copy_context_checked@Base 0
+ xcb_glx_create_context@Base 0
+ xcb_glx_create_context_checked@Base 0
+ xcb_glx_create_glx_pixmap@Base 0
+ xcb_glx_create_glx_pixmap_checked@Base 0
+ xcb_glx_create_new_context@Base 0
+ xcb_glx_create_new_context_checked@Base 0
+ xcb_glx_create_pbuffer@Base 0
+ xcb_glx_create_pbuffer_checked@Base 0
+ xcb_glx_create_pixmap@Base 0
+ xcb_glx_create_pixmap_checked@Base 0
+ xcb_glx_create_window@Base 0
+ xcb_glx_create_window_checked@Base 0
+ xcb_glx_delete_lists@Base 0
+ xcb_glx_delete_lists_checked@Base 0
+ xcb_glx_delete_queries_arb@Base 0
+ xcb_glx_delete_queries_arb_checked@Base 0
+ xcb_glx_delete_textures@Base 0
+ xcb_glx_delete_textures_checked@Base 0
+ xcb_glx_delete_window@Base 0
+ xcb_glx_delete_window_checked@Base 0
+ xcb_glx_destroy_context@Base 0
+ xcb_glx_destroy_context_checked@Base 0
+ xcb_glx_destroy_glx_pixmap@Base 0
+ xcb_glx_destroy_glx_pixmap_checked@Base 0
+ xcb_glx_destroy_pbuffer@Base 0
+ xcb_glx_destroy_pbuffer_checked@Base 0
+ xcb_glx_destroy_pixmap@Base 0
+ xcb_glx_destroy_pixmap_checked@Base 0
+ xcb_glx_drawable_end@Base 0
+ xcb_glx_drawable_next@Base 0
+ xcb_glx_end_list@Base 0
+ xcb_glx_end_list_checked@Base 0
+ xcb_glx_fbconfig_end@Base 0
+ xcb_glx_fbconfig_next@Base 0
+ xcb_glx_feedback_buffer@Base 0
+ xcb_glx_feedback_buffer_checked@Base 0
+ xcb_glx_finish@Base 0
+ xcb_glx_finish_reply@Base 0
+ xcb_glx_finish_unchecked@Base 0
+ xcb_glx_float32_end@Base 0
+ xcb_glx_float32_next@Base 0
+ xcb_glx_float64_end@Base 0
+ xcb_glx_float64_next@Base 0
+ xcb_glx_flush@Base 0
+ xcb_glx_flush_checked@Base 0
+ xcb_glx_gen_lists@Base 0
+ xcb_glx_gen_lists_reply@Base 0
+ xcb_glx_gen_lists_unchecked@Base 0
+ xcb_glx_gen_queries_arb@Base 0
+ xcb_glx_gen_queries_arb_data@Base 0
+ xcb_glx_gen_queries_arb_data_end@Base 0
+ xcb_glx_gen_queries_arb_data_length@Base 0
+ xcb_glx_gen_queries_arb_reply@Base 0
+ xcb_glx_gen_queries_arb_unchecked@Base 0
+ xcb_glx_gen_textures@Base 0
+ xcb_glx_gen_textures_data@Base 0
+ xcb_glx_gen_textures_data_end@Base 0
+ xcb_glx_gen_textures_data_length@Base 0
+ xcb_glx_gen_textures_reply@Base 0
+ xcb_glx_gen_textures_unchecked@Base 0
+ xcb_glx_get_booleanv@Base 0
+ xcb_glx_get_booleanv_data@Base 0
+ xcb_glx_get_booleanv_data_end@Base 0
+ xcb_glx_get_booleanv_data_length@Base 0
+ xcb_glx_get_booleanv_reply@Base 0
+ xcb_glx_get_booleanv_unchecked@Base 0
+ xcb_glx_get_clip_plane@Base 0
+ xcb_glx_get_clip_plane_data@Base 0
+ xcb_glx_get_clip_plane_data_end@Base 1.2
+ xcb_glx_get_clip_plane_data_length@Base 0
+ xcb_glx_get_clip_plane_reply@Base 0
+ xcb_glx_get_clip_plane_unchecked@Base 0
+ xcb_glx_get_color_table@Base 0
+ xcb_glx_get_color_table_data@Base 0
+ xcb_glx_get_color_table_data_end@Base 0
+ xcb_glx_get_color_table_data_length@Base 0
+ xcb_glx_get_color_table_parameterfv@Base 0
+ xcb_glx_get_color_table_parameterfv_data@Base 0
+ xcb_glx_get_color_table_parameterfv_data_end@Base 1.2
+ xcb_glx_get_color_table_parameterfv_data_length@Base 0
+ xcb_glx_get_color_table_parameterfv_reply@Base 0
+ xcb_glx_get_color_table_parameterfv_unchecked@Base 0
+ xcb_glx_get_color_table_parameteriv@Base 0
+ xcb_glx_get_color_table_parameteriv_data@Base 0
+ xcb_glx_get_color_table_parameteriv_data_end@Base 0
+ xcb_glx_get_color_table_parameteriv_data_length@Base 0
+ xcb_glx_get_color_table_parameteriv_reply@Base 0
+ xcb_glx_get_color_table_parameteriv_unchecked@Base 0
+ xcb_glx_get_color_table_reply@Base 0
+ xcb_glx_get_color_table_unchecked@Base 0
+ xcb_glx_get_compressed_tex_image_arb@Base 0
+ xcb_glx_get_compressed_tex_image_arb_data@Base 0
+ xcb_glx_get_compressed_tex_image_arb_data_end@Base 0
+ xcb_glx_get_compressed_tex_image_arb_data_length@Base 0
+ xcb_glx_get_compressed_tex_image_arb_reply@Base 0
+ xcb_glx_get_compressed_tex_image_arb_unchecked@Base 0
+ xcb_glx_get_convolution_filter@Base 0
+ xcb_glx_get_convolution_filter_data@Base 0
+ xcb_glx_get_convolution_filter_data_end@Base 0
+ xcb_glx_get_convolution_filter_data_length@Base 0
+ xcb_glx_get_convolution_filter_reply@Base 0
+ xcb_glx_get_convolution_filter_unchecked@Base 0
+ xcb_glx_get_convolution_parameterfv@Base 0
+ xcb_glx_get_convolution_parameterfv_data@Base 0
+ xcb_glx_get_convolution_parameterfv_data_end@Base 1.2
+ xcb_glx_get_convolution_parameterfv_data_length@Base 0
+ xcb_glx_get_convolution_parameterfv_reply@Base 0
+ xcb_glx_get_convolution_parameterfv_unchecked@Base 0
+ xcb_glx_get_convolution_parameteriv@Base 0
+ xcb_glx_get_convolution_parameteriv_data@Base 0
+ xcb_glx_get_convolution_parameteriv_data_end@Base 0
+ xcb_glx_get_convolution_parameteriv_data_length@Base 0
+ xcb_glx_get_convolution_parameteriv_reply@Base 0
+ xcb_glx_get_convolution_parameteriv_unchecked@Base 0
+ xcb_glx_get_doublev@Base 0
+ xcb_glx_get_doublev_data@Base 0
+ xcb_glx_get_doublev_data_end@Base 1.2
+ xcb_glx_get_doublev_data_length@Base 0
+ xcb_glx_get_doublev_reply@Base 0
+ xcb_glx_get_doublev_unchecked@Base 0
+ xcb_glx_get_drawable_attributes@Base 0
+ xcb_glx_get_drawable_attributes_attribs@Base 0
+ xcb_glx_get_drawable_attributes_attribs_end@Base 0
+ xcb_glx_get_drawable_attributes_attribs_length@Base 0
+ xcb_glx_get_drawable_attributes_reply@Base 0
+ xcb_glx_get_drawable_attributes_unchecked@Base 0
+ xcb_glx_get_error@Base 0
+ xcb_glx_get_error_reply@Base 0
+ xcb_glx_get_error_unchecked@Base 0
+ xcb_glx_get_fb_configs@Base 0
+ xcb_glx_get_fb_configs_property_list@Base 0
+ xcb_glx_get_fb_configs_property_list_end@Base 0
+ xcb_glx_get_fb_configs_property_list_length@Base 0
+ xcb_glx_get_fb_configs_reply@Base 0
+ xcb_glx_get_fb_configs_unchecked@Base 0
+ xcb_glx_get_floatv@Base 0
+ xcb_glx_get_floatv_data@Base 0
+ xcb_glx_get_floatv_data_end@Base 1.2
+ xcb_glx_get_floatv_data_length@Base 0
+ xcb_glx_get_floatv_reply@Base 0
+ xcb_glx_get_floatv_unchecked@Base 0
+ xcb_glx_get_histogram@Base 0
+ xcb_glx_get_histogram_data@Base 0
+ xcb_glx_get_histogram_data_end@Base 0
+ xcb_glx_get_histogram_data_length@Base 0
+ xcb_glx_get_histogram_parameterfv@Base 0
+ xcb_glx_get_histogram_parameterfv_data@Base 0
+ xcb_glx_get_histogram_parameterfv_data_end@Base 1.2
+ xcb_glx_get_histogram_parameterfv_data_length@Base 0
+ xcb_glx_get_histogram_parameterfv_reply@Base 0
+ xcb_glx_get_histogram_parameterfv_unchecked@Base 0
+ xcb_glx_get_histogram_parameteriv@Base 0
+ xcb_glx_get_histogram_parameteriv_data@Base 0
+ xcb_glx_get_histogram_parameteriv_data_end@Base 0
+ xcb_glx_get_histogram_parameteriv_data_length@Base 0
+ xcb_glx_get_histogram_parameteriv_reply@Base 0
+ xcb_glx_get_histogram_parameteriv_unchecked@Base 0
+ xcb_glx_get_histogram_reply@Base 0
+ xcb_glx_get_histogram_unchecked@Base 0
+ xcb_glx_get_integerv@Base 0
+ xcb_glx_get_integerv_data@Base 0
+ xcb_glx_get_integerv_data_end@Base 0
+ xcb_glx_get_integerv_data_length@Base 0
+ xcb_glx_get_integerv_reply@Base 0
+ xcb_glx_get_integerv_unchecked@Base 0
+ xcb_glx_get_lightfv@Base 0
+ xcb_glx_get_lightfv_data@Base 0
+ xcb_glx_get_lightfv_data_end@Base 1.2
+ xcb_glx_get_lightfv_data_length@Base 0
+ xcb_glx_get_lightfv_reply@Base 0
+ xcb_glx_get_lightfv_unchecked@Base 0
+ xcb_glx_get_lightiv@Base 0
+ xcb_glx_get_lightiv_data@Base 0
+ xcb_glx_get_lightiv_data_end@Base 0
+ xcb_glx_get_lightiv_data_length@Base 0
+ xcb_glx_get_lightiv_reply@Base 0
+ xcb_glx_get_lightiv_unchecked@Base 0
+ xcb_glx_get_mapdv@Base 0
+ xcb_glx_get_mapdv_data@Base 0
+ xcb_glx_get_mapdv_data_end@Base 1.2
+ xcb_glx_get_mapdv_data_length@Base 0
+ xcb_glx_get_mapdv_reply@Base 0
+ xcb_glx_get_mapdv_unchecked@Base 0
+ xcb_glx_get_mapfv@Base 0
+ xcb_glx_get_mapfv_data@Base 0
+ xcb_glx_get_mapfv_data_end@Base 1.2
+ xcb_glx_get_mapfv_data_length@Base 0
+ xcb_glx_get_mapfv_reply@Base 0
+ xcb_glx_get_mapfv_unchecked@Base 0
+ xcb_glx_get_mapiv@Base 0
+ xcb_glx_get_mapiv_data@Base 0
+ xcb_glx_get_mapiv_data_end@Base 0
+ xcb_glx_get_mapiv_data_length@Base 0
+ xcb_glx_get_mapiv_reply@Base 0
+ xcb_glx_get_mapiv_unchecked@Base 0
+ xcb_glx_get_materialfv@Base 0
+ xcb_glx_get_materialfv_data@Base 0
+ xcb_glx_get_materialfv_data_end@Base 1.2
+ xcb_glx_get_materialfv_data_length@Base 0
+ xcb_glx_get_materialfv_reply@Base 0
+ xcb_glx_get_materialfv_unchecked@Base 0
+ xcb_glx_get_materialiv@Base 0
+ xcb_glx_get_materialiv_data@Base 0
+ xcb_glx_get_materialiv_data_end@Base 0
+ xcb_glx_get_materialiv_data_length@Base 0
+ xcb_glx_get_materialiv_reply@Base 0
+ xcb_glx_get_materialiv_unchecked@Base 0
+ xcb_glx_get_minmax@Base 0
+ xcb_glx_get_minmax_data@Base 0
+ xcb_glx_get_minmax_data_end@Base 0
+ xcb_glx_get_minmax_data_length@Base 0
+ xcb_glx_get_minmax_parameterfv@Base 0
+ xcb_glx_get_minmax_parameterfv_data@Base 0
+ xcb_glx_get_minmax_parameterfv_data_end@Base 1.2
+ xcb_glx_get_minmax_parameterfv_data_length@Base 0
+ xcb_glx_get_minmax_parameterfv_reply@Base 0
+ xcb_glx_get_minmax_parameterfv_unchecked@Base 0
+ xcb_glx_get_minmax_parameteriv@Base 0
+ xcb_glx_get_minmax_parameteriv_data@Base 0
+ xcb_glx_get_minmax_parameteriv_data_end@Base 0
+ xcb_glx_get_minmax_parameteriv_data_length@Base 0
+ xcb_glx_get_minmax_parameteriv_reply@Base 0
+ xcb_glx_get_minmax_parameteriv_unchecked@Base 0
+ xcb_glx_get_minmax_reply@Base 0
+ xcb_glx_get_minmax_unchecked@Base 0
+ xcb_glx_get_pixel_mapfv@Base 0
+ xcb_glx_get_pixel_mapfv_data@Base 0
+ xcb_glx_get_pixel_mapfv_data_end@Base 1.2
+ xcb_glx_get_pixel_mapfv_data_length@Base 0
+ xcb_glx_get_pixel_mapfv_reply@Base 0
+ xcb_glx_get_pixel_mapfv_unchecked@Base 0
+ xcb_glx_get_pixel_mapuiv@Base 0
+ xcb_glx_get_pixel_mapuiv_data@Base 0
+ xcb_glx_get_pixel_mapuiv_data_end@Base 0
+ xcb_glx_get_pixel_mapuiv_data_length@Base 0
+ xcb_glx_get_pixel_mapuiv_reply@Base 0
+ xcb_glx_get_pixel_mapuiv_unchecked@Base 0
+ xcb_glx_get_pixel_mapusv@Base 0
+ xcb_glx_get_pixel_mapusv_data@Base 0
+ xcb_glx_get_pixel_mapusv_data_end@Base 0
+ xcb_glx_get_pixel_mapusv_data_length@Base 0
+ xcb_glx_get_pixel_mapusv_reply@Base 0
+ xcb_glx_get_pixel_mapusv_unchecked@Base 0
+ xcb_glx_get_polygon_stipple@Base 0
+ xcb_glx_get_polygon_stipple_data@Base 0
+ xcb_glx_get_polygon_stipple_data_end@Base 0
+ xcb_glx_get_polygon_stipple_data_length@Base 0
+ xcb_glx_get_polygon_stipple_reply@Base 0
+ xcb_glx_get_polygon_stipple_unchecked@Base 0
+ xcb_glx_get_query_objectiv_arb@Base 0
+ xcb_glx_get_query_objectiv_arb_data@Base 0
+ xcb_glx_get_query_objectiv_arb_data_end@Base 0
+ xcb_glx_get_query_objectiv_arb_data_length@Base 0
+ xcb_glx_get_query_objectiv_arb_reply@Base 0
+ xcb_glx_get_query_objectiv_arb_unchecked@Base 0
+ xcb_glx_get_query_objectuiv_arb@Base 0
+ xcb_glx_get_query_objectuiv_arb_data@Base 0
+ xcb_glx_get_query_objectuiv_arb_data_end@Base 0
+ xcb_glx_get_query_objectuiv_arb_data_length@Base 0
+ xcb_glx_get_query_objectuiv_arb_reply@Base 0
+ xcb_glx_get_query_objectuiv_arb_unchecked@Base 0
+ xcb_glx_get_queryiv_arb@Base 0
+ xcb_glx_get_queryiv_arb_data@Base 0
+ xcb_glx_get_queryiv_arb_data_end@Base 0
+ xcb_glx_get_queryiv_arb_data_length@Base 0
+ xcb_glx_get_queryiv_arb_reply@Base 0
+ xcb_glx_get_queryiv_arb_unchecked@Base 0
+ xcb_glx_get_separable_filter@Base 0
+ xcb_glx_get_separable_filter_reply@Base 0
+ xcb_glx_get_separable_filter_rows_and_cols@Base 0
+ xcb_glx_get_separable_filter_rows_and_cols_end@Base 0
+ xcb_glx_get_separable_filter_rows_and_cols_length@Base 0
+ xcb_glx_get_separable_filter_unchecked@Base 0
+ xcb_glx_get_string@Base 0
+ xcb_glx_get_string_reply@Base 0
+ xcb_glx_get_string_string@Base 0
+ xcb_glx_get_string_string_end@Base 0
+ xcb_glx_get_string_string_length@Base 0
+ xcb_glx_get_string_unchecked@Base 0
+ xcb_glx_get_tex_envfv@Base 0
+ xcb_glx_get_tex_envfv_data@Base 0
+ xcb_glx_get_tex_envfv_data_end@Base 1.2
+ xcb_glx_get_tex_envfv_data_length@Base 0
+ xcb_glx_get_tex_envfv_reply@Base 0
+ xcb_glx_get_tex_envfv_unchecked@Base 0
+ xcb_glx_get_tex_enviv@Base 0
+ xcb_glx_get_tex_enviv_data@Base 0
+ xcb_glx_get_tex_enviv_data_end@Base 0
+ xcb_glx_get_tex_enviv_data_length@Base 0
+ xcb_glx_get_tex_enviv_reply@Base 0
+ xcb_glx_get_tex_enviv_unchecked@Base 0
+ xcb_glx_get_tex_gendv@Base 0
+ xcb_glx_get_tex_gendv_data@Base 0
+ xcb_glx_get_tex_gendv_data_end@Base 1.2
+ xcb_glx_get_tex_gendv_data_length@Base 0
+ xcb_glx_get_tex_gendv_reply@Base 0
+ xcb_glx_get_tex_gendv_unchecked@Base 0
+ xcb_glx_get_tex_genfv@Base 0
+ xcb_glx_get_tex_genfv_data@Base 0
+ xcb_glx_get_tex_genfv_data_end@Base 1.2
+ xcb_glx_get_tex_genfv_data_length@Base 0
+ xcb_glx_get_tex_genfv_reply@Base 0
+ xcb_glx_get_tex_genfv_unchecked@Base 0
+ xcb_glx_get_tex_geniv@Base 0
+ xcb_glx_get_tex_geniv_data@Base 0
+ xcb_glx_get_tex_geniv_data_end@Base 0
+ xcb_glx_get_tex_geniv_data_length@Base 0
+ xcb_glx_get_tex_geniv_reply@Base 0
+ xcb_glx_get_tex_geniv_unchecked@Base 0
+ xcb_glx_get_tex_image@Base 0
+ xcb_glx_get_tex_image_data@Base 0
+ xcb_glx_get_tex_image_data_end@Base 0
+ xcb_glx_get_tex_image_data_length@Base 0
+ xcb_glx_get_tex_image_reply@Base 0
+ xcb_glx_get_tex_image_unchecked@Base 0
+ xcb_glx_get_tex_level_parameterfv@Base 0
+ xcb_glx_get_tex_level_parameterfv_data@Base 0
+ xcb_glx_get_tex_level_parameterfv_data_end@Base 1.2
+ xcb_glx_get_tex_level_parameterfv_data_length@Base 0
+ xcb_glx_get_tex_level_parameterfv_reply@Base 0
+ xcb_glx_get_tex_level_parameterfv_unchecked@Base 0
+ xcb_glx_get_tex_level_parameteriv@Base 0
+ xcb_glx_get_tex_level_parameteriv_data@Base 0
+ xcb_glx_get_tex_level_parameteriv_data_end@Base 0
+ xcb_glx_get_tex_level_parameteriv_data_length@Base 0
+ xcb_glx_get_tex_level_parameteriv_reply@Base 0
+ xcb_glx_get_tex_level_parameteriv_unchecked@Base 0
+ xcb_glx_get_tex_parameterfv@Base 0
+ xcb_glx_get_tex_parameterfv_data@Base 0
+ xcb_glx_get_tex_parameterfv_data_end@Base 1.2
+ xcb_glx_get_tex_parameterfv_data_length@Base 0
+ xcb_glx_get_tex_parameterfv_reply@Base 0
+ xcb_glx_get_tex_parameterfv_unchecked@Base 0
+ xcb_glx_get_tex_parameteriv@Base 0
+ xcb_glx_get_tex_parameteriv_data@Base 0
+ xcb_glx_get_tex_parameteriv_data_end@Base 0
+ xcb_glx_get_tex_parameteriv_data_length@Base 0
+ xcb_glx_get_tex_parameteriv_reply@Base 0
+ xcb_glx_get_tex_parameteriv_unchecked@Base 0
+ xcb_glx_get_visual_configs@Base 0
+ xcb_glx_get_visual_configs_property_list@Base 0
+ xcb_glx_get_visual_configs_property_list_end@Base 0
+ xcb_glx_get_visual_configs_property_list_length@Base 0
+ xcb_glx_get_visual_configs_reply@Base 0
+ xcb_glx_get_visual_configs_unchecked@Base 0
+ xcb_glx_id@Base 0
+ xcb_glx_is_direct@Base 0
+ xcb_glx_is_direct_reply@Base 0
+ xcb_glx_is_direct_unchecked@Base 0
+ xcb_glx_is_list@Base 0
+ xcb_glx_is_list_reply@Base 0
+ xcb_glx_is_list_unchecked@Base 0
+ xcb_glx_is_query_arb@Base 0
+ xcb_glx_is_query_arb_reply@Base 0
+ xcb_glx_is_query_arb_unchecked@Base 0
+ xcb_glx_is_texture@Base 0
+ xcb_glx_is_texture_reply@Base 0
+ xcb_glx_is_texture_unchecked@Base 0
+ xcb_glx_make_context_current@Base 0
+ xcb_glx_make_context_current_reply@Base 0
+ xcb_glx_make_context_current_unchecked@Base 0
+ xcb_glx_make_current@Base 0
+ xcb_glx_make_current_reply@Base 0
+ xcb_glx_make_current_unchecked@Base 0
+ xcb_glx_new_list@Base 0
+ xcb_glx_new_list_checked@Base 0
+ xcb_glx_pbuffer_end@Base 0
+ xcb_glx_pbuffer_next@Base 0
+ xcb_glx_pixel_storef@Base 0
+ xcb_glx_pixel_storef_checked@Base 0
+ xcb_glx_pixel_storei@Base 0
+ xcb_glx_pixel_storei_checked@Base 0
+ xcb_glx_pixmap_end@Base 0
+ xcb_glx_pixmap_next@Base 0
+ xcb_glx_query_context@Base 0
+ xcb_glx_query_context_attribs@Base 0
+ xcb_glx_query_context_attribs_end@Base 0
+ xcb_glx_query_context_attribs_length@Base 0
+ xcb_glx_query_context_reply@Base 0
+ xcb_glx_query_context_unchecked@Base 0
+ xcb_glx_query_extensions_string@Base 0
+ xcb_glx_query_extensions_string_reply@Base 0
+ xcb_glx_query_extensions_string_unchecked@Base 0
+ xcb_glx_query_server_string@Base 0
+ xcb_glx_query_server_string_reply@Base 0
+ xcb_glx_query_server_string_string@Base 0
+ xcb_glx_query_server_string_string_end@Base 0
+ xcb_glx_query_server_string_string_length@Base 0
+ xcb_glx_query_server_string_unchecked@Base 0
+ xcb_glx_query_version@Base 0
+ xcb_glx_query_version_reply@Base 0
+ xcb_glx_query_version_unchecked@Base 0
+ xcb_glx_read_pixels@Base 0
+ xcb_glx_read_pixels_data@Base 0
+ xcb_glx_read_pixels_data_end@Base 0
+ xcb_glx_read_pixels_data_length@Base 0
+ xcb_glx_read_pixels_reply@Base 0
+ xcb_glx_read_pixels_unchecked@Base 0
+ xcb_glx_render@Base 0
+ xcb_glx_render_checked@Base 0
+ xcb_glx_render_large@Base 0
+ xcb_glx_render_large_checked@Base 0
+ xcb_glx_render_mode@Base 0
+ xcb_glx_render_mode_data@Base 0
+ xcb_glx_render_mode_data_end@Base 0
+ xcb_glx_render_mode_data_length@Base 0
+ xcb_glx_render_mode_reply@Base 0
+ xcb_glx_render_mode_unchecked@Base 0
+ xcb_glx_select_buffer@Base 0
+ xcb_glx_select_buffer_checked@Base 0
+ xcb_glx_swap_buffers@Base 0
+ xcb_glx_swap_buffers_checked@Base 0
+ xcb_glx_use_x_font@Base 0
+ xcb_glx_use_x_font_checked@Base 0
+ xcb_glx_vendor_private@Base 0
+ xcb_glx_vendor_private_checked@Base 0
+ xcb_glx_vendor_private_with_reply@Base 0
+ xcb_glx_vendor_private_with_reply_data_2@Base 0
+ xcb_glx_vendor_private_with_reply_data_2_end@Base 0
+ xcb_glx_vendor_private_with_reply_data_2_length@Base 0
+ xcb_glx_vendor_private_with_reply_reply@Base 0
+ xcb_glx_vendor_private_with_reply_unchecked@Base 0
+ xcb_glx_wait_gl@Base 0
+ xcb_glx_wait_gl_checked@Base 0
+ xcb_glx_wait_x@Base 0
+ xcb_glx_wait_x_checked@Base 0
+ xcb_glx_window_end@Base 0
+ xcb_glx_window_next@Base 0
--- /dev/null
+usr/include/xcb/randr.h
+usr/lib/libxcb-randr.a
+usr/lib/libxcb-randr.so
+usr/lib/libxcb-randr.la
+usr/lib/pkgconfig/xcb-randr.pc
--- /dev/null
+usr/lib/libxcb-randr.so.0*
--- /dev/null
+libxcb-randr.so.0 libxcb-randr0 #MINVER#
+ xcb_randr_add_output_mode@Base 1.1
+ xcb_randr_add_output_mode_checked@Base 1.1
+ xcb_randr_change_output_property@Base 1.1
+ xcb_randr_change_output_property_checked@Base 1.1
+ xcb_randr_configure_output_property@Base 1.1
+ xcb_randr_configure_output_property_checked@Base 1.1
+ xcb_randr_create_mode@Base 1.1
+ xcb_randr_create_mode_reply@Base 1.1
+ xcb_randr_create_mode_unchecked@Base 1.1
+ xcb_randr_crtc_change_end@Base 1.1
+ xcb_randr_crtc_change_next@Base 1.1
+ xcb_randr_crtc_end@Base 1.2
+ xcb_randr_crtc_next@Base 1.2
+ xcb_randr_delete_output_mode@Base 1.1
+ xcb_randr_delete_output_mode_checked@Base 1.1
+ xcb_randr_delete_output_property@Base 1.1
+ xcb_randr_delete_output_property_checked@Base 1.1
+ xcb_randr_destroy_mode@Base 1.1
+ xcb_randr_destroy_mode_checked@Base 1.1
+ xcb_randr_get_crtc_gamma@Base 1.1
+ xcb_randr_get_crtc_gamma_blue@Base 1.1
+ xcb_randr_get_crtc_gamma_blue_end@Base 1.1
+ xcb_randr_get_crtc_gamma_blue_length@Base 1.1
+ xcb_randr_get_crtc_gamma_green@Base 1.1
+ xcb_randr_get_crtc_gamma_green_end@Base 1.1
+ xcb_randr_get_crtc_gamma_green_length@Base 1.1
+ xcb_randr_get_crtc_gamma_red@Base 1.1
+ xcb_randr_get_crtc_gamma_red_end@Base 1.1
+ xcb_randr_get_crtc_gamma_red_length@Base 1.1
+ xcb_randr_get_crtc_gamma_reply@Base 1.1
+ xcb_randr_get_crtc_gamma_size@Base 1.1
+ xcb_randr_get_crtc_gamma_size_reply@Base 1.1
+ xcb_randr_get_crtc_gamma_size_unchecked@Base 1.1
+ xcb_randr_get_crtc_gamma_unchecked@Base 1.1
+ xcb_randr_get_crtc_info@Base 1.1
+ xcb_randr_get_crtc_info_outputs@Base 1.1
+ xcb_randr_get_crtc_info_outputs_end@Base 1.1
+ xcb_randr_get_crtc_info_outputs_length@Base 1.1
+ xcb_randr_get_crtc_info_possible@Base 1.2
+ xcb_randr_get_crtc_info_possible_end@Base 1.2
+ xcb_randr_get_crtc_info_possible_length@Base 1.2
+ xcb_randr_get_crtc_info_reply@Base 1.1
+ xcb_randr_get_crtc_info_unchecked@Base 1.1
+ xcb_randr_get_crtc_transform@Base 1.3
+ xcb_randr_get_crtc_transform_current_filter_name@Base 1.3
+ xcb_randr_get_crtc_transform_current_filter_name_end@Base 1.3
+ xcb_randr_get_crtc_transform_current_filter_name_length@Base 1.3
+ xcb_randr_get_crtc_transform_current_params@Base 1.3
+ xcb_randr_get_crtc_transform_current_params_end@Base 1.3
+ xcb_randr_get_crtc_transform_current_params_length@Base 1.3
+ xcb_randr_get_crtc_transform_pending_filter_name@Base 1.3
+ xcb_randr_get_crtc_transform_pending_filter_name_end@Base 1.3
+ xcb_randr_get_crtc_transform_pending_filter_name_length@Base 1.3
+ xcb_randr_get_crtc_transform_pending_params@Base 1.3
+ xcb_randr_get_crtc_transform_pending_params_end@Base 1.3
+ xcb_randr_get_crtc_transform_pending_params_length@Base 1.3
+ xcb_randr_get_crtc_transform_reply@Base 1.3
+ xcb_randr_get_crtc_transform_unchecked@Base 1.3
+ xcb_randr_get_output_info@Base 1.1
+ xcb_randr_get_output_info_clones@Base 1.1
+ xcb_randr_get_output_info_clones_end@Base 1.1
+ xcb_randr_get_output_info_clones_length@Base 1.1
+ xcb_randr_get_output_info_crtcs@Base 1.1
+ xcb_randr_get_output_info_crtcs_end@Base 1.1
+ xcb_randr_get_output_info_crtcs_length@Base 1.1
+ xcb_randr_get_output_info_modes@Base 1.1
+ xcb_randr_get_output_info_modes_end@Base 1.1
+ xcb_randr_get_output_info_modes_length@Base 1.1
+ xcb_randr_get_output_info_name@Base 1.1
+ xcb_randr_get_output_info_name_end@Base 1.1
+ xcb_randr_get_output_info_name_length@Base 1.1
+ xcb_randr_get_output_info_reply@Base 1.1
+ xcb_randr_get_output_info_unchecked@Base 1.1
+ xcb_randr_get_output_primary@Base 1.3
+ xcb_randr_get_output_primary_reply@Base 1.3
+ xcb_randr_get_output_primary_unchecked@Base 1.3
+ xcb_randr_get_output_property@Base 1.1
+ xcb_randr_get_output_property_data@Base 1.1
+ xcb_randr_get_output_property_data_end@Base 1.1
+ xcb_randr_get_output_property_data_length@Base 1.1
+ xcb_randr_get_output_property_reply@Base 1.1
+ xcb_randr_get_output_property_unchecked@Base 1.1
+ xcb_randr_get_panning@Base 1.3
+ xcb_randr_get_panning_reply@Base 1.3
+ xcb_randr_get_panning_unchecked@Base 1.3
+ xcb_randr_get_screen_info@Base 0
+ xcb_randr_get_screen_info_rates_iterator@Base 0
+ xcb_randr_get_screen_info_rates_length@Base 0
+ xcb_randr_get_screen_info_reply@Base 0
+ xcb_randr_get_screen_info_sizes@Base 0
+ xcb_randr_get_screen_info_sizes_iterator@Base 0
+ xcb_randr_get_screen_info_sizes_length@Base 0
+ xcb_randr_get_screen_info_unchecked@Base 0
+ xcb_randr_get_screen_resources@Base 1.1
+ xcb_randr_get_screen_resources_crtcs@Base 1.1
+ xcb_randr_get_screen_resources_crtcs_end@Base 1.1
+ xcb_randr_get_screen_resources_crtcs_length@Base 1.1
+ xcb_randr_get_screen_resources_current@Base 1.3
+ xcb_randr_get_screen_resources_current_crtcs@Base 1.3
+ xcb_randr_get_screen_resources_current_crtcs_end@Base 1.3
+ xcb_randr_get_screen_resources_current_crtcs_length@Base 1.3
+ xcb_randr_get_screen_resources_current_modes@Base 1.3
+ xcb_randr_get_screen_resources_current_modes_iterator@Base 1.3
+ xcb_randr_get_screen_resources_current_modes_length@Base 1.3
+ xcb_randr_get_screen_resources_current_names@Base 1.3
+ xcb_randr_get_screen_resources_current_names_end@Base 1.3
+ xcb_randr_get_screen_resources_current_names_length@Base 1.3
+ xcb_randr_get_screen_resources_current_outputs@Base 1.3
+ xcb_randr_get_screen_resources_current_outputs_end@Base 1.3
+ xcb_randr_get_screen_resources_current_outputs_length@Base 1.3
+ xcb_randr_get_screen_resources_current_reply@Base 1.3
+ xcb_randr_get_screen_resources_current_unchecked@Base 1.3
+ xcb_randr_get_screen_resources_modes@Base 1.1
+ xcb_randr_get_screen_resources_modes_iterator@Base 1.1
+ xcb_randr_get_screen_resources_modes_length@Base 1.1
+ xcb_randr_get_screen_resources_names@Base 1.1
+ xcb_randr_get_screen_resources_names_end@Base 1.1
+ xcb_randr_get_screen_resources_names_length@Base 1.1
+ xcb_randr_get_screen_resources_outputs@Base 1.1
+ xcb_randr_get_screen_resources_outputs_end@Base 1.1
+ xcb_randr_get_screen_resources_outputs_length@Base 1.1
+ xcb_randr_get_screen_resources_reply@Base 1.1
+ xcb_randr_get_screen_resources_unchecked@Base 1.1
+ xcb_randr_get_screen_size_range@Base 1.1
+ xcb_randr_get_screen_size_range_reply@Base 1.1
+ xcb_randr_get_screen_size_range_unchecked@Base 1.1
+ xcb_randr_id@Base 0
+ xcb_randr_list_output_properties@Base 1.1
+ xcb_randr_list_output_properties_atoms@Base 1.1
+ xcb_randr_list_output_properties_atoms_end@Base 1.2
+ xcb_randr_list_output_properties_atoms_length@Base 1.1
+ xcb_randr_list_output_properties_reply@Base 1.1
+ xcb_randr_list_output_properties_unchecked@Base 1.1
+ xcb_randr_mode_end@Base 1.2
+ xcb_randr_mode_info_end@Base 1.1
+ xcb_randr_mode_info_next@Base 1.1
+ xcb_randr_mode_next@Base 1.2
+ xcb_randr_notify_data_end@Base 1.1
+ xcb_randr_notify_data_next@Base 1.1
+ xcb_randr_output_change_end@Base 1.1
+ xcb_randr_output_change_next@Base 1.1
+ xcb_randr_output_end@Base 1.2
+ xcb_randr_output_next@Base 1.2
+ xcb_randr_output_property_end@Base 1.1
+ xcb_randr_output_property_next@Base 1.1
+ xcb_randr_query_output_property@Base 1.1
+ xcb_randr_query_output_property_reply@Base 1.1
+ xcb_randr_query_output_property_unchecked@Base 1.1
+ xcb_randr_query_output_property_valid_values@Base 1.1
+ xcb_randr_query_output_property_valid_values_end@Base 1.1
+ xcb_randr_query_output_property_valid_values_length@Base 1.1
+ xcb_randr_query_version@Base 0
+ xcb_randr_query_version_reply@Base 0
+ xcb_randr_query_version_unchecked@Base 0
+ xcb_randr_refresh_rates_end@Base 0
+ xcb_randr_refresh_rates_next@Base 0
+ xcb_randr_refresh_rates_rates@Base 0
+ xcb_randr_refresh_rates_rates_end@Base 0
+ xcb_randr_refresh_rates_rates_length@Base 0
+ xcb_randr_screen_size_end@Base 0
+ xcb_randr_screen_size_next@Base 0
+ xcb_randr_select_input@Base 0
+ xcb_randr_select_input_checked@Base 0
+ xcb_randr_set_crtc_config@Base 1.1
+ xcb_randr_set_crtc_config_reply@Base 1.1
+ xcb_randr_set_crtc_config_unchecked@Base 1.1
+ xcb_randr_set_crtc_gamma@Base 1.1
+ xcb_randr_set_crtc_gamma_checked@Base 1.1
+ xcb_randr_set_crtc_transform@Base 1.3
+ xcb_randr_set_crtc_transform_checked@Base 1.3
+ xcb_randr_set_output_primary@Base 1.3
+ xcb_randr_set_output_primary_checked@Base 1.3
+ xcb_randr_set_panning@Base 1.3
+ xcb_randr_set_panning_reply@Base 1.3
+ xcb_randr_set_panning_unchecked@Base 1.3
+ xcb_randr_set_screen_config@Base 0
+ xcb_randr_set_screen_config_reply@Base 0
+ xcb_randr_set_screen_config_unchecked@Base 0
+ xcb_randr_set_screen_size@Base 1.1
+ xcb_randr_set_screen_size_checked@Base 1.1
--- /dev/null
+usr/include/xcb/record.h
+usr/lib/libxcb-record.a
+usr/lib/libxcb-record.so
+usr/lib/libxcb-record.la
+usr/lib/pkgconfig/xcb-record.pc
--- /dev/null
+usr/lib/libxcb-record.so.0*
--- /dev/null
+libxcb-record.so.0 libxcb-record0 #MINVER#
+ xcb_record_client_info_end@Base 0
+ xcb_record_client_info_next@Base 0
+ xcb_record_client_info_ranges@Base 0
+ xcb_record_client_info_ranges_iterator@Base 0
+ xcb_record_client_info_ranges_length@Base 0
+ xcb_record_client_spec_end@Base 0
+ xcb_record_client_spec_next@Base 0
+ xcb_record_context_end@Base 0
+ xcb_record_context_next@Base 0
+ xcb_record_create_context@Base 0
+ xcb_record_create_context_checked@Base 0
+ xcb_record_disable_context@Base 0
+ xcb_record_disable_context_checked@Base 0
+ xcb_record_element_header_end@Base 0
+ xcb_record_element_header_next@Base 0
+ xcb_record_enable_context@Base 0
+ xcb_record_enable_context_data@Base 0
+ xcb_record_enable_context_data_end@Base 0
+ xcb_record_enable_context_data_length@Base 0
+ xcb_record_enable_context_reply@Base 0
+ xcb_record_enable_context_unchecked@Base 0
+ xcb_record_ext_range_end@Base 0
+ xcb_record_ext_range_next@Base 0
+ xcb_record_free_context@Base 0
+ xcb_record_free_context_checked@Base 0
+ xcb_record_get_context@Base 0
+ xcb_record_get_context_intercepted_clients_iterator@Base 0
+ xcb_record_get_context_intercepted_clients_length@Base 0
+ xcb_record_get_context_reply@Base 0
+ xcb_record_get_context_unchecked@Base 0
+ xcb_record_id@Base 0
+ xcb_record_query_version@Base 0
+ xcb_record_query_version_reply@Base 0
+ xcb_record_query_version_unchecked@Base 0
+ xcb_record_range_16_end@Base 0
+ xcb_record_range_16_next@Base 0
+ xcb_record_range_8_end@Base 0
+ xcb_record_range_8_next@Base 0
+ xcb_record_range_end@Base 0
+ xcb_record_range_next@Base 0
+ xcb_record_register_clients@Base 0
+ xcb_record_register_clients_checked@Base 0
+ xcb_record_unregister_clients@Base 0
+ xcb_record_unregister_clients_checked@Base 0
--- /dev/null
+usr/include/xcb/render.h
+usr/lib/libxcb-render.a
+usr/lib/libxcb-render.so
+usr/lib/libxcb-render.la
+usr/lib/pkgconfig/xcb-render.pc
--- /dev/null
+usr/lib/libxcb-render.so.0*
--- /dev/null
+libxcb-render.so.0 libxcb-render0 #MINVER#
+ xcb_render_add_glyphs@Base 0
+ xcb_render_add_glyphs_checked@Base 0
+ xcb_render_add_traps@Base 0
+ xcb_render_add_traps_checked@Base 0
+ xcb_render_animcursorelt_end@Base 0
+ xcb_render_animcursorelt_next@Base 0
+ xcb_render_change_picture@Base 0
+ xcb_render_change_picture_checked@Base 0
+ xcb_render_color_end@Base 0
+ xcb_render_color_next@Base 0
+ xcb_render_composite@Base 0
+ xcb_render_composite_checked@Base 0
+ xcb_render_composite_glyphs_16@Base 0
+ xcb_render_composite_glyphs_16_checked@Base 0
+ xcb_render_composite_glyphs_32@Base 0
+ xcb_render_composite_glyphs_32_checked@Base 0
+ xcb_render_composite_glyphs_8@Base 0
+ xcb_render_composite_glyphs_8_checked@Base 0
+ xcb_render_create_anim_cursor@Base 0
+ xcb_render_create_anim_cursor_checked@Base 0
+ xcb_render_create_conical_gradient@Base 0
+ xcb_render_create_conical_gradient_checked@Base 0
+ xcb_render_create_cursor@Base 0
+ xcb_render_create_cursor_checked@Base 0
+ xcb_render_create_glyph_set@Base 0
+ xcb_render_create_glyph_set_checked@Base 0
+ xcb_render_create_linear_gradient@Base 0
+ xcb_render_create_linear_gradient_checked@Base 0
+ xcb_render_create_picture@Base 0
+ xcb_render_create_picture_checked@Base 0
+ xcb_render_create_radial_gradient@Base 0
+ xcb_render_create_radial_gradient_checked@Base 0
+ xcb_render_create_solid_fill@Base 0
+ xcb_render_create_solid_fill_checked@Base 0
+ xcb_render_directformat_end@Base 0
+ xcb_render_directformat_next@Base 0
+ xcb_render_fill_rectangles@Base 0
+ xcb_render_fill_rectangles_checked@Base 0
+ xcb_render_fixed_end@Base 0
+ xcb_render_fixed_next@Base 0
+ xcb_render_free_glyph_set@Base 0
+ xcb_render_free_glyph_set_checked@Base 0
+ xcb_render_free_glyphs@Base 0
+ xcb_render_free_glyphs_checked@Base 0
+ xcb_render_free_picture@Base 0
+ xcb_render_free_picture_checked@Base 0
+ xcb_render_glyph_end@Base 0
+ xcb_render_glyph_next@Base 0
+ xcb_render_glyphinfo_end@Base 0
+ xcb_render_glyphinfo_next@Base 0
+ xcb_render_glyphset_end@Base 0
+ xcb_render_glyphset_next@Base 0
+ xcb_render_id@Base 0
+ xcb_render_indexvalue_end@Base 0
+ xcb_render_indexvalue_next@Base 0
+ xcb_render_linefix_end@Base 0
+ xcb_render_linefix_next@Base 0
+ xcb_render_pictdepth_end@Base 0
+ xcb_render_pictdepth_next@Base 0
+ xcb_render_pictdepth_visuals@Base 0
+ xcb_render_pictdepth_visuals_iterator@Base 0
+ xcb_render_pictdepth_visuals_length@Base 0
+ xcb_render_pictformat_end@Base 0
+ xcb_render_pictformat_next@Base 0
+ xcb_render_pictforminfo_end@Base 0
+ xcb_render_pictforminfo_next@Base 0
+ xcb_render_pictscreen_depths_iterator@Base 0
+ xcb_render_pictscreen_depths_length@Base 0
+ xcb_render_pictscreen_end@Base 0
+ xcb_render_pictscreen_next@Base 0
+ xcb_render_picture_end@Base 0
+ xcb_render_picture_next@Base 0
+ xcb_render_pictvisual_end@Base 0
+ xcb_render_pictvisual_next@Base 0
+ xcb_render_pointfix_end@Base 0
+ xcb_render_pointfix_next@Base 0
+ xcb_render_query_filters@Base 0
+ xcb_render_query_filters_aliases@Base 0
+ xcb_render_query_filters_aliases_end@Base 0
+ xcb_render_query_filters_aliases_length@Base 0
+ xcb_render_query_filters_filters_iterator@Base 0
+ xcb_render_query_filters_filters_length@Base 0
+ xcb_render_query_filters_reply@Base 0
+ xcb_render_query_filters_unchecked@Base 0
+ xcb_render_query_pict_formats@Base 0
+ xcb_render_query_pict_formats_formats@Base 0
+ xcb_render_query_pict_formats_formats_iterator@Base 0
+ xcb_render_query_pict_formats_formats_length@Base 0
+ xcb_render_query_pict_formats_reply@Base 0
+ xcb_render_query_pict_formats_screens_iterator@Base 0
+ xcb_render_query_pict_formats_screens_length@Base 0
+ xcb_render_query_pict_formats_subpixels@Base 0
+ xcb_render_query_pict_formats_subpixels_end@Base 0
+ xcb_render_query_pict_formats_subpixels_length@Base 0
+ xcb_render_query_pict_formats_unchecked@Base 0
+ xcb_render_query_pict_index_values@Base 0
+ xcb_render_query_pict_index_values_reply@Base 0
+ xcb_render_query_pict_index_values_unchecked@Base 0
+ xcb_render_query_pict_index_values_values@Base 0
+ xcb_render_query_pict_index_values_values_iterator@Base 0
+ xcb_render_query_pict_index_values_values_length@Base 0
+ xcb_render_query_version@Base 0
+ xcb_render_query_version_reply@Base 0
+ xcb_render_query_version_unchecked@Base 0
+ xcb_render_reference_glyph_set@Base 0
+ xcb_render_reference_glyph_set_checked@Base 0
+ xcb_render_set_picture_clip_rectangles@Base 0
+ xcb_render_set_picture_clip_rectangles_checked@Base 0
+ xcb_render_set_picture_filter@Base 0
+ xcb_render_set_picture_filter_checked@Base 0
+ xcb_render_set_picture_transform@Base 0
+ xcb_render_set_picture_transform_checked@Base 0
+ xcb_render_spanfix_end@Base 0
+ xcb_render_spanfix_next@Base 0
+ xcb_render_transform_end@Base 0
+ xcb_render_transform_next@Base 0
+ xcb_render_trap_end@Base 0
+ xcb_render_trap_next@Base 0
+ xcb_render_trapezoid_end@Base 0
+ xcb_render_trapezoid_next@Base 0
+ xcb_render_trapezoids@Base 0
+ xcb_render_trapezoids_checked@Base 0
+ xcb_render_tri_fan@Base 0
+ xcb_render_tri_fan_checked@Base 0
+ xcb_render_tri_strip@Base 0
+ xcb_render_tri_strip_checked@Base 0
+ xcb_render_triangle_end@Base 0
+ xcb_render_triangle_next@Base 0
+ xcb_render_triangles@Base 0
+ xcb_render_triangles_checked@Base 0
--- /dev/null
+usr/include/xcb/res.h
+usr/lib/libxcb-res.a
+usr/lib/libxcb-res.so
+usr/lib/libxcb-res.la
+usr/lib/pkgconfig/xcb-res.pc
--- /dev/null
+usr/lib/libxcb-res.so.0*
--- /dev/null
+libxcb-res.so.0 libxcb-res0 #MINVER#
+ xcb_res_client_end@Base 0
+ xcb_res_client_next@Base 0
+ xcb_res_id@Base 0
+ xcb_res_query_client_pixmap_bytes@Base 0
+ xcb_res_query_client_pixmap_bytes_reply@Base 0
+ xcb_res_query_client_pixmap_bytes_unchecked@Base 0
+ xcb_res_query_client_resources@Base 0
+ xcb_res_query_client_resources_reply@Base 0
+ xcb_res_query_client_resources_types@Base 0
+ xcb_res_query_client_resources_types_iterator@Base 0
+ xcb_res_query_client_resources_types_length@Base 0
+ xcb_res_query_client_resources_unchecked@Base 0
+ xcb_res_query_clients@Base 0
+ xcb_res_query_clients_clients@Base 0
+ xcb_res_query_clients_clients_iterator@Base 0
+ xcb_res_query_clients_clients_length@Base 0
+ xcb_res_query_clients_reply@Base 0
+ xcb_res_query_clients_unchecked@Base 0
+ xcb_res_query_version@Base 0
+ xcb_res_query_version_reply@Base 0
+ xcb_res_query_version_unchecked@Base 0
+ xcb_res_type_end@Base 0
+ xcb_res_type_next@Base 0
--- /dev/null
+usr/include/xcb/screensaver.h
+usr/lib/libxcb-screensaver.a
+usr/lib/libxcb-screensaver.so
+usr/lib/libxcb-screensaver.la
+usr/lib/pkgconfig/xcb-screensaver.pc
--- /dev/null
+usr/lib/libxcb-screensaver.so.0*
--- /dev/null
+libxcb-screensaver.so.0 libxcb-screensaver0 #MINVER#
+ xcb_screensaver_id@Base 0
+ xcb_screensaver_query_info@Base 0
+ xcb_screensaver_query_info_reply@Base 0
+ xcb_screensaver_query_info_unchecked@Base 0
+ xcb_screensaver_query_version@Base 0
+ xcb_screensaver_query_version_reply@Base 0
+ xcb_screensaver_query_version_unchecked@Base 0
+ xcb_screensaver_select_input@Base 0
+ xcb_screensaver_select_input_checked@Base 0
+ xcb_screensaver_set_attributes@Base 0
+ xcb_screensaver_set_attributes_checked@Base 0
+ xcb_screensaver_suspend@Base 0
+ xcb_screensaver_suspend_checked@Base 0
+ xcb_screensaver_unset_attributes@Base 0
+ xcb_screensaver_unset_attributes_checked@Base 0
--- /dev/null
+usr/include/xcb/shape.h
+usr/lib/libxcb-shape.a
+usr/lib/libxcb-shape.so
+usr/lib/libxcb-shape.la
+usr/lib/pkgconfig/xcb-shape.pc
--- /dev/null
+usr/lib/libxcb-shape.so.0*
--- /dev/null
+libxcb-shape.so.0 libxcb-shape0 #MINVER#
+ xcb_shape_combine@Base 0
+ xcb_shape_combine_checked@Base 0
+ xcb_shape_get_rectangles@Base 0
+ xcb_shape_get_rectangles_rectangles@Base 0
+ xcb_shape_get_rectangles_rectangles_iterator@Base 0
+ xcb_shape_get_rectangles_rectangles_length@Base 0
+ xcb_shape_get_rectangles_reply@Base 0
+ xcb_shape_get_rectangles_unchecked@Base 0
+ xcb_shape_id@Base 0
+ xcb_shape_input_selected@Base 0
+ xcb_shape_input_selected_reply@Base 0
+ xcb_shape_input_selected_unchecked@Base 0
+ xcb_shape_kind_end@Base 0
+ xcb_shape_kind_next@Base 0
+ xcb_shape_mask@Base 0
+ xcb_shape_mask_checked@Base 0
+ xcb_shape_offset@Base 0
+ xcb_shape_offset_checked@Base 0
+ xcb_shape_op_end@Base 0
+ xcb_shape_op_next@Base 0
+ xcb_shape_query_extents@Base 0
+ xcb_shape_query_extents_reply@Base 0
+ xcb_shape_query_extents_unchecked@Base 0
+ xcb_shape_query_version@Base 0
+ xcb_shape_query_version_reply@Base 0
+ xcb_shape_query_version_unchecked@Base 0
+ xcb_shape_rectangles@Base 0
+ xcb_shape_rectangles_checked@Base 0
+ xcb_shape_select_input@Base 0
+ xcb_shape_select_input_checked@Base 0
--- /dev/null
+usr/include/xcb/shm.h
+usr/lib/libxcb-shm.a
+usr/lib/libxcb-shm.so
+usr/lib/libxcb-shm.la
+usr/lib/pkgconfig/xcb-shm.pc
--- /dev/null
+usr/lib/libxcb-shm.so.0*
--- /dev/null
+libxcb-shm.so.0 libxcb-shm0 #MINVER#
+ xcb_shm_attach@Base 0
+ xcb_shm_attach_checked@Base 0
+ xcb_shm_create_pixmap@Base 0
+ xcb_shm_create_pixmap_checked@Base 0
+ xcb_shm_detach@Base 0
+ xcb_shm_detach_checked@Base 0
+ xcb_shm_get_image@Base 0
+ xcb_shm_get_image_reply@Base 0
+ xcb_shm_get_image_unchecked@Base 0
+ xcb_shm_id@Base 0
+ xcb_shm_put_image@Base 0
+ xcb_shm_put_image_checked@Base 0
+ xcb_shm_query_version@Base 0
+ xcb_shm_query_version_reply@Base 0
+ xcb_shm_query_version_unchecked@Base 0
+ xcb_shm_seg_end@Base 0
+ xcb_shm_seg_next@Base 0
--- /dev/null
+usr/include/xcb/sync.h
+usr/lib/libxcb-sync.a
+usr/lib/libxcb-sync.so
+usr/lib/libxcb-sync.la
+usr/lib/pkgconfig/xcb-sync.pc
--- /dev/null
+usr/lib/libxcb-sync.so.0*
--- /dev/null
+libxcb-sync.so.0 libxcb-sync0 #MINVER#
+ xcb_sync_alarm_end@Base 0
+ xcb_sync_alarm_next@Base 0
+ xcb_sync_await@Base 0
+ xcb_sync_await_checked@Base 0
+ xcb_sync_change_alarm@Base 0
+ xcb_sync_change_alarm_checked@Base 0
+ xcb_sync_change_counter@Base 0
+ xcb_sync_change_counter_checked@Base 0
+ xcb_sync_counter_end@Base 0
+ xcb_sync_counter_next@Base 0
+ xcb_sync_create_alarm@Base 0
+ xcb_sync_create_alarm_checked@Base 0
+ xcb_sync_create_counter@Base 0
+ xcb_sync_create_counter_checked@Base 0
+ xcb_sync_destroy_alarm@Base 0
+ xcb_sync_destroy_alarm_checked@Base 0
+ xcb_sync_destroy_counter@Base 0
+ xcb_sync_destroy_counter_checked@Base 0
+ xcb_sync_get_priority@Base 0
+ xcb_sync_get_priority_reply@Base 0
+ xcb_sync_get_priority_unchecked@Base 0
+ xcb_sync_id@Base 0
+ xcb_sync_initialize@Base 0
+ xcb_sync_initialize_reply@Base 0
+ xcb_sync_initialize_unchecked@Base 0
+ xcb_sync_int64_end@Base 0
+ xcb_sync_int64_next@Base 0
+ xcb_sync_list_system_counters@Base 0
+ xcb_sync_list_system_counters_counters_iterator@Base 0
+ xcb_sync_list_system_counters_counters_length@Base 0
+ xcb_sync_list_system_counters_reply@Base 0
+ xcb_sync_list_system_counters_unchecked@Base 0
+ xcb_sync_query_alarm@Base 0
+ xcb_sync_query_alarm_reply@Base 0
+ xcb_sync_query_alarm_unchecked@Base 0
+ xcb_sync_query_counter@Base 0
+ xcb_sync_query_counter_reply@Base 0
+ xcb_sync_query_counter_unchecked@Base 0
+ xcb_sync_set_counter@Base 0
+ xcb_sync_set_counter_checked@Base 0
+ xcb_sync_set_priority@Base 0
+ xcb_sync_set_priority_checked@Base 0
+ xcb_sync_systemcounter_end@Base 0
+ xcb_sync_systemcounter_name@Base 0
+ xcb_sync_systemcounter_name_end@Base 0
+ xcb_sync_systemcounter_name_length@Base 0
+ xcb_sync_systemcounter_next@Base 0
+ xcb_sync_trigger_end@Base 0
+ xcb_sync_trigger_next@Base 0
+ xcb_sync_waitcondition_end@Base 0
+ xcb_sync_waitcondition_next@Base 0
--- /dev/null
+usr/include/xcb/xevie.h
+usr/lib/libxcb-xevie.a
+usr/lib/libxcb-xevie.so
+usr/lib/libxcb-xevie.la
+usr/lib/pkgconfig/xcb-xevie.pc
--- /dev/null
+usr/lib/libxcb-xevie.so.0*
--- /dev/null
+libxcb-xevie.so.0 libxcb-xevie0 #MINVER#
+ xcb_xevie_end@Base 0
+ xcb_xevie_end_reply@Base 0
+ xcb_xevie_end_unchecked@Base 0
+ xcb_xevie_event_end@Base 0
+ xcb_xevie_event_next@Base 0
+ xcb_xevie_id@Base 0
+ xcb_xevie_query_version@Base 0
+ xcb_xevie_query_version_reply@Base 0
+ xcb_xevie_query_version_unchecked@Base 0
+ xcb_xevie_select_input@Base 0
+ xcb_xevie_select_input_reply@Base 0
+ xcb_xevie_select_input_unchecked@Base 0
+ xcb_xevie_send@Base 0
+ xcb_xevie_send_reply@Base 0
+ xcb_xevie_send_unchecked@Base 0
+ xcb_xevie_start@Base 0
+ xcb_xevie_start_reply@Base 0
+ xcb_xevie_start_unchecked@Base 0
--- /dev/null
+usr/include/xcb/xf86dri.h
+usr/lib/libxcb-xf86dri.a
+usr/lib/libxcb-xf86dri.so
+usr/lib/libxcb-xf86dri.la
+usr/lib/pkgconfig/xcb-xf86dri.pc
--- /dev/null
+usr/lib/libxcb-xf86dri.so.0*
--- /dev/null
+libxcb-xf86dri.so.0 libxcb-xf86dri0 #MINVER#
+ xcb_xf86dri_auth_connection@Base 0
+ xcb_xf86dri_auth_connection_reply@Base 0
+ xcb_xf86dri_auth_connection_unchecked@Base 0
+ xcb_xf86dri_close_connection@Base 0
+ xcb_xf86dri_close_connection_checked@Base 0
+ xcb_xf86dri_create_context@Base 0
+ xcb_xf86dri_create_context_reply@Base 0
+ xcb_xf86dri_create_context_unchecked@Base 0
+ xcb_xf86dri_create_drawable@Base 0
+ xcb_xf86dri_create_drawable_reply@Base 0
+ xcb_xf86dri_create_drawable_unchecked@Base 0
+ xcb_xf86dri_destroy_context@Base 0
+ xcb_xf86dri_destroy_context_checked@Base 0
+ xcb_xf86dri_destroy_drawable@Base 0
+ xcb_xf86dri_destroy_drawable_checked@Base 0
+ xcb_xf86dri_drm_clip_rect_end@Base 0
+ xcb_xf86dri_drm_clip_rect_next@Base 0
+ xcb_xf86dri_get_client_driver_name@Base 0
+ xcb_xf86dri_get_client_driver_name_client_driver_name@Base 0
+ xcb_xf86dri_get_client_driver_name_client_driver_name_end@Base 0
+ xcb_xf86dri_get_client_driver_name_client_driver_name_length@Base 0
+ xcb_xf86dri_get_client_driver_name_reply@Base 0
+ xcb_xf86dri_get_client_driver_name_unchecked@Base 0
+ xcb_xf86dri_get_device_info@Base 0
+ xcb_xf86dri_get_device_info_device_private@Base 0
+ xcb_xf86dri_get_device_info_device_private_end@Base 0
+ xcb_xf86dri_get_device_info_device_private_length@Base 0
+ xcb_xf86dri_get_device_info_reply@Base 0
+ xcb_xf86dri_get_device_info_unchecked@Base 0
+ xcb_xf86dri_get_drawable_info@Base 0
+ xcb_xf86dri_get_drawable_info_clip_rects@Base 0
+ xcb_xf86dri_get_drawable_info_clip_rects_iterator@Base 0
+ xcb_xf86dri_get_drawable_info_clip_rects_length@Base 0
+ xcb_xf86dri_get_drawable_info_reply@Base 0
+ xcb_xf86dri_get_drawable_info_unchecked@Base 0
+ xcb_xf86dri_id@Base 0
+ xcb_xf86dri_open_connection@Base 0
+ xcb_xf86dri_open_connection_bus_id@Base 0
+ xcb_xf86dri_open_connection_bus_id_end@Base 0
+ xcb_xf86dri_open_connection_bus_id_length@Base 0
+ xcb_xf86dri_open_connection_reply@Base 0
+ xcb_xf86dri_open_connection_unchecked@Base 0
+ xcb_xf86dri_query_direct_rendering_capable@Base 0
+ xcb_xf86dri_query_direct_rendering_capable_reply@Base 0
+ xcb_xf86dri_query_direct_rendering_capable_unchecked@Base 0
+ xcb_xf86dri_query_version@Base 0
+ xcb_xf86dri_query_version_reply@Base 0
+ xcb_xf86dri_query_version_unchecked@Base 0
--- /dev/null
+usr/include/xcb/xfixes.h
+usr/lib/libxcb-xfixes.a
+usr/lib/libxcb-xfixes.so
+usr/lib/libxcb-xfixes.la
+usr/lib/pkgconfig/xcb-xfixes.pc
--- /dev/null
+usr/lib/libxcb-xfixes.so.0*
--- /dev/null
+libxcb-xfixes.so.0 libxcb-xfixes0 #MINVER#
+ xcb_xfixes_change_cursor@Base 0
+ xcb_xfixes_change_cursor_by_name@Base 0
+ xcb_xfixes_change_cursor_by_name_checked@Base 0
+ xcb_xfixes_change_cursor_checked@Base 0
+ xcb_xfixes_change_save_set@Base 0
+ xcb_xfixes_change_save_set_checked@Base 0
+ xcb_xfixes_copy_region@Base 0
+ xcb_xfixes_copy_region_checked@Base 0
+ xcb_xfixes_create_region@Base 0
+ xcb_xfixes_create_region_checked@Base 0
+ xcb_xfixes_create_region_from_bitmap@Base 0
+ xcb_xfixes_create_region_from_bitmap_checked@Base 0
+ xcb_xfixes_create_region_from_gc@Base 0
+ xcb_xfixes_create_region_from_gc_checked@Base 0
+ xcb_xfixes_create_region_from_picture@Base 0
+ xcb_xfixes_create_region_from_picture_checked@Base 0
+ xcb_xfixes_create_region_from_window@Base 0
+ xcb_xfixes_create_region_from_window_checked@Base 0
+ xcb_xfixes_destroy_region@Base 0
+ xcb_xfixes_destroy_region_checked@Base 0
+ xcb_xfixes_expand_region@Base 0
+ xcb_xfixes_expand_region_checked@Base 0
+ xcb_xfixes_fetch_region@Base 0
+ xcb_xfixes_fetch_region_rectangles@Base 0
+ xcb_xfixes_fetch_region_rectangles_iterator@Base 0
+ xcb_xfixes_fetch_region_rectangles_length@Base 0
+ xcb_xfixes_fetch_region_reply@Base 0
+ xcb_xfixes_fetch_region_unchecked@Base 0
+ xcb_xfixes_get_cursor_image@Base 0
+ xcb_xfixes_get_cursor_image_and_name@Base 0
+ xcb_xfixes_get_cursor_image_and_name_cursor_image@Base 0
+ xcb_xfixes_get_cursor_image_and_name_cursor_image_end@Base 0
+ xcb_xfixes_get_cursor_image_and_name_cursor_image_length@Base 0
+ xcb_xfixes_get_cursor_image_and_name_name@Base 0
+ xcb_xfixes_get_cursor_image_and_name_name_end@Base 0
+ xcb_xfixes_get_cursor_image_and_name_name_length@Base 0
+ xcb_xfixes_get_cursor_image_and_name_reply@Base 0
+ xcb_xfixes_get_cursor_image_and_name_unchecked@Base 0
+ xcb_xfixes_get_cursor_image_cursor_image@Base 0
+ xcb_xfixes_get_cursor_image_cursor_image_end@Base 0
+ xcb_xfixes_get_cursor_image_cursor_image_length@Base 0
+ xcb_xfixes_get_cursor_image_reply@Base 0
+ xcb_xfixes_get_cursor_image_unchecked@Base 0
+ xcb_xfixes_get_cursor_name@Base 0
+ xcb_xfixes_get_cursor_name_name@Base 0
+ xcb_xfixes_get_cursor_name_name_end@Base 0
+ xcb_xfixes_get_cursor_name_name_length@Base 0
+ xcb_xfixes_get_cursor_name_reply@Base 0
+ xcb_xfixes_get_cursor_name_unchecked@Base 0
+ xcb_xfixes_hide_cursor@Base 0
+ xcb_xfixes_hide_cursor_checked@Base 0
+ xcb_xfixes_id@Base 0
+ xcb_xfixes_intersect_region@Base 0
+ xcb_xfixes_intersect_region_checked@Base 0
+ xcb_xfixes_invert_region@Base 0
+ xcb_xfixes_invert_region_checked@Base 0
+ xcb_xfixes_query_version@Base 0
+ xcb_xfixes_query_version_reply@Base 0
+ xcb_xfixes_query_version_unchecked@Base 0
+ xcb_xfixes_region_end@Base 0
+ xcb_xfixes_region_extents@Base 0
+ xcb_xfixes_region_extents_checked@Base 0
+ xcb_xfixes_region_next@Base 0
+ xcb_xfixes_select_cursor_input@Base 0
+ xcb_xfixes_select_cursor_input_checked@Base 0
+ xcb_xfixes_select_selection_input@Base 0
+ xcb_xfixes_select_selection_input_checked@Base 0
+ xcb_xfixes_set_cursor_name@Base 0
+ xcb_xfixes_set_cursor_name_checked@Base 0
+ xcb_xfixes_set_gc_clip_region@Base 0
+ xcb_xfixes_set_gc_clip_region_checked@Base 0
+ xcb_xfixes_set_picture_clip_region@Base 0
+ xcb_xfixes_set_picture_clip_region_checked@Base 0
+ xcb_xfixes_set_region@Base 0
+ xcb_xfixes_set_region_checked@Base 0
+ xcb_xfixes_set_window_shape_region@Base 0
+ xcb_xfixes_set_window_shape_region_checked@Base 0
+ xcb_xfixes_show_cursor@Base 0
+ xcb_xfixes_show_cursor_checked@Base 0
+ xcb_xfixes_subtract_region@Base 0
+ xcb_xfixes_subtract_region_checked@Base 0
+ xcb_xfixes_translate_region@Base 0
+ xcb_xfixes_translate_region_checked@Base 0
+ xcb_xfixes_union_region@Base 0
+ xcb_xfixes_union_region_checked@Base 0
--- /dev/null
+usr/include/xcb/xinerama.h
+usr/lib/libxcb-xinerama.a
+usr/lib/libxcb-xinerama.so
+usr/lib/libxcb-xinerama.la
+usr/lib/pkgconfig/xcb-xinerama.pc
--- /dev/null
+usr/lib/libxcb-xinerama.so.0*
--- /dev/null
+libxcb-xinerama.so.0 libxcb-xinerama0 #MINVER#
+ xcb_xinerama_get_screen_count@Base 0
+ xcb_xinerama_get_screen_count_reply@Base 0
+ xcb_xinerama_get_screen_count_unchecked@Base 0
+ xcb_xinerama_get_screen_size@Base 0
+ xcb_xinerama_get_screen_size_reply@Base 0
+ xcb_xinerama_get_screen_size_unchecked@Base 0
+ xcb_xinerama_get_state@Base 0
+ xcb_xinerama_get_state_reply@Base 0
+ xcb_xinerama_get_state_unchecked@Base 0
+ xcb_xinerama_id@Base 0
+ xcb_xinerama_is_active@Base 0
+ xcb_xinerama_is_active_reply@Base 0
+ xcb_xinerama_is_active_unchecked@Base 0
+ xcb_xinerama_query_screens@Base 0
+ xcb_xinerama_query_screens_reply@Base 0
+ xcb_xinerama_query_screens_screen_info@Base 0
+ xcb_xinerama_query_screens_screen_info_iterator@Base 0
+ xcb_xinerama_query_screens_screen_info_length@Base 0
+ xcb_xinerama_query_screens_unchecked@Base 0
+ xcb_xinerama_query_version@Base 0
+ xcb_xinerama_query_version_reply@Base 0
+ xcb_xinerama_query_version_unchecked@Base 0
+ xcb_xinerama_screen_info_end@Base 0
+ xcb_xinerama_screen_info_next@Base 0
--- /dev/null
+usr/include/xcb/xprint.h
+usr/lib/libxcb-xprint.a
+usr/lib/libxcb-xprint.so
+usr/lib/libxcb-xprint.la
+usr/lib/pkgconfig/xcb-xprint.pc
--- /dev/null
+usr/lib/libxcb-xprint.so.0*
--- /dev/null
+libxcb-xprint.so.0 libxcb-xprint0 #MINVER#
+ xcb_x_print_create_context@Base 0
+ xcb_x_print_create_context_checked@Base 0
+ xcb_x_print_id@Base 0
+ xcb_x_print_pcontext_end@Base 0
+ xcb_x_print_pcontext_next@Base 0
+ xcb_x_print_print_destroy_context@Base 0
+ xcb_x_print_print_destroy_context_checked@Base 0
+ xcb_x_print_print_end_doc@Base 0
+ xcb_x_print_print_end_doc_checked@Base 0
+ xcb_x_print_print_end_job@Base 0
+ xcb_x_print_print_end_job_checked@Base 0
+ xcb_x_print_print_end_page@Base 0
+ xcb_x_print_print_end_page_checked@Base 0
+ xcb_x_print_print_get_attributes@Base 0
+ xcb_x_print_print_get_attributes_reply@Base 0
+ xcb_x_print_print_get_attributes_unchecked@Base 0
+ xcb_x_print_print_get_context@Base 0
+ xcb_x_print_print_get_context_reply@Base 0
+ xcb_x_print_print_get_context_unchecked@Base 0
+ xcb_x_print_print_get_document_data@Base 0
+ xcb_x_print_print_get_document_data_data@Base 0
+ xcb_x_print_print_get_document_data_data_end@Base 0
+ xcb_x_print_print_get_document_data_data_length@Base 0
+ xcb_x_print_print_get_document_data_reply@Base 0
+ xcb_x_print_print_get_document_data_unchecked@Base 0
+ xcb_x_print_print_get_image_resolution@Base 0
+ xcb_x_print_print_get_image_resolution_reply@Base 0
+ xcb_x_print_print_get_image_resolution_unchecked@Base 0
+ xcb_x_print_print_get_one_attributes@Base 0
+ xcb_x_print_print_get_one_attributes_reply@Base 0
+ xcb_x_print_print_get_one_attributes_unchecked@Base 0
+ xcb_x_print_print_get_one_attributes_value@Base 0
+ xcb_x_print_print_get_one_attributes_value_end@Base 1.2
+ xcb_x_print_print_get_one_attributes_value_length@Base 0
+ xcb_x_print_print_get_page_dimensions@Base 0
+ xcb_x_print_print_get_page_dimensions_reply@Base 0
+ xcb_x_print_print_get_page_dimensions_unchecked@Base 0
+ xcb_x_print_print_get_printer_list@Base 0
+ xcb_x_print_print_get_printer_list_printers_iterator@Base 0
+ xcb_x_print_print_get_printer_list_printers_length@Base 0
+ xcb_x_print_print_get_printer_list_reply@Base 0
+ xcb_x_print_print_get_printer_list_unchecked@Base 0
+ xcb_x_print_print_get_screen_of_context@Base 0
+ xcb_x_print_print_get_screen_of_context_reply@Base 0
+ xcb_x_print_print_get_screen_of_context_unchecked@Base 0
+ xcb_x_print_print_input_selected@Base 0
+ xcb_x_print_print_input_selected_all_events_list@Base 0
+ xcb_x_print_print_input_selected_all_events_list_end@Base 0
+ xcb_x_print_print_input_selected_all_events_list_length@Base 0
+ xcb_x_print_print_input_selected_all_events_mask@Base 1.2
+ xcb_x_print_print_input_selected_event_list@Base 0
+ xcb_x_print_print_input_selected_event_list_end@Base 0
+ xcb_x_print_print_input_selected_event_list_length@Base 0
+ xcb_x_print_print_input_selected_reply@Base 0
+ xcb_x_print_print_input_selected_unchecked@Base 0
+ xcb_x_print_print_put_document_data@Base 0
+ xcb_x_print_print_put_document_data_checked@Base 0
+ xcb_x_print_print_query_screens@Base 0
+ xcb_x_print_print_query_screens_reply@Base 0
+ xcb_x_print_print_query_screens_roots@Base 0
+ xcb_x_print_print_query_screens_roots_end@Base 1.2
+ xcb_x_print_print_query_screens_roots_length@Base 0
+ xcb_x_print_print_query_screens_unchecked@Base 0
+ xcb_x_print_print_query_version@Base 0
+ xcb_x_print_print_query_version_reply@Base 0
+ xcb_x_print_print_query_version_unchecked@Base 0
+ xcb_x_print_print_rehash_printer_list@Base 0
+ xcb_x_print_print_rehash_printer_list_checked@Base 0
+ xcb_x_print_print_select_input@Base 0
+ xcb_x_print_print_select_input_checked@Base 0
+ xcb_x_print_print_set_attributes@Base 0
+ xcb_x_print_print_set_attributes_checked@Base 0
+ xcb_x_print_print_set_context@Base 0
+ xcb_x_print_print_set_context_checked@Base 0
+ xcb_x_print_print_set_image_resolution@Base 0
+ xcb_x_print_print_set_image_resolution_reply@Base 0
+ xcb_x_print_print_set_image_resolution_unchecked@Base 0
+ xcb_x_print_print_start_doc@Base 0
+ xcb_x_print_print_start_doc_checked@Base 0
+ xcb_x_print_print_start_job@Base 0
+ xcb_x_print_print_start_job_checked@Base 0
+ xcb_x_print_print_start_page@Base 0
+ xcb_x_print_print_start_page_checked@Base 0
+ xcb_x_print_printer_desc_len@Base 1.2
+ xcb_x_print_printer_description@Base 0
+ xcb_x_print_printer_description_end@Base 1.2
+ xcb_x_print_printer_description_length@Base 0
+ xcb_x_print_printer_end@Base 0
+ xcb_x_print_printer_name@Base 0
+ xcb_x_print_printer_name_end@Base 1.2
+ xcb_x_print_printer_name_length@Base 0
+ xcb_x_print_printer_next@Base 0
+ xcb_x_print_string8_end@Base 0
+ xcb_x_print_string8_next@Base 0
--- /dev/null
+usr/include/xcb/xtest.h
+usr/lib/libxcb-xtest.a
+usr/lib/libxcb-xtest.so
+usr/lib/libxcb-xtest.la
+usr/lib/pkgconfig/xcb-xtest.pc
--- /dev/null
+usr/lib/libxcb-xtest.so.0*
--- /dev/null
+libxcb-xtest.so.0 libxcb-xtest0 #MINVER#
+ xcb_test_compare_cursor@Base 0
+ xcb_test_compare_cursor_reply@Base 0
+ xcb_test_compare_cursor_unchecked@Base 0
+ xcb_test_fake_input@Base 0
+ xcb_test_fake_input_checked@Base 0
+ xcb_test_get_version@Base 0
+ xcb_test_get_version_reply@Base 0
+ xcb_test_get_version_unchecked@Base 0
+ xcb_test_grab_control@Base 0
+ xcb_test_grab_control_checked@Base 0
+ xcb_test_id@Base 0
--- /dev/null
+usr/include/xcb/xv.h
+usr/lib/libxcb-xv.a
+usr/lib/libxcb-xv.so
+usr/lib/libxcb-xv.la
+usr/lib/pkgconfig/xcb-xv.pc
--- /dev/null
+usr/lib/libxcb-xv.so.0*
--- /dev/null
+libxcb-xv.so.0 libxcb-xv0 #MINVER#
+ xcb_xv_adaptor_info_end@Base 0
+ xcb_xv_adaptor_info_formats@Base 0
+ xcb_xv_adaptor_info_formats_iterator@Base 0
+ xcb_xv_adaptor_info_formats_length@Base 0
+ xcb_xv_adaptor_info_name@Base 0
+ xcb_xv_adaptor_info_name_end@Base 0
+ xcb_xv_adaptor_info_name_length@Base 0
+ xcb_xv_adaptor_info_next@Base 0
+ xcb_xv_attribute_info_end@Base 0
+ xcb_xv_attribute_info_name@Base 0
+ xcb_xv_attribute_info_name_end@Base 0
+ xcb_xv_attribute_info_name_length@Base 0
+ xcb_xv_attribute_info_next@Base 0
+ xcb_xv_encoding_end@Base 0
+ xcb_xv_encoding_info_end@Base 0
+ xcb_xv_encoding_info_name@Base 0
+ xcb_xv_encoding_info_name_end@Base 0
+ xcb_xv_encoding_info_name_length@Base 0
+ xcb_xv_encoding_info_next@Base 0
+ xcb_xv_encoding_next@Base 0
+ xcb_xv_format_end@Base 0
+ xcb_xv_format_next@Base 0
+ xcb_xv_get_port_attribute@Base 0
+ xcb_xv_get_port_attribute_reply@Base 0
+ xcb_xv_get_port_attribute_unchecked@Base 0
+ xcb_xv_get_still@Base 0
+ xcb_xv_get_still_checked@Base 0
+ xcb_xv_get_video@Base 0
+ xcb_xv_get_video_checked@Base 0
+ xcb_xv_grab_port@Base 0
+ xcb_xv_grab_port_reply@Base 0
+ xcb_xv_grab_port_unchecked@Base 0
+ xcb_xv_id@Base 0
+ xcb_xv_image_data@Base 0
+ xcb_xv_image_data_end@Base 0
+ xcb_xv_image_data_length@Base 0
+ xcb_xv_image_end@Base 0
+ xcb_xv_image_format_info_end@Base 0
+ xcb_xv_image_format_info_next@Base 0
+ xcb_xv_image_next@Base 0
+ xcb_xv_image_offsets@Base 0
+ xcb_xv_image_offsets_end@Base 0
+ xcb_xv_image_offsets_length@Base 0
+ xcb_xv_image_pitches@Base 0
+ xcb_xv_image_pitches_end@Base 0
+ xcb_xv_image_pitches_length@Base 0
+ xcb_xv_list_image_formats@Base 0
+ xcb_xv_list_image_formats_format@Base 1.2
+ xcb_xv_list_image_formats_format_iterator@Base 0
+ xcb_xv_list_image_formats_format_length@Base 0
+ xcb_xv_list_image_formats_reply@Base 0
+ xcb_xv_list_image_formats_unchecked@Base 0
+ xcb_xv_port_end@Base 0
+ xcb_xv_port_next@Base 0
+ xcb_xv_put_image@Base 0
+ xcb_xv_put_image_checked@Base 0
+ xcb_xv_put_still@Base 0
+ xcb_xv_put_still_checked@Base 0
+ xcb_xv_put_video@Base 0
+ xcb_xv_put_video_checked@Base 0
+ xcb_xv_query_adaptors@Base 0
+ xcb_xv_query_adaptors_info_iterator@Base 0
+ xcb_xv_query_adaptors_info_length@Base 0
+ xcb_xv_query_adaptors_reply@Base 0
+ xcb_xv_query_adaptors_unchecked@Base 0
+ xcb_xv_query_best_size@Base 0
+ xcb_xv_query_best_size_reply@Base 0
+ xcb_xv_query_best_size_unchecked@Base 0
+ xcb_xv_query_encodings@Base 0
+ xcb_xv_query_encodings_info_iterator@Base 0
+ xcb_xv_query_encodings_info_length@Base 0
+ xcb_xv_query_encodings_reply@Base 0
+ xcb_xv_query_encodings_unchecked@Base 0
+ xcb_xv_query_extension@Base 0
+ xcb_xv_query_extension_reply@Base 0
+ xcb_xv_query_extension_unchecked@Base 0
+ xcb_xv_query_image_attributes@Base 0
+ xcb_xv_query_image_attributes_offsets@Base 0
+ xcb_xv_query_image_attributes_offsets_end@Base 0
+ xcb_xv_query_image_attributes_offsets_length@Base 0
+ xcb_xv_query_image_attributes_pitches@Base 0
+ xcb_xv_query_image_attributes_pitches_end@Base 0
+ xcb_xv_query_image_attributes_pitches_length@Base 0
+ xcb_xv_query_image_attributes_reply@Base 0
+ xcb_xv_query_image_attributes_unchecked@Base 0
+ xcb_xv_query_port_attributes@Base 0
+ xcb_xv_query_port_attributes_attributes_iterator@Base 0
+ xcb_xv_query_port_attributes_attributes_length@Base 0
+ xcb_xv_query_port_attributes_reply@Base 0
+ xcb_xv_query_port_attributes_unchecked@Base 0
+ xcb_xv_rational_end@Base 0
+ xcb_xv_rational_next@Base 0
+ xcb_xv_select_port_notify@Base 0
+ xcb_xv_select_port_notify_checked@Base 0
+ xcb_xv_select_video_notify@Base 0
+ xcb_xv_select_video_notify_checked@Base 0
+ xcb_xv_set_port_attribute@Base 0
+ xcb_xv_set_port_attribute_checked@Base 0
+ xcb_xv_shm_put_image@Base 0
+ xcb_xv_shm_put_image_checked@Base 0
+ xcb_xv_stop_video@Base 0
+ xcb_xv_stop_video_checked@Base 0
+ xcb_xv_ungrab_port@Base 0
+ xcb_xv_ungrab_port_checked@Base 0
--- /dev/null
+usr/include/xcb/xvmc.h
+usr/lib/libxcb-xvmc.a
+usr/lib/libxcb-xvmc.so
+usr/lib/libxcb-xvmc.la
+usr/lib/pkgconfig/xcb-xvmc.pc
--- /dev/null
+usr/lib/libxcb-xvmc.so.0*
--- /dev/null
+libxcb-xvmc.so.0 libxcb-xvmc0 #MINVER#
+ xcb_xvmc_context_end@Base 0
+ xcb_xvmc_context_next@Base 0
+ xcb_xvmc_create_context@Base 0
+ xcb_xvmc_create_context_priv_data@Base 0
+ xcb_xvmc_create_context_priv_data_end@Base 0
+ xcb_xvmc_create_context_priv_data_length@Base 0
+ xcb_xvmc_create_context_reply@Base 0
+ xcb_xvmc_create_context_unchecked@Base 0
+ xcb_xvmc_create_subpicture@Base 0
+ xcb_xvmc_create_subpicture_priv_data@Base 0
+ xcb_xvmc_create_subpicture_priv_data_end@Base 0
+ xcb_xvmc_create_subpicture_priv_data_length@Base 0
+ xcb_xvmc_create_subpicture_reply@Base 0
+ xcb_xvmc_create_subpicture_unchecked@Base 0
+ xcb_xvmc_create_surface@Base 0
+ xcb_xvmc_create_surface_priv_data@Base 0
+ xcb_xvmc_create_surface_priv_data_end@Base 0
+ xcb_xvmc_create_surface_priv_data_length@Base 0
+ xcb_xvmc_create_surface_reply@Base 0
+ xcb_xvmc_create_surface_unchecked@Base 0
+ xcb_xvmc_destroy_context@Base 0
+ xcb_xvmc_destroy_context_checked@Base 0
+ xcb_xvmc_destroy_subpicture@Base 0
+ xcb_xvmc_destroy_subpicture_checked@Base 0
+ xcb_xvmc_destroy_surface@Base 0
+ xcb_xvmc_destroy_surface_checked@Base 0
+ xcb_xvmc_id@Base 0
+ xcb_xvmc_list_subpicture_types@Base 0
+ xcb_xvmc_list_subpicture_types_reply@Base 0
+ xcb_xvmc_list_subpicture_types_types@Base 0
+ xcb_xvmc_list_subpicture_types_types_iterator@Base 0
+ xcb_xvmc_list_subpicture_types_types_length@Base 0
+ xcb_xvmc_list_subpicture_types_unchecked@Base 0
+ xcb_xvmc_list_surface_types@Base 0
+ xcb_xvmc_list_surface_types_reply@Base 0
+ xcb_xvmc_list_surface_types_surfaces@Base 0
+ xcb_xvmc_list_surface_types_surfaces_iterator@Base 0
+ xcb_xvmc_list_surface_types_surfaces_length@Base 0
+ xcb_xvmc_list_surface_types_unchecked@Base 0
+ xcb_xvmc_query_version@Base 0
+ xcb_xvmc_query_version_reply@Base 0
+ xcb_xvmc_query_version_unchecked@Base 0
+ xcb_xvmc_subpicture_end@Base 0
+ xcb_xvmc_subpicture_next@Base 0
+ xcb_xvmc_surface_end@Base 0
+ xcb_xvmc_surface_info_end@Base 0
+ xcb_xvmc_surface_info_next@Base 0
+ xcb_xvmc_surface_next@Base 0
--- /dev/null
+usr/include/xcb/bigreq.h
+usr/include/xcb/xc_misc.h
+usr/include/xcb/xcb.h
+usr/include/xcb/xcbext.h
+usr/include/xcb/xproto.h
+usr/lib/libxcb.a
+usr/lib/libxcb.so
+usr/lib/libxcb.la
+usr/lib/pkgconfig/xcb.pc
+usr/include/xcb/xinput.h
+usr/include/xcb/xselinux.h
--- /dev/null
+usr/lib/libxcb.so.1*
--- /dev/null
+usr/lib/libxcb.so.1*
--- /dev/null
+libxcb.so.1 libxcb1 #MINVER#
+ xcb_alloc_color@Base 0
+ xcb_alloc_color_cells@Base 0
+ xcb_alloc_color_cells_masks@Base 0
+ xcb_alloc_color_cells_masks_end@Base 0
+ xcb_alloc_color_cells_masks_length@Base 0
+ xcb_alloc_color_cells_pixels@Base 0
+ xcb_alloc_color_cells_pixels_end@Base 0
+ xcb_alloc_color_cells_pixels_length@Base 0
+ xcb_alloc_color_cells_reply@Base 0
+ xcb_alloc_color_cells_unchecked@Base 0
+ xcb_alloc_color_planes@Base 0
+ xcb_alloc_color_planes_pixels@Base 0
+ xcb_alloc_color_planes_pixels_end@Base 0
+ xcb_alloc_color_planes_pixels_length@Base 0
+ xcb_alloc_color_planes_reply@Base 0
+ xcb_alloc_color_planes_unchecked@Base 0
+ xcb_alloc_color_reply@Base 0
+ xcb_alloc_color_unchecked@Base 0
+ xcb_alloc_named_color@Base 0
+ xcb_alloc_named_color_reply@Base 0
+ xcb_alloc_named_color_unchecked@Base 0
+ xcb_allow_events@Base 0
+ xcb_allow_events_checked@Base 0
+ xcb_arc_end@Base 0
+ xcb_arc_next@Base 0
+ xcb_atom_end@Base 0
+ xcb_atom_next@Base 0
+ xcb_bell@Base 0
+ xcb_bell_checked@Base 0
+ xcb_big_requests_enable@Base 0
+ xcb_big_requests_enable_reply@Base 0
+ xcb_big_requests_enable_unchecked@Base 0
+ xcb_big_requests_id@Base 0
+ xcb_button_end@Base 0
+ xcb_button_next@Base 0
+ xcb_change_active_pointer_grab@Base 0
+ xcb_change_active_pointer_grab_checked@Base 0
+ xcb_change_gc@Base 0
+ xcb_change_gc_checked@Base 0
+ xcb_change_hosts@Base 0
+ xcb_change_hosts_checked@Base 0
+ xcb_change_keyboard_control@Base 0
+ xcb_change_keyboard_control_checked@Base 0
+ xcb_change_keyboard_mapping@Base 0
+ xcb_change_keyboard_mapping_checked@Base 0
+ xcb_change_pointer_control@Base 0
+ xcb_change_pointer_control_checked@Base 0
+ xcb_change_property@Base 0
+ xcb_change_property_checked@Base 0
+ xcb_change_save_set@Base 0
+ xcb_change_save_set_checked@Base 0
+ xcb_change_window_attributes@Base 0
+ xcb_change_window_attributes_checked@Base 0
+ xcb_char2b_end@Base 0
+ xcb_char2b_next@Base 0
+ xcb_charinfo_end@Base 0
+ xcb_charinfo_next@Base 0
+ xcb_circulate_window@Base 0
+ xcb_circulate_window_checked@Base 0
+ xcb_clear_area@Base 0
+ xcb_clear_area_checked@Base 0
+ xcb_client_message_data_end@Base 0
+ xcb_client_message_data_next@Base 0
+ xcb_close_font@Base 0
+ xcb_close_font_checked@Base 0
+ xcb_coloritem_end@Base 0
+ xcb_coloritem_next@Base 0
+ xcb_colormap_end@Base 0
+ xcb_colormap_next@Base 0
+ xcb_configure_window@Base 0
+ xcb_configure_window_checked@Base 0
+ xcb_connect@Base 0
+ xcb_connect_to_display_with_auth_info@Base 0
+ xcb_connect_to_fd@Base 0
+ xcb_connection_has_error@Base 0
+ xcb_convert_selection@Base 0
+ xcb_convert_selection_checked@Base 0
+ xcb_copy_area@Base 0
+ xcb_copy_area_checked@Base 0
+ xcb_copy_colormap_and_free@Base 0
+ xcb_copy_colormap_and_free_checked@Base 0
+ xcb_copy_gc@Base 0
+ xcb_copy_gc_checked@Base 0
+ xcb_copy_plane@Base 0
+ xcb_copy_plane_checked@Base 0
+ xcb_create_colormap@Base 0
+ xcb_create_colormap_checked@Base 0
+ xcb_create_cursor@Base 0
+ xcb_create_cursor_checked@Base 0
+ xcb_create_gc@Base 0
+ xcb_create_gc_checked@Base 0
+ xcb_create_glyph_cursor@Base 0
+ xcb_create_glyph_cursor_checked@Base 0
+ xcb_create_pixmap@Base 0
+ xcb_create_pixmap_checked@Base 0
+ xcb_create_window@Base 0
+ xcb_create_window_checked@Base 0
+ xcb_cursor_end@Base 0
+ xcb_cursor_next@Base 0
+ xcb_delete_property@Base 0
+ xcb_delete_property_checked@Base 0
+ xcb_depth_end@Base 0
+ xcb_depth_next@Base 0
+ xcb_depth_visuals@Base 0
+ xcb_depth_visuals_iterator@Base 0
+ xcb_depth_visuals_length@Base 0
+ xcb_destroy_subwindows@Base 0
+ xcb_destroy_subwindows_checked@Base 0
+ xcb_destroy_window@Base 0
+ xcb_destroy_window_checked@Base 0
+ xcb_discard_reply@Base 1.6
+ xcb_disconnect@Base 0
+ xcb_drawable_end@Base 0
+ xcb_drawable_next@Base 0
+ xcb_fill_poly@Base 0
+ xcb_fill_poly_checked@Base 0
+ xcb_flush@Base 0
+ xcb_font_end@Base 0
+ xcb_font_next@Base 0
+ xcb_fontable_end@Base 0
+ xcb_fontable_next@Base 0
+ xcb_fontprop_end@Base 0
+ xcb_fontprop_next@Base 0
+ xcb_force_screen_saver@Base 0
+ xcb_force_screen_saver_checked@Base 0
+ xcb_format_end@Base 0
+ xcb_format_next@Base 0
+ xcb_free_colormap@Base 0
+ xcb_free_colormap_checked@Base 0
+ xcb_free_colors@Base 0
+ xcb_free_colors_checked@Base 0
+ xcb_free_cursor@Base 0
+ xcb_free_cursor_checked@Base 0
+ xcb_free_gc@Base 0
+ xcb_free_gc_checked@Base 0
+ xcb_free_pixmap@Base 0
+ xcb_free_pixmap_checked@Base 0
+ xcb_gcontext_end@Base 0
+ xcb_gcontext_next@Base 0
+ xcb_generate_id@Base 0
+ xcb_get_atom_name@Base 0
+ xcb_get_atom_name_name@Base 0
+ xcb_get_atom_name_name_end@Base 0
+ xcb_get_atom_name_name_length@Base 0
+ xcb_get_atom_name_reply@Base 0
+ xcb_get_atom_name_unchecked@Base 0
+ xcb_get_extension_data@Base 0
+ xcb_get_file_descriptor@Base 0
+ xcb_get_font_path@Base 0
+ xcb_get_font_path_path_iterator@Base 0
+ xcb_get_font_path_path_length@Base 0
+ xcb_get_font_path_reply@Base 0
+ xcb_get_font_path_unchecked@Base 0
+ xcb_get_geometry@Base 0
+ xcb_get_geometry_reply@Base 0
+ xcb_get_geometry_unchecked@Base 0
+ xcb_get_image@Base 0
+ xcb_get_image_data@Base 0
+ xcb_get_image_data_end@Base 0
+ xcb_get_image_data_length@Base 0
+ xcb_get_image_reply@Base 0
+ xcb_get_image_unchecked@Base 0
+ xcb_get_input_focus@Base 0
+ xcb_get_input_focus_reply@Base 0
+ xcb_get_input_focus_unchecked@Base 0
+ xcb_get_keyboard_control@Base 0
+ xcb_get_keyboard_control_reply@Base 0
+ xcb_get_keyboard_control_unchecked@Base 0
+ xcb_get_keyboard_mapping@Base 0
+ xcb_get_keyboard_mapping_keysyms@Base 0
+ xcb_get_keyboard_mapping_keysyms_end@Base 1.2
+ xcb_get_keyboard_mapping_keysyms_length@Base 0
+ xcb_get_keyboard_mapping_reply@Base 0
+ xcb_get_keyboard_mapping_unchecked@Base 0
+ xcb_get_maximum_request_length@Base 0
+ xcb_get_modifier_mapping@Base 0
+ xcb_get_modifier_mapping_keycodes@Base 0
+ xcb_get_modifier_mapping_keycodes_end@Base 1.2
+ xcb_get_modifier_mapping_keycodes_length@Base 0
+ xcb_get_modifier_mapping_reply@Base 0
+ xcb_get_modifier_mapping_unchecked@Base 0
+ xcb_get_motion_events@Base 0
+ xcb_get_motion_events_events@Base 0
+ xcb_get_motion_events_events_iterator@Base 0
+ xcb_get_motion_events_events_length@Base 0
+ xcb_get_motion_events_reply@Base 0
+ xcb_get_motion_events_unchecked@Base 0
+ xcb_get_pointer_control@Base 0
+ xcb_get_pointer_control_reply@Base 0
+ xcb_get_pointer_control_unchecked@Base 0
+ xcb_get_pointer_mapping@Base 0
+ xcb_get_pointer_mapping_map@Base 0
+ xcb_get_pointer_mapping_map_end@Base 0
+ xcb_get_pointer_mapping_map_length@Base 0
+ xcb_get_pointer_mapping_reply@Base 0
+ xcb_get_pointer_mapping_unchecked@Base 0
+ xcb_get_property@Base 0
+ xcb_get_property_reply@Base 0
+ xcb_get_property_unchecked@Base 0
+ xcb_get_property_value@Base 0
+ xcb_get_property_value_end@Base 0
+ xcb_get_property_value_length@Base 0
+ xcb_get_screen_saver@Base 0
+ xcb_get_screen_saver_reply@Base 0
+ xcb_get_screen_saver_unchecked@Base 0
+ xcb_get_selection_owner@Base 0
+ xcb_get_selection_owner_reply@Base 0
+ xcb_get_selection_owner_unchecked@Base 0
+ xcb_get_setup@Base 0
+ xcb_get_window_attributes@Base 0
+ xcb_get_window_attributes_reply@Base 0
+ xcb_get_window_attributes_unchecked@Base 0
+ xcb_grab_button@Base 0
+ xcb_grab_button_checked@Base 0
+ xcb_grab_key@Base 0
+ xcb_grab_key_checked@Base 0
+ xcb_grab_keyboard@Base 0
+ xcb_grab_keyboard_reply@Base 0
+ xcb_grab_keyboard_unchecked@Base 0
+ xcb_grab_pointer@Base 0
+ xcb_grab_pointer_reply@Base 0
+ xcb_grab_pointer_unchecked@Base 0
+ xcb_grab_server@Base 0
+ xcb_grab_server_checked@Base 0
+ xcb_host_address@Base 0
+ xcb_host_address_end@Base 0
+ xcb_host_address_length@Base 0
+ xcb_host_end@Base 0
+ xcb_host_next@Base 0
+ xcb_image_text_16@Base 0
+ xcb_image_text_16_checked@Base 0
+ xcb_image_text_8@Base 0
+ xcb_image_text_8_checked@Base 0
+ xcb_install_colormap@Base 0
+ xcb_install_colormap_checked@Base 0
+ xcb_intern_atom@Base 0
+ xcb_intern_atom_reply@Base 0
+ xcb_intern_atom_unchecked@Base 0
+ xcb_keycode_end@Base 0
+ xcb_keycode_next@Base 0
+ xcb_keysym_end@Base 0
+ xcb_keysym_next@Base 0
+ xcb_kill_client@Base 0
+ xcb_kill_client_checked@Base 0
+ xcb_list_extensions@Base 0
+ xcb_list_extensions_names_iterator@Base 0
+ xcb_list_extensions_names_length@Base 0
+ xcb_list_extensions_reply@Base 0
+ xcb_list_extensions_unchecked@Base 0
+ xcb_list_fonts@Base 0
+ xcb_list_fonts_names_iterator@Base 0
+ xcb_list_fonts_names_length@Base 0
+ xcb_list_fonts_reply@Base 0
+ xcb_list_fonts_unchecked@Base 0
+ xcb_list_fonts_with_info@Base 0
+ xcb_list_fonts_with_info_name@Base 0
+ xcb_list_fonts_with_info_name_end@Base 0
+ xcb_list_fonts_with_info_name_length@Base 0
+ xcb_list_fonts_with_info_properties@Base 0
+ xcb_list_fonts_with_info_properties_iterator@Base 0
+ xcb_list_fonts_with_info_properties_length@Base 0
+ xcb_list_fonts_with_info_reply@Base 0
+ xcb_list_fonts_with_info_unchecked@Base 0
+ xcb_list_hosts@Base 0
+ xcb_list_hosts_hosts_iterator@Base 0
+ xcb_list_hosts_hosts_length@Base 0
+ xcb_list_hosts_reply@Base 0
+ xcb_list_hosts_unchecked@Base 0
+ xcb_list_installed_colormaps@Base 0
+ xcb_list_installed_colormaps_cmaps@Base 0
+ xcb_list_installed_colormaps_cmaps_end@Base 1.2
+ xcb_list_installed_colormaps_cmaps_length@Base 0
+ xcb_list_installed_colormaps_reply@Base 0
+ xcb_list_installed_colormaps_unchecked@Base 0
+ xcb_list_properties@Base 0
+ xcb_list_properties_atoms@Base 0
+ xcb_list_properties_atoms_end@Base 1.2
+ xcb_list_properties_atoms_length@Base 0
+ xcb_list_properties_reply@Base 0
+ xcb_list_properties_unchecked@Base 0
+ xcb_lookup_color@Base 0
+ xcb_lookup_color_reply@Base 0
+ xcb_lookup_color_unchecked@Base 0
+ xcb_map_subwindows@Base 0
+ xcb_map_subwindows_checked@Base 0
+ xcb_map_window@Base 0
+ xcb_map_window_checked@Base 0
+ xcb_no_operation@Base 0
+ xcb_no_operation_checked@Base 0
+ xcb_open_font@Base 0
+ xcb_open_font_checked@Base 0
+ xcb_parse_display@Base 0
+ xcb_pixmap_end@Base 0
+ xcb_pixmap_next@Base 0
+ xcb_point_end@Base 0
+ xcb_point_next@Base 0
+ xcb_poll_for_event@Base 0
+ xcb_poll_for_reply@Base 0
+ xcb_poly_arc@Base 0
+ xcb_poly_arc_checked@Base 0
+ xcb_poly_fill_arc@Base 0
+ xcb_poly_fill_arc_checked@Base 0
+ xcb_poly_fill_rectangle@Base 0
+ xcb_poly_fill_rectangle_checked@Base 0
+ xcb_poly_line@Base 0
+ xcb_poly_line_checked@Base 0
+ xcb_poly_point@Base 0
+ xcb_poly_point_checked@Base 0
+ xcb_poly_rectangle@Base 0
+ xcb_poly_rectangle_checked@Base 0
+ xcb_poly_segment@Base 0
+ xcb_poly_segment_checked@Base 0
+ xcb_poly_text_16@Base 0
+ xcb_poly_text_16_checked@Base 0
+ xcb_poly_text_8@Base 0
+ xcb_poly_text_8_checked@Base 0
+ xcb_popcount@Base 0
+ xcb_prefetch_extension_data@Base 0
+ xcb_prefetch_maximum_request_length@Base 0
+ xcb_put_image@Base 0
+ xcb_put_image_checked@Base 0
+ xcb_query_best_size@Base 0
+ xcb_query_best_size_reply@Base 0
+ xcb_query_best_size_unchecked@Base 0
+ xcb_query_colors@Base 0
+ xcb_query_colors_colors@Base 0
+ xcb_query_colors_colors_iterator@Base 0
+ xcb_query_colors_colors_length@Base 0
+ xcb_query_colors_reply@Base 0
+ xcb_query_colors_unchecked@Base 0
+ xcb_query_extension@Base 0
+ xcb_query_extension_reply@Base 0
+ xcb_query_extension_unchecked@Base 0
+ xcb_query_font@Base 0
+ xcb_query_font_char_infos@Base 0
+ xcb_query_font_char_infos_iterator@Base 0
+ xcb_query_font_char_infos_length@Base 0
+ xcb_query_font_properties@Base 0
+ xcb_query_font_properties_iterator@Base 0
+ xcb_query_font_properties_length@Base 0
+ xcb_query_font_reply@Base 0
+ xcb_query_font_unchecked@Base 0
+ xcb_query_keymap@Base 0
+ xcb_query_keymap_reply@Base 0
+ xcb_query_keymap_unchecked@Base 0
+ xcb_query_pointer@Base 0
+ xcb_query_pointer_reply@Base 0
+ xcb_query_pointer_unchecked@Base 0
+ xcb_query_text_extents@Base 0
+ xcb_query_text_extents_reply@Base 0
+ xcb_query_text_extents_unchecked@Base 0
+ xcb_query_tree@Base 0
+ xcb_query_tree_children@Base 0
+ xcb_query_tree_children_end@Base 1.2
+ xcb_query_tree_children_length@Base 0
+ xcb_query_tree_reply@Base 0
+ xcb_query_tree_unchecked@Base 0
+ xcb_recolor_cursor@Base 0
+ xcb_recolor_cursor_checked@Base 0
+ xcb_rectangle_end@Base 0
+ xcb_rectangle_next@Base 0
+ xcb_reparent_window@Base 0
+ xcb_reparent_window_checked@Base 0
+ xcb_request_check@Base 0
+ xcb_rgb_end@Base 0
+ xcb_rgb_next@Base 0
+ xcb_rotate_properties@Base 0
+ xcb_rotate_properties_checked@Base 0
+ xcb_screen_allowed_depths_iterator@Base 0
+ xcb_screen_allowed_depths_length@Base 0
+ xcb_screen_end@Base 0
+ xcb_screen_next@Base 0
+ xcb_segment_end@Base 0
+ xcb_segment_next@Base 0
+ xcb_send_event@Base 0
+ xcb_send_event_checked@Base 0
+ xcb_send_request@Base 0
+ xcb_set_access_control@Base 0
+ xcb_set_access_control_checked@Base 0
+ xcb_set_clip_rectangles@Base 0
+ xcb_set_clip_rectangles_checked@Base 0
+ xcb_set_close_down_mode@Base 0
+ xcb_set_close_down_mode_checked@Base 0
+ xcb_set_dashes@Base 0
+ xcb_set_dashes_checked@Base 0
+ xcb_set_font_path@Base 0
+ xcb_set_font_path_checked@Base 0
+ xcb_set_input_focus@Base 0
+ xcb_set_input_focus_checked@Base 0
+ xcb_set_modifier_mapping@Base 0
+ xcb_set_modifier_mapping_reply@Base 0
+ xcb_set_modifier_mapping_unchecked@Base 0
+ xcb_set_pointer_mapping@Base 0
+ xcb_set_pointer_mapping_reply@Base 0
+ xcb_set_pointer_mapping_unchecked@Base 0
+ xcb_set_screen_saver@Base 0
+ xcb_set_screen_saver_checked@Base 0
+ xcb_set_selection_owner@Base 0
+ xcb_set_selection_owner_checked@Base 0
+ xcb_setup_authenticate_end@Base 0
+ xcb_setup_authenticate_next@Base 0
+ xcb_setup_authenticate_reason@Base 0
+ xcb_setup_authenticate_reason_end@Base 0
+ xcb_setup_authenticate_reason_length@Base 0
+ xcb_setup_end@Base 0
+ xcb_setup_failed_end@Base 0
+ xcb_setup_failed_next@Base 0
+ xcb_setup_failed_reason@Base 0
+ xcb_setup_failed_reason_end@Base 0
+ xcb_setup_failed_reason_length@Base 0
+ xcb_setup_next@Base 0
+ xcb_setup_pixmap_formats@Base 0
+ xcb_setup_pixmap_formats_iterator@Base 0
+ xcb_setup_pixmap_formats_length@Base 0
+ xcb_setup_request_authorization_protocol_data@Base 0
+ xcb_setup_request_authorization_protocol_data_end@Base 0
+ xcb_setup_request_authorization_protocol_data_length@Base 0
+ xcb_setup_request_authorization_protocol_name@Base 0
+ xcb_setup_request_authorization_protocol_name_end@Base 0
+ xcb_setup_request_authorization_protocol_name_length@Base 0
+ xcb_setup_request_end@Base 0
+ xcb_setup_request_next@Base 0
+ xcb_setup_roots_iterator@Base 0
+ xcb_setup_roots_length@Base 0
+ xcb_setup_vendor@Base 0
+ xcb_setup_vendor_end@Base 0
+ xcb_setup_vendor_length@Base 0
+ xcb_store_colors@Base 0
+ xcb_store_colors_checked@Base 0
+ xcb_store_named_color@Base 0
+ xcb_store_named_color_checked@Base 0
+ xcb_str_end@Base 0
+ xcb_str_name@Base 0
+ xcb_str_name_end@Base 0
+ xcb_str_name_length@Base 0
+ xcb_str_next@Base 0
+ xcb_take_socket@Base 1.2
+ xcb_timecoord_end@Base 0
+ xcb_timecoord_next@Base 0
+ xcb_timestamp_end@Base 0
+ xcb_timestamp_next@Base 0
+ xcb_translate_coordinates@Base 0
+ xcb_translate_coordinates_reply@Base 0
+ xcb_translate_coordinates_unchecked@Base 0
+ xcb_ungrab_button@Base 0
+ xcb_ungrab_button_checked@Base 0
+ xcb_ungrab_key@Base 0
+ xcb_ungrab_key_checked@Base 0
+ xcb_ungrab_keyboard@Base 0
+ xcb_ungrab_keyboard_checked@Base 0
+ xcb_ungrab_pointer@Base 0
+ xcb_ungrab_pointer_checked@Base 0
+ xcb_ungrab_server@Base 0
+ xcb_ungrab_server_checked@Base 0
+ xcb_uninstall_colormap@Base 0
+ xcb_uninstall_colormap_checked@Base 0
+ xcb_unmap_subwindows@Base 0
+ xcb_unmap_subwindows_checked@Base 0
+ xcb_unmap_window@Base 0
+ xcb_unmap_window_checked@Base 0
+ xcb_visualid_end@Base 0
+ xcb_visualid_next@Base 0
+ xcb_visualtype_end@Base 0
+ xcb_visualtype_next@Base 0
+ xcb_wait_for_event@Base 0
+ xcb_wait_for_reply@Base 0
+ xcb_warp_pointer@Base 0
+ xcb_warp_pointer_checked@Base 0
+ xcb_window_end@Base 0
+ xcb_window_next@Base 0
+ xcb_writev@Base 1.2
+ xcb_xc_misc_get_version@Base 0
+ xcb_xc_misc_get_version_reply@Base 0
+ xcb_xc_misc_get_version_unchecked@Base 0
+ xcb_xc_misc_get_xid_list@Base 0
+ xcb_xc_misc_get_xid_list_ids@Base 0
+ xcb_xc_misc_get_xid_list_ids_end@Base 0
+ xcb_xc_misc_get_xid_list_ids_length@Base 0
+ xcb_xc_misc_get_xid_list_reply@Base 0
+ xcb_xc_misc_get_xid_list_unchecked@Base 0
+ xcb_xc_misc_get_xid_range@Base 0
+ xcb_xc_misc_get_xid_range_reply@Base 0
+ xcb_xc_misc_get_xid_range_unchecked@Base 0
+ xcb_xc_misc_id@Base 0
--- /dev/null
+#!/usr/bin/make -f
+
+CFLAGS = -g
+CFLAGS += -D_F_ENABLE_XI2_SENDEVENT_
+
+LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+# XXX make check fails with -j, so disable for now
+#ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+# NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+# MAKEFLAGS += -j$(NUMJOBS)
+#endif
+
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)
+
+confflags = --build=$(DEB_HOST_GNU_TYPE)
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ confflags += --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+configure:
+ autoreconf -vfi
+
+$(DEB_BUILDDIR)/config.status: configure
+ mkdir -p $(DEB_BUILDDIR)
+ cd $(DEB_BUILDDIR) && \
+ ../configure \
+ $(confflags) \
+ --prefix=/usr \
+ --disable-build-docs \
+ CFLAGS="$(CFLAGS)" \
+ LDFLAGS="$(LDFLAGS)"
+
+override_dh_auto_configure: $(DEB_BUILDDIR)/config.status
+
+check:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ $(MAKE) -C $(DEB_BUILDDIR) check
+endif
+
+override_dh_auto_test: check
+
+.PHONY: build
+build: build-stamp
+build-stamp: $(DEB_BUILDDIR)/config.status
+ dh_testdir
+
+ $(MAKE) -C $(DEB_BUILDDIR) || exit 1
+ >$@
+
+override_dh_auto_build: build-stamp
+
+.PHONY: install
+install: build-stamp
+ $(MAKE) -C $(DEB_BUILDDIR) install DESTDIR=$(CURDIR)/debian/tmp
+
+override_dh_auto_install: install
+
+override_dh_strip:
+ set -e; \
+ for pkg in $$(grep-dctrl -n -F Section libs -s Package < debian/control); do \
+ dh_strip -p $$pkg --dbg-package=$${pkg}-dbg; \
+ done
+ dh_strip -s --remaining-packages
+
+override_dh_makeshlibs:
+# dh_makeshlibs -plibxcb1 --add-udeb=libxcb1-udeb -- -c4
+# dh_makeshlibs -Nlibxcb1 -- -c4
+ dh_makeshlibs -- -c4
+.PHONY: binary binary-arch binary-indep
+binary: binary-arch
+binary-arch: debian/copyright build install
+ dh_testdir
+ dh_testroot
+
+ dh_install --sourcedir=debian/tmp --list-missing
+# dh_installchangelogs ChangeLog
+ dh_makeshlibs
+ dh_link
+ dh_strip
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ #dh_md5sums
+ dh_builddeb
+
+binary-indep: build install
+
+debian/copyright: debian/copyright.debian COPYING
+ cat $+ > $@
+
+clean:
+ dh_testdir
+ dh_testroot
+
+ -rm -f debian/copyright
+ rm -f aclocal.m4 configure install-sh missing
+ rm -f config.guess config.sub depcomp ltmain.sh src/config.h.in
+ rm -f $$(find -name Makefile.in)
+ rm -rf $(DEB_BUILDDIR)
+ rm -f build-stamp
+
+ dh_clean
--- /dev/null
+version=3
+http://xcb.freedesktop.org/dist/libxcb-([0-9].*)\.tar\.gz
--- /dev/null
+
+EXTRA_DIST = \
+tutorial/index.html \
+tutorial/xcb.css \
+xcb.doxygen.in
+
+docdirs = $(srcdir)/tutorial
+
+if BUILD_DOCS
+
+docdirs += manual
+
+# rule to build documentation and copy necessary files
+manual:
+ doxygen xcb.doxygen
+
+# rules to clean
+clean-local:
+ rm -rf manual/
+
+endif
+
+all-local: $(docdirs)
+
+# rule to install the html documentation and tutorial in $(htmldir)
+install-data-local:
+ @if ! test -d "$(DESTDIR)$(htmldir)"; then \
+ echo "$(mkinstalldirs) '$(DESTDIR)$(htmldir)'"; \
+ $(mkinstalldirs) '$(DESTDIR)$(htmldir)'; \
+ fi
+ @for d in $(docdirs); do \
+ echo "cp -pR $$d '$(DESTDIR)$(htmldir)/'"; \
+ cp -pR $$d '$(DESTDIR)$(htmldir)/'; \
+ done
+
+uninstall-local:
+ @for d in $(docdirs); do \
+ d=`basename $$d`; \
+ echo "test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }"; \
+ test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }; \
+ done
+ rmdir "$(DESTDIR)$(htmldir)/" || true
--- /dev/null
+<!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+
+<head>
+ <title>Basic Graphics Programming With The XCB Library</title>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+ <link href="xcb.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+ <div class="title">
+ Basic Graphics Programming With The XCB Library
+ </div>
+ <div class="toc">
+ <ol>
+ <li><a class="section" href="#intro">Introduction</a>
+ <li><a class="section" href="#Xmodel">The client and server model of the X window system</a>
+ <li><a class="section" href="#asynch">GUI programming: the asynchronous model</a>
+ <li><a class="section" href="#notions">Basic XCB notions</a>
+ <ol>
+ <li><a class="subsection" href="#conn">The X Connection</a>
+ <li><a class="subsection" href="#requestsreplies">Requests and replies: the Xlib killers</a>
+ <li><a class="subsection" href="#gc">The Graphics Context</a>
+ <li>Object handles
+ <li>Memory allocation for XCB structures
+ <li><a class="subsection" href="#events">Events</a>
+ </ol>
+ <li><a class="section" href="#use">Using XCB-based programs</a>
+ <ol>
+ <li><a class="subsection" href="#inst">Installation of XCB</a>
+ <li><a class="subsection" href="#comp">Compiling XCB-based programs</a>
+ </ol>
+ <li><a class="section" href="#openconn">Opening and closing the connection to an X server</a>
+ <li><a class="section" href="#screen">Checking basic information about a connection</a>
+ <li><a class="section" href="#helloworld">Creating a basic window - the "hello world" program</a>
+ <li><a class="section" href="#drawing">Drawing in a window</a>
+ <ol>
+ <li><a class="subsection" href="#allocgc">Allocating a Graphics Context</a>
+ <li><a class="subsection" href="#changegc">Changing the attributes of a Graphics Context</a>
+ <li><a class="subsection" href="#drawingprim">Drawing primitives: point, line, box, circle,...</a>
+ </ol>
+ <li><a class="section" href="#xevents">X Events</a>
+ <ol>
+ <li><a class="subsection" href="#register">Registering for event types using event masks</a>
+ <li><a class="subsection" href="#loop">Receiving events: writing the events loop</a>
+ <li><a class="subsection" href="#expose">Expose events</a>
+ <li><a class="subsection" href="#userinput">Getting user input</a>
+ <ol>
+ <li><a class="subsubsection" href="#mousepressrelease">Mouse button press and release events</a>
+ <li><a class="subsubsection" href="#mousemvnt">Mouse movement events</a>
+ <li><a class="subsubsection" href="#mouseenter">Mouse pointer enter and leave events</a>
+ <li><a class="subsubsection" href="#focus">The keyboard focus</a>
+ <li><a class="subsubsection" href="#keypress">Keyboard press and release events</a>
+ </ol>
+ <li><a class="subsection" href="#eventex">X events: a complete example</a>
+ </ol>
+ <li><a class="section" href="#font">Handling text and fonts</a>
+ <ol>
+ <li><a class="subsection" href="#fontstruct">The Font structure</a>
+ <li><a class="subsection" href="#openingfont">Opening a Font</a>
+ <li><a class="subsection" href="#assigningfont">Assigning a Font to a Graphic Context</a>
+ <li><a class="subsection" href="#drawingtext">Drawing text in a drawable</a>
+ <li><a class="subsection" href="#fontcompleteexample">Complete example</a>
+ </ol>
+ <li>Windows hierarchy
+ <ol>
+ <li>Root, parent and child windows
+ <li>Events propagation
+ </ol>
+ <li><a class="section" href="#wm">Interacting with the window manager</a>
+ <ol>
+ <li><a class="subsection" href="#wmprop">Window properties</a>
+ <li><a class="subsection" href="#wmname">Setting the window name and icon name</a>
+ <li>Setting preferred window size(s)
+ <li>Setting miscellaneous window manager hints
+ <li>Setting an application's icon
+ <li>Obeying the delete-window protocol
+ </ol>
+ <li><a class="section" href="#winop">Simple window operations</a>
+ <ol>
+ <li><a class="subsection" href="#winmap">Mapping and unmapping a window</a>
+ <li><a class="subsection" href="#winconf">Configuring a window</a>
+ <li><a class="subsection" href="#winmove">Moving a window around the screen</a>
+ <li><a class="subsection" href="#winsize">Resizing a window</a>
+ <li><a class="subsection" href="#winstack">Changing windows stacking order: raise and lower</a>
+ <li>Iconifying and de-iconifying a window
+ <li><a class="subsection" href="#wingetinfo">Getting informations about a window</a>
+ </ol>
+ <li><a class="section" href="#usecolor">Using colors to paint the rainbow</a>
+ <ol>
+ <li><a class="subsection" href="#colormap">Color maps</a>
+ <li><a class="subsection" href="#colormapalloc">Allocating and freeing Color Maps</a>
+ <li><a class="subsection" href="#alloccolor">Allocating and freeing a color entry</a>
+ <li>Drawing with a color
+ </ol>
+ <li><a class="section" href="#pixmaps">X Bitmaps and Pixmaps</a>
+ <ol>
+ <li><a class="subsection" href="#pixmapswhat">What is a X Bitmap ? An X Pixmap ?</a>
+ <li>Loading a bitmap from a file
+ <li>Drawing a bitmap in a window
+ <li><a class="subsection" href="#pixmapscreate">Creating a pixmap</a>
+ <li><a class="subsection" href="#pixmapsdraw">Drawing a pixmap in a window</a>
+ <li><a class="subsection" href="#pixmapsfree">Freeing a pixmap</a>
+ </ol>
+ <li><a class="subsection" href="#mousecursor">Messing with the mouse cursor</a>
+ <ol>
+ <li><a class="subsection" href="#mousecursorcreate">Creating and destroying a mouse cursor</a>
+ <li><a class="subsection" href="#mousecursorset">Setting a window's mouse cursor</a>
+ <li><a class="subsection" href="#mousecursorexample">Complete example</a>
+ </ol>
+ <li><a class="subsection" href="#translation">Translation of basic Xlib functions and macros</a>
+ <ol>
+ <li><a class="subsection" href="#displaystructure">Members of the Display structure</a>
+ <ol>
+ <li><a class="subsection" href="#ConnectionNumber">ConnectionNumber</a>
+ <li><a class="subsection" href="#DefaultScreen">DefaultScreen</a>
+ <li><a class="subsection" href="#QLength">QLength</a>
+ <li><a class="subsection" href="#ScreenCount">ScreenCount</a>
+ <li><a class="subsection" href="#ServerVendor">ServerVendor</a>
+ <li><a class="subsection" href="#ProtocolVersion">ProtocolVersion</a>
+ <li><a class="subsection" href="#ProtocolRevision">ProtocolRevision</a>
+ <li><a class="subsection" href="#VendorRelease">VendorRelease</a>
+ <li><a class="subsection" href="#DisplayString">DisplayString</a>
+ <li><a class="subsection" href="#BitmapUnit">BitmapUnit</a>
+ <li><a class="subsection" href="#BitmapBitOrder">BitmapBitOrder</a>
+ <li><a class="subsection" href="#BitmapPad">BitmapPad</a>
+ <li><a class="subsection" href="#ImageByteOrder">ImageByteOrder</a>
+ </ol>
+ <li><a class="subsection" href="#screenofdisplay">ScreenOfDisplay related functions</a>
+ <ol>
+ <li><a class="subsection" href="#ScreenOfDisplay">ScreenOfDisplay</a>
+ <li><a class="subsection" href="#DefaultScreenOfDisplay">DefaultScreenOfDisplay</a>
+ <li><a class="subsection" href="#RootWindow">RootWindow / RootWindowOfScreen</a>
+ <li><a class="subsection" href="#DefaultRootWindow">DefaultRootWindow</a>
+ <li><a class="subsection" href="#DefaultVisual">DefaultVisual / DefaultVisualOfScreen</a>
+ <li><a class="subsection" href="#DefaultGC">DefaultGC / DefaultGCOfScreen</a>
+ <li><a class="subsection" href="#BlackPixel">BlackPixel / BlackPixelOfScreen</a>
+ <li><a class="subsection" href="#WhitePixel">WhitePixel / WhitePixelOfScreen</a>
+ <li><a class="subsection" href="#DisplayWidth">DisplayWidth / WidthOfScreen</a>
+ <li><a class="subsection" href="#DisplayHeight">DisplayHeight / HeightOfScreen</a>
+ <li><a class="subsection" href="#DisplayWidthMM">DisplayWidthMM / WidthMMOfScreen</a>
+ <li><a class="subsection" href="#DisplayHeightMM">DisplayHeightMM / HeightMMOfScreen</a>
+ <li><a class="subsection" href="#DisplayPlanes">DisplayPlanes / DefaultDepth / DefaultDepthOfScreen / PlanesOfScreen</a>
+ <li><a class="subsection" href="#DefaultColormap">DefaultColormap / DefaultColormapOfScreen</a>
+ <li><a class="subsection" href="#MinCmapsOfScreen">MinCmapsOfScreen</a>
+ <li><a class="subsection" href="#MaxCmapsOfScreen">MaxCmapsOfScreen</a>
+ <li><a class="subsection" href="#DoesSaveUnders">DoesSaveUnders</a>
+ <li><a class="subsection" href="#DoesBackingStore">DoesBackingStore</a>
+ <li><a class="subsection" href="#EventMaskOfScreen">EventMaskOfScreen</a>
+ </ol>
+ <li><a class="subsection" href="#misc">Miscellaneaous macros</a>
+ <ol>
+ <li><a class="subsection" href="#DisplayOfScreen">DisplayOfScreen</a>
+ <li><a class="subsection" href="#DisplayCells">DisplayCells / CellsOfScreen</a>
+ </ol>
+ </ol>
+ </ol>
+ </div>
+ <div class="section">
+ <ol>
+ <li class="title"><a name="intro">Introduction</a>
+ <p>
+ This tutorial is based on the
+ <a href="http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html">Xlib Tutorial</a>
+ written by <a href="mailto:choor at atcom dot co dot il">Guy Keren</a>. The
+ author allowed me to take some parts of his text, mainly the text which
+ deals with the X Windows generality.
+ </p>
+ <p>
+ This tutorial is intended for people who want to start to program
+ with the <a href="http://xcb.freedesktop.org">XCB</a>
+ library. keep in mind that XCB, like the
+ <a href="http://tronche.com/gui/x/xlib/introduction">Xlib</a>
+ library, isn't what most programmers wanting to write X
+ applications are looking for. They should use a much higher
+ level GUI toolkit like Motif,
+ <a href="http://www.lesstif.org">LessTiff</a>,
+ <a href="http://www.gtk.org">GTK</a>,
+ <a href="http://www.trolltech.com">QT</a>,
+ <a href="http://www.enlightenment.org">EWL</a>,
+ <a href="http://www.enlightenment.org">ETK</a>, or use
+ <a href="http://cairographics.org">Cairo</a>.
+ However,
+ we need to start somewhere. More than this, knowing how things
+ work down below is never a bad idea.
+ </p>
+ <p>
+ After reading this tutorial, one should be able to write very
+ simple graphical programs, but not programs with decent user
+ interfaces. For such programs, one of the previously mentioned
+ libraries should be used.
+ </p>
+ <p>
+ But what is XCB? Xlib has been
+ the standard C binding for the <a href="http://www.x.org">X
+ Window System</a> protocol for many years now. It is an
+ excellent piece of work, but there are applications for which it
+ is not ideal, for example:
+ </p>
+ <ul>
+ <li><b>Small platforms</b>: Xlib is a large piece of code, and
+ it's difficult to make it smaller
+ <li><b>Latency hiding</b>: Xlib requests requiring a reply are
+ effectively synchronous: they block until the reply appears,
+ whether the result is needed immediately or not.
+ <li><b>Direct access to the protocol</b>: Xlib does quite a
+ bit of caching, layering, and similar optimizations. While this
+ is normally a feature, it makes it difficult to simply emit
+ specified X protocol requests and process specific
+ responses.
+ <li><b>Threaded applications</b>: While Xlib does attempt to
+ support multithreading, the API makes this difficult and
+ error-prone.
+ <li><b>New extensions</b>: The Xlib infrastructure provides
+ limited support for the new creation of X extension client side
+ code.
+ </ul>
+ <p>
+ For these reasons, among others, XCB, an X C binding, has been
+ designed to solve the above problems and thus provide a base for
+ </p>
+ <ul>
+ <li>Toolkit implementation.
+ <li>Direct protocol-level programming.
+ <li>Lightweight emulation of commonly used portions of the
+ Xlib API.
+ </ul>
+ <br>
+ <li class="title"><a name="Xmodel">The client and server model of the X window system</a>
+ <p>
+ The X Window System was developed with one major goal:
+ flexibility. The idea was that the way things look is one thing,
+ but the way things work is another matter. Thus, the lower
+ levels provide the tools required to draw windows, handle user
+ input, allow drawing graphics using colors (or black and white
+ screens), etc. To this point, a decision was made to separate
+ the system into two parts. A client that decides what to do, and
+ a server that actually draws on the screen and reads user input
+ in order to send it to the client for processing.
+ </p>
+ <p>
+ This model is the complete opposite of what is used to when
+ dealing with clients and servers. In our case, the user sits
+ near the machine controlled by the server, while the client
+ might be running on a remote machine. The server controls the
+ screens, mouse and keyboard. A client may connect to the server,
+ request that it draws a window (or several windows), and ask the
+ server to send it any input the user sends to these
+ windows. Thus, several clients may connect to a single X server
+ (one might be running mail software, one running a WWW
+ browser, etc). When input is sent by the user to some window,
+ the server sends a message to the client controlling this window
+ for processing. The client decides what to do with this input,
+ and sends the server requests for drawing in the window.
+ </p>
+ <p>
+ The whole session is carried out using the X message
+ protocol. This protocol was originally carried over the TCP/IP
+ protocol suite, allowing the client to run on any machine
+ connected to the same network that the server is. Later on, the
+ X servers were extended to allow clients running on the local
+ machine with more optimized access to the server (note that an X
+ protocol message may be several hundreds of KB in size), such as
+ using shared memory, or using Unix domain sockets (a method for
+ creating a logical channel on a Unix system between two processes).
+ </p>
+ <li class="title"><a name="asynch">GUI programming: the asynchronous model</a>
+ <p>
+ Unlike conventional computer programs, that carry some serial
+ nature, a GUI program usually uses an asynchronous programming
+ model, also known as "event-driven programming". This means that
+ that program mostly sits idle, waiting for events sent by the X
+ server, and then acts upon these events. An event may say "The
+ user pressed the 1st button mouse in spot (x,y)", or "The window
+ you control needs to be redrawn". In order for the program to be
+ responsive to the user input, as well as to refresh requests, it
+ needs to handle each event in a rather short period of time
+ (e.g. less that 200 milliseconds, as a rule of thumb).
+ </p>
+ <p>
+ This also implies that the program may not perform operations
+ that might take a long time while handling an event (such as
+ opening a network connection to some remote server, or
+ connecting to a database server, or even performing a long file
+ copy operation). Instead, it needs to perform all these
+ operations in an asynchronous manner. This may be done by using
+ various asynchronous models to perform the longish operations,
+ or by performing them in a different process or thread.
+ </p>
+ <p>
+ So the way a GUI program looks is something like that:
+ </p>
+ <ol>
+ <li>Perform initialization routines.
+ <li>Connect to the X server.
+ <li>Perform X-related initialization.
+ <li>While not finished:
+ <ol>
+ <li>Receive the next event from the X server.
+ <li>Handle the event, possibly sending various drawing
+ requests to the X server.
+ <li>If the event was a quit message, exit the loop.
+ </ol>
+ <li>Close down the connection to the X server.
+ <li>Perform cleanup operations.
+ </ol>
+ <br>
+ <li class="title"><a name="notions">Basic XCB notions</a>
+ <p>
+ XCB has been created to eliminate the need for
+ programs to actually implement the X protocol layer. This
+ library gives a program a very low-level access to any X
+ server. Since the protocol is standardized, a client using any
+ implementation of XCB may talk with any X server (the same
+ occurs for Xlib, of course). We now give a brief description of
+ the basic XCB notions. They will be detailed later.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="conn">The X Connection</a>
+ <p>
+ The major notion of using XCB is the X Connection. This is a
+ structure representing the connection we have open with a
+ given X server. It hides a queue of messages coming from the
+ server, and a queue of pending requests that our client
+ intends to send to the server. In XCB, this structure is named
+ 'xcb_connection_t'. It is analogous to the Xlib Display.
+ When we open a connection to an X server, the
+ library returns a pointer to such a structure. Later, we
+ supply this pointer to any XCB function that should send
+ messages to the X server or receive messages from this server.
+ </p>
+ <li class="subtitle"><a name="requestsreplies">Requests and
+ replies: the Xlib killers</a>
+ <p>
+ To ask for information from the X server, we have to make a request
+ and ask for a reply. With Xlib, these two tasks are
+ automatically done: Xlib locks the system, sends a request,
+ waits for a reply from the X server and unlocks. This is
+ annoying, especially if one makes a lot of requests to the X
+ server. Indeed, Xlib has to wait for the end of a reply
+ before asking for the next request (because of the locks that
+ Xlib sends). For example, here is a time-line of N=4
+ requests/replies with Xlib, with a round-trip latency
+ <b>T_round_trip</b> that is 5 times long as the time required
+ to write or read a request/reply (<b>T_write/T_read</b>):
+ </p>
+ <pre class="text">
+ W-----RW-----RW-----RW-----R
+</pre>
+ <ul>
+ <li>W: Writing request
+ <li>-: Stalled, waiting for data
+ <li>R: Reading reply
+ </ul>
+ <p>
+ The total time is N * (T_write + T_round_trip + T_read).
+ </p>
+ <p>
+ With XCB, we can suppress most of the round-trips as the
+ requests and the replies are not locked. We usually send a
+ request, then XCB returns to us a <b>cookie</b>, which is an
+ identifier. Then, later, we ask for a reply using this
+ <b>cookie</b> and XCB returns a
+ pointer to that reply. Hence, with XCB, we can send a lot of
+ requests, and later in the program, ask for all the replies
+ when we need them. Here is the time-line for 4
+ requests/replies when we use this property of XCB:
+ </p>
+ <pre class="text">
+ WWWW--RRRR
+</pre>
+ <p>
+ The total time is N * T_write + max (0, T_round_trip - (N-1) *
+ T_write) + N * T_read. Which can be considerably faster than
+ all those Xlib round-trips.
+ </p>
+ <p>
+ Here is a program that computes the time to create 500 atoms
+ with Xlib and XCB. It shows the Xlib way, the bad XCB way
+ (which is similar to Xlib) and the good XCB way. On my
+ computer, XCB is 25 times faster than Xlib.
+ </p>
+ <pre class="code">
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/time.h>
+
+#include <xcb/xcb.h>
+
+#include <X11/Xlib.h>
+
+double
+get_time(void)
+{
+ struct timeval timev;
+
+ gettimeofday(&timev, NULL);
+
+ return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
+}
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_atom_t *atoms;
+ xcb_intern_atom_cookie_t *cs;
+ char **names;
+ int count;
+ int i;
+ double start;
+ double end;
+ double diff;
+
+ /* Xlib */
+ Display *disp;
+ Atom *atoms_x;
+ double diff_x;
+
+ c = xcb_connect (NULL, NULL);
+
+ count = 500;
+ atoms = (xcb_atom_t *)malloc (count * sizeof (atoms));
+ names = (char **)malloc (count * sizeof (char *));
+
+ /* init names */
+ for (i = 0; i < count; ++i) {
+ char buf[100];
+
+ sprintf (buf, "NAME%d", i);
+ names[i] = strdup (buf);
+ }
+
+ /* bad use */
+ start = get_time ();
+
+ for (i = 0; i < count; ++i)
+ atoms[i] = xcb_intern_atom_reply (c,
+ xcb_intern_atom (c,
+ 0,
+ strlen(names[i]),
+ names[i]),
+ NULL)->atom;
+
+ end = get_time ();
+ diff = end - start;
+ printf ("bad use time : %f\n", diff);
+
+ /* good use */
+ start = get_time ();
+
+ cs = (xcb_intern_atom_cookie_t *) malloc (count * sizeof(xcb_intern_atom_cookie_t));
+ for(i = 0; i < count; ++i)
+ cs[i] = xcb_intern_atom (c, 0, strlen(names[i]), names[i]);
+
+ for(i = 0; i < count; ++i) {
+ xcb_intern_atom_reply_t *r;
+
+ r = xcb_intern_atom_reply(c, cs[i], 0);
+ if(r)
+ atoms[i] = r->atom;
+ free(r);
+ }
+
+ end = get_time ();
+ printf ("good use time : %f\n", end - start);
+ printf ("ratio : %f\n", diff / (end - start));
+ diff = end - start;
+
+ /* free var */
+ free (atoms);
+ free (cs);
+
+ xcb_disconnect (c);
+
+ /* Xlib */
+ disp = XOpenDisplay (getenv("DISPLAY"));
+
+ atoms_x = (Atom *)malloc (count * sizeof (atoms_x));
+
+ start = get_time ();
+
+ for (i = 0; i < count; ++i)
+ atoms_x[i] = XInternAtom(disp, names[i], 0);
+
+ end = get_time ();
+ diff_x = end - start;
+ printf ("Xlib use time : %f\n", diff_x);
+ printf ("ratio : %f\n", diff_x / diff);
+
+ free (atoms_x);
+ for (i = 0; i < count; ++i)
+ free (names[i]);
+ free (names);
+
+ XCloseDisplay (disp);
+
+ return 0;
+}
+</pre>
+ <li class="subtitle"><a name="gc">The Graphic Context</a>
+ <p>
+ When we perform various drawing operations (graphics, text,
+ etc), we may specify various options for controlling how the
+ data will be drawn (what foreground and background colors to
+ use, how line edges will be connected, what font to use when
+ drawing some text, etc). In order to avoid the need to supply
+ hundreds of parameters to each drawing function, a graphical
+ context structure is used. We set the various drawing options
+ in this structure, and then we pass a pointer to this
+ structure to any drawing routines. This is rather handy, as we
+ often need to perform several drawing requests with the same
+ options. Thus, we would initialize a graphical context, set
+ the desired options, and pass this structure to all drawing
+ functions.
+ </p>
+ <p>
+ Note that graphic contexts have no client-side structure in
+ XCB, they're just XIDs. Xlib has a client-side structure
+ because it caches the GC contents so it can avoid making
+ redundant requests, but of course XCB doesn't do that.
+ </p>
+ <li class="subtitle"><a name="events">Events</a>
+ <p>
+ A structure is used to pass events received from the X
+ server. XCB supports exactly the events specified in the
+ protocol (33 events). This structure contains the type
+ of event received (including a bit for whether it came
+ from the server or another client), as well as the data associated with the
+ event (e.g. position on the screen where the event was
+ generated, mouse button associated with the event, region of
+ the screen associated with a "redraw" event, etc). The way to
+ read the event's data depends on the event type.
+ </p>
+ </ol>
+ <br>
+ <li class="title"><a name="use">Using XCB-based programs</a>
+ <br>
+ <ol>
+ <li class="subtitle"><a name="inst">Installation of XCB</a>
+ <p>
+ <b>TODO:</b> These instructions are out of date.
+ Just reference the <a href="http://xcb.freedesktop.org/">main XCB page</a>
+ so we don't have to maintain these instructions in more than
+ one place.
+ </p>
+ <p>
+ To build XCB from source, you need to have installed at
+ least:
+ </p>
+ <ul>
+ <li>pkgconfig 0.15.0
+ <li><a href="http://www.gnu.org/software/automake/">automake 1.7</a>
+ <li><a href="http://www.gnu.org/software/autoconf/">autoconf 2.50</a>
+ <li><a href="http://www.check.org">check</a>
+ <li><a href="http://xmlsoft.org/XSLT/">xsltproc</a>
+ <li><a href="http://www.gnu.org/software/gperf/">gperf 3.0.1</a>
+ </ul>
+ <p>
+ You have to checkout in the git repository the following modules:
+ </p>
+ <ul>
+ <li>Xau from xlibs
+ <li>xcb-proto
+ <li>xcb
+ </ul>
+ <p>
+ Note that xcb-proto exists only to install header
+ files, so typing 'make' or 'make all' will produce the message
+ "Nothing to be done for 'all'". That's normal.
+ </p>
+ <li class="subtitle"><a name="comp">Compiling XCB-based programs</a>
+ <p>
+ Compiling XCB-based programs requires linking them with the XCB
+ library. This is easily done thanks to pkgconfig:
+ </p>
+ <pre class="text">
+gcc -Wall prog.c -o prog `pkg-config --cflags --libs xcb`
+</pre>
+ </ol>
+ <li class="title"><a name="openconn">Opening and closing the connection to an X server</a>
+ <p>
+ An X program first needs to open the connection to the X
+ server. There is a function that opens a connection. It requires
+ the display name, or NULL. In the latter case, the display name
+ will be the one in the environment variable DISPLAY.
+ </p>
+ <pre class="code">
+<span class="type">xcb_connection_t</span> *xcb_connect (<span class="keyword">const</span> <span class="type">char</span> *displayname,
+ <span class="type">int</span> *screenp);
+</pre>
+ <p>
+ The second parameter returns the screen number used for the
+ connection. The returned structure describes an XCB connection
+ and is opaque. Here is how the connection can be opened:
+ </p>
+ <pre class="code">
+#<span class="include">include</span> <span class="string"><xcb/xcb.h></span>
+
+<span class="type">int</span>
+<span class="function">main</span> ()
+{
+ <span class="type">xcb_connection_t</span> *c;
+
+ /* Open the connection to the X server. Use the DISPLAY environment variable as the default display name */
+ c = xcb_connect (NULL, NULL);
+
+ <span class="keyword">return</span> 0;
+}
+</pre>
+ <p>
+ To close a connection, it suffices to use:
+ </p>
+ <pre class="code">
+<span class="type">void</span> xcb_disconnect (<span class="type">xcb_connection_t</span> *c);
+</pre>
+ <div class="comp">
+ <div class="title">
+ Comparison Xlib/XCB
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XOpenDisplay ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_connect ()
+ </ul>
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XCloseDisplay ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_disconnect ()
+ </ul>
+ </div>
+ </div>
+ <br>
+ <li class="title"><a name="screen">Checking basic information about a connection</a>
+ <p>
+ Once we have opened a connection to an X server, we should check some
+ basic information about it: what screens it has, what is the
+ size (width and height) of the screen, how many colors it
+ supports (black and white ? grey scale ?, 256 colors ? more ?),
+ and so on. We get such information from the xcb_screen_t
+ structure:
+ </p>
+ <pre class="code">
+typedef struct {
+ xcb_window_t root;
+ xcb_colormap_t default_colormap;
+ uint32_t white_pixel;
+ uint32_t black_pixel;
+ uint32_t current_input_masks;
+ uint16_t width_in_pixels;
+ uint16_t height_in_pixels;
+ uint16_t width_in_millimeters;
+ uint16_t height_in_millimeters;
+ uint16_t min_installed_maps;
+ uint16_t max_installed_maps;
+ xcb_visualid_t root_visual;
+ uint8_t backing_stores;
+ uint8_t save_unders;
+ uint8_t root_depth;
+ uint8_t allowed_depths_len;
+} xcb_screen_t;
+</pre>
+ <p>
+ We could retrieve the first screen of the connection by using the
+ following function:
+ </p>
+ <pre class="code">
+xcb_screen_iterator_t xcb_setup_roots_iterator (xcb_setup_t *R);
+</pre>
+ <p>
+ Here is a small program that shows how to use this function:
+ </p>
+ <pre class="code">
+#include <stdio.h>
+
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ int screen_nbr;
+ xcb_screen_iterator_t iter;
+
+ /* Open the connection to the X server. Use the DISPLAY environment variable */
+ c = xcb_connect (NULL, &screen_nbr);
+
+ /* Get the screen #screen_nbr */
+ iter = xcb_setup_roots_iterator (xcb_get_setup (c));
+ for (; iter.rem; --screen_nbr, xcb_screen_next (&iter))
+ if (screen_nbr == 0) {
+ screen = iter.data;
+ break;
+ }
+
+ printf ("\n");
+ printf ("Informations of screen %ld:\n", screen->root);
+ printf (" width.........: %d\n", screen->width_in_pixels);
+ printf (" height........: %d\n", screen->height_in_pixels);
+ printf (" white pixel...: %ld\n", screen->white_pixel);
+ printf (" black pixel...: %ld\n", screen->black_pixel);
+ printf ("\n");
+
+ return 0;
+}
+</pre>
+ <li class="title"><a name="helloworld">Creating a basic window - the "hello world" program</a>
+ <p>
+ After we got some basic information about our screen, we can
+ create our first window. In the X Window System, a window is
+ characterized by an Id. So, in XCB, a window is of type:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_window_t;
+</pre>
+ <p>
+ We first ask for a new Id for our window, with this function:
+ </p>
+ <pre class="code">
+xcb_window_t xcb_generate_id(xcb_connection_t *c);
+</pre>
+ <p>
+ Then, XCB supplies the following function to create new windows:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_window (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t depth, /* Depth of the screen */
+ xcb_window_t wid, /* Id of the window */
+ xcb_window_t parent, /* Id of an existing window that should be the parent of the new window */
+ int16_t x, /* X position of the top-left corner of the window (in pixels) */
+ int16_t y, /* Y position of the top-left corner of the window (in pixels) */
+ uint16_t width, /* Width of the window (in pixels) */
+ uint16_t height, /* Height of the window (in pixels) */
+ uint16_t border_width, /* Width of the window's border (in pixels) */
+ uint16_t _class,
+ xcb_visualid_t visual,
+ uint32_t value_mask,
+ const uint32_t *value_list);
+</pre>
+ <p>
+ The fact that we created the window does not mean that it will
+ be drawn on screen. By default, newly created windows are not
+ mapped on the screen (they are invisible). In order to make our
+ window visible, we use the function <span class="code">xcb_map_window()</span>, whose
+ prototype is
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_map_window (xcb_connection_t *c,
+ xcb_window_t window);
+</pre>
+ <p>
+ Finally, here is a small program to create a window of size
+ 150x150 pixels, positioned at the top-left corner of the screen:
+ </p>
+ <pre class="code">
+#include <unistd.h> /* pause() */
+
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+
+ /* Open the connection to the X server */
+ c = xcb_connect (NULL, NULL);
+
+ /* Get the first screen */
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* Ask for our window's Id */
+ win = xcb_generate_id(c);
+
+ /* Create the window */
+ xcb_create_window (c, /* Connection */
+ XCB_COPY_FROM_PARENT, /* depth (same as root)*/
+ win, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ 0, NULL); /* masks, not used yet */
+
+ /* Map the window on the screen */
+ xcb_map_window (c, win);
+
+ /* Make sure commands are sent before we pause, so window is shown */
+ xcb_flush (c);
+
+ pause (); /* hold client until Ctrl-C */
+
+ return 0;
+}
+</pre>
+ <p>
+ In this code, you see one more function - <span class="code">xcb_flush()</span>, not explained
+ yet. It is used to flush all the pending requests. More
+ precisely, there are 2 functions that do such things. The first
+ one is <span class="code">xcb_flush()</span>:
+ </p>
+ <pre class="code">
+int xcb_flush (xcb_connection_t *c);
+</pre>
+ <p>
+ This function flushes all pending requests to the X server (much
+ like the <span class="code">fflush()</span> function is used to
+ flush standard output). The second function is
+ <span class="code">xcb_aux_sync()</span>:
+ </p>
+ <pre class="code">
+int xcb_aux_sync (xcb_connection_t *c);
+</pre>
+ <p>
+ This functions also flushes all pending requests to the X
+ server, and then waits until the X server finishing processing
+ these requests. In a normal program, this will not be necessary
+ (we'll see why when we get to write a normal X program), but for
+ now, we put it there.
+ </p>
+ <p>
+ The window that is created by the above code has a non defined
+ background. This one can be set to a specific color,
+ thanks to the two last parameters of
+ <span class="code">xcb_create_window()</span>, which are not
+ described yet. See the subsections
+ <a href="#winconf">Configuring a window</a> or
+ <a href="#winconf">Registering for event types using event masks</a>
+ for examples on how to use these parameters. In addition, as no
+ events are handled, you have to make a Ctrl-C to interrupt the
+ program.
+ </p>
+ <p>
+ <b>TODO</b>: one should tell what these functions return and
+ about the generic error
+ </p>
+ <div class="comp">
+ <div class="title">
+ Comparison Xlib/XCB
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XCreateWindow ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_generate_id ()
+ <li>xcb_create_window ()
+ </ul>
+ </div>
+ </div>
+ <br>
+ <li class="title"><a name="drawing">Drawing in a window</a>
+ <p>
+ Drawing in a window can be done using various graphical
+ functions (drawing pixels, lines, rectangles, etc). In order to
+ draw in a window, we first need to define various general
+ drawing parameters (what line width to use, which color to draw
+ with, etc). This is done using a graphical context.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="allocgc">Allocating a Graphics Context</a>
+ <p>
+ As we said, a graphical context defines several attributes to
+ be used with the various drawing functions. For this, we
+ define a graphical context. We can use more than one graphical
+ context with a single window, in order to draw in multiple
+ styles (different colors, different line widths, etc). In XCB,
+ a Graphics Context is, as a window, characterized by an Id:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_gcontext_t;
+</pre>
+ <p>
+ We first ask the X server to attribute an Id to our graphic
+ context with this function:
+ </p>
+ <pre class="code">
+xcb_gcontext_t xcb_generate_id (xcb_connection_t *c);
+</pre>
+ <p>
+ Then, we set the attributes of the graphic context with this function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_gc (xcb_connection_t *c,
+ xcb_gcontext_t cid,
+ xcb_drawable_t drawable,
+ uint32_t value_mask,
+ const uint32_t *value_list);
+</pre>
+ <p>
+ We give now an example on how to allocate a graphic context
+ that specifies that each drawing function that uses it will
+ draw in foreground with a black color.
+ </p>
+ <pre class="code">
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+ xcb_gcontext_t black;
+ uint32_t mask;
+ uint32_t value[1];
+
+ /* Open the connection to the X server and get the first screen */
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* Create a black graphic context for drawing in the foreground */
+ win = screen->root;
+ black = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND;
+ value[0] = screen->black_pixel;
+ xcb_create_gc (c, black, win, mask, value);
+
+ return 0;
+}
+</pre>
+ <p>
+ Note should be taken regarding the role of "value_mask" and
+ "value_list" in the prototype of <span class="code">xcb_create_gc()</span>. Since a
+ graphic context has many attributes, and since we often just
+ want to define a few of them, we need to be able to tell the
+ <span class="code">xcb_create_gc()</span> which attributes we
+ want to set. This is what the "value_mask" parameter is
+ for. We then use the "value_list" parameter to specify actual
+ values for the attribute we defined in "value_mask". Thus, for
+ each constant used in "value_list", we will use the matching
+ constant in "value_mask". In this case, we define a graphic
+ context with one attribute: when drawing (a point, a line,
+ etc), the foreground color will be black. The rest of the
+ attributes of this graphic context will be set to their
+ default values.
+ </p>
+ <p>
+ See the next Subsection for more details.
+ </p>
+ <div class="comp">
+ <div class="title">
+ Comparison Xlib/XCB
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XCreateGC ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_generate_id ()
+ <li>xcb_create_gc ()
+ </ul>
+ </div>
+ </div>
+ <br>
+ <li class="subtitle"><a name="changegc">Changing the attributes of a Graphics Context</a>
+ <p>
+ Once we have allocated a Graphic Context, we may need to
+ change its attributes (for example, changing the foreground
+ color we use to draw a line, or changing the attributes of the
+ font we use to display strings. See Subsections Drawing with a
+ color and
+ <a href="#assigningfont">Assigning a Font to a Graphic Context</a>).
+ This is done by using this function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_change_gc (xcb_connection_t *c, /* The XCB Connection */
+ xcb_gcontext_t gc, /* The Graphic Context */
+ uint32_t value_mask, /* Components of the Graphic Context that have to be set */
+ const uint32_t *value_list); /* Value as specified by value_mask */
+</pre>
+ <p>
+ The <span class="code">value_mask</span> parameter could take
+ any combination of these masks from the xcb_gc_t enumeration:
+ </p>
+ <ul>
+ <li>XCB_GC_FUNCTION
+ <li>XCB_GC_PLANE_MASK
+ <li>XCB_GC_FOREGROUND
+ <li>XCB_GC_BACKGROUND
+ <li>XCB_GC_LINE_WIDTH
+ <li>XCB_GC_LINE_STYLE
+ <li>XCB_GC_CAP_STYLE
+ <li>XCB_GC_JOIN_STYLE
+ <li>XCB_GC_FILL_STYLE
+ <li>XCB_GC_FILL_RULE
+ <li>XCB_GC_TILE
+ <li>XCB_GC_STIPPLE
+ <li>XCB_GC_TILE_STIPPLE_ORIGIN_X
+ <li>XCB_GC_TILE_STIPPLE_ORIGIN_Y
+ <li>XCB_GC_FONT
+ <li>XCB_GC_SUBWINDOW_MODE
+ <li>XCB_GC_GRAPHICS_EXPOSURES
+ <li>XCB_GC_CLIP_ORIGIN_X
+ <li>XCB_GC_CLIP_ORIGIN_Y
+ <li>XCB_GC_CLIP_MASK
+ <li>XCB_GC_DASH_OFFSET
+ <li>XCB_GC_DASH_LIST
+ <li>XCB_GC_ARC_MODE
+ </ul>
+ <p>
+ It is possible to set several attributes at the same
+ time (for example setting the attributes of a font and the
+ color which will be used to display a string), by OR'ing these
+ values in <span class="code">value_mask</span>. Then
+ <span class="code">value_list</span> has to be an array which
+ lists the value for the respective attributes. <b>These values
+ must be in the same order as masks listed above.</b> See Subsection
+ Drawing with a color to have an example.
+ </p>
+ <p>
+ <b>TODO</b>: set the links of the 3 subsections, once they will
+ be written :)
+ </p>
+ <p>
+ <b>TODO</b>: give an example which sets several attributes.
+ </p>
+ <li class="subtitle"><a name="drawingprim">Drawing primitives: point, line, box, circle,...</a>
+ <p>
+ After we have created a Graphic Context, we can draw on a
+ window using this Graphic Context, with a set of XCB
+ functions, collectively called "drawing primitives". Let see
+ how they are used.
+ </p>
+ <p>
+ To draw a point, or several points, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_point (xcb_connection_t *c, /* The connection to the X server */
+ uint8_t coordinate_mode, /* Coordinate mode, usually set to XCB_COORD_MODE_ORIGIN */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the point(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the point(s) */
+ uint32_t points_len, /* The number of points */
+ const xcb_point_t *points); /* An array of points */
+</pre>
+ <p>
+ The <span class="code">coordinate_mode</span> parameter
+ specifies the coordinate mode. Available values are
+ </p>
+ <ul>
+ <li><span class="code">XCB_COORD_MODE_ORIGIN</span>
+ <li><span class="code">XCB_COORD_MODE_PREVIOUS</span>
+ </ul>
+ <p>
+ If XCB_COORD_MODE_PREVIOUS is used, then all points but the first one
+ are relative to the immediately previous point.
+ </p>
+ <p>
+ The <span class="code">xcb_point_t</span> type is just a
+ structure with two fields (the coordinates of the point):
+ </p>
+ <pre class="code">
+typedef struct {
+ int16_t x;
+ int16_t y;
+} xcb_point_t;
+</pre>
+ <p>
+ You could see an example in xpoints.c. <b>TODO</b> Set the link.
+ </p>
+ <p>
+ To draw a line, or a polygonal line, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_line (xcb_connection_t *c, /* The connection to the X server */
+ uint8_t coordinate_mode, /* Coordinate mode, usually set to XCB_COORD_MODE_ORIGIN */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the line(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the line(s) */
+ uint32_t points_len, /* The number of points in the polygonal line */
+ const xcb_point_t *points); /* An array of points */
+</pre>
+ <p>
+ This function will draw the line between the first and the
+ second points, then the line between the second and the third
+ points, and so on.
+ </p>
+ <p>
+ To draw a segment, or several segments, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_segment (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the segment(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the segment(s) */
+ uint32_t segments_len, /* The number of segments */
+ const xcb_segment_t *segments); /* An array of segments */
+</pre>
+ <p>
+ The <span class="code">xcb_segment_t</span> type is just a
+ structure with four fields (the coordinates of the two points
+ that define the segment):
+ </p>
+ <pre class="code">
+typedef struct {
+ int16_t x1;
+ int16_t y1;
+ int16_t x2;
+ int16_t y2;
+} xcb_segment_t;
+</pre>
+ <p>
+ To draw a rectangle, or several rectangles, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_rectangle (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the rectangle(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the rectangle(s) */
+ uint32_t rectangles_len, /* The number of rectangles */
+ const xcb_rectangle_t *rectangles); /* An array of rectangles */
+</pre>
+ <p>
+ The <span class="code">xcb_rectangle_t</span> type is just a
+ structure with four fields (the coordinates of the top-left
+ corner of the rectangle, and its width and height):
+ </p>
+ <pre class="code">
+typedef struct {
+ int16_t x;
+ int16_t y;
+ uint16_t width;
+ uint16_t height;
+} xcb_rectangle_t;
+</pre>
+ <!-- There's no coordinate_mode. Is it normal? -->
+ <!-- [iano] Yes, it's not in the protocol. -->
+ <p>
+ To draw an elliptical arc, or several elliptical arcs, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_arc (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the arc(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the arc(s) */
+ uint32_t arcs_len, /* The number of arcs */
+ const xcb_arc_t *arcs); /* An array of arcs */
+</pre>
+ <p>
+ The <span class="code">xcb_arc_t</span> type is a structure with
+ six fields:
+ </p>
+ <pre class="code">
+typedef struct {
+ int16_t x; /* Top left x coordinate of the rectangle surrounding the ellipse */
+ int16_t y; /* Top left y coordinate of the rectangle surrounding the ellipse */
+ uint16_t width; /* Width of the rectangle surrounding the ellipse */
+ uint16_t height; /* Height of the rectangle surrounding the ellipse */
+ int16_t angle1; /* Angle at which the arc begins */
+ int16_t angle2; /* Angle at which the arc ends */
+} xcb_arc_t;
+</pre>
+ <div class="emph">
+ <p>
+ Note: the angles are expressed in units of 1/64 of a degree,
+ so to have an angle of 90 degrees, starting at 0,
+ <span class="code">angle1 = 0</span> and
+ <span class="code">angle2 = 90 << 6</span>. Positive angles
+ indicate counterclockwise motion, while negative angles
+ indicate clockwise motion.
+ </p>
+ </div>
+ <!-- I think that (x,y) should be the center of the
+ ellipse, and (width, height) the radius. It's more logical. -->
+ <!-- iano: Yes, and I bet some toolkits do that.
+ But the protocol (and many other graphics APIs) define arcs
+ by bounding rectangles. -->
+ <p>
+ The corresponding function which fill inside the geometrical
+ object are listed below, without further explanation, as they
+ are used as the above functions.
+ </p>
+ <p>
+ To Fill a polygon defined by the points given as arguments ,
+ we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_fill_poly (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint8_t shape,
+ uint8_t coordinate_mode,
+ uint32_t points_len,
+ const xcb_point_t *points);
+</pre>
+ <p>
+ The <span class="code">shape</span> parameter specifies a
+ shape that helps the server to improve performance. Available
+ values are
+ </p>
+ <ul>
+ <li><span class="code">XCB_POLY_SHAPE_COMPLEX</span>
+ <li><span class="code">XCB_POLY_SHAPE_NONCONVEX</span>
+ <li><span class="code">XCB_POLY_SHAPE_CONVEX</span>
+ </ul>
+ <p>
+ To fill one or several rectangles, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_fill_rectangle (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint32_t rectangles_len,
+ const xcb_rectangle_t *rectangles);
+</pre>
+ <p>
+ To fill one or several arcs, we use
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_poly_fill_arc (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint32_t arcs_len,
+ const xcb_arc_t *arcs);
+</pre>
+ <br>
+ <a name="points.c"></a>
+ <p>
+ To illustrate these functions, here is an example that draws
+ four points, a polygonal line, two segments, two rectangles
+ and two arcs. Remark that we use events for the first time, as
+ an introduction to the next section.
+ </p>
+ <p>
+ <b>TODO:</b> Use screen->root_depth for depth parameter.
+ </p>
+ <pre class="code">
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+ xcb_gcontext_t foreground;
+ xcb_generic_event_t *e;
+ uint32_t mask = 0;
+ uint32_t values[2];
+
+ /* geometric objects */
+ xcb_point_t points[] = {
+ {10, 10},
+ {10, 20},
+ {20, 10},
+ {20, 20}};
+
+ xcb_point_t polyline[] = {
+ {50, 10},
+ { 5, 20}, /* rest of points are relative */
+ {25,-20},
+ {10, 10}};
+
+ xcb_segment_t segments[] = {
+ {100, 10, 140, 30},
+ {110, 25, 130, 60}};
+
+ xcb_rectangle_t rectangles[] = {
+ { 10, 50, 40, 20},
+ { 80, 50, 10, 40}};
+
+ xcb_arc_t arcs[] = {
+ {10, 100, 60, 40, 0, 90 << 6},
+ {90, 100, 55, 40, 0, 270 << 6}};
+
+ /* Open the connection to the X server */
+ c = xcb_connect (NULL, NULL);
+
+ /* Get the first screen */
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* Create black (foreground) graphic context */
+ win = screen->root;
+
+ foreground = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
+ values[0] = screen->black_pixel;
+ values[1] = 0;
+ xcb_create_gc (c, foreground, win, mask, values);
+
+ /* Ask for our window's Id */
+ win = xcb_generate_id(c);
+
+ /* Create the window */
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
+ values[0] = screen->white_pixel;
+ values[1] = XCB_EVENT_MASK_EXPOSURE;
+ xcb_create_window (c, /* Connection */
+ XCB_COPY_FROM_PARENT, /* depth */
+ win, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ mask, values); /* masks */
+
+ /* Map the window on the screen */
+ xcb_map_window (c, win);
+
+
+ /* We flush the request */
+ xcb_flush (c);
+
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ /* We draw the points */
+ xcb_poly_point (c, XCB_COORD_MODE_ORIGIN, win, foreground, 4, points);
+
+ /* We draw the polygonal line */
+ xcb_poly_line (c, XCB_COORD_MODE_PREVIOUS, win, foreground, 4, polyline);
+
+ /* We draw the segements */
+ xcb_poly_segment (c, win, foreground, 2, segments);
+
+ /* We draw the rectangles */
+ xcb_poly_rectangle (c, win, foreground, 2, rectangles);
+
+ /* We draw the arcs */
+ xcb_poly_arc (c, win, foreground, 2, arcs);
+
+ /* We flush the request */
+ xcb_flush (c);
+
+ break;
+ }
+ default: {
+ /* Unknown event type, ignore it */
+ break;
+ }
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
+
+ return 0;
+}
+</pre>
+ </ol>
+ <li class="title"><a name="xevents">X Events</a>
+ <p>
+ In an X program, everything is driven by events. Event painting
+ on the screen is sometimes done as a response to an event (an
+ <span class="code">Expose</span> event). If part of a program's
+ window that was hidden, gets exposed (e.g. the window was raised
+ above other widows), the X server will send an "expose" event to
+ let the program know it should repaint that part of the
+ window. User input (key presses, mouse movement, etc) is also
+ received as a set of events.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="register">Registering for event types using event masks</a>
+ <p>
+ During the creation of a window, you should give it what kind
+ of events it wishes to receive. Thus, you may register for
+ various mouse (also called pointer) events, keyboard events,
+ expose events, and so on. This is done for optimizing the
+ server-to-client connection (i.e. why send a program (that
+ might even be running at the other side of the globe) an event
+ it is not interested in ?)
+ </p>
+ <p>
+ In XCB, you use the "value_mask" and "value_list" data in the
+ <span class="code">xcb_create_window()</span> function to
+ register for events. Here is how we register for
+ <span class="code">Expose</span> event when creating a window:
+ </p>
+ <pre class="code">
+ mask = XCB_CW_EVENT_MASK;
+ valwin[0] = XCB_EVENT_MASK_EXPOSURE;
+ win = xcb_generate_id (c);
+ xcb_create_window (c, depth, win, root->root,
+ 0, 0, 150, 150, 10,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual,
+ mask, valwin);
+</pre>
+ <p>
+ <span class="code">XCB_EVENT_MASK_EXPOSURE</span> is a constant defined
+ in the xcb_event_mask_t enumeration in the "xproto.h" header file. If we wanted to register for several
+ event types, we can logically "or" them, as follows:
+ </p>
+ <pre class="code">
+ mask = XCB_CW_EVENT_MASK;
+ valwin[0] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS;
+ win = xcb_generate_id (c);
+ xcb_create_window (c, depth, win, root->root,
+ 0, 0, 150, 150, 10,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual,
+ mask, valwin);
+</pre>
+ <p>
+ This registers for <span class="code">Expose</span> events as
+ well as for mouse button presses inside the created
+ window. You should note that a mask may represent several
+ event sub-types.
+ </p>
+ <p>
+ The values that a mask could take are given
+ by the <span class="code">xcb_cw_t</span> enumeration:
+ </p>
+ <pre class="code">
+typedef enum {
+ XCB_CW_BACK_PIXMAP = 1L<<0,
+ XCB_CW_BACK_PIXEL = 1L<<1,
+ XCB_CW_BORDER_PIXMAP = 1L<<2,
+ XCB_CW_BORDER_PIXEL = 1L<<3,
+ XCB_CW_BIT_GRAVITY = 1L<<4,
+ XCB_CW_WIN_GRAVITY = 1L<<5,
+ XCB_CW_BACKING_STORE = 1L<<6,
+ XCB_CW_BACKING_PLANES = 1L<<7,
+ XCB_CW_BACKING_PIXEL = 1L<<8,
+ XCB_CW_OVERRIDE_REDIRECT = 1L<<9,
+ XCB_CW_SAVE_UNDER = 1L<<10,
+ XCB_CW_EVENT_MASK = 1L<<11,
+ XCB_CW_DONT_PROPAGATE = 1L<<12,
+ XCB_CW_COLORMAP = 1L<<13,
+ XCB_CW_CURSOR = 1L<<14
+} xcb_cw_t;
+</pre>
+ <div class="emph">
+ <p>Note: we must be careful when setting the values of the valwin
+ parameter, as they have to follow the order the
+ <span class="code">xcb_cw_t</span> enumeration. Here is an
+ example:
+ </p>
+ </div>
+ <pre class="code">
+ mask = XCB_CW_EVENT_MASK | XCB_CW_BACK_PIXMAP;
+ valwin[0] = XCB_NONE; /* for XCB_CW_BACK_PIXMAP (whose value is 1) */
+ valwin[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS; /* for XCB_CW_EVENT_MASK, whose value (2048) */
+ /* is greater than the one of XCB_CW_BACK_PIXMAP */
+</pre>
+ <p>
+ If the window has already been created, we can use the
+ <span class="code">xcb_configure_window()</span> function to set
+ the events that the window will receive. The subsection
+ <a href="#winconf">Configuring a window</a> shows its
+ prototype. As an example, here is a piece of code that
+ configures the window to receive the
+ <span class="code">Expose</span> and
+ <span class="code">ButtonPress</span> events:
+ </p>
+ <pre class="code">
+const static uint32_t values[] = { XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS };
+
+/* The connection c and the window win are supposed to be defined */
+
+xcb_configure_window (c, win, XCB_CW_EVENT_MASK, values);
+</pre>
+ <div class="emph">
+ <p>
+ Note: A common bug programmers do is adding code to handle new
+ event types in their program, while forgetting to add the
+ masks for these events in the creation of the window. Such a
+ programmer then should sit down for hours debugging his
+ program, wondering "Why doesn't my program notice that I
+ released the button?", only to find that they registered for
+ button press events but not for button release events.
+ </p>
+ </div>
+ <li class="subtitle"><a name="loop">Receiving events: writing the events loop</a>
+ <p>
+ After we have registered for the event types we are interested
+ in, we need to enter a loop of receiving events and handling
+ them. There are two ways to receive events: a blocking way and
+ a non-blocking way:
+ </p>
+ <ul>
+ <li>
+ <span class="code">xcb_wait_for_event (xcb_connection_t *c)</span>
+ is the blocking way. It waits (so blocks...) until an event is
+ queued in the X server. Then it retrieves it into a newly
+ allocated structure (it dequeues it from the queue) and returns
+ it. This structure has to be freed. The function returns
+ <span class="code">NULL</span> if an error occurs.
+
+ <br>
+ <li>
+ <span class="code">xcb_poll_for_event (xcb_connection_t *c, int
+ *error)</span> is the non-blocking way. It looks at the event
+ queue and returns (and dequeues too) an existing event into
+ a newly allocated structure. This structure has to be
+ freed. It returns <span class="code">NULL</span> if there is
+ no event. If an error occurs, the parameter <span
+ class="code">error</span> will be filled with the error
+ status.
+ </ul>
+ <p>
+ There are various ways to write such a loop. We present two
+ ways to write such a loop, with the two functions above. The
+ first one uses <span class="code">xcb_wait_for_event_t</span>, which
+ is similar to an event Xlib loop using only <span
+ class="code">XNextEvent</span>:
+ </p>
+ <pre class="code">
+ xcb_generic_event_t *e;
+
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ /* Handle the Expose event type */
+ xcb_expose_event_t *ev = (xcb_expose_event_t *)e;
+
+ /* ... */
+
+ break;
+ }
+ case XCB_BUTTON_PRESS: {
+ /* Handle the ButtonPress event type */
+ xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
+
+ /* ... */
+
+ break;
+ }
+ default: {
+ /* Unknown event type, ignore it */
+ break;
+ }
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
+</pre>
+ <p>
+ You will certainly want to use <span
+ class="code">xcb_poll_for_event(xcb_connection_t *c, int
+ *error)</span> if, in Xlib, you use <span
+ class="code">XPending</span> or
+ <span class="code">XCheckMaskEvent</span>:
+ </p>
+ <pre class="code">
+ while (XPending (display)) {
+ XEvent ev;
+
+ XNextEvent(d, &ev);
+
+ /* Manage your event */
+ }
+</pre>
+ <p>
+ Such a loop in XCB looks like:
+ </p>
+ <pre class="code">
+ xcb_generic_event_t *ev;
+
+ while ((ev = xcb_poll_for_event (conn, 0))) {
+ /* Manage your event */
+ }
+</pre>
+ <p>
+ The events are managed in the same way as with <span
+ class="code">xcb_wait_for_event_t</span>.
+ Obviously, we will need to give the user some way of
+ terminating the program. This is usually done by handling a
+ special "quit" event, as we will soon see.
+ </p>
+ <div class="comp">
+ <div class="title">
+ Comparison Xlib/XCB
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XNextEvent ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_wait_for_event ()
+ </ul>
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XPending ()
+ <li>XCheckMaskEvent ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_poll_for_event ()
+ </ul>
+ </div>
+ </div>
+ <br>
+ <li class="subtitle"><a name="expose">Expose events</a>
+ <p>
+ The <span class="code">Expose</span> event is one of the most
+ basic (and most used) events an application may receive. It
+ will be sent to us in one of several cases:
+ </p>
+ <ul>
+ <li>A window that covered part of our window has moved
+ away, exposing part (or all) of our window.
+ <li>Our window was raised above other windows.
+ <li>Our window mapped for the first time.
+ <li>Our window was de-iconified.
+ </ul>
+ <p>
+ You should note the implicit assumption hidden here: the
+ contents of our window is lost when it is being obscured
+ (covered) by either windows. One may wonder why the X server
+ does not save this contents. The answer is: to save
+ memory. After all, the number of windows on a display at a
+ given time may be very large, and storing the contents of all
+ of them might require a lot of memory. Actually, there is a
+ way to tell the X server to store the contents of a window in
+ special cases, as we will see later.
+ </p>
+ <p>
+ When we get an <span class="code">Expose</span> event, we
+ should take the event's data from the members of the following
+ structure:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type; /* The type of the event, here it is XCB_EXPOSE */
+ uint8_t pad0;
+ uint16_t sequence;
+ xcb_window_t window; /* The Id of the window that receives the event (in case */
+ /* our application registered for events on several windows */
+ uint16_t x; /* The x coordinate of the top-left part of the window that needs to be redrawn */
+ uint16_t y; /* The y coordinate of the top-left part of the window that needs to be redrawn */
+ uint16_t width; /* The width of the part of the window that needs to be redrawn */
+ uint16_t height; /* The height of the part of the window that needs to be redrawn */
+ uint16_t count;
+} xcb_expose_event_t;
+</pre>
+ <li class="subtitle"><a name="userinput">Getting user input</a>
+ <p>
+ User input traditionally comes from two sources: the mouse
+ and the keyboard. Various event types exist to notify us of
+ user input (a key being presses on the keyboard, a key being
+ released on the keyboard, the mouse moving over our window,
+ the mouse entering (or leaving) our window, and so on.
+ </p>
+ <ol>
+ <li class="subsubtitle"><a name="mousepressrelease">Mouse button press and release events</a>
+ <p>
+ The first event type we will deal with is a mouse
+ button-press (or button-release) event in our window. In
+ order to register to such an event type, we should add one
+ (or more) of the following masks when we create our window:
+ </p>
+ <ul>
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_PRESS</span>: notify us
+ of any button that was pressed in one of our windows.
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_RELEASE</span>: notify us
+ of any button that was released in one of our windows.
+ </ul>
+ <p>
+ The structure to be checked for in our events loop is the
+ same for these two events, and is the following:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type; /* The type of the event, here it is xcb_button_press_event_t or xcb_button_release_event_t */
+ xcb_button_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate where the mouse has been pressed in the window */
+ int16_t event_y; /* The y coordinate where the mouse has been pressed in the window */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t same_screen;
+} xcb_button_press_event_t;
+
+typedef xcb_button_press_event_t xcb_button_release_event_t;
+</pre>
+ <p>
+ The <span class="code">time</span> field may be used to calculate "double-click"
+ situations by an application (e.g. if the mouse button was
+ clicked two times in a duration shorter than a given amount
+ of time, assume this was a double click).
+ </p>
+ <p>
+ The <span class="code">state</span> field is a mask of the buttons held down during
+ the event. It is a bitwise OR of any of the following (from the xcb_button_mask_t and
+ xcb_mod_mask_t enumerations):
+ </p>
+ <ul>
+ <li><span class="code">XCB_BUTTON_MASK_1</span>
+ <li><span class="code">XCB_BUTTON_MASK_2</span>
+ <li><span class="code">XCB_BUTTON_MASK_3</span>
+ <li><span class="code">XCB_BUTTON_MASK_4</span>
+ <li><span class="code">XCB_BUTTON_MASK_5</span>
+ <li><span class="code">XCB_MOD_MASK_SHIFT</span>
+ <li><span class="code">XCB_MOD_MASK_LOCK</span>
+ <li><span class="code">XCB_MOD_MASK_CONTROL</span>
+ <li><span class="code">XCB_MOD_MASK_1</span>
+ <li><span class="code">XCB_MOD_MASK_2</span>
+ <li><span class="code">XCB_MOD_MASK_3</span>
+ <li><span class="code">XCB_MOD_MASK_4</span>
+ <li><span class="code">XCB_MOD_MASK_5</span>
+ </ul>
+ <p>
+ Their names are self explanatory, where the first 5 refer to
+ the mouse buttons that are being pressed, while the rest
+ refer to various "special keys" that are being pressed (Mod1
+ is usually the 'Alt' key or the 'Meta' key).
+ </p>
+ <p>
+ <b>TODO:</b> Problem: it seems that the state does not
+ change when clicking with various buttons.
+ </p>
+ <li class="subsubtitle"><a name="mousemvnt">Mouse movement events</a>
+ <p>
+ Similar to mouse button press and release events, we also
+ can be notified of various mouse movement events. These can
+ be split into two families. One is of mouse pointer
+ movement while no buttons are pressed, and the second is a
+ mouse pointer motion while one (or more) of the buttons are
+ pressed (this is sometimes called "a mouse drag operation",
+ or just "dragging"). The following event masks may be added
+ during the creation of our window:
+ </p>
+ <ul>
+ <li><span class="code">XCB_EVENT_MASK_POINTER_MOTION</span>: events of
+ the pointer moving in one of the windows controlled by our
+ application, while no mouse button is held pressed.
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_MOTION</span>: Events of
+ the pointer moving while one or more of the mouse buttons
+ is held pressed.
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_1_MOTION</span>: same as
+ <span class="code">XCB_EVENT_MASK_BUTTON_MOTION</span>, but only when
+ the 1st mouse button is held pressed.
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_2_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_3_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_4_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_5_MOTION</span>: same as
+ <span class="code">XCB_EVENT_MASK_BUTTON_1_MOTION</span>, but
+ respectively for 2nd, 3rd, 4th and 5th mouse button.
+ </ul>
+ <p>
+ The structure to be checked for in our events loop is the
+ same for these events, and is the following:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type; /* The type of the event */
+ uint8_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate of the mouse when the event was generated */
+ int16_t event_y; /* The y coordinate of the mouse when the event was generated */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t same_screen;
+} xcb_motion_notify_event_t;
+</pre>
+ <li class="subsubtitle"><a name="mouseenter">Mouse pointer enter and leave events</a>
+ <p>
+ Another type of event that applications might be interested
+ in, is a mouse pointer entering a window the program
+ controls, or leaving such a window. Some programs use these
+ events to show the user that the application is now in
+ focus. In order to register for such an event type, we
+ should add one (or more) of the following masks when we
+ create our window:
+ </p>
+ <ul>
+ <li><span class="code">xcb_event_enter_window_t</span>: notify us
+ when the mouse pointer enters any of our controlled
+ windows.
+ <li><span class="code">xcb_event_leave_window_t</span>: notify us
+ when the mouse pointer leaves any of our controlled
+ windows.
+ </ul>
+ <p>
+ The structure to be checked for in our events loop is the
+ same for these two events, and is the following:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type; /* The type of the event */
+ uint8_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate of the mouse when the event was generated */
+ int16_t event_y; /* The y coordinate of the mouse when the event was generated */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t mode; /* The number of mouse button that was clicked */
+ uint8_t same_screen_focus;
+} xcb_enter_notify_event_t;
+
+typedef xcb_enter_notify_event_t xcb_leave_notify_event_t;
+</pre>
+ <li class="subsubtitle"><a name="focus">The keyboard focus</a>
+ <p>
+ There may be many windows on a screen, but only a single
+ keyboard attached to them. How does the X server then know
+ which window should be sent a given keyboard input ? This is
+ done using the keyboard focus. Only a single window on the
+ screen may have the keyboard focus at a given time. There
+ is a XCB function that allows a program to set the keyboard
+ focus to a given window. The user can usually set the
+ keyboard focus using the window manager (often by clicking
+ on the title bar of the desired window). Once our window
+ has the keyboard focus, every key press or key release will
+ cause an event to be sent to our program (if it regsitered
+ for these event types...).
+ </p>
+ <li class="subsubtitle"><a name="keypress">Keyboard press and release events</a>
+ <p>
+ If a window controlled by our program currently holds the
+ keyboard focus, it can receive key press and key release
+ events. So, we should add one (or more) of the following
+ masks when we create our window:
+ </p>
+ <ul>
+ <li><span class="code">XCB_EVENT_MASK_KEY_PRESS</span>: notify us when
+ a key was pressed while any of our controlled windows had
+ the keyboard focus.
+ <li><span class="code">XCB_EVENT_MASK_KEY_RELEASE</span>: notify us
+ when a key was released while any of our controlled
+ windows had the keyboard focus.
+ </ul>
+ <p>
+ The structure to be checked for in our events loop is the
+ same for these two events, and is the following:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type; /* The type of the event */
+ xcb_keycode_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x;
+ int16_t event_y;
+ uint16_t state;
+ uint8_t same_screen;
+} xcb_key_press_event_t;
+
+typedef xcb_key_press_event_t xcb_key_release_event_t;
+</pre>
+ <p>
+ The <span class="code">detail</span> field refers to the
+ physical key on the keyboard.
+ </p>
+ <p>
+ <b>TODO:</b> Talk about getting the ASCII code from the key code.
+ </p>
+ </ol>
+ <li class="subtitle"><a name="eventex">X events: a complete example</a>
+ <p>
+ As an example for handling events, we show a program that
+ creates a window, enters an events loop and checks for all the
+ events described above, and writes on the terminal the relevant
+ characteristics of the event. With this code, it should be
+ easy to add drawing operations, like those which have been
+ described above.
+ </p>
+ <pre class="code">
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <xcb/xcb.h>
+
+void
+print_modifiers (uint32_t mask)
+{
+ const char **mod, *mods[] = {
+ "Shift", "Lock", "Ctrl", "Alt",
+ "Mod2", "Mod3", "Mod4", "Mod5",
+ "Button1", "Button2", "Button3", "Button4", "Button5"
+ };
+ printf ("Modifier mask: ");
+ for (mod = mods ; mask; mask >>= 1, mod++)
+ if (mask & 1)
+ printf(*mod);
+ putchar ('\n');
+}
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ xcb_generic_event_t *e;
+ uint32_t mask = 0;
+ uint32_t values[2];
+
+ /* Open the connection to the X server */
+ c = xcb_connect (NULL, NULL);
+
+ /* Get the first screen */
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* Ask for our window's Id */
+ win = xcb_generate_id (c);
+
+ /* Create the window */
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
+ values[0] = screen->white_pixel;
+ values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE;
+ xcb_create_window (c, /* Connection */
+ 0, /* depth */
+ win, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ mask, values); /* masks */
+
+ /* Map the window on the screen */
+ xcb_map_window (c, win);
+
+ xcb_flush (c);
+
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ xcb_expose_event_t *ev = (xcb_expose_event_t *)e;
+
+ printf ("Window %ld exposed. Region to be redrawn at location (%d,%d), with dimension (%d,%d)\n",
+ ev->window, ev->x, ev->y, ev->width, ev->height);
+ break;
+ }
+ case XCB_BUTTON_PRESS: {
+ xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
+ print_modifiers(ev->state);
+
+ switch (ev->detail) {
+ case 4:
+ printf ("Wheel Button up in window %ld, at coordinates (%d,%d)\n",
+ ev->event, ev->event_x, ev->event_y);
+ break;
+ case 5:
+ printf ("Wheel Button down in window %ld, at coordinates (%d,%d)\n",
+ ev->event, ev->event_x, ev->event_y);
+ break;
+ default:
+ printf ("Button %d pressed in window %ld, at coordinates (%d,%d)\n",
+ ev->detail, ev->event, ev->event_x, ev->event_y);
+ }
+ break;
+ }
+ case XCB_BUTTON_RELEASE: {
+ xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Button %d released in window %ld, at coordinates (%d,%d)\n",
+ ev->detail, ev->event, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_MOTION_NOTIFY: {
+ xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)e;
+
+ printf ("Mouse moved in window %ld, at coordinates (%d,%d)\n",
+ ev->event, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_ENTER_NOTIFY: {
+ xcb_enter_notify_event_t *ev = (xcb_enter_notify_event_t *)e;
+
+ printf ("Mouse entered window %ld, at coordinates (%d,%d)\n",
+ ev->event, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_LEAVE_NOTIFY: {
+ xcb_leave_notify_event_t *ev = (xcb_leave_notify_event_t *)e;
+
+ printf ("Mouse left window %ld, at coordinates (%d,%d)\n",
+ ev->event, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_KEY_PRESS: {
+ xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Key pressed in window %ld\n",
+ ev->event);
+ break;
+ }
+ case XCB_KEY_RELEASE: {
+ xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Key released in window %ld\n",
+ ev->event);
+ break;
+ }
+ default:
+ /* Unknown event type, ignore it */
+ printf("Unknown event: %d\n", e->response_type);
+ break;
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
+
+ return 0;
+}
+</pre>
+ </ol>
+ <li class="title"><a name="font">Handling text and fonts</a>
+ <p>
+ Besides drawing graphics on a window, we often want to draw
+ text. Text strings have two major properties: the characters to
+ be drawn and the font with which they are drawn. In order to
+ draw text, we need to first request the X server to load a
+ font. We then assign a font to a Graphic Context, and finally, we
+ draw the text in a window, using the Graphic Context.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="fontstruct">The Font structure</a>
+ <p>
+ In order to support flexible fonts, a font type is
+ defined. You know what ? It's an Id:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_font_t;
+</pre>
+ <p>
+ It is used to contain information about a font, and is passed
+ to several functions that handle fonts selection and text drawing.
+ We ask the X server to attribute an Id to our font with the
+ function:
+ </p>
+ <pre class="code">
+xcb_font_t xcb_generate_id (xcb_connection_t *c);
+</pre>
+ <br>
+ <li class="subtitle"><a name="openingfont">Opening a Font</a>
+ <p>
+ To open a font, we use the following function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_open_font (xcb_connection_t *c,
+ xcb_font_t fid,
+ uint16_t name_len,
+ const char *name);
+</pre>
+ <p>
+ The <span class="code">fid</span> parameter is the font Id
+ defined by <span class="code">xcb_generate_id()</span> (see
+ above). The <span class="code">name</span> parameter is the
+ name of the font you want to open. Use the command
+ <span class="code">xlsfonts</span> in a terminal to know which
+ are the fonts available on your computer. The parameter
+ <span class="code">name_len</span> is the length of the name
+ of the font (given by <span class="code">strlen()</span>).
+ </p>
+ <li class="subtitle"><a name="assigningfont">Assigning a Font to a Graphic Context</a>
+ <p>
+ Once a font is opened, you have to create a Graphic Context
+ that will contain the informations about the color of the
+ foreground and the background used when you draw a text in a
+ Drawable. Here is an exemple of a Graphic Context that will
+ allow us to draw an opened font with a black foreground and a
+ white background:
+ </p>
+ <pre class="code">
+ /*
+ * c is the connection
+ * screen is the screen where the window is displayed
+ * window is the window in which we will draw the text
+ * font is the opened font
+ */
+
+ uint32_t value_list[3];
+ xcb_gcontext_t gc;
+ uint32_t mask;
+
+ gc = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
+ value_list[0] = screen->black_pixel;
+ value_list[1] = screen->white_pixel;
+ value_list[2] = font;
+ xcb_create_gc (c, gc, window, mask, value_list);
+
+ /* The font is not needed anymore, so we close it */
+ xcb_close_font (c, font);
+</pre>
+ <li class="subtitle"><a name="drawingtext">Drawing text in a drawable</a>
+ <p>
+ To draw a text in a drawable, we use the following function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_image_text_8 (xcb_connection_t *c,
+ uint8_t string_len,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ int16_t x,
+ int16_t y,
+ const char *string);
+</pre>
+ <p>
+ The <span class="code">string</span> parameter is the text to
+ draw. The location of the drawing is given by the parameters
+ <span class="code">x</span> and <span class="code">y</span>.
+ The base line of the text is exactly the parameter
+ <span class="code">y</span>.
+ </p>
+ <li class="subtitle"><a name="fontcompleteexample">Complete example</a>
+ <p>
+ This example draw a text at 10 pixels (for the base line) of
+ the bottom of a window. Pressing the Esc key exits the program.
+ </p>
+ <pre class="code">
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <xcb/xcb.h>
+
+#define WIDTH 300
+#define HEIGHT 100
+
+
+
+static xcb_gc_t gc_font_get (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ const char *font_name);
+
+static void text_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label);
+
+static void
+text_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label)
+{
+ xcb_void_cookie_t cookie_gc;
+ xcb_void_cookie_t cookie_text;
+ xcb_generic_error_t *error;
+ xcb_gcontext_t gc;
+ uint8_t length;
+
+ length = strlen (label);
+
+ gc = gc_font_get(c, screen, window, "7x13");
+
+ cookie_text = xcb_image_text_8_checked (c, length, window, gc,
+ x1,
+ y1, label);
+ error = xcb_request_check (c, cookie_text);
+ if (error) {
+ fprintf (stderr, "ERROR: can't paste text : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_gc = xcb_free_gc (c, gc);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't free gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+}
+
+static xcb_gc_t
+gc_font_get (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ const char *font_name)
+{
+ uint32_t value_list[3];
+ xcb_void_cookie_t cookie_font;
+ xcb_void_cookie_t cookie_gc;
+ xcb_generic_error_t *error;
+ xcb_font_t font;
+ xcb_gcontext_t gc;
+ uint32_t mask;
+
+ font = xcb_generate_id (c);
+ cookie_font = xcb_open_font_checked (c, font,
+ strlen (font_name),
+ font_name);
+
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't open font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ gc = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
+ value_list[0] = screen->black_pixel;
+ value_list[1] = screen->white_pixel;
+ value_list[2] = font;
+ cookie_gc = xcb_create_gc_checked (c, gc, window, mask, value_list);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't create gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_font = xcb_close_font_checked (c, font);
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't close font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ return gc;
+}
+
+int main ()
+{
+ xcb_screen_iterator_t screen_iter;
+ xcb_connection_t *c;
+ const xcb_setup_t *setup;
+ xcb_screen_t *screen;
+ xcb_generic_event_t *e;
+ xcb_generic_error_t *error;
+ xcb_void_cookie_t cookie_window;
+ xcb_void_cookie_t cookie_map;
+ xcb_window_t window;
+ uint32_t mask;
+ uint32_t values[2];
+ int screen_number;
+
+ /* getting the connection */
+ c = xcb_connect (NULL, &screen_number);
+ if (!c) {
+ fprintf (stderr, "ERROR: can't connect to an X server\n");
+ return -1;
+ }
+
+ /* getting the current screen */
+ setup = xcb_get_setup (c);
+
+ screen = NULL;
+ screen_iter = xcb_setup_roots_iterator (setup);
+ for (; screen_iter.rem != 0; --screen_number, xcb_screen_next (&screen_iter))
+ if (screen_number == 0)
+ {
+ screen = screen_iter.data;
+ break;
+ }
+ if (!screen) {
+ fprintf (stderr, "ERROR: can't get the current screen\n");
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ /* creating the window */
+ window = xcb_generate_id (c);
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
+ values[0] = screen->white_pixel;
+ values[1] =
+ XCB_EVENT_MASK_KEY_RELEASE |
+ XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_POINTER_MOTION;
+ cookie_window = xcb_create_window_checked (c,
+ screen->root_depth,
+ window, screen->root,
+ 20, 200, WIDTH, HEIGHT,
+ 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->root_visual,
+ mask, values);
+ cookie_map = xcb_map_window_checked (c, window);
+
+ /* error managing */
+ error = xcb_request_check (c, cookie_window);
+ if (error) {
+ fprintf (stderr, "ERROR: can't create window : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+ error = xcb_request_check (c, cookie_map);
+ if (error) {
+ fprintf (stderr, "ERROR: can't map window : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ xcb_flush(c);
+
+ while (1) {
+ e = xcb_poll_for_event(c);
+ if (e) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ char *text;
+
+ text = "Press ESC key to exit...";
+ text_draw (c, screen, window, 10, HEIGHT - 10, text);
+ break;
+ }
+ case XCB_KEY_RELEASE: {
+ xcb_key_release_event_t *ev;
+
+ ev = (xcb_key_release_event_t *)e;
+
+ switch (ev->detail) {
+ /* ESC */
+ case 9:
+ free (e);
+ xcb_disconnect (c);
+ return 0;
+ }
+ }
+ }
+ free (e);
+ }
+ }
+
+ return 0;
+}
+</pre>
+ </ol>
+ <li class="title"><a name="wm">Interacting with the window manager</a>
+ <p>
+ After we have seen how to create windows and draw on them, we
+ take one step back, and look at how our windows are interacting
+ with their environment (the full screen and the other
+ windows). First of all, our application needs to interact with
+ the window manager. The window manager is responsible to
+ decorating drawn windows (i.e. adding a frame, an iconify
+ button, a system menu, a title bar, etc), as well as handling
+ icons shown when windows are being iconified. It also handles
+ ordering of windows on the screen, and other administrative
+ tasks. We need to give it various hints as to how we want it to
+ treat our application's windows.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="wmprop">Window properties</a>
+ <p>
+ Many of the parameters communicated to the window manager are
+ passed using data called "properties". These properties are
+ attached by the X server to different windows, and are stored
+ in a format that makes it possible to read them from different
+ machines that may use different architectures (remember that
+ an X client program may run on a remote machine).
+ </p>
+ <p>
+ The property and its type (a string, an integer, etc) are
+ Id. Their type are <span class="code">xcb_atom_t</span>:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_atom_t;
+</pre>
+ <p>
+ To change the property of a window, we use the following
+ function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_change_property (xcb_connection_t *c, /* Connection to the X server */
+ uint8_t mode, /* Property mode */
+ xcb_window_t window, /* Window */
+ xcb_atom_t property, /* Property to change */
+ xcb_atom_t type, /* Type of the property */
+ uint8_t format, /* Format of the property (8, 16, 32) */
+ uint32_t data_len, /* Length of the data parameter */
+ const void *data); /* Data */
+</pre>
+ <p>
+ The <span class="code">mode</span> parameter coud be one of
+ the following values (defined in enumeration xcb_prop_mode_t in
+ the xproto.h header file):
+ </p>
+ <ul>
+ <li>XCB_PROP_MODE_REPLACE
+ <li>XCB_PROP_MODE_PREPEND
+ <li>XCB_PROP_MODE_APPEND
+ </ul>
+ <br>
+ <li class="subtitle"><a name="wmname">Setting the window name and icon name</a>
+ <p>
+ The first thing we want to do would be to set the name for our
+ window. This is done using the
+ <span class="code">xcb_change_property()</span> function. This
+ name may be used by the window manager as the title of the
+ window (in the title bar), in a task list, etc. The property
+ atom to use to set the name of a window is
+ <span class="code">WM_NAME</span> (and
+ <span class="code">WM_ICON_NAME</span> for the iconified
+ window) and its type is <span class="code">STRING</span>. Here
+ is an example of utilization:
+ </p>
+ <pre class="code">
+#include <string.h>
+
+#include <xcb/xcb.h>
+#include <xcb/xcb_atom.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ char *title = "Hello World !";
+ char *title_icon = "Hello World ! (iconified)";
+
+
+
+ /* Open the connection to the X server */
+ c = xcb_connect (NULL, NULL);
+
+ /* Get the first screen */
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* Ask for our window's Id */
+ win = xcb_generate_id (c);
+
+ /* Create the window */
+ xcb_create_window (c, /* Connection */
+ 0, /* depth */
+ win, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 250, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ 0, NULL); /* masks, not used */
+
+ /* Set the title of the window */
+ xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
+ WM_NAME, STRING, 8,
+ strlen (title), title);
+
+ /* Set the title of the window icon */
+ xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
+ WM_ICON_NAME, STRING, 8,
+ strlen(title_icon), title_icon);
+
+ /* Map the window on the screen */
+ xcb_map_window (c, win);
+
+ xcb_flush (c);
+
+ while (1) {}
+
+ return 0;
+}
+</pre>
+ <div class="emph">
+ <p>Note: the use of the atoms needs our program to be compiled
+ and linked against xcb_atom, so that we have to use
+ </p>
+ </div>
+ <pre class="text">
+gcc prog.c -o prog `pkg-config --cflags --libs xcb_atom`
+</pre>
+ <div class="emph">
+ <p>
+ for the program to compile fine.
+ </p>
+ </div>
+ </ol>
+ <li class="title"><a name="winop">Simple window operations</a>
+ <p>
+ One more thing we can do to our window is manipulate them on the
+ screen (resize them, move them, raise or lower them, iconify
+ them, and so on). Some window operations functions are supplied
+ by XCB for this purpose.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="winmap">Mapping and un-mapping a window</a>
+ <p>
+ The first pair of operations we can apply on a window is
+ mapping it, or un-mapping it. Mapping a window causes the
+ window to appear on the screen, as we have seen in our simple
+ window program example. Un-mapping it causes it to be removed
+ from the screen (although the window as a logical entity still
+ exists). This gives the effect of making a window hidden
+ (unmapped) and shown again (mapped). For example, if we have a
+ dialog box window in our program, instead of creating it every
+ time the user asks to open it, we can create the window once,
+ in an un-mapped mode, and when the user asks to open it, we
+ simply map the window on the screen. When the user clicked the
+ 'OK' or 'Cancel' button, we simply un-map the window. This is
+ much faster than creating and destroying the window, however,
+ the cost is wasted resources, both on the client side, and on
+ the X server side.
+ </p>
+ <p>
+ To map a window, you use the following function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_map_window (xcb_connection_t *c,
+ xcb_window_t window);
+</pre>
+ <p>
+ To have a simple example, see the <a href="#helloworld">example</a>
+ above. The mapping operation will cause an
+ <span class="code">Expose</span> event to be sent to our
+ application, unless the window is completely covered by other
+ windows.
+ </p>
+ <p>
+ Un-mapping a window is also simple. You use the function
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_unmap_window (xcb_connection_t *c,
+ xcb_window_t window);
+</pre>
+ <p>
+ The utilization of this function is the same as
+ <span class="code">xcb_map_window()</span>.
+ </p>
+ <li class="subtitle"><a name="winconf">Configuring a window</a>
+ <p>
+ As we have seen when we have created our first window, in the
+ X Events subsection, we can set some attributes for the window
+ (that is, the position, the size, the events the window will
+ receive, etc). If we want to modify them, but the window is
+ already created, we can change them by using the following
+ function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_configure_window (xcb_connection_t *c, /* The connection to the X server*/
+ xcb_window_t window, /* The window to configure */
+ uint16_t value_mask, /* The mask */
+ const uint32_t *value_list); /* The values to set */
+</pre>
+ <p>
+ We set the <span class="code">value_mask</span> to one or
+ several mask values that are in the xcb_config_window_t enumeration in the xproto.h header:
+ </p>
+ <ul>
+ <li><span class="code">XCB_CONFIG_WINDOW_X</span>: new x coordinate of the window's top left corner
+ <li><span class="code">XCB_CONFIG_WINDOW_Y</span>: new y coordinate of the window's top left corner
+ <li><span class="code">XCB_CONFIG_WINDOW_WIDTH</span>: new width of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_HEIGHT</span>: new height of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_BORDER_WIDTH</span>: new width of the border of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_SIBLING</span>
+ <li><span class="code">XCB_CONFIG_WINDOW_STACK_MODE</span>: the new stacking order
+ </ul>
+ <p>
+ We then give to <span class="code">value_mask</span> the new
+ value. We now describe how to use
+ <span class="code">xcb_configure_window_t</span> in some useful
+ situations.
+ </p>
+ <li class="subtitle"><a name="winmove">Moving a window around the screen</a>
+ <p>
+ An operation we might want to do with windows is to move them
+ to a different location. This can be done like this:
+ </p>
+ <pre class="code">
+const static uint32_t values[] = { 10, 20 };
+
+/* The connection c and the window win are supposed to be defined */
+
+/* Move the window to coordinates x = 10 and y = 20 */
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, values);
+</pre>
+ <p>
+ Note that when the window is moved, it might get partially
+ exposed or partially hidden by other windows, and thus we
+ might get <span class="code">Expose</span> events due to this
+ operation.
+ </p>
+ <li class="subtitle"><a name="winsize">Resizing a window</a>
+ <p>
+ Yet another operation we can do is to change the size of a
+ window. This is done using the following code:
+ </p>
+ <pre class="code">
+const static uint32_t values[] = { 200, 300 };
+
+/* The connection c and the window win are supposed to be defined */
+
+/* Resize the window to width = 10 and height = 20 */
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
+</pre>
+ <p>
+ We can also combine the move and resize operations using one
+ single call to <span class="code">xcb_configure_window_t</span>:
+ </p>
+ <pre class="code">
+const static uint32_t values[] = { 10, 20, 200, 300 };
+
+/* The connection c and the window win are supposed to be defined */
+
+/* Move the window to coordinates x = 10 and y = 20 */
+/* and resize the window to width = 10 and height = 20 */
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
+</pre>
+ <li class="subtitle"><a name="winstack">Changing windows stacking order: raise and lower</a>
+ <p>
+ Until now, we changed properties of a single window. We'll see
+ that there are properties that relate to the window and other
+ windows. One of them is the stacking order. That is, the order
+ in which the windows are layered on top of each other. The
+ front-most window is said to be on the top of the stack, while
+ the back-most window is at the bottom of the stack. Here is
+ how to manipulate our windows stack order:
+ </p>
+ <pre class="code">
+const static uint32_t values[] = { XCB_STACK_MODE_ABOVE };
+
+/* The connection c and the window win are supposed to be defined */
+
+/* Move the window on the top of the stack */
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
+</pre>
+ <pre class="code">
+const static uint32_t values[] = { XCB_STACK_MODE_BELOW };
+
+/* The connection c and the window win are supposed to be defined */
+
+/* Move the window on the bottom of the stack */
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
+</pre>
+ <li class="subtitle"><a name="wingetinfo">Getting information about a window</a>
+ <p>
+ Just like we can set various attributes of our windows, we can
+ also ask the X server supply the current values of these
+ attributes. For example, we can check where a window is
+ located on the screen, what is its current size, whether it is
+ mapped or not, etc. The structure that contains some of this
+ information is
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type;
+ uint8_t depth; /* depth of the window */
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t root; /* Id of the root window *>
+ int16_t x; /* X coordinate of the window's location */
+ int16_t y; /* Y coordinate of the window's location */
+ uint16_t width; /* Width of the window */
+ uint16_t height; /* Height of the window */
+ uint16_t border_width; /* Width of the window's border */
+} xcb_get_geometry_reply_t;
+</pre>
+ <p>
+ XCB fill this structure with two functions:
+ </p>
+ <pre class="code">
+xcb_get_geometry_cookie_t xcb_get_geometry (xcb_connection_t *c,
+ xcb_drawable_t drawable);
+xcb_get_geometry_reply_t *xcb_get_geometry_reply (xcb_connection_t *c,
+ xcb_get_geometry_cookie_t cookie,
+ xcb_generic_error_t **e);
+</pre>
+ <p>
+ You use them as follows:
+ </p>
+ <pre class="code">
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_geometry_reply_t *geom;
+
+ /* You initialize c and win */
+
+ geom = xcb_get_geometry_reply (c, xcb_get_geometry (c, win), NULL);
+
+ /* Do something with the fields of geom */
+
+ free (geom);
+</pre>
+ <p>
+ Remark that you have to free the structure, as
+ <span class="code">xcb_get_geometry_reply_t</span> allocates a
+ newly one.
+ </p>
+ <p>
+ One problem is that the returned location of the window is
+ relative to its parent window. This makes these coordinates
+ rather useless for any window manipulation functions, like
+ moving it on the screen. In order to overcome this problem, we
+ need to take a two-step operation. First, we find out the Id
+ of the parent window of our window. We then translate the
+ above relative coordinates to the screen coordinates.
+ </p>
+ <p>
+ To get the Id of the parent window, we need this structure:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type;
+ uint8_t pad0;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t root;
+ xcb_window_t parent; /* Id of the parent window */
+ uint16_t children_len;
+ uint8_t pad1[14];
+} xcb_query_tree_reply_t;
+</pre>
+ <p>
+ To fill this structure, we use these two functions:
+ </p>
+ <pre class="code">
+xcb_query_tree_cookie_t xcb_query_tree (xcb_connection_t *c,
+ xcb_window_t window);
+xcb_query_tree_reply_t *xcb_query_tree_reply (xcb_connection_t *c,
+ xcb_query_tree_cookie_t cookie,
+ xcb_generic_error_t **e);
+</pre>
+ <p>
+ The translated coordinates will be found in this structure:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type;
+ uint8_t same_screen;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t child;
+ uint16_t dst_x; /* Translated x coordinate */
+ uint16_t dst_y; /* Translated y coordinate */
+} xcb_translate_coordinates_reply_t;
+</pre>
+ <p>
+ As usual, we need two functions to fill this structure:
+ </p>
+ <pre class="code">
+xcb_translate_coordinates_cookie_t xcb_translate_coordinates (xcb_connection_t *c,
+ xcb_window_t src_window,
+ xcb_window_t dst_window,
+ int16_t src_x,
+ int16_t src_y);
+xcb_translate_coordinates_reply_t *xcb_translate_coordinates_reply (xcb_connection_t *c,
+ xcb_translate_coordinates_cookie_t cookie,
+ xcb_generic_error_t **e);
+</pre>
+ <p>
+ We use them as follows:
+ </p>
+ <pre class="code">
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_geometry_reply_t *geom;
+ xcb_query_tree_reply_t *tree;
+ xcb_translate_coordinates_reply_t *trans;
+
+ /* You initialize c and win */
+
+ geom = xcb_get_geometry_reply (c, xcb_get_geometry (c, win), NULL);
+ if (!geom)
+ return 0;
+
+ tree = xcb_query_tree_reply (c, xcb_query_tree (c, win), NULL);
+ if (!tree)
+ return 0;
+
+ trans = xcb_translate_coordinates_reply (c,
+ xcb_translate_coordinates (c,
+ win,
+ tree->parent,
+ geom->x, geom->y),
+ NULL);
+ if (!trans)
+ return 0;
+
+ /* the translated coordinates are in trans->dst_x and trans->dst_y */
+
+ free (trans);
+ free (tree);
+ free (geom);
+</pre>
+ <p>
+ Of course, as for <span class="code">geom</span>,
+ <span class="code">tree</span> and
+ <span class="code">trans</span> have to be freed.
+ </p>
+ <p>
+ The work is a bit hard, but XCB is a very low-level library.
+ </p>
+ <p>
+ <b>TODO:</b> the utilization of these functions should be a
+ prog, which displays the coordinates of the window.
+ </p>
+ <p>
+ There is another structure that gives informations about our window:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type;
+ uint8_t backing_store;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_visualid_t visual; /* Visual of the window */
+ uint16_t _class;
+ uint8_t bit_gravity;
+ uint8_t win_gravity;
+ uint32_t backing_planes;
+ uint32_t backing_pixel;
+ uint8_t save_under;
+ uint8_t map_is_installed;
+ uint8_t map_state; /* Map state of the window */
+ uint8_t override_redirect;
+ xcb_colormap_t colormap; /* Colormap of the window */
+ uint32_t all_event_masks;
+ uint32_t your_event_mask;
+ uint16_t do_not_propagate_mask;
+} xcb_get_window_attributes_reply_t;
+</pre>
+ <p>
+ XCB supplies these two functions to fill it:
+ </p>
+ <pre class="code">
+xcb_get_window_attributes_cookie_t xcb_get_window_attributes (xcb_connection_t *c,
+ xcb_window_t window);
+xcb_get_window_attributes_reply_t *xcb_get_window_attributes_reply (xcb_connection_t *c,
+ xcb_get_window_attributes_cookie_t cookie,
+ xcb_generic_error_t **e);
+</pre>
+ <p>
+ You use them as follows:
+ </p>
+ <pre class="code">
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_window_attributes_reply_t *attr;
+
+ /* You initialize c and win */
+
+ attr = xcb_get_window_attributes_reply (c, xcb_get_window_attributes (c, win), NULL);
+
+ if (!attr)
+ return 0;
+
+ /* Do something with the fields of attr */
+
+ free (attr);
+</pre>
+ <p>
+ As for <span class="code">geom</span>,
+ <span class="code">attr</span> has to be freed.
+ </p>
+ </ol>
+ <li class="title"><a name="usecolor">Using colors to paint the rainbow</a>
+ <p>
+ Up until now, all our painting operation were done using black
+ and white. We will (finally) see now how to draw using colors.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="colormap">Color maps</a>
+ <p>
+ In the beginning, there were not enough colors. Screen
+ controllers could only support a limited number of colors
+ simultaneously (initially 2, then 4, 16 and 256). Because of
+ this, an application could not just ask to draw in a "light
+ purple-red" color, and expect that color to be available. Each
+ application allocated the colors it needed, and when all the
+ color entries (4, 16, 256 colors) were in use, the next color
+ allocation would fail.
+ </p>
+ <p>
+ Thus, the notion of "a color map" was introduced. A color map
+ is a table whose size is the same as the number of
+ simultaneous colors a given screen controller. Each entry
+ contained the RGB (Red, Green and Blue) values of a different
+ color (all colors can be drawn using some combination of red,
+ green and blue). When an application wants to draw on the
+ screen, it does not specify which color to use. Rather, it
+ specifies which color entry of some color map to be used
+ during this drawing. Change the value in this color map entry
+ and the drawing will use a different color.
+ </p>
+ <p>
+ In order to be able to draw using colors that got something to
+ do with what the programmer intended, color map allocation
+ functions are supplied. You could ask to allocate entry for a
+ color with a set of RGB values. If one already existed, you
+ would get its index in the table. If none existed, and the
+ table was not full, a new cell would be allocated to contain
+ the given RGB values, and its index returned. If the table was
+ full, the procedure would fail. You could then ask to get a
+ color map entry with a color that is closest to the one you
+ were asking for. This would mean that the actual drawing on
+ the screen would be done using colors similar to what you
+ wanted, but not the same.
+ </p>
+ <p>
+ On today's more modern screens where one runs an X server with
+ support for 16 million colors, this limitation looks a little
+ silly, but remember that there are still older computers with
+ older graphics cards out there. Using color map, support for
+ these screen becomes transparent to you. On a display
+ supporting 16 million colors, any color entry allocation
+ request would succeed. On a display supporting a limited
+ number of colors, some color allocation requests would return
+ similar colors. It won't look as good, but your application
+ would still work.
+ </p>
+ <li class="subtitle"><a name="colormapalloc">Allocating and freeing Color Maps</a>
+ <p>
+ When you draw using XCB, you can choose to use the standard
+ color map of the screen your window is displayed on, or you
+ can allocate a new color map and apply it to a window. In the
+ latter case, each time the mouse moves onto your window, the
+ screen color map will be replaced by your window's color map,
+ and you'll see all the other windows on screen change their
+ colors into something quite bizzare. In fact, this is the
+ effect you get with X applications that use the "-install"
+ command line option.
+ </p>
+ <p>
+ In XCB, a color map is (as often in X) an Id:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_colormap_t;
+</pre>
+ <p>
+ In order to access the screen's default color map, you just
+ have to retrieve the <span class="code">default_colormap</span>
+ field of the <span class="code">xcb_screen_t</span> structure
+ (see Section
+ <a href="#screen">Checking basic information about a connection</a>):
+ </p>
+ <pre class="code">
+#include <stdio.h>
+
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_colormap_t colormap;
+
+ /* Open the connection to the X server and get the first screen */
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ colormap = screen->default_colormap;
+
+ return 0;
+}
+</pre>
+ <p>
+ This will return the color map used by default on the first
+ screen (again, remember that an X server may support several
+ different screens, each of which might have its own resources).
+ </p>
+ <p>
+ The other option, that of allocating a new colormap, works as
+ follows. We first ask the X server to give an Id to our color
+ map, with this function:
+ </p>
+ <pre class="code">
+xcb_colormap_t xcb_generate_id (xcb_connection_t *c);
+</pre>
+ <p>
+ Then, we create the color map with
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_colormap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t alloc, /* Colormap entries to be allocated (AllocNone or AllocAll) */
+ xcb_colormap_t mid, /* Id of the color map */
+ xcb_window_t window, /* Window on whose screen the colormap will be created */
+ xcb_visualid_t visual); /* Id of the visual supported by the screen */
+</pre>
+ <p>
+ Here is an example of creation of a new color map:
+ </p>
+ <pre class="code">
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ xcb_colormap_t cmap
+
+ /* Open the connection to the X server and get the first screen */
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* We create the window win here*/
+
+ cmap = xcb_generate_id (c);
+ xcb_create_colormap (c, XCB_COLORMAP_ALLOC_NONE, cmap, win, screen->root_visual);
+
+ return 0;
+}
+</pre>
+ <p>
+ Note that the window parameter is only used to allow the X
+ server to create the color map for the given screen. We can
+ then use this color map for any window drawn on the same screen.
+ </p>
+ <p>
+ To free a color map, it suffices to use this function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_free_colormap (xcb_connection_t *c, /* The connection */
+ xcb_colormap_t cmap); /* The color map */
+</pre>
+ <div class="comp">
+ <div class="title">
+ Comparison Xlib/XCB
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XCreateColormap ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_generate_id ()
+ <li>xcb_create_colormap ()
+ </ul>
+ </div>
+ <div class="xlib">
+ <ul>
+ <li>XFreeColormap ()
+ </ul>
+ </div>
+ <div class="xcb">
+ <ul>
+ <li>xcb_free_colormap ()
+ </ul>
+ </div>
+ </div>
+ <br>
+ <li class="subtitle"><a name="alloccolor">Allocating and freeing a color entry</a>
+ <p>
+ Once we got access to some color map, we can start allocating
+ colors. The informations related to a color are stored in the
+ following structure:
+ </p>
+ <pre class="code">
+typedef struct {
+ uint8_t response_type;
+ uint8_t pad0;
+ uint16_t sequence;
+ uint32_t length;
+ uint16_t red; /* The red component */
+ uint16_t green; /* The green component */
+ uint16_t blue; /* The blue component */
+ uint8_t pad1[2];
+ uint32_t pixel; /* The entry in the color map, supplied by the X server */
+} xcb_alloc_color_reply_t;
+</pre>
+ <p>
+ XCB supplies these two functions to fill it:
+ </p>
+ <pre class="code">
+xcb_alloc_color_cookie_t xcb_alloc_color (xcb_connection_t *c,
+ xcb_colormap_t cmap,
+ uint16_t red,
+ uint16_t green,
+ uint16_t blue);
+xcb_alloc_color_reply_t *xcb_alloc_color_reply (xcb_connection_t *c,
+ xcb_alloc_color_cookie_t cookie,
+ xcb_generic_error_t **e);
+</pre>
+ <p>
+ The fuction <span class="code">xcb_alloc_color()</span> takes the
+ 3 RGB components as parameters (red, green and blue). Here is an
+ example of using these functions:
+ </p>
+ <pre class="code">
+#include <malloc.h>
+
+#include <xcb/xcb.h>
+
+int
+main ()
+{
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ xcb_colormap_t cmap;
+ xcb_alloc_color_reply_t *rep;
+
+ /* Open the connection to the X server and get the first screen */
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
+
+ /* We create the window win here*/
+
+ cmap = xcb_generate_id (c);
+ xcb_create_colormap (c, XCB_COLORMAP_ALLOC_NONE, cmap, win, screen->root_visual);
+
+ rep = xcb_alloc_color_reply (c, xcb_alloc_color (c, cmap, 65535, 0, 0), NULL);
+
+ if (!rep)
+ return 0;
+
+ /* Do something with r->pixel or the components */
+
+ free (rep);
+
+ return 0;
+}
+</pre>
+ <p>
+ As <span class="code">xcb_alloc_color_reply()</span> allocates
+ memory, you have to free <span class="code">rep</span>.
+ </p>
+ <p>
+ <b>TODO</b>: Talk about freeing colors.
+ </p>
+ </ol>
+ <li class="title"><a name="pixmaps">X Bitmaps and Pixmaps</a>
+ <p>
+ One thing many so-called "Multi-Media" applications need to do,
+ is display images. In the X world, this is done using bitmaps
+ and pixmaps. We have already seen some usage of them when
+ setting an icon for our application. Lets study them further,
+ and see how to draw these images inside a window, along side the
+ simple graphics and text we have seen so far.
+ </p>
+ <p>
+ One thing to note before delving further, is that XCB (nor Xlib)
+ supplies no means of manipulating popular image formats, such as
+ gif, png, jpeg or tiff. It is up to the programmer (or to higher
+ level graphics libraries) to translate these image formats into
+ formats that the X server is familiar with (x bitmaps and x
+ pixmaps).
+ </p>
+ <ol>
+ <li class="subtitle"><a name="pixmapswhat">What is a X Bitmap? An X Pixmap?</a>
+ <p>
+ An X bitmap is a two-color image stored in a format specific
+ to the X window system. When stored in a file, the bitmap data
+ looks like a C source file. It contains variables defining the
+ width and the height of the bitmap, an array containing the
+ bit values of the bitmap (the size of the array is
+ (width+7)/8*height and the bit and byte order are LSB), and
+ an optional hot-spot location (that will
+ be explained later, when discussing mouse cursors).
+ </p>
+ <p>
+ An X pixmap is a format used to stored images in the memory of
+ an X server. This format can store both black and white images
+ (such as x bitmaps) as well as color images. It is the only
+ image format supported by the X protocol, and any image to be
+ drawn on screen, should be first translated into this format.
+ </p>
+ <p>
+ In actuality, an X pixmap can be thought of as a window that
+ does not appear on the screen. Many graphics operations that
+ work on windows, will also work on pixmaps. Indeed, the type
+ of X pixmap in XCB is an Id like a window:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_pixmap_t;
+</pre>
+ <p>
+ Like Xlib, there is no difference between a Drawable, a Window
+ or a Pixmap:
+ </p>
+ <pre class="code">
+typedef uint32_t xcb_drawable_t;
+</pre>
+ <p>
+ in order to avoid confusion between a window and a pixmap. The
+ operations that will work the same on a window or a pixmap
+ will require a <span class="code">xcb_drawable_t</span>
+ </p>
+ <div class="emph">
+ <p>
+ Remark: In Xlib, there is no specific difference between a
+ <span class="code">Drawable</span>, a
+ <span class="code">Pixmap</span> or a
+ <span class="code">Window</span>: all are 32 bit long
+ integer. XCB wraps all these different IDs in structures to
+ provide some measure of type-safety.
+ </p>
+ </div>
+ <li class="subtitle"><a name="pixmapscreate">Creating a pixmap</a>
+ <p>
+ Sometimes we want to create an un-initialized pixmap, so we
+ can later draw into it. This is useful for image drawing
+ programs (creating a new empty canvas will cause the creation
+ of a new pixmap on which the drawing can be stored). It is
+ also useful when reading various image formats: we load the
+ image data into memory, create a pixmap on the server, and
+ then draw the decoded image data onto that pixmap.
+ </p>
+ <p>
+ To create a new pixmap, we first ask the X server to give an
+ Id to our pixmap, with this function:
+ </p>
+ <pre class="code">
+xcb_pixmap_t xcb_generate_id (xcb_connection_t *c);
+</pre>
+ <p>
+ Then, XCB supplies the following function to create new pixmaps:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_pixmap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t depth, /* Depth of the screen */
+ xcb_pixmap_t pid, /* Id of the pixmap */
+ xcb_drawable_t drawable,
+ uint16_t width, /* Width of the window (in pixels) */
+ uint16_t height); /* Height of the window (in pixels) */
+</pre>
+ <p>
+ <b>TODO</b>: Explain the drawable parameter, and give an
+ example (like <a href="xpoints.c">xpoints.c</a>)
+ </p>
+ <li class="subtitle"><a name="pixmapsdraw"></a>Drawing a pixmap in a window
+ <p>
+ Once we got a handle to a pixmap, we can draw it on some
+ window, using the following function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_copy_area (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ xcb_drawable_t src_drawable, /* The Drawable we want to paste */
+ xcb_drawable_t dst_drawable, /* The Drawable on which we copy the previous Drawable */
+ xcb_gcontext_t gc, /* A Graphic Context */
+ int16_t src_x, /* Top left x coordinate of the region we want to copy */
+ int16_t src_y, /* Top left y coordinate of the region we want to copy */
+ int16_t dst_x, /* Top left x coordinate of the region where we want to copy */
+ int16_t dst_y, /* Top left y coordinate of the region where we want to copy */
+ uint16_t width, /* Width of the region we want to copy */
+ uint16_t height); /* Height of the region we want to copy */
+</pre>
+ <p>
+ As you can see, we could copy the whole pixmap, as well as
+ only a given rectangle of the pixmap. This is useful to
+ optimize the drawing speed: we could copy only what we have
+ modified in the pixmap.
+ </p>
+ <p>
+ <b>One important note should be made</b>: it is possible to
+ create pixmaps with different depths on the same screen. When
+ we perform copy operations (a pixmap onto a window, etc), we
+ should make sure that both source and target have the same
+ depth. If they have a different depth, the operation would
+ fail. The exception to this is if we copy a specific bit plane
+ of the source pixmap using the
+ <span class="code">xcb_copy_plane_t</span> function. In such an
+ event, we can copy a specific plane to the target window (in
+ actuality, setting a specific bit in the color of each pixel
+ copied). This can be used to generate strange graphic effects
+ in a window, but that is beyond the scope of this tutorial.
+ </p>
+ <li class="subtitle"><a name="pixmapsfree"></a>Freeing a pixmap
+ <p>
+ Finally, when we are done using a given pixmap, we should free
+ it, in order to free resources of the X server. This is done
+ using this function:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_free_pixmap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ xcb_pixmap_t pixmap); /* A given pixmap */
+</pre>
+ <p>
+ Of course, after having freed it, we must not try accessing
+ the pixmap again.
+ </p>
+ <p>
+ <b>TODO</b>: Give an example, or a link to xpoints.c
+ </p>
+ </ol>
+ <li class="title"><a name="mousecursor">Messing with the mouse cursor</a>
+ <p>
+ It it possible to modify the shape of the mouse pointer (also
+ called the X pointer) when in certain states, as we otfen see in
+ programs. For example, a busy application would often display
+ the sand clock over its main window, to give the user a visual
+ hint that he should wait. Let's see how we can change the mouse
+ cursor of our windows.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="mousecursorcreate">Creating and destroying a mouse cursor</a>
+ <p>
+ There are two methods for creating cursors. One of them is by
+ using a set of predefined cursors, that are supplied by the X
+ server, the other is by using a user-supplied bitmap.
+ </p>
+ <p>
+ In the first method, we use a special font named "cursor", and
+ the function <span class="code">xcb_create_glyph_cursor</span>:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_glyph_cursor (xcb_connection_t *c,
+ xcb_cursor_t cid,
+ xcb_font_t source_font, /* font for the source glyph */
+ xcb_font_t mask_font, /* font for the mask glyph or XCB_NONE */
+ uint16_t source_char, /* character glyph for the source */
+ uint16_t mask_char, /* character glyph for the mask */
+ uint16_t fore_red, /* red value for the foreground of the source */
+ uint16_t fore_green, /* green value for the foreground of the source */
+ uint16_t fore_blue, /* blue value for the foreground of the source */
+ uint16_t back_red, /* red value for the background of the source */
+ uint16_t back_green, /* green value for the background of the source */
+ uint16_t back_blue) /* blue value for the background of the source */
+</pre>
+ <p>
+ <b>TODO</b>: Describe <span class="code">source_char</span>
+ and <span class="code">mask_char</span>, for example by giving
+ an example on how to get the values. There is a list there:
+ <a href="http://tronche.com/gui/x/xlib/appendix/b/">X Font Cursors</a>
+ </p>
+ <p>
+ So we first open that font (see <a href="#loadfont">Loading a Font</a>)
+ and create the new cursor. As for every X ressource, we have to
+ ask for an X id with <span class="code">xcb_generate_id</span>
+ first:
+ </p>
+ <pre class="code">
+xcb_font_t font;
+xcb_cursor_t cursor;
+
+/* The connection is set */
+
+font = xcb_generate_id (conn);
+xcb_open_font (conn, font, strlen ("cursor"), "cursor");
+
+cursor = xcb_generate_id (conn);
+xcb_create_glyph_cursor (conn, cursor, font, font,
+ 58, 58 + 1,
+ 0, 0, 0,
+ 0, 0, 0);
+</pre>
+ <p>
+ We have created the cursor "right hand" by specifying 58 to
+ the <span class="code">source_fon</span>t argument and 58 + 1
+ to the <span class="code">mask_font</span>.
+ </p>
+ <p>
+ The cursor is destroyed by using the function
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_free_cursor (xcb_connection_t *c,
+ xcb_cursor_t cursor);
+</pre>
+ <p>
+ In the second method, we create a new cursor by using a pair
+ of pixmaps, with depth of one (that is, two colors
+ pixmaps). One pixmap defines the shape of the cursor, while
+ the other works as a mask, specifying which pixels of the
+ cursor will be actually drawn. The rest of the pixels will be
+ transparent.
+ </p>
+ <p>
+ <b>TODO</b>: give an example.
+ </p>
+ <li class="subtitle"><a name="mousecursorset">Setting a window's mouse cursor</a>
+ <p>
+ Once the cursor is created, we can modify the cursor of our
+ window by using <span class="code">xcb_change_window_attributes</span>
+ and using the <span class="code">XCB_CWCURSOR</span> attribute:
+ </p>
+ <pre class="code">
+uint32_t mask;
+uint32_t value_list;
+
+/* The connection and window are set */
+/* The cursor is already created */
+
+mask = XCB_CWCURSOR;
+value_list = cursor;
+xcb_change_window_attributes (conn, window, mask, &value_list);
+</pre>
+ <p>
+ Of course, the cursor and the font must be freed.
+ </p>
+ <li class="subtitle"><a name="mousecursorexample">Complete example</a>
+ <p>
+ The following example displays a window with a
+ button. When entering the window, the window cursor is changed
+ to an arrow. When clicking once on the button, the cursor is
+ changed to a hand. When clicking again on the button, the
+ cursor window gets back to the arrow. The Esc key exits the
+ application.
+ </p>
+ <pre class="code">
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <xcb/xcb.h>
+
+#define WIDTH 300
+#define HEIGHT 150
+
+
+
+static xcb_gc_t gc_font_get (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ const char *font_name);
+
+static void button_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label);
+
+static void text_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label);
+
+static void cursor_set (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int cursor_id);
+
+
+static void
+button_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label)
+{
+ xcb_point_t points[5];
+ xcb_void_cookie_t cookie_gc;
+ xcb_void_cookie_t cookie_line;
+ xcb_void_cookie_t cookie_text;
+ xcb_generic_error_t *error;
+ xcb_gcontext_t gc;
+ int16_t width;
+ int16_t height;
+ uint8_t length;
+ int16_t inset;
+
+ length = strlen (label);
+ inset = 2;
+
+ gc = gc_font_get(c, screen, window, "7x13");
+
+ width = 7 * length + 2 * (inset + 1);
+ height = 13 + 2 * (inset + 1);
+ points[0].x = x1;
+ points[0].y = y1;
+ points[1].x = x1 + width;
+ points[1].y = y1;
+ points[2].x = x1 + width;
+ points[2].y = y1 - height;
+ points[3].x = x1;
+ points[3].y = y1 - height;
+ points[4].x = x1;
+ points[4].y = y1;
+ cookie_line = xcb_poly_line_checked (c, XCB_COORD_MODE_ORIGIN,
+ window, gc, 5, points);
+
+ error = xcb_request_check (c, cookie_line);
+ if (error) {
+ fprintf (stderr, "ERROR: can't draw lines : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_text = xcb_image_text_8_checked (c, length, window, gc,
+ x1 + inset + 1,
+ y1 - inset - 1, label);
+ error = xcb_request_check (c, cookie_text);
+ if (error) {
+ fprintf (stderr, "ERROR: can't paste text : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_gc = xcb_free_gc (c, gc);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't free gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+}
+
+static void
+text_draw (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int16_t x1,
+ int16_t y1,
+ const char *label)
+{
+ xcb_void_cookie_t cookie_gc;
+ xcb_void_cookie_t cookie_text;
+ xcb_generic_error_t *error;
+ xcb_gcontext_t gc;
+ uint8_t length;
+
+ length = strlen (label);
+
+ gc = gc_font_get(c, screen, window, "7x13");
+
+ cookie_text = xcb_image_text_8_checked (c, length, window, gc,
+ x1,
+ y1, label);
+ error = xcb_request_check (c, cookie_text);
+ if (error) {
+ fprintf (stderr, "ERROR: can't paste text : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_gc = xcb_free_gc (c, gc);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't free gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+}
+
+static xcb_gc_t
+gc_font_get (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ const char *font_name)
+{
+ uint32_t value_list[3];
+ xcb_void_cookie_t cookie_font;
+ xcb_void_cookie_t cookie_gc;
+ xcb_generic_error_t *error;
+ xcb_font_t font;
+ xcb_gcontext_t gc;
+ uint32_t mask;
+
+ font = xcb_generate_id (c);
+ cookie_font = xcb_open_font_checked (c, font,
+ strlen (font_name),
+ font_name);
+
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't open font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ gc = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
+ value_list[0] = screen->black_pixel;
+ value_list[1] = screen->white_pixel;
+ value_list[2] = font;
+ cookie_gc = xcb_create_gc_checked (c, gc, window, mask, value_list);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't create gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cookie_font = xcb_close_font_checked (c, font);
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't close font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ return gc;
+}
+
+static void
+cursor_set (xcb_connection_t *c,
+ xcb_screen_t *screen,
+ xcb_window_t window,
+ int cursor_id)
+{
+ uint32_t values_list[3];
+ xcb_void_cookie_t cookie_font;
+ xcb_void_cookie_t cookie_gc;
+ xcb_generic_error_t *error;
+ xcb_font_t font;
+ xcb_cursor_t cursor;
+ xcb_gcontext_t gc;
+ uint32_t mask;
+ uint32_t value_list;
+
+ font = xcb_generate_id (c);
+ cookie_font = xcb_open_font_checked (c, font,
+ strlen ("cursor"),
+ "cursor");
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't open font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ cursor = xcb_generate_id (c);
+ xcb_create_glyph_cursor (c, cursor, font, font,
+ cursor_id, cursor_id + 1,
+ 0, 0, 0,
+ 0, 0, 0);
+
+ gc = xcb_generate_id (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
+ values_list[0] = screen->black_pixel;
+ values_list[1] = screen->white_pixel;
+ values_list[2] = font;
+ cookie_gc = xcb_create_gc_checked (c, gc, window, mask, values_list);
+ error = xcb_request_check (c, cookie_gc);
+ if (error) {
+ fprintf (stderr, "ERROR: can't create gc : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+
+ mask = XCB_CW_CURSOR;
+ value_list = cursor;
+ xcb_change_window_attributes (c, window, mask, &value_list);
+
+ xcb_free_cursor (c, cursor);
+
+ cookie_font = xcb_close_font_checked (c, font);
+ error = xcb_request_check (c, cookie_font);
+ if (error) {
+ fprintf (stderr, "ERROR: can't close font : %d\n", error->error_code);
+ xcb_disconnect (c);
+ exit (-1);
+ }
+}
+
+int main ()
+{
+ xcb_screen_iterator_t screen_iter;
+ xcb_connection_t *c;
+ const xcb_setup_t *setup;
+ xcb_screen_t *screen;
+ xcb_generic_event_t *e;
+ xcb_generic_error_t *error;
+ xcb_void_cookie_t cookie_window;
+ xcb_void_cookie_t cookie_map;
+ xcb_window_t window;
+ uint32_t mask;
+ uint32_t values[2];
+ int screen_number;
+ uint8_t is_hand = 0;
+
+ /* getting the connection */
+ c = xcb_connect (NULL, &screen_number);
+ if (!c) {
+ fprintf (stderr, "ERROR: can't connect to an X server\n");
+ return -1;
+ }
+
+ /* getting the current screen */
+ setup = xcb_get_setup (c);
+
+ screen = NULL;
+ screen_iter = xcb_setup_roots_iterator (setup);
+ for (; screen_iter.rem != 0; --screen_number, xcb_screen_next (&screen_iter))
+ if (screen_number == 0)
+ {
+ screen = screen_iter.data;
+ break;
+ }
+ if (!screen) {
+ fprintf (stderr, "ERROR: can't get the current screen\n");
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ /* creating the window */
+ window = xcb_generate_id (c);
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
+ values[0] = screen->white_pixel;
+ values[1] =
+ XCB_EVENT_MASK_KEY_RELEASE |
+ XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_EXPOSURE |
+ XCB_EVENT_MASK_POINTER_MOTION;
+ cookie_window = xcb_create_window_checked (c,
+ screen->root_depth,
+ window, screen->root,
+ 20, 200, WIDTH, HEIGHT,
+ 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ screen->root_visual,
+ mask, values);
+ cookie_map = xcb_map_window_checked (c, window);
+
+ /* error managing */
+ error = xcb_request_check (c, cookie_window);
+ if (error) {
+ fprintf (stderr, "ERROR: can't create window : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+ error = xcb_request_check (c, cookie_map);
+ if (error) {
+ fprintf (stderr, "ERROR: can't map window : %d\n", error->error_code);
+ xcb_disconnect (c);
+ return -1;
+ }
+
+ cursor_set (c, screen, window, 68);
+
+ xcb_flush(c);
+
+ while (1) {
+ e = xcb_poll_for_event(c);
+ if (e) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ char *text;
+
+ text = "click here to change cursor";
+ button_draw (c, screen, window,
+ (WIDTH - 7 * strlen(text)) / 2,
+ (HEIGHT - 16) / 2, text);
+
+ text = "Press ESC key to exit...";
+ text_draw (c, screen, window, 10, HEIGHT - 10, text);
+ break;
+ }
+ case XCB_BUTTON_PRESS: {
+ xcb_button_press_event_t *ev;
+ int length;
+
+ ev = (xcb_button_press_event_t *)e;
+ length = strlen ("click here to change cursor");
+
+ if ((ev->event_x >= (WIDTH - 7 * length) / 2) &&
+ (ev->event_x <= ((WIDTH - 7 * length) / 2 + 7 * length + 6)) &&
+ (ev->event_y >= (HEIGHT - 16) / 2 - 19) &&
+ (ev->event_y <= ((HEIGHT - 16) / 2)))
+ is_hand = 1 - is_hand;
+
+ is_hand ? cursor_set (c, screen, window, 58) : cursor_set (c, screen, window, 68);
+ }
+ case XCB_KEY_RELEASE: {
+ xcb_key_release_event_t *ev;
+
+ ev = (xcb_key_release_event_t *)e;
+
+ switch (ev->detail) {
+ /* ESC */
+ case 9:
+ free (e);
+ xcb_disconnect (c);
+ return 0;
+ }
+ }
+ }
+ free (e);
+ }
+ }
+
+ return 0;
+}
+</pre>
+ </ol>
+ <li class="title"><a name="translation">Translation of basic Xlib functions and macros</a>
+ <p>
+ The problem when you want to port an Xlib program to XCB is that
+ you don't know if the Xlib function that you want to "translate"
+ is a X Window one or an Xlib macro. In that section, we describe
+ a way to translate the usual functions or macros that Xlib
+ provides. It's usually just a member of a structure.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="displaystructure">Members of the Display structure</a>
+ <p>
+ In this section, we look at how to translate the macros that
+ return some members of the <span class="code">Display</span>
+ structure. They are obtained by using a function that requires a
+ <span class="code">xcb_connection_t *</span> or a member of the
+ <span class="code">xcb_setup_t</span> structure
+ (via the function <span class="code">xcb_get_setup</span>), or
+ a function that requires that structure.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="ConnectionNumber">ConnectionNumber</a>
+ <p>
+ This number is the file descriptor that connects the client
+ to the server. You just have to use that function:
+ </p>
+ <pre class="code">
+int xcb_get_file_descriptor (xcb_connection_t *c);
+</pre>
+ <li class="subtitle"><a name="DefaultScreen"></a>DefaultScreen
+ <p>
+ That number is not stored by XCB. It is returned in the
+ second parameter of the function <span class="code"><a href="#openconn">xcb_connect</a></span>.
+ Hence, you have to store it yourself if you want to use
+ it. Then, to get the <span class="code">xcb_screen_t</span>
+ structure, you have to iterate on the screens.
+ The equivalent function of the Xlib's
+ <span class="code">ScreenOfDisplay</span> function can be
+ found <a href="#ScreenOfDisplay">below</a>. This is also provided in the
+ xcb_aux_t library as <span class="code">xcb_aux_get_screen()</span>. OK, here is the
+ small piece of code to get that number:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+int screen_default_nbr;
+
+/* you pass the name of the display you want to xcb_connect_t */
+
+c = xcb_connect (display_name, &screen_default_nbr);
+
+/* screen_default_nbr contains now the number of the default screen */
+</pre>
+ <li class="subtitle"><a name="QLength"></a>QLength
+ <p>
+ Not documented yet.
+ </p>
+ <p>
+ However, this points out a basic difference in philosophy between
+ Xlib and XCB. Xlib has several functions for filtering and
+ manipulating the incoming and outgoing X message queues. XCB
+ wishes to hide this as much as possible from the user, which
+ allows for more freedom in implementation strategies.
+ </p>
+ <li class="subtitle"><a name="ScreenCount"></a>ScreenCount
+ <p>
+ You get the count of screens with the functions
+ <span class="code">xcb_get_setup</span>
+ and
+ <span class="code">xcb_setup_roots_iterator</span>
+ (if you need to iterate):
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+int screen_count;
+
+/* you init the connection */
+
+screen_count = xcb_setup_roots_iterator (xcb_get_setup (c)).rem;
+
+/* screen_count contains now the count of screens */
+</pre>
+ <p>
+ If you don't want to iterate over the screens, a better way
+ to get that number is to use
+ <span class="code">xcb_setup_roots_length_t</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+int screen_count;
+
+/* you init the connection */
+
+screen_count = xcb_setup_roots_length (xcb_get_setup (c));
+
+/* screen_count contains now the count of screens */
+</pre>
+ <li class="subtitle"><a name="ServerVendor"></a>ServerVendor
+ <p>
+ You get the name of the vendor of the server hardware with
+ the functions <span class="code">xcb_get_setup</span>
+ and
+ <span
+ class="code">xcb_setup_vendor</span>. Beware
+ that, unlike Xlib, the string returned by XCB is not
+ necessarily null-terminaled:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+char *vendor = NULL;
+int length;
+
+/* you init the connection */
+length = xcb_setup_vendor_length (xcb_get_setup (c));
+vendor = (char *)malloc (length + 1);
+if (vendor)
+memcpy (vendor, xcb_setup_vendor (xcb_get_setup (c)), length);
+vendor[length] = '\0';
+
+/* vendor contains now the name of the vendor. Must be freed when not used anymore */
+</pre>
+ <li class="subtitle"><a name="ProtocolVersion"></a>ProtocolVersion
+ <p>
+ You get the major version of the protocol in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint16_t protocol_major_version;
+
+/* you init the connection */
+
+protocol_major_version = xcb_get_setup (c)->protocol_major_version;
+
+/* protocol_major_version contains now the major version of the protocol */
+</pre>
+ <li class="subtitle"><a name="ProtocolRevision"></a>ProtocolRevision
+ <p>
+ You get the minor version of the protocol in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint16_t protocol_minor_version;
+
+/* you init the connection */
+
+protocol_minor_version = xcb_get_setup (c)->protocol_minor_version;
+
+/* protocol_minor_version contains now the minor version of the protocol */
+</pre>
+ <li class="subtitle"><a name="VendorRelease"></a>VendorRelease
+ <p>
+ You get the number of the release of the server hardware in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint32_t release_number;
+
+/* you init the connection */
+
+release_number = xcb_get_setup (c)->release_number;
+
+/* release_number contains now the number of the release of the server hardware */
+</pre>
+ <li class="subtitle"><a name="DisplayString"></a>DisplayString
+ <p>
+ The name of the display is not stored in XCB. You have to
+ store it by yourself.
+ </p>
+ <li class="subtitle"><a name="BitmapUnit"></a>BitmapUnit
+ <p>
+ You get the bitmap scanline unit in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint8_t bitmap_format_scanline_unit;
+
+/* you init the connection */
+
+bitmap_format_scanline_unit = xcb_get_setup (c)->bitmap_format_scanline_unit;
+
+/* bitmap_format_scanline_unit contains now the bitmap scanline unit */
+</pre>
+ <li class="subtitle"><a name="BitmapBitOrder"></a>BitmapBitOrder
+ <p>
+ You get the bitmap bit order in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint8_t bitmap_format_bit_order;
+
+/* you init the connection */
+
+bitmap_format_bit_order = xcb_get_setup (c)->bitmap_format_bit_order;
+
+/* bitmap_format_bit_order contains now the bitmap bit order */
+</pre>
+ <li class="subtitle"><a name="BitmapPad"></a>BitmapPad
+ <p>
+ You get the bitmap scanline pad in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint8_t bitmap_format_scanline_pad;
+
+/* you init the connection */
+
+bitmap_format_scanline_pad = xcb_get_setup (c)->bitmap_format_scanline_pad;
+
+/* bitmap_format_scanline_pad contains now the bitmap scanline pad */
+</pre>
+ <li class="subtitle"><a name="ImageByteOrder"></a>ImageByteOrder
+ <p>
+ You get the image byte order in the
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+uint8_t image_byte_order;
+
+/* you init the connection */
+
+image_byte_order = xcb_get_setup (c)->image_byte_order;
+
+/* image_byte_order contains now the image byte order */
+</pre>
+ </ol>
+ <li class="subtitle"><a name="screenofdisplay">ScreenOfDisplay related functions</a>
+ <p>
+ in Xlib, <span class="code">ScreenOfDisplay</span> returns a
+ <span class="code">Screen</span> structure that contains
+ several characteristics of your screen. XCB has a similar
+ structure (<span class="code">xcb_screen_t</span>),
+ but the way to obtain it is a bit different. With
+ Xlib, you just provide the number of the screen and you grab it
+ from an array. With XCB, you iterate over all the screens to
+ obtain the one you want. The complexity of this operation is
+ O(n). So the best is to store this structure if you use
+ it often. See <a href="#ScreenOfDisplay">screen_of_display</a> just below.
+ </p>
+ <p>
+ Xlib provides generally two functions to obtain the characteristics
+ related to the screen. One with the display and the number of
+ the screen, which calls <span class="code">ScreenOfDisplay</span>,
+ and the other that uses the <span class="code">Screen</span> structure.
+ This might be a bit confusing. As mentioned above, with XCB, it
+ is better to store the <span class="code">xcb_screen_t</span>
+ structure. Then, you have to read the members of this
+ structure. That's why the Xlib functions are put by pairs (or
+ more) as, with XCB, you will use the same code.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="ScreenOfDisplay">ScreenOfDisplay</a>
+ <p>
+ This function returns the Xlib <span class="code">Screen</span>
+ structure. With XCB, you iterate over all the screens and
+ once you get the one you want, you return it:
+ </p>
+ <pre class="code"><a name="ScreenOfDisplay"></a>
+xcb_screen_t *screen_of_display (xcb_connection_t *c,
+ int screen)
+{
+ xcb_screen_iterator_t iter;
+
+ iter = xcb_setup_roots_iterator (xcb_get_setup (c));
+ for (; iter.rem; --screen, xcb_screen_next (&iter))
+ if (screen == 0)
+ return iter.data;
+
+ return NULL;
+}
+</pre>
+ <p>
+ As mentioned above, you might want to store the value
+ returned by this function.
+ </p>
+ <p>
+ All the functions below will use the result of that
+ function, as they just grab a specific member of the
+ <span class="code">xcb_screen_t</span> structure.
+ </p>
+ <li class="subtitle"><a name="DefaultScreenOfDisplay"></a>DefaultScreenOfDisplay
+ <p>
+ It is the default screen that you obtain when you connect to
+ the X server. It suffices to call the <a href="#ScreenOfDisplay">screen_of_display</a>
+ function above with the connection and the number of the
+ default screen.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+int screen_default_nbr;
+xcb_screen_t *default_screen; /* the returned default screen */
+
+/* you pass the name of the display you want to xcb_connect_t */
+
+c = xcb_connect (display_name, &screen_default_nbr);
+default_screen = screen_of_display (c, screen_default_nbr);
+
+/* default_screen contains now the default root window, or a NULL window if no screen is found */
+</pre>
+ <li class="subtitle"><a name="RootWindow">RootWindow / RootWindowOfScreen</a>
+ <br>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_window_t root_window = { 0 }; /* the returned window */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ root_window = screen->root;
+
+/* root_window contains now the root window, or a NULL window if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DefaultRootWindow">DefaultRootWindow</a>
+ <p>
+ It is the root window of the default screen. So, you call
+ <a name="ScreenOfDisplay">ScreenOfDisplay</a> with the
+ default screen number and you get the
+ <a href="#RootWindow">root window</a> as above:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_default_nbr;
+xcb_window_t root_window = { 0 }; /* the returned root window */
+
+/* you pass the name of the display you want to xcb_connect_t */
+
+c = xcb_connect (display_name, &screen_default_nbr);
+screen = screen_of_display (c, screen_default_nbr);
+if (screen)
+ root_window = screen->root;
+
+/* root_window contains now the default root window, or a NULL window if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DefaultVisual">DefaultVisual / DefaultVisualOfScreen</a>
+ <p>
+ While a Visual is, in Xlib, a structure, in XCB, there are
+ two types: <span class="code">xcb_visualid_t</span>, which is
+ the Id of the visual, and <span class="code">xcb_visualtype_t</span>,
+ which corresponds to the Xlib Visual. To get the Id of the
+ visual of a screen, just get the
+ <span class="code">root_visual</span>
+ member of a <span class="code">xcb_screen_t</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_visualid_t root_visual = { 0 }; /* the returned visual Id */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ root_visual = screen->root_visual;
+
+/* root_visual contains now the value of the Id of the visual, or a NULL visual if no screen is found */
+</pre>
+ <p>
+ To get the <span class="code">xcb_visualtype_t</span>
+ structure, it's a bit less easy. You have to get the
+ <span class="code">xcb_screen_t</span> structure that you want,
+ get its <span class="code">root_visual</span> member,
+ then iterate over the <span class="code">xcb_depth_t</span>s
+ and the <span class="code">xcb_visualtype_t</span>s, and compare
+ the <span class="code">xcb_visualid_t</span> of these <span class="code">xcb_visualtype_t</span>s:
+ with <span class="code">root_visual</span>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_visualid_t root_visual = { 0 };
+xcb_visualtype_t *visual_type = NULL; /* the returned visual type */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen) {
+ xcb_depth_iterator_t depth_iter;
+
+ depth_iter = xcb_screen_allowed_depths_iterator (screen);
+ for (; depth_iter.rem; xcb_depth_next (&depth_iter)) {
+ xcb_visualtype_iterator_t visual_iter;
+
+ visual_iter = xcb_depth_visuals_iterator (depth_iter.data);
+ for (; visual_iter.rem; xcb_visualtype_next (&visual_iter)) {
+ if (screen->root_visual == visual_iter.data->visual_id) {
+ visual_type = visual_iter.data;
+ break;
+ }
+ }
+ }
+}
+
+/* visual_type contains now the visual structure, or a NULL visual structure if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DefaultGC">DefaultGC / DefaultGCOfScreen</a>
+ <p>
+ This default Graphic Context is just a newly created Graphic
+ Context, associated to the root window of a
+ <span class="code">xcb_screen_t</span>,
+ using the black white pixels of that screen:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_gcontext_t gc = { 0 }; /* the returned default graphic context */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen) {
+ xcb_drawable_t draw;
+ uint32_t mask;
+ uint32_t values[2];
+
+ gc = xcb_generate_id (c);
+ draw = screen->root;
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND;
+ values[0] = screen->black_pixel;
+ values[1] = screen->white_pixel;
+ xcb_create_gc (c, gc, draw, mask, values);
+}
+
+/* gc contains now the default graphic context */
+</pre>
+ <li class="subtitle"><a name="BlackPixel">BlackPixel / BlackPixelOfScreen</a>
+ <p>
+ It is the Id of the black pixel, which is in the structure
+ of an <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t black_pixel = 0; /* the returned black pixel */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ black_pixel = screen->black_pixel;
+
+/* black_pixel contains now the value of the black pixel, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="WhitePixel">WhitePixel / WhitePixelOfScreen</a>
+ <p>
+ It is the Id of the white pixel, which is in the structure
+ of an <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t white_pixel = 0; /* the returned white pixel */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ white_pixel = screen->white_pixel;
+
+/* white_pixel contains now the value of the white pixel, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DisplayWidth">DisplayWidth / WidthOfScreen</a>
+ <p>
+ It is the width in pixels of the screen that you want, and
+ which is in the structure of the corresponding
+ <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t width_in_pixels = 0; /* the returned width in pixels */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ width_in_pixels = screen->width_in_pixels;
+
+/* width_in_pixels contains now the width in pixels, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DisplayHeight">DisplayHeight / HeightOfScreen</a>
+ <p>
+ It is the height in pixels of the screen that you want, and
+ which is in the structure of the corresponding
+ <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t height_in_pixels = 0; /* the returned height in pixels */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ height_in_pixels = screen->height_in_pixels;
+
+/* height_in_pixels contains now the height in pixels, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DisplayWidthMM">DisplayWidthMM / WidthMMOfScreen</a>
+ <p>
+ It is the width in millimeters of the screen that you want, and
+ which is in the structure of the corresponding
+ <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t width_in_millimeters = 0; /* the returned width in millimeters */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ width_in_millimeters = screen->width_in_millimeters;
+
+/* width_in_millimeters contains now the width in millimeters, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DisplayHeightMM">DisplayHeightMM / HeightMMOfScreen</a>
+ <p>
+ It is the height in millimeters of the screen that you want, and
+ which is in the structure of the corresponding
+ <span class="code">xcb_screen_t</span>.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t height_in_millimeters = 0; /* the returned height in millimeters */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ height_in_millimeters = screen->height_in_millimeters;
+
+/* height_in_millimeters contains now the height in millimeters, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DisplayPlanes">DisplayPlanes / DefaultDepth / DefaultDepthOfScreen / PlanesOfScreen</a>
+ <p>
+ It is the depth (in bits) of the root window of the
+ screen. You get it from the <span class="code">xcb_screen_t</span> structure.
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t root_depth = 0; /* the returned depth of the root window */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ root_depth = screen->root_depth;
+
+/* root_depth contains now the depth of the root window, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DefaultColormap">DefaultColormap / DefaultColormapOfScreen</a>
+ <p>
+ This is the default colormap of the screen (and not the
+ (default) colormap of the default screen !). As usual, you
+ get it from the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_colormap_t default_colormap = { 0 }; /* the returned default colormap */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ default_colormap = screen->default_colormap;
+
+/* default_colormap contains now the default colormap, or a NULL colormap if no screen is found */
+</pre>
+ <li class="subtitle"><a name="MinCmapsOfScreen"></a>MinCmapsOfScreen
+ <p>
+ You get the minimum installed colormaps in the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint16_t min_installed_maps = 0; /* the returned minimum installed colormaps */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ min_installed_maps = screen->min_installed_maps;
+
+/* min_installed_maps contains now the minimum installed colormaps, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="MaxCmapsOfScreen"></a>MaxCmapsOfScreen
+ <p>
+ You get the maximum installed colormaps in the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint16_t max_installed_maps = 0; /* the returned maximum installed colormaps */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ max_installed_maps = screen->max_installed_maps;
+
+/* max_installed_maps contains now the maximum installed colormaps, or 0 if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DoesSaveUnders"></a>DoesSaveUnders
+ <p>
+ You know if <span class="code">save_unders</span> is set,
+ by looking in the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t save_unders = 0; /* the returned value of save_unders */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ save_unders = screen->save_unders;
+
+/* save_unders contains now the value of save_unders, or FALSE if no screen is found */
+</pre>
+ <li class="subtitle"><a name="DoesBackingStore"></a>DoesBackingStore
+ <p>
+ You know the value of <span class="code">backing_stores</span>,
+ by looking in the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t backing_stores = 0; /* the returned value of backing_stores */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ backing_stores = screen->backing_stores;
+
+/* backing_stores contains now the value of backing_stores, or FALSE if no screen is found */
+</pre>
+ <li class="subtitle"><a name="EventMaskOfScreen"></a>EventMaskOfScreen
+ <p>
+ To get the current input masks,
+ you look in the <span class="code">xcb_screen_t</span> structure:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t current_input_masks = 0; /* the returned value of current input masks */
+
+/* you init the connection and screen_nbr */
+
+screen = screen_of_display (c, screen_nbr);
+if (screen)
+ current_input_masks = screen->current_input_masks;
+
+/* current_input_masks contains now the value of the current input masks, or FALSE if no screen is found */
+</pre>
+ </ol>
+ <li class="subtitle"><a name="misc">Miscellaneous macros</a>
+ <ol>
+ <li class="subtitle"><a name="DisplayOfScreen"></a>DisplayOfScreen
+ <p>
+ in Xlib, the <span class="code">Screen</span> structure
+ stores its associated <span class="code">Display</span>
+ structure. This is not the case in the X Window protocol,
+ hence, it's also not the case in XCB. So you have to store
+ it by yourself.
+ </p>
+ <li class="subtitle"><a name="DisplayCells"></a>DisplayCells / CellsOfScreen
+ <p>
+ To get the colormap entries,
+ you look in the <span class="code">xcb_visualtype_t</span>
+ structure, that you grab like <a class="subsection" href="#DefaultVisual">here</a>:
+ </p>
+ <pre class="code">
+xcb_connection_t *c;
+xcb_visualtype_t *visual_type;
+uint16_t colormap_entries = 0; /* the returned value of the colormap entries */
+
+/* you init the connection and visual_type */
+
+if (visual_type)
+ colormap_entries = visual_type->colormap_entries;
+
+/* colormap_entries contains now the value of the colormap entries, or FALSE if no screen is found */
+</pre>
+ </ol>
+ </ol>
+ </ol>
+ </div>
+</body>
+
+</html>
--- /dev/null
+body
+{
+ background-color: #dddddd;
+ color: #000000;
+ padding: 8px;
+ margin: 0px;
+}
+div.title
+{
+ text-align: center;
+ font-weight: bold;
+ font-size: 28px;
+}
+div.emph
+{
+ text-align: left;
+ font-weight: bold;
+}
+div.section li.title
+{
+ font-weight: bold;
+ font-size: 22px;
+}
+div.section li.title p
+{
+ font-weight: normal;
+ font-size: 16px;
+}
+div.section li.title ul
+{
+ font-weight: normal;
+ font-size: 16px;
+}
+div.section li.title ol
+{
+ font-weight: normal;
+ font-size: 16px;
+}
+div.section li.subtitle
+{
+ font-weight: bold;
+ font-size: 18px;
+}
+div.section li.subsubtitle
+{
+ font-weight: bold;
+ font-size: 16px;
+}
+div.comp
+{
+ border: thin solid #000000;
+ color: #000000;
+ background-color: #ffffe0;
+ padding: 14px;
+}
+div.comp div.title
+{
+ font-weight: bold;
+ font-size: 16px;
+ text-align: center;
+}
+div.comp div.xlib ul li
+{
+ font-family: monospace;
+ font-size: 12px;
+ font-weight: bold;
+ position: absolute;
+ width: 49%;
+ margin-left: 0px;
+ margin-top: 10px;
+}
+div.comp div.xcb ul li
+{
+ font-family: monospace;
+ font-size: 12px;
+ font-weight: bold;
+ position: relative;
+ margin-left: 51%;
+ margin-top: 10px;
+}
+pre.code
+{
+ border: thin solid #000000;
+ color: #000000;
+ background-color: #efefef;
+ padding: 4px;
+ text-align: left;
+ font-size: 10px;
+}
+pre.text
+{
+ border: thin solid #000000;
+ color: #000000;
+ background-color: #efefef;
+ padding: 4px;
+ text-align: left;
+ font-size: 10px;
+}
+span.code
+{
+ font-family: monospace;
+ font-size: 12px;
+}
+pre.code .type
+{
+ color: #44bb44;
+}
+pre.code .function
+{
+ color: #449fb7;
+}
+pre.code .include
+{
+ color: #7d93ae;
+}
+pre.code .string
+{
+ color: #ef6e4b;
+}
+pre.code .keyword
+{
+ color: #00bbbb;
+}
--- /dev/null
+# Doxyfile 1.5.0
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "XCB"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = @VERSION@
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = @top_builddir@/doc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+# XXX: In the future this should be turned on. For now it generates too much noise.
+WARN_IF_UNDOCUMENTED = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = @top_srcdir@/src @top_builddir@/src
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = manual
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
--- /dev/null
+Name: libxcb
+Summary: A C binding to the X11 protocol
+Version: 1.7
+Release: 0
+Group: System/Libraries
+License: MIT
+URL: http://xcb.freedesktop.org/
+Source0: http://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(xorg-macros)
+BuildRequires: pkgconfig(pthread-stubs)
+BuildRequires: pkgconfig(xcb-proto)
+BuildRequires: pkgconfig(xau)
+BuildRequires: pkgconfig(xproto)
+BuildRequires: libxslt
+BuildRequires: python-xml, python-devel
+
+
+%description
+Description: %{summary}
+
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: libpthread-stubs
+Requires: libXau-devel
+
+%description devel
+Description: %{summary}
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%description doc
+Description: %{summary}
+
+
+%prep
+%setup -q
+
+
+%build
+
+%reconfigure \
+ --disable-build-docs \
+ CFLAGS="-D_F_ENABLE_XI2_SENDEVENT_" \
+ LDFLAGS="-Wl,--hash-style=both -Wl,--as-needed"
+
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/xcb
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+
+%files doc
+%defattr(-,root,root,-)
+%{_datadir}/doc/%{name}
+
--- /dev/null
+lib_LTLIBRARIES = libxcb.la
+
+EXTSOURCES = xproto.c \
+ bigreq.c \
+ xc_misc.c
+
+AM_CFLAGS = $(CWARNFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS)
+libxcb_la_LIBADD = $(NEEDED_LIBS) $(XDMCP_LIBS)
+libxcb_la_SOURCES = \
+ xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \
+ xcb_list.c xcb_util.c xcb_auth.c c_client.py
+nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c
+
+# Explanation for -version-info:
+# -version-info current:revision:age
+# The library supports interface (current-age) to interface current.
+# * If you changed the source code at all, increment revision.
+# * If you add an interface, increment current and age and set revision to 0.
+# * If you change or remove an interface, increment current and set revision
+# and age to 0.
+libxcb_la_LDFLAGS = -version-info 2:0:1 -no-undefined
+
+XCB_LIBS = libxcb.la
+
+# FIXME: find a way to autogenerate this from the XML files.
+
+EXTSOURCES += composite.c
+if BUILD_COMPOSITE
+lib_LTLIBRARIES += libxcb-composite.la
+libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_composite_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_composite_la_SOURCES = composite.c composite.h
+endif
+
+EXTSOURCES += damage.c
+if BUILD_DAMAGE
+lib_LTLIBRARIES += libxcb-damage.la
+libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_damage_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_damage_la_SOURCES = damage.c damage.h
+endif
+
+EXTSOURCES += dpms.c
+if BUILD_DPMS
+lib_LTLIBRARIES += libxcb-dpms.la
+libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_dpms_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h
+endif
+
+EXTSOURCES += dri2.c
+if BUILD_DRI2
+lib_LTLIBRARIES += libxcb-dri2.la
+libxcb_dri2_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_dri2_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_dri2_la_SOURCES = dri2.c dri2.h
+endif
+
+EXTSOURCES += glx.c
+if BUILD_GLX
+lib_LTLIBRARIES += libxcb-glx.la
+libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_glx_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_glx_la_SOURCES = glx.c glx.h
+endif
+
+EXTSOURCES += randr.c
+if BUILD_RANDR
+lib_LTLIBRARIES += libxcb-randr.la
+libxcb_randr_la_LDFLAGS = -version-info 1:0:1 -no-undefined
+libxcb_randr_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_randr_la_SOURCES = randr.c randr.h
+endif
+
+EXTSOURCES += record.c
+if BUILD_RECORD
+lib_LTLIBRARIES += libxcb-record.la
+libxcb_record_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_record_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_record_la_SOURCES = record.c record.h
+endif
+
+EXTSOURCES += render.c
+if BUILD_RENDER
+lib_LTLIBRARIES += libxcb-render.la
+libxcb_render_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_render_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_render_la_SOURCES = render.c render.h
+endif
+
+EXTSOURCES += res.c
+if BUILD_RESOURCE
+lib_LTLIBRARIES += libxcb-res.la
+libxcb_res_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_res_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_res_la_SOURCES = res.c res.h
+endif
+
+EXTSOURCES += screensaver.c
+if BUILD_SCREENSAVER
+lib_LTLIBRARIES += libxcb-screensaver.la
+libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_screensaver_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h
+endif
+
+EXTSOURCES += shape.c
+if BUILD_SHAPE
+lib_LTLIBRARIES += libxcb-shape.la
+libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_shape_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_shape_la_SOURCES = shape.c shape.h
+endif
+
+EXTSOURCES += shm.c
+if BUILD_SHM
+lib_LTLIBRARIES += libxcb-shm.la
+libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_shm_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_shm_la_SOURCES = shm.c shm.h
+endif
+
+EXTSOURCES += sync.c
+if BUILD_SYNC
+lib_LTLIBRARIES += libxcb-sync.la
+libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_sync_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_sync_la_SOURCES = sync.c sync.h
+endif
+
+EXTSOURCES += xevie.c
+if BUILD_XEVIE
+lib_LTLIBRARIES += libxcb-xevie.la
+libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xevie_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h
+endif
+
+EXTSOURCES += xf86dri.c
+if BUILD_XFREE86_DRI
+lib_LTLIBRARIES += libxcb-xf86dri.la
+libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h
+endif
+
+EXTSOURCES += xfixes.c
+if BUILD_XFIXES
+lib_LTLIBRARIES += libxcb-xfixes.la
+libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xfixes_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h
+endif
+
+EXTSOURCES += xinerama.c
+if BUILD_XINERAMA
+lib_LTLIBRARIES += libxcb-xinerama.la
+libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xinerama_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h
+endif
+
+EXTSOURCES += xinput.c
+if BUILD_XINPUT
+lib_LTLIBRARIES += libxcb-xinput.la
+libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xinput_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h
+endif
+
+EXTSOURCES += xprint.c
+if BUILD_XPRINT
+lib_LTLIBRARIES += libxcb-xprint.la
+libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xprint_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h
+endif
+
+EXTSOURCES += xselinux.c
+if BUILD_SELINUX
+lib_LTLIBRARIES += libxcb-xselinux.la
+libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xselinux_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h
+endif
+
+EXTSOURCES += xtest.c
+if BUILD_XTEST
+lib_LTLIBRARIES += libxcb-xtest.la
+libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xtest_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h
+endif
+
+EXTSOURCES += xv.c
+if BUILD_XV
+lib_LTLIBRARIES += libxcb-xv.la
+libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xv_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xv_la_SOURCES = xv.c xv.h
+endif
+
+EXTSOURCES += xvmc.c
+if BUILD_XVMC
+lib_LTLIBRARIES += libxcb-xvmc.la
+libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_xvmc_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h
+endif
+
+
+EXTHEADERS=$(EXTSOURCES:.c=.h)
+xcbinclude_HEADERS = xcb.h xcbext.h
+nodist_xcbinclude_HEADERS = $(EXTHEADERS)
+noinst_HEADERS = xcbint.h
+
+BUILT_SOURCES = $(EXTSOURCES)
+CLEANFILES = $(EXTSOURCES) $(EXTHEADERS)
+
+$(EXTSOURCES): c_client.py
+ $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2004 Josh Triplett. All Rights Reserved.
+
+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.
+-->
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns:e="http://exslt.org/common"
+ xmlns:func="http://exslt.org/functions"
+ xmlns:str="http://exslt.org/strings"
+ xmlns:xcb="http://xcb.freedesktop.org"
+ extension-element-prefixes="func str xcb">
+
+ <xsl:output method="text" />
+
+ <xsl:strip-space elements="*" />
+
+ <!-- "header" or "source" -->
+ <xsl:param name="mode" />
+
+ <!-- Path to the core protocol descriptions. -->
+ <xsl:param name="base-path" />
+
+ <!-- Path to the extension protocol descriptions. -->
+ <xsl:param name="extension-path" select="$base-path" />
+
+ <xsl:variable name="h" select="$mode = 'header'" />
+ <xsl:variable name="c" select="$mode = 'source'" />
+
+ <xsl:variable name="need-string-h" select="//request/pad[@bytes != 1]" />
+
+ <!-- String used to indent lines of code. -->
+ <xsl:variable name="indent-string" select="' '" />
+
+ <xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+ <xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'" />
+ <xsl:variable name="letters" select="concat($ucase, $lcase)" />
+ <xsl:variable name="digits" select="'0123456789'" />
+
+ <xsl:variable name="header" select="/xcb/@header" />
+ <xsl:variable name="ucase-header"
+ select="translate($header,$lcase,$ucase)" />
+
+ <xsl:variable name="ext" select="/xcb/@extension-name" />
+
+ <!-- Other protocol descriptions to search for types in, after checking the
+ current protocol description. -->
+ <xsl:variable name="search-path-rtf">
+ <xsl:for-each select="/xcb/import">
+ <path><xsl:value-of select="concat($extension-path, ., '.xml')" /></path>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="search-path" select="e:node-set($search-path-rtf)/path"/>
+
+ <xsl:variable name="root" select="/" />
+
+ <!-- First pass: Store everything in a variable. -->
+ <xsl:variable name="pass1-rtf">
+ <xsl:apply-templates select="/" mode="pass1" />
+ </xsl:variable>
+ <xsl:variable name="pass1" select="e:node-set($pass1-rtf)" />
+
+ <xsl:template match="xcb" mode="pass1">
+ <xcb>
+ <xsl:copy-of select="@*" />
+ <xsl:if test="$ext">
+ <constant type="xcb_extension_t" name="{xcb:xcb-prefix()}_id">
+ <xsl:attribute name="value">{ "<xsl:value-of select="@extension-xname" />" }</xsl:attribute>
+ </constant>
+ </xsl:if>
+ <xsl:apply-templates mode="pass1" />
+ </xcb>
+ </xsl:template>
+
+ <func:function name="xcb:xcb-prefix">
+ <xsl:param name="name" />
+ <func:result>
+ <xsl:text>xcb</xsl:text>
+ <xsl:if test="/xcb/@extension-name">
+ <xsl:text>_</xsl:text>
+ <xsl:choose>
+ <xsl:when test="/xcb/@extension-multiword = 'true' or /xcb/@extension-multiword = '1'">
+ <xsl:call-template name="camelcase-to-underscore">
+ <xsl:with-param name="camelcase" select="/xcb/@extension-name" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(/xcb/@extension-name, $ucase, $lcase)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$name">
+ <xsl:text>_</xsl:text>
+ <xsl:call-template name="camelcase-to-underscore">
+ <xsl:with-param name="camelcase" select="$name" />
+ </xsl:call-template>
+ </xsl:if>
+ </func:result>
+ </func:function>
+
+ <func:function name="xcb:lowercase">
+ <xsl:param name="name" />
+ <func:result>
+ <xsl:call-template name="camelcase-to-underscore">
+ <xsl:with-param name="camelcase" select="$name" />
+ </xsl:call-template>
+ </func:result>
+ </func:function>
+
+ <func:function name="xcb:get-char-void">
+ <xsl:param name="name" />
+ <xsl:variable name="ctype" select="substring-before($name, '_t')" />
+ <func:result>
+ <xsl:choose>
+ <xsl:when test="$ctype = 'char' or $ctype = 'void' or $ctype = 'float' or $ctype = 'double'">
+ <xsl:value-of select="$ctype" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$name" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:result>
+ </func:function>
+
+ <func:function name="xcb:remove-void">
+ <xsl:param name="name" />
+ <xsl:variable name="ctype" select="substring-before($name, '_t')" />
+ <func:result>
+ <xsl:choose>
+ <xsl:when test="$ctype = 'char' or $ctype = 'void' or $ctype = 'float' or $ctype = 'double'">
+ <xsl:choose>
+ <xsl:when test="$ctype = 'void'">
+ <xsl:text>char</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$ctype" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$name" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:result>
+ </func:function>
+
+ <!-- split camel case into words and insert underscore -->
+ <xsl:template name="camelcase-to-underscore">
+ <xsl:param name="camelcase"/>
+ <xsl:choose>
+ <xsl:when test="$camelcase='CHAR2B' or $camelcase='INT64'
+ or $camelcase='FLOAT32' or $camelcase='FLOAT64'
+ or $camelcase='BOOL32' or $camelcase='STRING8'
+ or $camelcase='Family_DECnet'">
+ <xsl:value-of select="translate($camelcase, $ucase, $lcase)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="str:split($camelcase, '')">
+ <xsl:variable name="a" select="."/>
+ <xsl:variable name="b" select="following::*[1]"/>
+ <xsl:variable name="c" select="following::*[2]"/>
+ <xsl:value-of select="translate(., $ucase, $lcase)"/>
+ <xsl:if test="($b and contains($lcase, $a) and contains($ucase, $b))
+ or ($b and contains($digits, $a)
+ and contains($letters, $b))
+ or ($b and contains($letters, $a)
+ and contains($digits, $b))
+ or ($c and contains($ucase, $a)
+ and contains($ucase, $b)
+ and contains($lcase, $c))">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Modify names that conflict with C++ keywords by prefixing them with an
+ underscore. If the name parameter is not specified, it defaults to the
+ value of the name attribute on the context node. -->
+ <xsl:template name="canonical-var-name">
+ <xsl:param name="name" select="@name" />
+ <xsl:if test="$name='new' or $name='delete'
+ or $name='class' or $name='operator'">
+ <xsl:text>_</xsl:text>
+ </xsl:if>
+ <xsl:value-of select="$name" />
+ </xsl:template>
+
+ <!-- List of core types, for use in canonical-type-name. -->
+ <xsl:variable name="core-types-rtf">
+ <type name="BOOL" newname="uint8" />
+ <type name="BYTE" newname="uint8" />
+ <type name="CARD8" newname="uint8" />
+ <type name="CARD16" newname="uint16" />
+ <type name="CARD32" newname="uint32" />
+ <type name="INT8" newname="int8" />
+ <type name="INT16" newname="int16" />
+ <type name="INT32" newname="int32" />
+
+ <type name="char" newname="char" />
+ <type name="void" newname="void" />
+ <type name="float" newname="float" />
+ <type name="double" newname="double" />
+ </xsl:variable>
+ <xsl:variable name="core-types" select="e:node-set($core-types-rtf)" />
+
+ <!--
+ Output the canonical name for a type. This will be
+ xcb_{extension-containing-type-if-any}_type, wherever the type is found in
+ the search path, or just type if not found. If the type parameter is not
+ specified, it defaults to the value of the type attribute on the context
+ node.
+ -->
+ <xsl:template name="canonical-type-name">
+ <xsl:param name="type" select="string(@type)" />
+
+ <xsl:variable name="is-unqualified" select="not(contains($type, ':'))"/>
+ <xsl:variable name="namespace" select="substring-before($type, ':')" />
+ <xsl:variable name="unqualified-type">
+ <xsl:choose>
+ <xsl:when test="$is-unqualified">
+ <xsl:value-of select="$type" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($type, ':')" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$is-unqualified and $core-types/type[@name=$type]">
+ <xsl:value-of select="$core-types/type[@name=$type]/@newname" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="type-definitions"
+ select="(/xcb|document($search-path)/xcb
+ )[$is-unqualified or @header=$namespace]
+ /*[((self::struct or self::union or self::enum
+ or self::xidtype or self::xidunion
+ or self::event or self::eventcopy
+ or self::error or self::errorcopy)
+ and @name=$unqualified-type)
+ or (self::typedef
+ and @newname=$unqualified-type)]" />
+ <xsl:choose>
+ <xsl:when test="count($type-definitions) = 1">
+ <xsl:for-each select="$type-definitions">
+ <xsl:value-of select="xcb:xcb-prefix($unqualified-type)" />
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="count($type-definitions) > 1">
+ <xsl:message terminate="yes">
+ <xsl:text>Multiple definitions of type "</xsl:text>
+ <xsl:value-of select="$type" />
+ <xsl:text>" found.</xsl:text>
+ <xsl:if test="$is-unqualified">
+ <xsl:for-each select="$type-definitions">
+ <xsl:text>
+ </xsl:text>
+ <xsl:value-of select="concat(/xcb/@header, ':', $type)" />
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>No definitions of type "</xsl:text>
+ <xsl:value-of select="$type" />
+ <xsl:text>" found</xsl:text>
+ <xsl:if test="$is-unqualified">
+ <xsl:text>, and it is not a known core type</xsl:text>
+ </xsl:if>
+ <xsl:text>.</xsl:text>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Helper template for requests, that outputs the cookie type. The
+ parameter "request" must be the request node, which defaults to the
+ context node. -->
+ <xsl:template name="cookie-type">
+ <xsl:param name="request" select="." />
+ <xsl:choose>
+ <xsl:when test="$request/reply">
+ <xsl:value-of select="xcb:xcb-prefix($request/@name)" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>xcb_void</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>_cookie_t</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="request-function">
+ <xsl:param name="checked" />
+ <xsl:param name="req" />
+ <function>
+ <xsl:attribute name="name">
+ <xsl:value-of select="xcb:xcb-prefix($req/@name)" />
+ <xsl:if test="$checked='true' and not($req/reply)">_checked</xsl:if>
+ <xsl:if test="$checked='false' and $req/reply">_unchecked</xsl:if>
+ </xsl:attribute>
+ <xsl:attribute name="type">
+ <xsl:call-template name="cookie-type">
+ <xsl:with-param name="request" select="$req" />
+ </xsl:call-template>
+ </xsl:attribute>
+ <doc>/**</doc>
+ <doc> * Delivers a request to the X server</doc>
+ <doc> * @param c The connection</doc>
+ <doc> * @return A cookie</doc>
+ <doc> *</doc>
+ <doc> * Delivers a request to the X server.</doc>
+ <doc> * </doc>
+ <xsl:if test="$checked='true' and not($req/reply)">
+ <doc> * This form can be used only if the request will not cause</doc>
+ <doc> * a reply to be generated. Any returned error will be</doc>
+ <doc> * saved for handling by xcb_request_check().</doc>
+ </xsl:if>
+ <xsl:if test="$checked='false' and $req/reply">
+ <doc> * This form can be used only if the request will cause</doc>
+ <doc> * a reply to be generated. Any returned error will be</doc>
+ <doc> * placed in the event queue.</doc>
+ </xsl:if>
+ <doc> */</doc>
+ <field type="xcb_connection_t *" name="c" />
+ <xsl:apply-templates select="$req/*[not(self::reply)]" mode="param" />
+ <do-request ref="{xcb:xcb-prefix($req/@name)}_request_t" opcode="{translate(xcb:xcb-prefix($req/@name), $lcase, $ucase)}"
+ checked="{$checked}">
+ <xsl:if test="$req/reply">
+ <xsl:attribute name="has-reply">true</xsl:attribute>
+ </xsl:if>
+ </do-request>
+ </function>
+ </xsl:template>
+
+ <xsl:template match="request" mode="pass1">
+ <xsl:variable name="req" select="." />
+ <xsl:if test="reply">
+ <struct name="{xcb:xcb-prefix(@name)}_cookie_t">
+ <field type="unsigned int" name="sequence" />
+ </struct>
+ </xsl:if>
+ <constant type="number" name="{xcb:xcb-prefix($req/@name)}" value="{$req/@opcode}" />
+ <struct name="{xcb:xcb-prefix(@name)}_request_t">
+ <field type="uint8_t" name="major_opcode" no-assign="true" />
+ <xsl:if test="$ext">
+ <field type="uint8_t" name="minor_opcode" no-assign="true" />
+ </xsl:if>
+ <xsl:apply-templates select="*[not(self::reply)]" mode="field" />
+ <middle>
+ <field type="uint16_t" name="length" no-assign="true" />
+ </middle>
+ </struct>
+ <xsl:call-template name="request-function">
+ <xsl:with-param name="checked" select="'true'" />
+ <xsl:with-param name="req" select="$req" />
+ </xsl:call-template>
+ <xsl:call-template name="request-function">
+ <xsl:with-param name="checked" select="'false'" />
+ <xsl:with-param name="req" select="$req" />
+ </xsl:call-template>
+ <xsl:if test="reply">
+ <struct name="{xcb:xcb-prefix(@name)}_reply_t">
+ <field type="uint8_t" name="response_type" />
+ <xsl:apply-templates select="reply/*" mode="field" />
+ <middle>
+ <field type="uint16_t" name="sequence" />
+ <field type="uint32_t" name="length" />
+ </middle>
+ </struct>
+ <iterator-functions ref="{xcb:xcb-prefix(@name)}" kind="_reply" />
+ <function type="{xcb:xcb-prefix(@name)}_reply_t *" name="{xcb:xcb-prefix(@name)}_reply">
+ <doc>/**</doc>
+ <doc> * Return the reply</doc>
+ <doc> * @param c The connection</doc>
+ <doc> * @param cookie The cookie</doc>
+ <doc> * @param e The xcb_generic_error_t supplied</doc>
+ <doc> *</doc>
+ <doc> * Returns the reply of the request asked by</doc>
+ <doc> * </doc>
+ <doc> * The parameter @p e supplied to this function must be NULL if</doc>
+ <doc> * <xsl:value-of select="xcb:xcb-prefix(@name)" />_unchecked(). is used.</doc>
+ <doc> * Otherwise, it stores the error if any.</doc>
+ <doc> *</doc>
+ <doc> * The returned value must be freed by the caller using free().</doc>
+ <doc> */</doc>
+ <field type="xcb_connection_t *" name="c" />
+ <field name="cookie">
+ <xsl:attribute name="type">
+ <xsl:call-template name="cookie-type" />
+ </xsl:attribute>
+ </field>
+ <field type="xcb_generic_error_t **" name="e" />
+ <l>return (<xsl:value-of select="xcb:xcb-prefix(@name)" />_reply_t *)<!--
+ --> xcb_wait_for_reply(c, cookie.sequence, e);</l>
+ </function>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="xidtype|xidunion" mode="pass1">
+ <typedef oldname="uint32_t" newname="{xcb:xcb-prefix(@name)}_t" />
+ <iterator ref="{xcb:xcb-prefix(@name)}" />
+ <iterator-functions ref="{xcb:xcb-prefix(@name)}" />
+ </xsl:template>
+
+ <xsl:template match="struct|union" mode="pass1">
+ <struct name="{xcb:xcb-prefix(@name)}_t">
+ <xsl:if test="self::union">
+ <xsl:attribute name="kind">union</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="*" mode="field" />
+ </struct>
+ <iterator ref="{xcb:xcb-prefix(@name)}" />
+ <iterator-functions ref="{xcb:xcb-prefix(@name)}" />
+ </xsl:template>
+
+ <xsl:template match="event|eventcopy|error|errorcopy" mode="pass1">
+ <xsl:variable name="suffix">
+ <xsl:choose>
+ <xsl:when test="self::event|self::eventcopy">
+ <xsl:text>_event_t</xsl:text>
+ </xsl:when>
+ <xsl:when test="self::error|self::errorcopy">
+ <xsl:text>_error_t</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <constant type="number" name="{xcb:xcb-prefix(@name)}" value="{@number}" />
+ <xsl:choose>
+ <xsl:when test="self::event|self::error">
+ <struct name="{xcb:xcb-prefix(@name)}{$suffix}">
+ <field type="uint8_t" name="response_type" />
+ <xsl:if test="self::error">
+ <field type="uint8_t" name="error_code" />
+ </xsl:if>
+ <xsl:apply-templates select="*" mode="field" />
+ <xsl:if test="not(self::event and boolean(@no-sequence-number))">
+ <middle>
+ <field type="uint16_t" name="sequence" />
+ </middle>
+ </xsl:if>
+ </struct>
+ </xsl:when>
+ <xsl:when test="self::eventcopy|self::errorcopy">
+ <typedef newname="{xcb:xcb-prefix(@name)}{$suffix}">
+ <xsl:attribute name="oldname">
+ <xsl:call-template name="canonical-type-name">
+ <xsl:with-param name="type" select="@ref" />
+ </xsl:call-template>
+ <xsl:value-of select="$suffix" />
+ </xsl:attribute>
+ </typedef>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="typedef" mode="pass1">
+ <typedef>
+ <xsl:attribute name="oldname">
+ <xsl:call-template name="canonical-type-name">
+ <xsl:with-param name="type" select="@oldname" />
+ </xsl:call-template>
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="newname">
+ <xsl:call-template name="canonical-type-name">
+ <xsl:with-param name="type" select="@newname" />
+ </xsl:call-template>
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ </typedef>
+ <iterator ref="{xcb:xcb-prefix(@newname)}" />
+ <iterator-functions ref="{xcb:xcb-prefix(@newname)}" />
+ </xsl:template>
+
+ <xsl:template match="enum" mode="pass1">
+ <enum name="{xcb:xcb-prefix(@name)}_t">
+ <xsl:for-each select="item">
+ <item name="{translate(xcb:xcb-prefix(concat(../@name, concat('_', @name))), $lcase, $ucase)}">
+ <xsl:copy-of select="*" />
+ </item>
+ </xsl:for-each>
+ </enum>
+ </xsl:template>
+
+ <!--
+ Templates for processing fields.
+ -->
+
+ <xsl:template match="pad" mode="field">
+ <xsl:copy-of select="." />
+ </xsl:template>
+
+ <xsl:template match="field|exprfield" mode="field">
+ <xsl:copy>
+ <xsl:attribute name="type">
+ <xsl:call-template name="canonical-type-name" />
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name" />
+ </xsl:attribute>
+ <xsl:copy-of select="*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="list" mode="field">
+ <xsl:variable name="type"><!--
+ --><xsl:call-template name="canonical-type-name" />
+ <xsl:text>_t</xsl:text><!--
+ --></xsl:variable>
+ <list type="{$type}">
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name" />
+ </xsl:attribute>
+ <xsl:if test="not(parent::request) and node()
+ and not(.//*[not(self::value or self::op)])">
+ <xsl:attribute name="fixed">true</xsl:attribute>
+ </xsl:if>
+ <!-- Handle lists with no length expressions. -->
+ <xsl:if test="not(node())">
+ <xsl:choose>
+ <!-- In a request, refer to an implicit localparam for length. -->
+ <xsl:when test="parent::request">
+ <fieldref>
+ <xsl:value-of select="concat(@name, '_len')" />
+ </fieldref>
+ </xsl:when>
+ <!-- In a reply, use the length of the reply to determine the length
+ of the list. -->
+ <xsl:when test="parent::reply">
+ <op op="/">
+ <op op="<<">
+ <fieldref>length</fieldref>
+ <value>2</value>
+ </op>
+ <function-call name="sizeof">
+ <param><xsl:value-of select="$type" /></param>
+ </function-call>
+ </op>
+ </xsl:when>
+ <!-- Other cases generate an error. -->
+ <xsl:otherwise>
+ <xsl:message terminate="yes"><!--
+ -->Encountered a list with no length expresssion outside a<!--
+ --> request or reply.<!--
+ --></xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:copy-of select="*" />
+ </list>
+ </xsl:template>
+
+ <xsl:template match="valueparam" mode="field">
+ <field>
+ <xsl:attribute name="type">
+ <xsl:call-template name="canonical-type-name">
+ <xsl:with-param name="type" select="@value-mask-type" />
+ </xsl:call-template>
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name">
+ <xsl:with-param name="name" select="@value-mask-name" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </field>
+ <list type="uint32_t">
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name">
+ <xsl:with-param name="name" select="@value-list-name" />
+ </xsl:call-template>
+ </xsl:attribute>
+ <function-call name="xcb_popcount">
+ <param>
+ <fieldref>
+ <xsl:call-template name="canonical-var-name">
+ <xsl:with-param name="name" select="@value-mask-name" />
+ </xsl:call-template>
+ </fieldref>
+ </param>
+ </function-call>
+ </list>
+ </xsl:template>
+
+ <xsl:template match="field" mode="param">
+ <field>
+ <xsl:attribute name="type">
+ <xsl:call-template name="canonical-type-name" />
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name" />
+ </xsl:attribute>
+ </field>
+ </xsl:template>
+
+ <xsl:template match="list" mode="param">
+ <!-- If no length expression is provided, use a CARD32 localfield. -->
+ <xsl:if test="not(node())">
+ <field type="uint32_t" name="{@name}_len" />
+ </xsl:if>
+ <field>
+ <xsl:variable name="ctype">
+ <xsl:call-template name="canonical-type-name" />
+ </xsl:variable>
+ <xsl:attribute name="type">
+ <xsl:text>const </xsl:text>
+ <xsl:call-template name="canonical-type-name" />
+ <xsl:if test="not($ctype='char') and not($ctype='void')">
+ <xsl:text>_t</xsl:text>
+ </xsl:if>
+ <xsl:text> *</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name" />
+ </xsl:attribute>
+ </field>
+ </xsl:template>
+
+ <xsl:template match="valueparam" mode="param">
+ <field>
+ <xsl:attribute name="type">
+ <xsl:call-template name="canonical-type-name">
+ <xsl:with-param name="type" select="@value-mask-type" />
+ </xsl:call-template>
+ <xsl:text>_t</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name">
+ <xsl:with-param name="name" select="@value-mask-name" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </field>
+ <field type="const uint32_t *">
+ <xsl:attribute name="name">
+ <xsl:call-template name="canonical-var-name">
+ <xsl:with-param name="name" select="@value-list-name" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </field>
+ </xsl:template>
+
+ <!-- Second pass: Process the variable. -->
+ <xsl:variable name="result-rtf">
+ <xsl:apply-templates select="$pass1/*" mode="pass2" />
+ </xsl:variable>
+ <xsl:variable name="result" select="e:node-set($result-rtf)" />
+
+ <xsl:template match="xcb" mode="pass2">
+ <xcb>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates mode="pass2"
+ select="constant|enum|struct|typedef|iterator" />
+ <xsl:apply-templates mode="pass2"
+ select="function|iterator-functions" />
+ </xcb>
+ </xsl:template>
+
+ <!-- Generic rules for nodes that don't need further processing: copy node
+ with attributes, and recursively process the child nodes. -->
+ <xsl:template match="*" mode="pass2">
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates mode="pass2" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="struct" mode="pass2">
+ <xsl:if test="@kind='union' and list[not(@fixed)]">
+ <xsl:message terminate="yes">Unions must be fixed length.</xsl:message>
+ </xsl:if>
+ <struct name="{@name}">
+ <xsl:if test="@kind">
+ <xsl:attribute name="kind">
+ <xsl:value-of select="@kind" />
+ </xsl:attribute>
+ </xsl:if>
+ <!-- FIXME: This should go by size, not number of fields. -->
+ <xsl:copy-of select="node()[not(self::middle)
+ and position() < 3]" />
+ <xsl:if test="middle and (count(*[not(self::middle)]) < 2)">
+ <pad bytes="{2 - count(*[not(self::middle)])}" />
+ </xsl:if>
+ <xsl:copy-of select="middle/*" />
+ <xsl:copy-of select="node()[not(self::middle) and (position() > 2)]" />
+ </struct>
+ </xsl:template>
+
+ <xsl:template match="do-request" mode="pass2">
+ <xsl:variable name="struct"
+ select="$pass1/xcb/struct[@name=current()/@ref]" />
+
+ <xsl:variable name="num-parts" select="(1+count($struct/list))*2" />
+
+ <l>static const xcb_protocol_request_t xcb_req = {</l>
+ <indent>
+ <l>/* count */ <xsl:value-of select="$num-parts" />,</l>
+ <l>/* ext */ <xsl:choose>
+ <xsl:when test="$ext">
+ <xsl:text>&</xsl:text>
+ <xsl:value-of select="xcb:xcb-prefix()" />
+ <xsl:text>_id</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>,</l>
+ <l>/* opcode */ <xsl:value-of select="@opcode" />,</l>
+ <l>/* isvoid */ <xsl:value-of select="1-boolean(@has-reply)" /></l>
+ </indent>
+ <l>};</l>
+
+ <l />
+ <l>struct iovec xcb_parts[<xsl:value-of select="$num-parts+2" />];</l>
+ <l><xsl:value-of select="../@type" /> xcb_ret;</l>
+ <l><xsl:value-of select="@ref" /> xcb_out;</l>
+
+ <l />
+ <xsl:if test="not ($ext) and not($struct//*[(self::field or self::exprfield or self::pad)
+ and not(boolean(@no-assign))])">
+ <l>xcb_out.pad0 = 0;</l>
+ </xsl:if>
+ <xsl:apply-templates select="$struct//*[(self::field or self::exprfield or self::pad)
+ and not(boolean(@no-assign))]"
+ mode="assign" />
+
+ <l />
+ <l>xcb_parts[2].iov_base = (char *) &xcb_out;</l>
+ <l>xcb_parts[2].iov_len = sizeof(xcb_out);</l>
+ <l>xcb_parts[3].iov_base = 0;</l>
+ <l>xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;</l>
+
+ <xsl:for-each select="$struct/list">
+ <l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (char *) <!--
+ --><xsl:value-of select="@name" />;</l>
+ <l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_len = <!--
+ --><xsl:apply-templates mode="output-expression" />
+ <xsl:if test="not(@type = 'void_t')">
+ <xsl:text> * sizeof(</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@type='char_t'">
+ <xsl:text>char</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@type" />
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>)</xsl:text>
+ </xsl:if>;</l>
+ <l>xcb_parts[<xsl:value-of select="3 + position() * 2"/>].iov_base = 0;</l>
+ <l>xcb_parts[<xsl:value-of select="3 + position() * 2"/>].iov_len = -xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_len & 3;</l>
+ </xsl:for-each>
+
+ <l>xcb_ret.sequence = xcb_send_request(c, <!--
+ --><xsl:choose>
+ <xsl:when test="@checked='true'">XCB_REQUEST_CHECKED</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>, xcb_parts + 2, &xcb_req);</l>
+ <l>return xcb_ret;</l>
+ </xsl:template>
+
+ <xsl:template match="field" mode="assign">
+ <l>
+ <xsl:text>xcb_out.</xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text>;</xsl:text>
+ </l>
+ </xsl:template>
+
+ <xsl:template match="exprfield" mode="assign">
+ <l>
+ <xsl:text>xcb_out.</xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text> = </xsl:text>
+ <xsl:apply-templates mode="output-expression" />
+ <xsl:text>;</xsl:text>
+ </l>
+ </xsl:template>
+
+ <xsl:template match="pad" mode="assign">
+ <xsl:variable name="padnum"><xsl:number /></xsl:variable>
+ <l><xsl:choose>
+ <xsl:when test="@bytes = 1">xcb_out.pad<xsl:value-of select="$padnum - 1" /> = 0;</xsl:when>
+ <xsl:otherwise>memset(xcb_out.pad<xsl:value-of select="$padnum - 1" />, 0, <xsl:value-of select="@bytes" />);</xsl:otherwise>
+ </xsl:choose></l>
+ </xsl:template>
+
+ <xsl:template match="iterator" mode="pass2">
+ <struct name="{@ref}_iterator_t">
+ <field type="{@ref}_t *" name="data" />
+ <field type="int" name="rem" />
+ <field type="int" name="index" />
+ </struct>
+ </xsl:template>
+
+ <xsl:template match="iterator-functions" mode="pass2">
+ <xsl:variable name="ref" select="@ref" />
+ <xsl:variable name="kind" select="@kind" />
+ <xsl:variable name="struct"
+ select="$pass1/xcb/struct[@name=concat($ref, $kind, '_t')]" />
+ <xsl:variable name="nextfields-rtf">
+ <nextfield>R + 1</nextfield>
+ <xsl:for-each select="$struct/list[not(@fixed)]">
+ <xsl:choose>
+ <xsl:when test="substring(@type, 1, 3) = 'xcb'">
+ <nextfield><xsl:value-of select="substring(@type, 1, string-length(@type)-2)" />_end(<!--
+ --><xsl:value-of select="$ref" />_<!--
+ --><xsl:value-of select="string(@name)" />_iterator(R))</nextfield>
+ </xsl:when>
+ <xsl:otherwise>
+ <nextfield><xsl:value-of select="$ref" />_<!--
+ --><xsl:value-of select="string(@name)" />_end(R)</nextfield>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="nextfields" select="e:node-set($nextfields-rtf)" />
+ <xsl:for-each select="$struct/list[not(@fixed)]">
+ <xsl:variable name="number"
+ select="1+count(preceding-sibling::list[not(@fixed)])" />
+ <xsl:variable name="nextfield" select="$nextfields/nextfield[$number]" />
+ <xsl:variable name="is-first"
+ select="not(preceding-sibling::list[not(@fixed)])" />
+ <xsl:variable name="field-name" select="@name" />
+ <xsl:variable name="is-variable"
+ select="$pass1/xcb/struct[@name=current()/@type]/list
+ or document($search-path)/xcb
+ /struct[concat(xcb:xcb-prefix(@name), '_t')
+ = current()/@type]
+ /*[self::valueparam
+ or self::list[.//*[not(self::value
+ or self::op)]]]" />
+ <xsl:if test="not($is-variable)">
+ <function type="{xcb:get-char-void(@type)} *" name="{$ref}_{xcb:lowercase($field-name)}">
+ <field type="const {$ref}{$kind}_t *" name="R" />
+ <xsl:choose>
+ <xsl:when test="$is-first">
+ <l>return (<xsl:value-of select="xcb:get-char-void(@type)" /> *) <!--
+ -->(<xsl:value-of select="$nextfield" />);</l>
+ </xsl:when>
+ <xsl:otherwise>
+ <l>xcb_generic_iterator_t prev = <!--
+ --><xsl:value-of select="$nextfield" />;</l>
+ <l>return (<xsl:value-of select="xcb:get-char-void(@type)" /> *) <!--
+ -->((char *) prev.data + XCB_TYPE_PAD(<!--
+ --><xsl:value-of select="xcb:get-char-void(@type)" />, prev.index));</l>
+ </xsl:otherwise>
+ </xsl:choose>
+ </function>
+ </xsl:if>
+ <function type="int" name="{$ref}_{xcb:lowercase($field-name)}_length">
+ <field type="const {$ref}{$kind}_t *" name="R" />
+ <l>return <xsl:apply-templates mode="output-expression">
+ <xsl:with-param name="field-prefix" select="'R->'" />
+ </xsl:apply-templates>;</l>
+ </function>
+ <xsl:choose>
+ <xsl:when test="substring(@type, 1, 3) = 'xcb'">
+ <function type="{substring(@type, 1, string-length(@type)-2)}_iterator_t" name="{$ref}_{xcb:lowercase($field-name)}_iterator">
+ <field type="const {$ref}{$kind}_t *" name="R" />
+ <l><xsl:value-of select="substring(@type, 1, string-length(@type)-2)" />_iterator_t i;</l>
+ <xsl:choose>
+ <xsl:when test="$is-first">
+ <l>i.data = (<xsl:value-of select="@type" /> *) <!--
+ -->(<xsl:value-of select="$nextfield" />);</l>
+ </xsl:when>
+ <xsl:otherwise>
+ <l>xcb_generic_iterator_t prev = <!--
+ --><xsl:value-of select="$nextfield" />;</l>
+ <l>i.data = (<xsl:value-of select="@type" /> *) <!--
+ -->((char *) prev.data + XCB_TYPE_PAD(<!--
+ --><xsl:value-of select="@type" />, prev.index));</l>
+ </xsl:otherwise>
+ </xsl:choose>
+ <l>i.rem = <xsl:apply-templates mode="output-expression">
+ <xsl:with-param name="field-prefix" select="'R->'" />
+ </xsl:apply-templates>;</l>
+ <l>i.index = (char *) i.data - (char *) R;</l>
+ <l>return i;</l>
+ </function>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="cast">
+ <xsl:choose>
+ <xsl:when test="@type='void'">char</xsl:when>
+ <xsl:otherwise><xsl:value-of select="@type" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <function type="xcb_generic_iterator_t" name="{$ref}_{xcb:lowercase($field-name)}_end">
+ <field type="const {$ref}{$kind}_t *" name="R" />
+ <l>xcb_generic_iterator_t i;</l>
+ <xsl:choose>
+ <xsl:when test="$is-first">
+ <l>i.data = ((<xsl:value-of select="xcb:remove-void($cast)" /> *) <!--
+ -->(<xsl:value-of select="$nextfield" />)) + (<!--
+ --><xsl:apply-templates mode="output-expression">
+ <xsl:with-param name="field-prefix" select="'R->'" />
+ </xsl:apply-templates>);</l>
+ </xsl:when>
+ <xsl:otherwise>
+ <l>xcb_generic_iterator_t child = <!--
+ --><xsl:value-of select="$nextfield" />;</l>
+ <l>i.data = ((<xsl:value-of select="xcb:get-char-void($cast)" /> *) <!--
+ -->child.data) + (<!--
+ --><xsl:apply-templates mode="output-expression">
+ <xsl:with-param name="field-prefix" select="'R->'" />
+ </xsl:apply-templates>);</l>
+ </xsl:otherwise>
+ </xsl:choose>
+ <l>i.rem = 0;</l>
+ <l>i.index = (char *) i.data - (char *) R;</l>
+ <l>return i;</l>
+ </function>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:if test="not($kind)">
+ <function type="void" name="{$ref}_next">
+ <doc>/**</doc>
+ <doc> * Get the next element of the iterator</doc>
+ <doc> * @param i Pointer to a <xsl:value-of select="$ref" />_iterator_t</doc>
+ <doc> *</doc>
+ <doc> * Get the next element in the iterator. The member rem is</doc>
+ <doc> * decreased by one. The member data points to the next</doc>
+ <doc> * element. The member index is increased by sizeof(<xsl:value-of select="$ref" />_t)</doc>
+ <doc> */</doc>
+ <field type="{$ref}_iterator_t *" name="i" />
+ <xsl:choose>
+ <xsl:when test="$struct/list[not(@fixed)]">
+ <l><xsl:value-of select="$ref" />_t *R = i->data;</l>
+ <l>xcb_generic_iterator_t child = <!--
+ --><xsl:value-of select="$nextfields/nextfield[last()]" />;</l>
+ <l>--i->rem;</l>
+ <l>i->data = (<xsl:value-of select="$ref" />_t *) child.data;</l>
+ <l>i->index = child.index;</l>
+ </xsl:when>
+ <xsl:otherwise>
+ <l>--i->rem;</l>
+ <l>++i->data;</l>
+ <l>i->index += sizeof(<xsl:value-of select="$ref" />_t);</l>
+ </xsl:otherwise>
+ </xsl:choose>
+ </function>
+ <function type="xcb_generic_iterator_t" name="{$ref}_end">
+ <doc>/**</doc>
+ <doc> * Return the iterator pointing to the last element</doc>
+ <doc> * @param i An <xsl:value-of select="$ref" />_iterator_t</doc>
+ <doc> * @return The iterator pointing to the last element</doc>
+ <doc> *</doc>
+ <doc> * Set the current element in the iterator to the last element.</doc>
+ <doc> * The member rem is set to 0. The member data points to the</doc>
+ <doc> * last element.</doc>
+ <doc> */</doc>
+ <field type="{$ref}_iterator_t" name="i" />
+ <l>xcb_generic_iterator_t ret;</l>
+ <xsl:choose>
+ <xsl:when test="$struct/list[not(@fixed)]">
+ <l>while(i.rem > 0)</l>
+ <indent>
+ <l><xsl:value-of select="$ref" />_next(&i);</l>
+ </indent>
+ <l>ret.data = i.data;</l>
+ <l>ret.rem = i.rem;</l>
+ <l>ret.index = i.index;</l>
+ </xsl:when>
+ <xsl:otherwise>
+ <l>ret.data = i.data + i.rem;</l>
+ <l>ret.index = i.index + ((char *) ret.data - (char *) i.data);</l>
+ <l>ret.rem = 0;</l>
+ </xsl:otherwise>
+ </xsl:choose>
+ <l>return ret;</l>
+ </function>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output the results. -->
+ <xsl:template match="/">
+ <xsl:if test="not(function-available('e:node-set'))">
+ <xsl:message terminate="yes"><!--
+ -->Error: This stylesheet requires the EXSL node-set extension.<!--
+ --></xsl:message>
+ </xsl:if>
+
+ <xsl:if test="not($h) and not($c)">
+ <xsl:message terminate="yes"><!--
+ -->Error: Parameter "mode" must be "header" or "source".<!--
+ --></xsl:message>
+ </xsl:if>
+
+ <xsl:apply-templates select="$result/*" mode="output" />
+ </xsl:template>
+
+ <xsl:template match="xcb" mode="output">
+ <xsl:variable name="guard"><!--
+ -->__<xsl:value-of select="$ucase-header" />_H<!--
+ --></xsl:variable>
+
+<xsl:text>/*
+ * This file generated automatically from </xsl:text>
+<xsl:value-of select="$header" /><xsl:text>.xml by c-client.xsl using XSLT.
+ * Edit at your peril.
+ */
+</xsl:text>
+<xsl:if test="$h"><xsl:text>
+/**
+ * @defgroup XCB_</xsl:text><xsl:value-of select="$ext" /><xsl:text>_API XCB </xsl:text><xsl:value-of select="$ext" /><xsl:text> API
+ * @brief </xsl:text><xsl:value-of select="$ext" /><xsl:text> XCB Protocol Implementation.</xsl:text>
+<xsl:text>
+ * @{
+ **/
+</xsl:text>
+
+<xsl:text>
+#ifndef </xsl:text><xsl:value-of select="$guard" /><xsl:text>
+#define </xsl:text><xsl:value-of select="$guard" /><xsl:text>
+</xsl:text>
+#include "xcb.h"
+<xsl:for-each select="$root/xcb/import">
+<xsl:text>#include "</xsl:text><xsl:value-of select="." /><xsl:text>.h"
+</xsl:text>
+</xsl:for-each>
+<xsl:text>
+</xsl:text>
+</xsl:if>
+<xsl:if test="$h">
+ <xsl:choose>
+ <xsl:when test="string($ext)">
+ <xsl:text>#define XCB_</xsl:text><xsl:value-of select="translate($ext, $lcase, $ucase)"/><xsl:text>_MAJOR_VERSION </xsl:text><xsl:value-of select="/xcb/@major-version" /><xsl:text>
+</xsl:text>
+ <xsl:text>#define XCB_</xsl:text><xsl:value-of select="translate($ext, $lcase, $ucase)"/><xsl:text>_MINOR_VERSION </xsl:text><xsl:value-of select="/xcb/@minor-version" />
+ <xsl:text>
+
+</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+</xsl:if>
+
+<xsl:if test="$c">
+<xsl:if test="$need-string-h">
+#include <string.h></xsl:if>
+<xsl:text>
+#include <assert.h>
+#include "xcbext.h"
+#include "</xsl:text><xsl:value-of select="$header" /><xsl:text>.h"
+
+</xsl:text></xsl:if>
+
+ <xsl:apply-templates mode="output" />
+
+<xsl:if test="$h">
+<xsl:text>
+#endif
+
+/**
+ * @}
+ */
+</xsl:text>
+</xsl:if>
+ </xsl:template>
+
+ <xsl:template match="constant" mode="output">
+ <xsl:choose>
+ <xsl:when test="@type = 'number'">
+ <xsl:if test="$h">
+ <xsl:text>/** Opcode for </xsl:text><xsl:value-of select="@name"/><xsl:text>. */
+</xsl:text>
+ <xsl:text>#define </xsl:text>
+ <xsl:value-of select="translate(@name, $lcase, $ucase)" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@value" />
+ <xsl:text>
+
+</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="@type = 'string'">
+ <xsl:if test="$h">
+ <xsl:text>extern </xsl:text>
+ </xsl:if>
+ <xsl:text>const char </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text>[]</xsl:text>
+ <xsl:if test="$c">
+ <xsl:text> = "</xsl:text>
+ <xsl:value-of select="@value" />
+ <xsl:text>"</xsl:text>
+ </xsl:if>
+ <xsl:text>;
+
+</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$h">
+ <xsl:text>extern </xsl:text>
+ </xsl:if>
+ <xsl:call-template name="type-and-name" />
+ <xsl:if test="$c">
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="@value" />
+ </xsl:if>
+ <xsl:text>;
+
+</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="typedef" mode="output">
+ <xsl:if test="$h">
+ <xsl:text>typedef </xsl:text>
+ <xsl:value-of select="xcb:get-char-void(@oldname)" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@newname" />
+ <xsl:text>;
+
+</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="struct" mode="output">
+ <xsl:if test="$h">
+ <xsl:variable name="type-lengths">
+ <xsl:call-template name="type-lengths">
+ <xsl:with-param name="items" select="field/@type" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:text>/**
+ * @brief </xsl:text><xsl:value-of select="@name" /><xsl:text>
+ **/
+</xsl:text>
+ <xsl:text>typedef </xsl:text>
+ <xsl:if test="not(@kind)">struct</xsl:if><xsl:value-of select="@kind" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text> {
+</xsl:text>
+ <xsl:for-each select="exprfield|field|list[@fixed]|pad">
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:apply-templates>
+ <xsl:text>; /**< </xsl:text><xsl:text> */
+</xsl:text>
+ </xsl:for-each>
+ <xsl:text>} </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text>;
+
+</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="enum" mode="output">
+ <xsl:if test="$h">
+ <xsl:text>typedef enum </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text> {
+ </xsl:text>
+ <xsl:call-template name="list">
+ <xsl:with-param name="separator"><xsl:text>,
+ </xsl:text></xsl:with-param>
+ <xsl:with-param name="items">
+ <xsl:for-each select="item">
+ <item>
+ <xsl:value-of select="@name" />
+ <xsl:if test="node()"> <!-- If there is an expression -->
+ <xsl:text> = </xsl:text>
+ <xsl:apply-templates mode="output-expression" />
+ </xsl:if>
+ </item>
+ </xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>
+} </xsl:text><xsl:value-of select="@name" /><xsl:text>;
+
+</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="function" mode="output">
+ <xsl:variable name="decl-open" select="concat(@name, ' (')" />
+ <xsl:variable name="type-lengths">
+ <xsl:call-template name="type-lengths">
+ <xsl:with-param name="items" select="field/@type" />
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Doxygen for functions in header. -->
+ <xsl:if test="$h">
+ <xsl:apply-templates select="doc" mode="function-doc">
+ </xsl:apply-templates>
+ </xsl:if>
+/*****************************************************************************
+ **
+ ** <xsl:value-of select="@type" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name" />
+ ** <xsl:call-template name="list">
+ <xsl:with-param name="items">
+ <xsl:for-each select="field">
+ <item>
+ <xsl:text>
+ ** @param </xsl:text>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:apply-templates>
+ </item>
+ </xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ ** @returns <xsl:value-of select="@type" />
+ **
+ *****************************************************************************/
+
+<xsl:value-of select="@type" />
+ <xsl:text>
+</xsl:text>
+ <xsl:value-of select="$decl-open" />
+ <xsl:call-template name="list">
+ <xsl:with-param name="separator">
+ <xsl:text>,
+</xsl:text>
+ <xsl:call-template name="repeat">
+ <xsl:with-param name="count" select="string-length($decl-open)" />
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="items">
+ <xsl:for-each select="field">
+ <item>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:apply-templates>
+ <xsl:text> /**< */</xsl:text>
+ </item>
+ </xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+
+ <xsl:if test="$h"><xsl:text>;
+
+</xsl:text></xsl:if>
+
+ <xsl:if test="$c">
+ <xsl:text>
+{
+</xsl:text>
+ <xsl:apply-templates select="l|indent" mode="function-body">
+ <xsl:with-param name="indent" select="$indent-string" />
+ </xsl:apply-templates>
+ <xsl:text>}
+
+</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="doc" mode="function-doc">
+ <xsl:value-of select="." /><xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="l" mode="function-body">
+ <xsl:param name="indent" />
+ <xsl:value-of select="concat($indent, .)" /><xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="indent" mode="function-body">
+ <xsl:param name="indent" />
+ <xsl:apply-templates select="l|indent" mode="function-body">
+ <xsl:with-param name="indent" select="concat($indent, $indent-string)" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="value" mode="output-expression">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="fieldref" mode="output-expression">
+ <xsl:param name="field-prefix" />
+ <xsl:value-of select="concat($field-prefix, .)" />
+ </xsl:template>
+
+ <xsl:template match="op" mode="output-expression">
+ <xsl:param name="field-prefix" />
+ <xsl:text>(</xsl:text>
+ <xsl:apply-templates select="node()[1]" mode="output-expression">
+ <xsl:with-param name="field-prefix" select="$field-prefix" />
+ </xsl:apply-templates>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@op" />
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="node()[2]" mode="output-expression">
+ <xsl:with-param name="field-prefix" select="$field-prefix" />
+ </xsl:apply-templates>
+ <xsl:text>)</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="bit" mode="output-expression">
+ <xsl:text>(1 << </xsl:text>
+ <xsl:value-of select="." />
+ <xsl:text>)</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="function-call" mode="output-expression">
+ <xsl:param name="field-prefix" />
+ <xsl:value-of select="@name" />
+ <xsl:text>(</xsl:text>
+ <xsl:call-template name="list">
+ <xsl:with-param name="separator" select="', '" />
+ <xsl:with-param name="items">
+ <xsl:for-each select="param">
+ <item><xsl:apply-templates mode="output-expression">
+ <xsl:with-param name="field-prefix" select="$field-prefix" />
+ </xsl:apply-templates></item>
+ </xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:template>
+
+ <!-- Catch invalid elements in expressions. -->
+ <xsl:template match="*" mode="output-expression">
+ <xsl:message terminate="yes">
+ <xsl:text>Invalid element in expression: </xsl:text>
+ <xsl:value-of select="name()" />
+ </xsl:message>
+ </xsl:template>
+
+ <xsl:template match="field|exprfield">
+ <xsl:param name="type-lengths" select="0" />
+ <xsl:call-template name="type-and-name">
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="list[@fixed]">
+ <xsl:param name="type-lengths" select="0" />
+ <xsl:call-template name="type-and-name">
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:call-template>
+ <xsl:text>[</xsl:text>
+ <xsl:apply-templates mode="output-expression" />
+ <xsl:text>]</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="pad">
+ <xsl:param name="type-lengths" select="0" />
+
+ <xsl:variable name="padnum"><xsl:number /></xsl:variable>
+
+ <xsl:call-template name="type-and-name">
+ <xsl:with-param name="type" select="'uint8_t'" />
+ <xsl:with-param name="name">
+ <xsl:text>pad</xsl:text>
+ <xsl:value-of select="$padnum - 1" />
+ </xsl:with-param>
+ <xsl:with-param name="type-lengths" select="$type-lengths" />
+ </xsl:call-template>
+ <xsl:if test="@bytes > 1">
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="@bytes" />
+ <xsl:text>]</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Output the given type and name (defaulting to the corresponding
+ attributes of the context node), with the appropriate spacing. The
+ type must consist of a base type (which may contain spaces), then
+ optionally a single space and a suffix of one or more '*' characters.
+ If the type-lengths parameter is provided, use it to line up the base
+ types and suffixs of the type declarations. -->
+ <xsl:template name="type-and-name">
+ <xsl:param name="type" select="@type" />
+ <xsl:param name="name" select="@name" />
+ <xsl:param name="type-lengths">
+ <max-type-length>0</max-type-length>
+ <max-suffix-length>0</max-suffix-length>
+ </xsl:param>
+
+ <xsl:variable name="type-lengths-ns" select="e:node-set($type-lengths)" />
+ <xsl:variable name="min-type-length"
+ select="$type-lengths-ns/max-type-length" />
+ <xsl:variable name="min-suffix-length"
+ select="$type-lengths-ns/max-suffix-length" />
+
+ <xsl:variable name="base-type">
+ <xsl:choose>
+ <xsl:when test="contains($type, ' *')">
+ <xsl:value-of select="substring-before($type, ' *')" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$type" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="suffix">
+ <xsl:if test="contains($type, ' *')">
+ <xsl:text>*</xsl:text>
+ <xsl:value-of select="substring-after($type, ' *')" />
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:value-of select="$base-type" />
+ <xsl:if test="string-length($base-type) < $min-type-length">
+ <xsl:call-template name="repeat">
+ <xsl:with-param name="count" select="$min-type-length
+ - string-length($base-type)" />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:text> </xsl:text>
+ <xsl:if test="string-length($suffix) < $min-suffix-length">
+ <xsl:call-template name="repeat">
+ <xsl:with-param name="count" select="$min-suffix-length
+ - string-length($suffix)" />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:value-of select="$suffix" />
+ <xsl:value-of select="$name" />
+ </xsl:template>
+
+ <!-- Output a list with a given separator. Empty items are skipped. -->
+ <xsl:template name="list">
+ <xsl:param name="separator" />
+ <xsl:param name="items" />
+
+ <xsl:for-each select="e:node-set($items)/*">
+ <xsl:value-of select="." />
+ <xsl:if test="not(position() = last())">
+ <xsl:value-of select="$separator" />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Repeat a string (space by default) a given number of times. -->
+ <xsl:template name="repeat">
+ <xsl:param name="str" select="' '" />
+ <xsl:param name="count" />
+
+ <xsl:if test="$count > 0">
+ <xsl:value-of select="$str" />
+ <xsl:call-template name="repeat">
+ <xsl:with-param name="str" select="$str" />
+ <xsl:with-param name="count" select="$count - 1" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Record the maximum type lengths of a set of types for use as the
+ max-type-lengths parameter of type-and-name. -->
+ <xsl:template name="type-lengths">
+ <xsl:param name="items" />
+ <xsl:variable name="type-lengths-rtf">
+ <xsl:for-each select="$items">
+ <item>
+ <xsl:choose>
+ <xsl:when test="contains(., ' *')">
+ <xsl:value-of select="string-length(
+ substring-before(., ' *'))" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length(.)" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </item>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="suffix-lengths-rtf">
+ <xsl:for-each select="$items">
+ <item>
+ <xsl:choose>
+ <xsl:when test="contains(., ' *')">
+ <xsl:value-of select="string-length(substring-after(., ' *'))
+ + 1" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </item>
+ </xsl:for-each>
+ </xsl:variable>
+ <max-type-length>
+ <xsl:call-template name="max">
+ <xsl:with-param name="items"
+ select="e:node-set($type-lengths-rtf)/*" />
+ </xsl:call-template>
+ </max-type-length>
+ <max-suffix-length>
+ <xsl:call-template name="max">
+ <xsl:with-param name="items"
+ select="e:node-set($suffix-lengths-rtf)/*" />
+ </xsl:call-template>
+ </max-suffix-length>
+ </xsl:template>
+
+ <!-- Return the maximum number in a set of numbers. -->
+ <xsl:template name="max">
+ <xsl:param name="items" />
+ <xsl:choose>
+ <xsl:when test="count($items) = 0">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="head" select="number($items[1])" />
+ <xsl:variable name="tail-max">
+ <xsl:call-template name="max">
+ <xsl:with-param name="items" select="$items[position() > 1]" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$head > number($tail-max)">
+ <xsl:value-of select="$head" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tail-max" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+</xsl:transform>
--- /dev/null
+#!/usr/bin/env python
+from xml.etree.cElementTree import *
+from os.path import basename
+import getopt
+import sys
+import re
+
+# Jump to the bottom of this file for the main routine
+
+# Some hacks to make the API more readable, and to keep backwards compability
+_cname_re = re.compile('([A-Z0-9][a-z]+|[A-Z0-9]+(?![a-z])|[a-z]+)')
+_cname_special_cases = {'DECnet':'decnet'}
+
+_extension_special_cases = ['XPrint', 'XCMisc', 'BigRequests']
+
+_cplusplus_annoyances = {'class' : '_class',
+ 'new' : '_new',
+ 'delete': '_delete'}
+
+_hlines = []
+_hlevel = 0
+_clines = []
+_clevel = 0
+_ns = None
+
+def _h(fmt, *args):
+ '''
+ Writes the given line to the header file.
+ '''
+ _hlines[_hlevel].append(fmt % args)
+
+def _c(fmt, *args):
+ '''
+ Writes the given line to the source file.
+ '''
+ _clines[_clevel].append(fmt % args)
+
+def _hc(fmt, *args):
+ '''
+ Writes the given line to both the header and source files.
+ '''
+ _h(fmt, *args)
+ _c(fmt, *args)
+
+# XXX See if this level thing is really necessary.
+def _h_setlevel(idx):
+ '''
+ Changes the array that header lines are written to.
+ Supports writing different sections of the header file.
+ '''
+ global _hlevel
+ while len(_hlines) <= idx:
+ _hlines.append([])
+ _hlevel = idx
+
+def _c_setlevel(idx):
+ '''
+ Changes the array that source lines are written to.
+ Supports writing to different sections of the source file.
+ '''
+ global _clevel
+ while len(_clines) <= idx:
+ _clines.append([])
+ _clevel = idx
+
+def _n_item(str):
+ '''
+ Does C-name conversion on a single string fragment.
+ Uses a regexp with some hard-coded special cases.
+ '''
+ if str in _cname_special_cases:
+ return _cname_special_cases[str]
+ else:
+ split = _cname_re.finditer(str)
+ name_parts = [match.group(0) for match in split]
+ return '_'.join(name_parts)
+
+def _cpp(str):
+ '''
+ Checks for certain C++ reserved words and fixes them.
+ '''
+ if str in _cplusplus_annoyances:
+ return _cplusplus_annoyances[str]
+ else:
+ return str
+
+def _ext(str):
+ '''
+ Does C-name conversion on an extension name.
+ Has some additional special cases on top of _n_item.
+ '''
+ if str in _extension_special_cases:
+ return _n_item(str).lower()
+ else:
+ return str.lower()
+
+def _n(list):
+ '''
+ Does C-name conversion on a tuple of strings.
+ Different behavior depending on length of tuple, extension/not extension, etc.
+ Basically C-name converts the individual pieces, then joins with underscores.
+ '''
+ if len(list) == 1:
+ parts = list
+ elif len(list) == 2:
+ parts = [list[0], _n_item(list[1])]
+ elif _ns.is_ext:
+ parts = [list[0], _ext(list[1])] + [_n_item(i) for i in list[2:]]
+ else:
+ parts = [list[0]] + [_n_item(i) for i in list[1:]]
+ return '_'.join(parts).lower()
+
+def _t(list):
+ '''
+ Does C-name conversion on a tuple of strings representing a type.
+ Same as _n but adds a "_t" on the end.
+ '''
+ if len(list) == 1:
+ parts = list
+ elif len(list) == 2:
+ parts = [list[0], _n_item(list[1]), 't']
+ elif _ns.is_ext:
+ parts = [list[0], _ext(list[1])] + [_n_item(i) for i in list[2:]] + ['t']
+ else:
+ parts = [list[0]] + [_n_item(i) for i in list[1:]] + ['t']
+ return '_'.join(parts).lower()
+
+
+def c_open(self):
+ '''
+ Exported function that handles module open.
+ Opens the files and writes out the auto-generated comment, header file includes, etc.
+ '''
+ global _ns
+ _ns = self.namespace
+ _ns.c_ext_global_name = _n(_ns.prefix + ('id',))
+
+ # Build the type-name collision avoidance table used by c_enum
+ build_collision_table()
+
+ _h_setlevel(0)
+ _c_setlevel(0)
+
+ _hc('/*')
+ _hc(' * This file generated automatically from %s by c_client.py.', _ns.file)
+ _hc(' * Edit at your peril.')
+ _hc(' */')
+ _hc('')
+
+ _h('/**')
+ _h(' * @defgroup XCB_%s_API XCB %s API', _ns.ext_name, _ns.ext_name)
+ _h(' * @brief %s XCB Protocol Implementation.', _ns.ext_name)
+ _h(' * @{')
+ _h(' **/')
+ _h('')
+ _h('#ifndef __%s_H', _ns.header.upper())
+ _h('#define __%s_H', _ns.header.upper())
+ _h('')
+ _h('#include "xcb.h"')
+
+ _c('#include <string.h>')
+ _c('#include <assert.h>')
+ _c('#include "xcbext.h"')
+ _c('#include "%s.h"', _ns.header)
+
+ if _ns.is_ext:
+ for (n, h) in self.imports:
+ _hc('#include "%s.h"', h)
+
+ _h('')
+ _h('#ifdef __cplusplus')
+ _h('extern "C" {')
+ _h('#endif')
+
+ if _ns.is_ext:
+ _h('')
+ _h('#define XCB_%s_MAJOR_VERSION %s', _ns.ext_name.upper(), _ns.major_version)
+ _h('#define XCB_%s_MINOR_VERSION %s', _ns.ext_name.upper(), _ns.minor_version)
+ _h(' ') #XXX
+ _h('extern xcb_extension_t %s;', _ns.c_ext_global_name)
+
+ _c('')
+ _c('xcb_extension_t %s = { "%s", 0 };', _ns.c_ext_global_name, _ns.ext_xname)
+
+def c_close(self):
+ '''
+ Exported function that handles module close.
+ Writes out all the stored content lines, then closes the files.
+ '''
+ _h_setlevel(2)
+ _c_setlevel(2)
+ _hc('')
+
+ _h('')
+ _h('#ifdef __cplusplus')
+ _h('}')
+ _h('#endif')
+
+ _h('')
+ _h('#endif')
+ _h('')
+ _h('/**')
+ _h(' * @}')
+ _h(' */')
+
+ # Write header file
+ hfile = open('%s.h' % _ns.header, 'w')
+ for list in _hlines:
+ for line in list:
+ hfile.write(line)
+ hfile.write('\n')
+ hfile.close()
+
+ # Write source file
+ cfile = open('%s.c' % _ns.header, 'w')
+ for list in _clines:
+ for line in list:
+ cfile.write(line)
+ cfile.write('\n')
+ cfile.close()
+
+def build_collision_table():
+ global namecount
+ namecount = {}
+
+ for v in module.types.values():
+ name = _t(v[0])
+ namecount[name] = (namecount.get(name) or 0) + 1
+
+def c_enum(self, name):
+ '''
+ Exported function that handles enum declarations.
+ '''
+
+ tname = _t(name)
+ if namecount[tname] > 1:
+ tname = _t(name + ('enum',))
+
+ _h_setlevel(0)
+ _h('')
+ _h('typedef enum %s {', tname)
+
+ count = len(self.values)
+
+ for (enam, eval) in self.values:
+ count = count - 1
+ equals = ' = ' if eval != '' else ''
+ comma = ',' if count > 0 else ''
+ _h(' %s%s%s%s', _n(name + (enam,)).upper(), equals, eval, comma)
+
+ _h('} %s;', tname)
+
+def _c_type_setup(self, name, postfix):
+ '''
+ Sets up all the C-related state by adding additional data fields to
+ all Field and Type objects. Here is where we figure out most of our
+ variable and function names.
+
+ Recurses into child fields and list member types.
+ '''
+ # Do all the various names in advance
+ self.c_type = _t(name + postfix)
+ self.c_wiretype = 'char' if self.c_type == 'void' else self.c_type
+
+ self.c_iterator_type = _t(name + ('iterator',))
+ self.c_next_name = _n(name + ('next',))
+ self.c_end_name = _n(name + ('end',))
+
+ self.c_request_name = _n(name)
+ self.c_checked_name = _n(name + ('checked',))
+ self.c_unchecked_name = _n(name + ('unchecked',))
+ self.c_reply_name = _n(name + ('reply',))
+ self.c_reply_type = _t(name + ('reply',))
+ self.c_cookie_type = _t(name + ('cookie',))
+
+ if self.is_container:
+
+ self.c_container = 'union' if self.is_union else 'struct'
+ prev_varsized_field = None
+ prev_varsized_offset = 0
+ first_field_after_varsized = None
+
+ for field in self.fields:
+ _c_type_setup(field.type, field.field_type, ())
+ if field.type.is_list:
+ _c_type_setup(field.type.member, field.field_type, ())
+
+ field.c_field_type = _t(field.field_type)
+ field.c_field_const_type = ('' if field.type.nmemb == 1 else 'const ') + field.c_field_type
+ field.c_field_name = _cpp(field.field_name)
+ field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb > 1) else ''
+ field.c_pointer = ' ' if field.type.nmemb == 1 else '*'
+
+ field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t
+ field.c_iterator_name = _n(name + (field.field_name, 'iterator')) # xcb_container_field_iterator
+ field.c_accessor_name = _n(name + (field.field_name,)) # xcb_container_field
+ field.c_length_name = _n(name + (field.field_name, 'length')) # xcb_container_field_length
+ field.c_end_name = _n(name + (field.field_name, 'end')) # xcb_container_field_end
+
+ field.prev_varsized_field = prev_varsized_field
+ field.prev_varsized_offset = prev_varsized_offset
+
+ if prev_varsized_offset == 0:
+ first_field_after_varsized = field
+ field.first_field_after_varsized = first_field_after_varsized
+
+ if field.type.fixed_size():
+ prev_varsized_offset += field.type.size
+ else:
+ self.last_varsized_field = field
+ prev_varsized_field = field
+ prev_varsized_offset = 0
+
+def _c_iterator_get_end(field, accum):
+ '''
+ Figures out what C code is needed to find the end of a variable-length structure field.
+ For nested structures, recurses into its last variable-sized field.
+ For lists, calls the end function
+ '''
+ if field.type.is_container:
+ accum = field.c_accessor_name + '(' + accum + ')'
+ # XXX there could be fixed-length fields at the end
+ return _c_iterator_get_end(field.type.last_varsized_field, accum)
+ if field.type.is_list:
+ # XXX we can always use the first way
+ if field.type.member.is_simple:
+ return field.c_end_name + '(' + accum + ')'
+ else:
+ return field.type.member.c_end_name + '(' + field.c_iterator_name + '(' + accum + '))'
+
+def _c_iterator(self, name):
+ '''
+ Declares the iterator structure and next/end functions for a given type.
+ '''
+ _h_setlevel(0)
+ _h('')
+ _h('/**')
+ _h(' * @brief %s', self.c_iterator_type)
+ _h(' **/')
+ _h('typedef struct %s {', self.c_iterator_type)
+ _h(' %s *data; /**< */', self.c_type)
+ _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2))
+ _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2))
+ _h('} %s;', self.c_iterator_type)
+
+ _h_setlevel(1)
+ _c_setlevel(1)
+ _h('')
+ _h('/**')
+ _h(' * Get the next element of the iterator')
+ _h(' * @param i Pointer to a %s', self.c_iterator_type)
+ _h(' *')
+ _h(' * Get the next element in the iterator. The member rem is')
+ _h(' * decreased by one. The member data points to the next')
+ _h(' * element. The member index is increased by sizeof(%s)', self.c_type)
+ _h(' */')
+ _c('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** void %s', self.c_next_name)
+ _hc(' ** ')
+ _hc(' ** @param %s *i', self.c_iterator_type)
+ _hc(' ** @returns void')
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('void')
+ _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type)
+ _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type)
+ _c('{')
+
+ if not self.fixed_size():
+ _c(' %s *R = i->data;', self.c_type)
+ _c(' xcb_generic_iterator_t child = %s;', _c_iterator_get_end(self.last_varsized_field, 'R'))
+ _c(' --i->rem;')
+ _c(' i->data = (%s *) child.data;', self.c_type)
+ _c(' i->index = child.index;')
+ else:
+ _c(' --i->rem;')
+ _c(' ++i->data;')
+ _c(' i->index += sizeof(%s);', self.c_type)
+
+ _c('}')
+
+ _h('')
+ _h('/**')
+ _h(' * Return the iterator pointing to the last element')
+ _h(' * @param i An %s', self.c_iterator_type)
+ _h(' * @return The iterator pointing to the last element')
+ _h(' *')
+ _h(' * Set the current element in the iterator to the last element.')
+ _h(' * The member rem is set to 0. The member data points to the')
+ _h(' * last element.')
+ _h(' */')
+ _c('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** xcb_generic_iterator_t %s', self.c_end_name)
+ _hc(' ** ')
+ _hc(' ** @param %s i', self.c_iterator_type)
+ _hc(' ** @returns xcb_generic_iterator_t')
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('xcb_generic_iterator_t')
+ _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type)
+ _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type)
+ _c('{')
+ _c(' xcb_generic_iterator_t ret;')
+
+ if self.fixed_size():
+ _c(' ret.data = i.data + i.rem;')
+ _c(' ret.index = i.index + ((char *) ret.data - (char *) i.data);')
+ _c(' ret.rem = 0;')
+ else:
+ _c(' while(i.rem > 0)')
+ _c(' %s(&i);', self.c_next_name)
+ _c(' ret.data = i.data;')
+ _c(' ret.rem = i.rem;')
+ _c(' ret.index = i.index;')
+
+ _c(' return ret;')
+ _c('}')
+
+def _c_accessor_get_length(expr, prefix=''):
+ '''
+ Figures out what C code is needed to get a length field.
+ For fields that follow a variable-length field, use the accessor.
+ Otherwise, just reference the structure field directly.
+ '''
+ prefarrow = '' if prefix == '' else prefix + '->'
+
+ if expr.lenfield != None and expr.lenfield.prev_varsized_field != None:
+ return expr.lenfield.c_accessor_name + '(' + prefix + ')'
+ elif expr.lenfield_name != None:
+ return prefarrow + expr.lenfield_name
+ else:
+ return str(expr.nmemb)
+
+def _c_accessor_get_expr(expr, prefix=''):
+ '''
+ Figures out what C code is needed to get the length of a list field.
+ Recurses for math operations.
+ Returns bitcount for value-mask fields.
+ Otherwise, uses the value of the length field.
+ '''
+ lenexp = _c_accessor_get_length(expr, prefix)
+
+ if expr.op == '~':
+ return '(' + '~' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
+ elif expr.op != None:
+ return '(' + _c_accessor_get_expr(expr.lhs, prefix) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
+ elif expr.bitfield:
+ return 'xcb_popcount(' + lenexp + ')'
+ else:
+ return lenexp
+
+def _c_accessors_field(self, field):
+ '''
+ Declares the accessor functions for a non-list field that follows a variable-length field.
+ '''
+ if field.type.is_simple:
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s %s', field.c_field_type, field.c_accessor_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns %s', field.c_field_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s', field.c_field_type)
+ _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type)
+ _c('{')
+ _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
+ _c(' return * (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+ _c('}')
+ else:
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s * %s', field.c_field_type, field.c_accessor_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns %s *', field.c_field_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s *', field.c_field_type)
+ _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type)
+ _c('{')
+ _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
+ _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+ _c('}')
+
+def _c_accessors_list(self, field):
+ '''
+ Declares the accessor functions for a list field.
+ Declares a direct-accessor function only if the list members are fixed size.
+ Declares length and get-iterator functions always.
+ '''
+ list = field.type
+
+ _h_setlevel(1)
+ _c_setlevel(1)
+ if list.member.fixed_size():
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s * %s', field.c_field_type, field.c_accessor_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns %s *', field.c_field_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s *', field.c_field_type)
+ _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type)
+ _c('{')
+
+ if field.prev_varsized_field == None:
+ _c(' return (%s *) (R + 1);', field.c_field_type)
+ else:
+ _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
+ _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+
+ _c('}')
+
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** int %s', field.c_length_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns int')
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('int')
+ _h('%s (const %s *R /**< */);', field.c_length_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_length_name, self.c_type)
+ _c('{')
+ _c(' return %s;', _c_accessor_get_expr(field.type.expr, 'R'))
+ _c('}')
+
+ if field.type.member.is_simple:
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** xcb_generic_iterator_t %s', field.c_end_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns xcb_generic_iterator_t')
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('xcb_generic_iterator_t')
+ _h('%s (const %s *R /**< */);', field.c_end_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_end_name, self.c_type)
+ _c('{')
+ _c(' xcb_generic_iterator_t i;')
+
+ if field.prev_varsized_field == None:
+ _c(' i.data = ((%s *) (R + 1)) + (%s);', field.type.c_wiretype, _c_accessor_get_expr(field.type.expr, 'R'))
+ else:
+ _c(' xcb_generic_iterator_t child = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
+ _c(' i.data = ((%s *) child.data) + (%s);', field.type.c_wiretype, _c_accessor_get_expr(field.type.expr, 'R'))
+
+ _c(' i.rem = 0;')
+ _c(' i.index = (char *) i.data - (char *) R;')
+ _c(' return i;')
+ _c('}')
+
+ else:
+ _hc('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s %s', field.c_iterator_type, field.c_iterator_name)
+ _hc(' ** ')
+ _hc(' ** @param const %s *R', self.c_type)
+ _hc(' ** @returns %s', field.c_iterator_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s', field.c_iterator_type)
+ _h('%s (const %s *R /**< */);', field.c_iterator_name, self.c_type)
+ _c('%s (const %s *R /**< */)', field.c_iterator_name, self.c_type)
+ _c('{')
+ _c(' %s i;', field.c_iterator_type)
+
+ if field.prev_varsized_field == None:
+ _c(' i.data = (%s *) (R + 1);', field.c_field_type)
+ else:
+ _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
+ _c(' i.data = (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index));', field.c_field_type, field.c_field_type)
+
+ _c(' i.rem = %s;', _c_accessor_get_expr(field.type.expr, 'R'))
+ _c(' i.index = (char *) i.data - (char *) R;')
+ _c(' return i;')
+ _c('}')
+
+def _c_accessors(self, name, base):
+ '''
+ Declares the accessor functions for the fields of a structure.
+ '''
+ for field in self.fields:
+ if field.type.is_list and not field.type.fixed_size():
+ _c_accessors_list(self, field)
+ elif field.prev_varsized_field != None:
+ _c_accessors_field(self, field)
+
+def c_simple(self, name):
+ '''
+ Exported function that handles cardinal type declarations.
+ These are types which are typedef'd to one of the CARDx's, char, float, etc.
+ '''
+ _c_type_setup(self, name, ())
+
+ if (self.name != name):
+ # Typedef
+ _h_setlevel(0)
+ my_name = _t(name)
+ _h('')
+ _h('typedef %s %s;', _t(self.name), my_name)
+
+ # Iterator
+ _c_iterator(self, name)
+
+def _c_complex(self):
+ '''
+ Helper function for handling all structure types.
+ Called for all structs, requests, replies, events, errors.
+ '''
+ _h_setlevel(0)
+ _h('')
+ _h('/**')
+ _h(' * @brief %s', self.c_type)
+ _h(' **/')
+ _h('typedef %s %s {', self.c_container, self.c_type)
+
+ struct_fields = []
+ maxtypelen = 0
+
+ varfield = None
+ for field in self.fields:
+ if not field.type.fixed_size():
+ varfield = field.c_field_name
+ continue
+ if varfield != None and not field.type.is_pad and field.wire:
+ errmsg = '%s: warning: variable field %s followed by fixed field %s\n' % (self.c_type, varfield, field.c_field_name)
+ sys.stderr.write(errmsg)
+ # sys.exit(1)
+ if field.wire:
+ struct_fields.append(field)
+
+ for field in struct_fields:
+ if len(field.c_field_type) > maxtypelen:
+ maxtypelen = len(field.c_field_type)
+
+ for field in struct_fields:
+ spacing = ' ' * (maxtypelen - len(field.c_field_type))
+ _h(' %s%s %s%s; /**< */', field.c_field_type, spacing, field.c_field_name, field.c_subscript)
+
+ _h('} %s;', self.c_type)
+
+def c_struct(self, name):
+ '''
+ Exported function that handles structure declarations.
+ '''
+ _c_type_setup(self, name, ())
+ _c_complex(self)
+ _c_accessors(self, name, name)
+ _c_iterator(self, name)
+
+def c_union(self, name):
+ '''
+ Exported function that handles union declarations.
+ '''
+ _c_type_setup(self, name, ())
+ _c_complex(self)
+ _c_iterator(self, name)
+
+def _c_request_helper(self, name, cookie_type, void, regular):
+ '''
+ Declares a request function.
+ '''
+
+ # Four stunningly confusing possibilities here:
+ #
+ # Void Non-void
+ # ------------------------------
+ # "req" "req"
+ # 0 flag CHECKED flag Normal Mode
+ # void_cookie req_cookie
+ # ------------------------------
+ # "req_checked" "req_unchecked"
+ # CHECKED flag 0 flag Abnormal Mode
+ # void_cookie req_cookie
+ # ------------------------------
+
+
+ # Whether we are _checked or _unchecked
+ checked = void and not regular
+ unchecked = not void and not regular
+
+ # What kind of cookie we return
+ func_cookie = 'xcb_void_cookie_t' if void else self.c_cookie_type
+
+ # What flag is passed to xcb_request
+ func_flags = '0' if (void and regular) or (not void and not regular) else 'XCB_REQUEST_CHECKED'
+
+ # Global extension id variable or NULL for xproto
+ func_ext_global = '&' + _ns.c_ext_global_name if _ns.is_ext else '0'
+
+ # What our function name is
+ func_name = self.c_request_name
+ if checked:
+ func_name = self.c_checked_name
+ if unchecked:
+ func_name = self.c_unchecked_name
+
+ param_fields = []
+ wire_fields = []
+ maxtypelen = len('xcb_connection_t')
+
+ for field in self.fields:
+ if field.visible:
+ # The field should appear as a call parameter
+ param_fields.append(field)
+ if field.wire and not field.auto:
+ # We need to set the field up in the structure
+ wire_fields.append(field)
+
+ for field in param_fields:
+ if len(field.c_field_const_type) > maxtypelen:
+ maxtypelen = len(field.c_field_const_type)
+
+ _h_setlevel(1)
+ _c_setlevel(1)
+ _h('')
+ _h('/**')
+ _h(' * Delivers a request to the X server')
+ _h(' * @param c The connection')
+ _h(' * @return A cookie')
+ _h(' *')
+ _h(' * Delivers a request to the X server.')
+ _h(' * ')
+ if checked:
+ _h(' * This form can be used only if the request will not cause')
+ _h(' * a reply to be generated. Any returned error will be')
+ _h(' * saved for handling by xcb_request_check().')
+ if unchecked:
+ _h(' * This form can be used only if the request will cause')
+ _h(' * a reply to be generated. Any returned error will be')
+ _h(' * placed in the event queue.')
+ _h(' */')
+ _c('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s %s', cookie_type, func_name)
+ _hc(' ** ')
+
+ spacing = ' ' * (maxtypelen - len('xcb_connection_t'))
+ _hc(' ** @param xcb_connection_t%s *c', spacing)
+
+ for field in param_fields:
+ spacing = ' ' * (maxtypelen - len(field.c_field_const_type))
+ _hc(' ** @param %s%s %s%s', field.c_field_const_type, spacing, field.c_pointer, field.c_field_name)
+
+ _hc(' ** @returns %s', cookie_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s', cookie_type)
+
+ spacing = ' ' * (maxtypelen - len('xcb_connection_t'))
+ comma = ',' if len(param_fields) else ');'
+ _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma)
+ comma = ',' if len(param_fields) else ')'
+ _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma)
+
+ func_spacing = ' ' * (len(func_name) + 2)
+ count = len(param_fields)
+ for field in param_fields:
+ count = count - 1
+ spacing = ' ' * (maxtypelen - len(field.c_field_const_type))
+ comma = ',' if count else ');'
+ _h('%s%s%s %s%s /**< */%s', func_spacing, field.c_field_const_type, spacing, field.c_pointer, field.c_field_name, comma)
+ comma = ',' if count else ')'
+ _c('%s%s%s %s%s /**< */%s', func_spacing, field.c_field_const_type, spacing, field.c_pointer, field.c_field_name, comma)
+
+ count = 2
+ for field in param_fields:
+ if not field.type.fixed_size():
+ count = count + 2
+
+ _c('{')
+ _c(' static const xcb_protocol_request_t xcb_req = {')
+ _c(' /* count */ %d,', count)
+ _c(' /* ext */ %s,', func_ext_global)
+ _c(' /* opcode */ %s,', self.c_request_name.upper())
+ _c(' /* isvoid */ %d', 1 if void else 0)
+ _c(' };')
+ _c(' ')
+ _c(' struct iovec xcb_parts[%d];', count + 2)
+ _c(' %s xcb_ret;', func_cookie)
+ _c(' %s xcb_out;', self.c_type)
+ _c(' ')
+
+ for field in wire_fields:
+ if field.type.fixed_size():
+ if field.type.is_expr:
+ _c(' xcb_out.%s = %s;', field.c_field_name, _c_accessor_get_expr(field.type.expr))
+
+ elif field.type.is_pad:
+ if field.type.nmemb == 1:
+ _c(' xcb_out.%s = 0;', field.c_field_name)
+ else:
+ _c(' memset(xcb_out.%s, 0, %d);', field.c_field_name, field.type.nmemb)
+ else:
+ if field.type.nmemb == 1:
+ _c(' xcb_out.%s = %s;', field.c_field_name, field.c_field_name)
+ else:
+ _c(' memcpy(xcb_out.%s, %s, %d);', field.c_field_name, field.c_field_name, field.type.nmemb)
+
+ _c(' ')
+ _c(' xcb_parts[2].iov_base = (char *) &xcb_out;')
+ _c(' xcb_parts[2].iov_len = sizeof(xcb_out);')
+ _c(' xcb_parts[3].iov_base = 0;')
+ _c(' xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;')
+
+ count = 4
+ for field in param_fields:
+ if not field.type.fixed_size():
+ _c(' xcb_parts[%d].iov_base = (char *) %s;', count, field.c_field_name)
+ if field.type.is_list:
+ _c(' xcb_parts[%d].iov_len = %s * sizeof(%s);', count, _c_accessor_get_expr(field.type.expr), field.type.member.c_wiretype)
+ else:
+ _c(' xcb_parts[%d].iov_len = %s * sizeof(%s);', count, 'Uh oh', field.type.c_wiretype)
+ _c(' xcb_parts[%d].iov_base = 0;', count + 1)
+ _c(' xcb_parts[%d].iov_len = -xcb_parts[%d].iov_len & 3;', count + 1, count)
+ count = count + 2
+
+ _c(' xcb_ret.sequence = xcb_send_request(c, %s, xcb_parts + 2, &xcb_req);', func_flags)
+ _c(' return xcb_ret;')
+ _c('}')
+
+def _c_reply(self, name):
+ '''
+ Declares the function that returns the reply structure.
+ '''
+ spacing1 = ' ' * (len(self.c_cookie_type) - len('xcb_connection_t'))
+ spacing2 = ' ' * (len(self.c_cookie_type) - len('xcb_generic_error_t'))
+ spacing3 = ' ' * (len(self.c_reply_name) + 2)
+
+ _h('')
+ _h('/**')
+ _h(' * Return the reply')
+ _h(' * @param c The connection')
+ _h(' * @param cookie The cookie')
+ _h(' * @param e The xcb_generic_error_t supplied')
+ _h(' *')
+ _h(' * Returns the reply of the request asked by')
+ _h(' * ')
+ _h(' * The parameter @p e supplied to this function must be NULL if')
+ _h(' * %s(). is used.', self.c_unchecked_name)
+ _h(' * Otherwise, it stores the error if any.')
+ _h(' *')
+ _h(' * The returned value must be freed by the caller using free().')
+ _h(' */')
+ _c('')
+ _hc('')
+ _hc('/*****************************************************************************')
+ _hc(' **')
+ _hc(' ** %s * %s', self.c_reply_type, self.c_reply_name)
+ _hc(' ** ')
+ _hc(' ** @param xcb_connection_t%s *c', spacing1)
+ _hc(' ** @param %s cookie', self.c_cookie_type)
+ _hc(' ** @param xcb_generic_error_t%s **e', spacing2)
+ _hc(' ** @returns %s *', self.c_reply_type)
+ _hc(' **')
+ _hc(' *****************************************************************************/')
+ _hc(' ')
+ _hc('%s *', self.c_reply_type)
+ _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1)
+ _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type)
+ _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2)
+ _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2)
+ _c('{')
+ _c(' return (%s *) xcb_wait_for_reply(c, cookie.sequence, e);', self.c_reply_type)
+ _c('}')
+
+def _c_opcode(name, opcode):
+ '''
+ Declares the opcode define for requests, events, and errors.
+ '''
+ _h_setlevel(0)
+ _h('')
+ _h('/** Opcode for %s. */', _n(name))
+ _h('#define %s %s', _n(name).upper(), opcode)
+
+def _c_cookie(self, name):
+ '''
+ Declares the cookie type for a non-void request.
+ '''
+ _h_setlevel(0)
+ _h('')
+ _h('/**')
+ _h(' * @brief %s', self.c_cookie_type)
+ _h(' **/')
+ _h('typedef struct %s {', self.c_cookie_type)
+ _h(' unsigned int sequence; /**< */')
+ _h('} %s;', self.c_cookie_type)
+
+def c_request(self, name):
+ '''
+ Exported function that handles request declarations.
+ '''
+ _c_type_setup(self, name, ('request',))
+
+ if self.reply:
+ # Cookie type declaration
+ _c_cookie(self, name)
+
+ # Opcode define
+ _c_opcode(name, self.opcode)
+
+ # Request structure declaration
+ _c_complex(self)
+
+ if self.reply:
+ _c_type_setup(self.reply, name, ('reply',))
+ # Reply structure definition
+ _c_complex(self.reply)
+ # Request prototypes
+ _c_request_helper(self, name, self.c_cookie_type, False, True)
+ _c_request_helper(self, name, self.c_cookie_type, False, False)
+ # Reply accessors
+ _c_accessors(self.reply, name + ('reply',), name)
+ _c_reply(self, name)
+ else:
+ # Request prototypes
+ _c_request_helper(self, name, 'xcb_void_cookie_t', True, False)
+ _c_request_helper(self, name, 'xcb_void_cookie_t', True, True)
+
+def c_event(self, name):
+ '''
+ Exported function that handles event declarations.
+ '''
+ _c_type_setup(self, name, ('event',))
+
+ # Opcode define
+ _c_opcode(name, self.opcodes[name])
+
+ if self.name == name:
+ # Structure definition
+ _c_complex(self)
+ else:
+ # Typedef
+ _h('')
+ _h('typedef %s %s;', _t(self.name + ('event',)), _t(name + ('event',)))
+
+def c_error(self, name):
+ '''
+ Exported function that handles error declarations.
+ '''
+ _c_type_setup(self, name, ('error',))
+
+ # Opcode define
+ _c_opcode(name, self.opcodes[name])
+
+ if self.name == name:
+ # Structure definition
+ _c_complex(self)
+ else:
+ # Typedef
+ _h('')
+ _h('typedef %s %s;', _t(self.name + ('error',)), _t(name + ('error',)))
+
+
+# Main routine starts here
+
+# Must create an "output" dictionary before any xcbgen imports.
+output = {'open' : c_open,
+ 'close' : c_close,
+ 'simple' : c_simple,
+ 'enum' : c_enum,
+ 'struct' : c_struct,
+ 'union' : c_union,
+ 'request' : c_request,
+ 'event' : c_event,
+ 'error' : c_error
+ }
+
+# Boilerplate below this point
+
+# Check for the argument that specifies path to the xcbgen python package.
+try:
+ opts, args = getopt.getopt(sys.argv[1:], 'p:')
+except getopt.GetoptError, err:
+ print str(err)
+ print 'Usage: c_client.py [-p path] file.xml'
+ sys.exit(1)
+
+for (opt, arg) in opts:
+ if opt == '-p':
+ sys.path.append(arg)
+
+# Import the module class
+try:
+ from xcbgen.state import Module
+except ImportError:
+ print ''
+ print 'Failed to load the xcbgen Python package!'
+ print 'Make sure that xcb/proto installed it on your Python path.'
+ print 'If not, you will need to create a .pth file or define $PYTHONPATH'
+ print 'to extend the path.'
+ print 'Refer to the README file in xcb/proto for more info.'
+ print ''
+ raise
+
+# Parse the xml header
+module = Module(args[0], output)
+
+# Build type-registry and resolve type dependencies
+module.register()
+module.resolve()
+
+# Output the code
+module.generate()
--- /dev/null
+/*
+ * Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.
+ * All Rights Reserved.
+ *
+ * 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.
+ */
+
+#ifndef __XCB_H__
+#define __XCB_H__
+#include <sys/types.h>
+
+#if defined(__solaris__)
+#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
+
+#include <sys/uio.h>
+#include <pthread.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file xcb.h
+ */
+
+/**
+ * @defgroup XCB_Core_API XCB Core API
+ * @brief Core API of the XCB library.
+ *
+ * @{
+ */
+
+/* Pre-defined constants */
+
+/** Current protocol version */
+#define X_PROTOCOL 11
+
+/** Current minor version */
+#define X_PROTOCOL_REVISION 0
+
+/** X_TCP_PORT + display number = server port for TCP transport */
+#define X_TCP_PORT 6000
+
+#define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
+
+/* Opaque structures */
+
+/**
+ * @brief XCB Connection structure.
+ *
+ * A structure that contain all data that XCB needs to communicate with an X server.
+ */
+typedef struct xcb_connection_t xcb_connection_t; /**< Opaque structure containing all data that XCB needs to communicate with an X server. */
+
+
+/* Other types */
+
+/**
+ * @brief Generic iterator.
+ *
+ * A generic iterator structure.
+ */
+typedef struct {
+ void *data; /**< Data of the current iterator */
+ int rem; /**< remaining elements */
+ int index; /**< index of the current iterator */
+} xcb_generic_iterator_t;
+
+/**
+ * @brief Generic reply.
+ *
+ * A generic reply structure.
+ */
+typedef struct {
+ uint8_t response_type; /**< Type of the response */
+ uint8_t pad0; /**< Padding */
+ uint16_t sequence; /**< Sequence number */
+ uint32_t length; /**< Length of the response */
+} xcb_generic_reply_t;
+
+/**
+ * @brief Generic event.
+ *
+ * A generic event structure.
+ */
+typedef struct {
+ uint8_t response_type; /**< Type of the response */
+ uint8_t pad0; /**< Padding */
+ uint16_t sequence; /**< Sequence number */
+ uint32_t pad[7]; /**< Padding */
+ uint32_t full_sequence; /**< full sequence */
+} xcb_generic_event_t;
+
+/**
+ * @brief GE event
+ *
+ * An event as sent by the XGE extension. The length field specifies the
+ * number of 4-byte blocks trailing the struct.
+ */
+typedef struct {
+ uint8_t response_type; /**< Type of the response */
+ uint8_t pad0; /**< Padding */
+ uint16_t sequence; /**< Sequence number */
+ uint32_t length;
+ uint16_t event_type;
+ uint16_t pad1;
+ uint32_t pad[5]; /**< Padding */
+ uint32_t full_sequence; /**< full sequence */
+} xcb_ge_event_t;
+
+/**
+ * @brief Generic error.
+ *
+ * A generic error structure.
+ */
+typedef struct {
+ uint8_t response_type; /**< Type of the response */
+ uint8_t error_code; /**< Error code */
+ uint16_t sequence; /**< Sequence number */
+ uint32_t resource_id; /** < Resource ID for requests with side effects only */
+ uint16_t minor_code; /** < Minor opcode of the failed request */
+ uint8_t major_code; /** < Major opcode of the failed request */
+ uint8_t pad0;
+ uint32_t pad[5]; /**< Padding */
+ uint32_t full_sequence; /**< full sequence */
+} xcb_generic_error_t;
+
+/**
+ * @brief Generic cookie.
+ *
+ * A generic cookie structure.
+ */
+typedef struct {
+ unsigned int sequence; /**< Sequence number */
+} xcb_void_cookie_t;
+
+
+/* Include the generated xproto header. */
+#include "xproto.h"
+
+
+/** XCB_NONE is the universal null resource or null atom parameter value for many core X requests */
+#define XCB_NONE 0L
+
+/** XCB_COPY_FROM_PARENT can be used for many xcb_create_window parameters */
+#define XCB_COPY_FROM_PARENT 0L
+
+/** XCB_CURRENT_TIME can be used in most requests that take an xcb_timestamp_t */
+#define XCB_CURRENT_TIME 0L
+
+/** XCB_NO_SYMBOL fills in unused entries in xcb_keysym_t tables */
+#define XCB_NO_SYMBOL 0L
+
+
+/* xcb_auth.c */
+
+/**
+ * @brief Container for authorization information.
+ *
+ * A container for authorization information to be sent to the X server.
+ */
+typedef struct xcb_auth_info_t {
+ int namelen; /**< Length of the string name (as returned by strlen). */
+ char *name; /**< String containing the authentication protocol name, such as "MIT-MAGIC-COOKIE-1" or "XDM-AUTHORIZATION-1". */
+ int datalen; /**< Length of the data member. */
+ char *data; /**< Data interpreted in a protocol-specific manner. */
+} xcb_auth_info_t;
+
+
+/* xcb_out.c */
+
+/**
+ * @brief Forces any buffered output to be written to the server.
+ * @param c: The connection to the X server.
+ * @return > @c 0 on success, <= @c 0 otherwise.
+ *
+ * Forces any buffered output to be written to the server. Blocks
+ * until the write is complete.
+ */
+int xcb_flush(xcb_connection_t *c);
+
+/**
+ * @brief Returns the maximum request length that this server accepts.
+ * @param c: The connection to the X server.
+ * @return The maximum request length field.
+ *
+ * In the absence of the BIG-REQUESTS extension, returns the
+ * maximum request length field from the connection setup data, which
+ * may be as much as 65535. If the server supports BIG-REQUESTS, then
+ * the maximum request length field from the reply to the
+ * BigRequestsEnable request will be returned instead.
+ *
+ * Note that this length is measured in four-byte units, making the
+ * theoretical maximum lengths roughly 256kB without BIG-REQUESTS and
+ * 16GB with.
+ */
+uint32_t xcb_get_maximum_request_length(xcb_connection_t *c);
+
+/**
+ * @brief Prefetch the maximum request length without blocking.
+ * @param c: The connection to the X server.
+ *
+ * Without blocking, does as much work as possible toward computing
+ * the maximum request length accepted by the X server.
+ *
+ * Invoking this function may cause a call to xcb_big_requests_enable,
+ * but will not block waiting for the reply.
+ * xcb_get_maximum_request_length will return the prefetched data
+ * after possibly blocking while the reply is retrieved.
+ *
+ * Note that in order for this function to be fully non-blocking, the
+ * application must previously have called
+ * xcb_prefetch_extension_data(c, &xcb_big_requests_id) and the reply
+ * must have already arrived.
+ */
+void xcb_prefetch_maximum_request_length(xcb_connection_t *c);
+
+
+/* xcb_in.c */
+
+/**
+ * @brief Returns the next event or error from the server.
+ * @param c: The connection to the X server.
+ * @return The next event from the server.
+ *
+ * Returns the next event or error from the server, or returns null in
+ * the event of an I/O error. Blocks until either an event or error
+ * arrive, or an I/O error occurs.
+ */
+xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
+
+/**
+ * @brief Returns the next event or error from the server.
+ * @param c: The connection to the X server.
+ * error status of the operation.
+ * @return The next event from the server.
+ *
+ * Returns the next event or error from the server, if one is
+ * available, or returns @c NULL otherwise. If no event is available, that
+ * might be because an I/O error like connection close occurred while
+ * attempting to read the next event, in which case the connection is
+ * shut down when this function returns.
+ */
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
+
+/**
+ * @brief Return the error for a request, or NULL if none can ever arrive.
+ * @param c: The connection to the X server.
+ * @param cookie: The request cookie.
+ * @return The error for the request, or NULL if none can ever arrive.
+ *
+ * The xcb_void_cookie_t cookie supplied to this function must have resulted
+ * from a call to xcb_[request_name]_checked(). This function will block
+ * until one of two conditions happens. If an error is received, it will be
+ * returned. If a reply to a subsequent request has already arrived, no error
+ * can arrive for this request, so this function will return NULL.
+ *
+ * Note that this function will perform a sync if needed to ensure that the
+ * sequence number will advance beyond that provided in cookie; this is a
+ * convenience to avoid races in determining whether the sync is needed.
+ */
+xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
+
+/**
+ * @brief Discards the reply for a request.
+ * @param c: The connection to the X server.
+ * @param sequence: The request sequence number from a cookie.
+ *
+ * Discards the reply for a request. Additionally, any error generated
+ * by the request is also discarded (unless it was an _unchecked request
+ * and the error has already arrived).
+ *
+ * This function will not block even if the reply is not yet available.
+ *
+ * Note that the sequence really does have to come from an xcb cookie;
+ * this function is not designed to operate on socket-handoff replies.
+ */
+void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
+
+
+/* xcb_ext.c */
+
+/**
+ * @typedef typedef struct xcb_extension_t xcb_extension_t
+ */
+typedef struct xcb_extension_t xcb_extension_t; /**< Opaque structure used as key for xcb_get_extension_data_t. */
+
+/**
+ * @brief Caches reply information from QueryExtension requests.
+ * @param c: The connection.
+ * @param ext: The extension data.
+ * @return A pointer to the xcb_query_extension_reply_t for the extension.
+ *
+ * This function is the primary interface to the "extension cache",
+ * which caches reply information from QueryExtension
+ * requests. Invoking this function may cause a call to
+ * xcb_query_extension to retrieve extension information from the
+ * server, and may block until extension data is received from the
+ * server.
+ *
+ * The result must not be freed. This storage is managed by the cache
+ * itself.
+ */
+const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
+
+/**
+ * @brief Prefetch of extension data into the extension cache
+ * @param c: The connection.
+ * @param ext: The extension data.
+ *
+ * This function allows a "prefetch" of extension data into the
+ * extension cache. Invoking the function may cause a call to
+ * xcb_query_extension, but will not block waiting for the
+ * reply. xcb_get_extension_data will return the prefetched data after
+ * possibly blocking while it is retrieved.
+ */
+void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
+
+
+/* xcb_conn.c */
+
+/**
+ * @brief Access the data returned by the server.
+ * @param c: The connection.
+ * @return A pointer to an xcb_setup_t structure.
+ *
+ * Accessor for the data returned by the server when the xcb_connection_t
+ * was initialized. This data includes
+ * - the server's required format for images,
+ * - a list of available visuals,
+ * - a list of available screens,
+ * - the server's maximum request length (in the absence of the
+ * BIG-REQUESTS extension),
+ * - and other assorted information.
+ *
+ * See the X protocol specification for more details.
+ *
+ * The result must not be freed.
+ */
+const xcb_setup_t *xcb_get_setup(xcb_connection_t *c);
+
+/**
+ * @brief Access the file descriptor of the connection.
+ * @param c: The connection.
+ * @return The file descriptor.
+ *
+ * Accessor for the file descriptor that was passed to the
+ * xcb_connect_to_fd call that returned @p c.
+ */
+int xcb_get_file_descriptor(xcb_connection_t *c);
+
+/**
+ * @brief Test whether the connection has shut down due to a fatal error.
+ * @param c: The connection.
+ * @return 1 if the connection is in an error state; 0 otherwise.
+ *
+ * Some errors that occur in the context of an xcb_connection_t
+ * are unrecoverable. When such an error occurs, the
+ * connection is shut down and further operations on the
+ * xcb_connection_t have no effect.
+ *
+ * @todo Other functions should document the conditions in
+ * which they shut down the connection.
+ */
+int xcb_connection_has_error(xcb_connection_t *c);
+
+/**
+ * @brief Connects to the X server.
+ * @param fd: The file descriptor.
+ * @param auth_info: Authentication data.
+ * @return A newly allocated xcb_connection_t structure.
+ *
+ * Connects to an X server, given the open socket @p fd and the
+ * xcb_auth_info_t @p auth_info. The file descriptor @p fd is
+ * bidirectionally connected to an X server. If the connection
+ * should be unauthenticated, @p auth_info must be @c
+ * NULL.
+ */
+xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info);
+
+/**
+ * @brief Closes the connection.
+ * @param c: The connection.
+ *
+ * Closes the file descriptor and frees all memory associated with the
+ * connection @c c.
+ */
+void xcb_disconnect(xcb_connection_t *c);
+
+
+/* xcb_util.c */
+
+/**
+ * @brief Parses a display string name in the form documented by X(7x).
+ * @param name: The name of the display.
+ * @param host: A pointer to a malloc'd copy of the hostname.
+ * @param display: A pointer to the display number.
+ * @param screen: A pointer to the screen number.
+ * @return 0 on failure, non 0 otherwise.
+ *
+ * Parses the display string name @p display_name in the form
+ * documented by X(7x). Has no side effects on failure. If
+ * @p displayname is @c NULL or empty, it uses the environment
+ * variable DISPLAY. @p hostp is a pointer to a newly allocated string
+ * that contain the host name. @p displayp is set to the display
+ * number and @p screenp to the preferred screen number. @p screenp
+ * can be @c NULL. If @p displayname does not contain a screen number,
+ * it is set to @c 0.
+ */
+int xcb_parse_display(const char *name, char **host, int *display, int *screen);
+
+/**
+ * @brief Connects to the X server.
+ * @param displayname: The name of the display.
+ * @param screenp: A pointer to a preferred screen number.
+ * @return A newly allocated xcb_connection_t structure.
+ *
+ * Connects to the X server specified by @p displayname. If @p
+ * displayname is @c NULL, uses the value of the DISPLAY environment
+ * variable. If a particular screen on that server is preferred, the
+ * int pointed to by @p screenp (if not @c NULL) will be set to that
+ * screen; otherwise the screen will be set to 0.
+ */
+xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
+
+/**
+ * @brief Connects to the X server, using an authorization information.
+ * @param display: The name of the display.
+ * @param auth: The authorization information.
+ * @param screen: A pointer to a preferred screen number.
+ * @return A newly allocated xcb_connection_t structure.
+ *
+ * Connects to the X server specified by @p displayname, using the
+ * authorization @p auth. If a particular screen on that server is
+ * preferred, the int pointed to by @p screenp (if not @c NULL) will
+ * be set to that screen; otherwise @p screenp will be set to 0.
+ */
+xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
+
+
+/* xcb_xid.c */
+
+/**
+ * @brief Allocates an XID for a new object.
+ * @param c: The connection.
+ * @return A newly allocated XID.
+ *
+ * Allocates an XID for a new object. Typically used just prior to
+ * various object creation functions, such as xcb_create_window.
+ */
+uint32_t xcb_generate_id(xcb_connection_t *c);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __XCB_H__ */
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* Authorization systems for the X protocol. */
+
+#include <assert.h>
+#include <X11/Xauth.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "xcb.h"
+#include "xcbint.h"
+
+#ifdef HASXDMAUTH
+#include <X11/Xdmcp.h>
+#endif
+
+enum auth_protos {
+#ifdef HASXDMAUTH
+ AUTH_XA1,
+#endif
+ AUTH_MC1,
+ N_AUTH_PROTOS
+};
+
+#define AUTH_PROTO_XDM_AUTHORIZATION "XDM-AUTHORIZATION-1"
+#define AUTH_PROTO_MIT_MAGIC_COOKIE "MIT-MAGIC-COOKIE-1"
+
+static char *authnames[N_AUTH_PROTOS] = {
+#ifdef HASXDMAUTH
+ AUTH_PROTO_XDM_AUTHORIZATION,
+#endif
+ AUTH_PROTO_MIT_MAGIC_COOKIE,
+};
+
+static int authnameslen[N_AUTH_PROTOS] = {
+#ifdef HASXDMAUTH
+ sizeof(AUTH_PROTO_XDM_AUTHORIZATION) - 1,
+#endif
+ sizeof(AUTH_PROTO_MIT_MAGIC_COOKIE) - 1,
+};
+
+static size_t memdup(char **dst, void *src, size_t len)
+{
+ if(len)
+ *dst = malloc(len);
+ else
+ *dst = 0;
+ if(!*dst)
+ return 0;
+ memcpy(*dst, src, len);
+ return len;
+}
+
+static int authname_match(enum auth_protos kind, char *name, size_t namelen)
+{
+ if(authnameslen[kind] != namelen)
+ return 0;
+ if(memcmp(authnames[kind], name, namelen))
+ return 0;
+ return 1;
+}
+
+#define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr)
+
+static Xauth *get_authptr(struct sockaddr *sockname, int display)
+{
+ char *addr = 0;
+ int addrlen = 0;
+ unsigned short family;
+ char hostnamebuf[256]; /* big enough for max hostname */
+ char dispbuf[40]; /* big enough to hold more than 2^64 base 10 */
+ int dispbuflen;
+
+ family = FamilyLocal; /* 256 */
+ switch(sockname->sa_family)
+ {
+#ifdef AF_INET6
+ case AF_INET6:
+ addr = (char *) SIN6_ADDR(sockname);
+ addrlen = sizeof(*SIN6_ADDR(sockname));
+ if(!IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
+ {
+ if(!IN6_IS_ADDR_LOOPBACK(SIN6_ADDR(sockname)))
+ family = XCB_FAMILY_INTERNET_6;
+ break;
+ }
+ addr += 12;
+ /* if v4-mapped, fall through. */
+#endif
+ case AF_INET:
+ if(!addr)
+ addr = (char *) &((struct sockaddr_in *)sockname)->sin_addr;
+ addrlen = sizeof(((struct sockaddr_in *)sockname)->sin_addr);
+ if(*(in_addr_t *) addr != htonl(INADDR_LOOPBACK))
+ family = XCB_FAMILY_INTERNET;
+ break;
+ case AF_UNIX:
+ break;
+ default:
+ return 0; /* cannot authenticate this family */
+ }
+
+ dispbuflen = snprintf(dispbuf, sizeof(dispbuf), "%d", display);
+ if(dispbuflen < 0)
+ return 0;
+ /* snprintf may have truncate our text */
+ dispbuflen = MIN(dispbuflen, sizeof(dispbuf) - 1);
+
+ if (family == FamilyLocal) {
+ if (gethostname(hostnamebuf, sizeof(hostnamebuf)) == -1)
+ return 0; /* do not know own hostname */
+ addr = hostnamebuf;
+ addrlen = strlen(addr);
+ }
+
+ return XauGetBestAuthByAddr (family,
+ (unsigned short) addrlen, addr,
+ (unsigned short) dispbuflen, dispbuf,
+ N_AUTH_PROTOS, authnames, authnameslen);
+}
+
+#ifdef HASXDMAUTH
+static int next_nonce(void)
+{
+ static int nonce = 0;
+ static pthread_mutex_t nonce_mutex = PTHREAD_MUTEX_INITIALIZER;
+ int ret;
+ pthread_mutex_lock(&nonce_mutex);
+ ret = nonce++;
+ pthread_mutex_unlock(&nonce_mutex);
+ return ret;
+}
+
+static void do_append(char *buf, int *idxp, void *val, size_t valsize) {
+ memcpy(buf + *idxp, val, valsize);
+ *idxp += valsize;
+}
+#endif
+
+static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr *sockname)
+{
+ if (authname_match(AUTH_MC1, authptr->name, authptr->name_length)) {
+ info->datalen = memdup(&info->data, authptr->data, authptr->data_length);
+ if(!info->datalen)
+ return 0;
+ return 1;
+ }
+#ifdef HASXDMAUTH
+#define APPEND(buf,idx,val) do_append((buf),&(idx),&(val),sizeof(val))
+ if (authname_match(AUTH_XA1, authptr->name, authptr->name_length)) {
+ int j;
+
+ info->data = malloc(192 / 8);
+ if(!info->data)
+ return 0;
+
+ for (j = 0; j < 8; j++)
+ info->data[j] = authptr->data[j];
+ switch(sockname->sa_family) {
+ case AF_INET:
+ /*block*/ {
+ struct sockaddr_in *si = (struct sockaddr_in *) sockname;
+ APPEND(info->data, j, si->sin_addr.s_addr);
+ APPEND(info->data, j, si->sin_port);
+ }
+ break;
+#ifdef AF_INET6
+ case AF_INET6:
+ /*block*/ {
+ struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname;
+ if(IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
+ {
+ do_append(info->data, &j, &si6->sin6_addr.s6_addr[12], 4);
+ APPEND(info->data, j, si6->sin6_port);
+ }
+ else
+ {
+ /* XDM-AUTHORIZATION-1 does not handle IPv6 correctly. Do the
+ same thing Xlib does: use all zeroes for the 4-byte address
+ and 2-byte port number. */
+ uint32_t fakeaddr = 0;
+ uint16_t fakeport = 0;
+ APPEND(info->data, j, fakeaddr);
+ APPEND(info->data, j, fakeport);
+ }
+ }
+ break;
+#endif
+ case AF_UNIX:
+ /*block*/ {
+ uint32_t fakeaddr = htonl(0xffffffff - next_nonce());
+ uint16_t fakeport = htons(getpid());
+ APPEND(info->data, j, fakeaddr);
+ APPEND(info->data, j, fakeport);
+ }
+ break;
+ default:
+ free(info->data);
+ return 0; /* do not know how to build this */
+ }
+ {
+ uint32_t now = htonl(time(0));
+ APPEND(info->data, j, now);
+ }
+ assert(j <= 192 / 8);
+ while (j < 192 / 8)
+ info->data[j++] = 0;
+ info->datalen = j;
+ XdmcpWrap ((unsigned char *) info->data, (unsigned char *) authptr->data + 8, (unsigned char *) info->data, info->datalen);
+ return 1;
+ }
+#undef APPEND
+#endif
+
+ return 0; /* Unknown authorization type */
+}
+
+/* `sockaddr_un.sun_path' typical size usually ranges between 92 and 108 */
+#define INITIAL_SOCKNAME_SLACK 108
+
+/* Return a dynamically allocated socket address structure according
+ to the value returned by either getpeername() or getsockname()
+ (according to POSIX, applications should not assume a particular
+ length for `sockaddr_un.sun_path') */
+static struct sockaddr *get_peer_sock_name(int (*socket_func)(int,
+ struct sockaddr *,
+ socklen_t *),
+ int fd)
+{
+ socklen_t socknamelen = sizeof(struct sockaddr) + INITIAL_SOCKNAME_SLACK;
+ socklen_t actual_socknamelen = socknamelen;
+ struct sockaddr *sockname = malloc(socknamelen), *new_sockname = NULL;
+
+ if (sockname == NULL)
+ return NULL;
+
+ /* Both getpeername() and getsockname() truncates sockname if
+ there is not enough space and set the required length in
+ actual_socknamelen */
+ if (socket_func(fd, sockname, &actual_socknamelen) == -1)
+ goto sock_or_realloc_error;
+
+ if (actual_socknamelen > socknamelen)
+ {
+ socknamelen = actual_socknamelen;
+
+ if ((new_sockname = realloc(sockname, actual_socknamelen)) == NULL ||
+ socket_func(fd, new_sockname, &actual_socknamelen) == -1 ||
+ actual_socknamelen > socknamelen)
+ goto sock_or_realloc_error;
+
+ sockname = new_sockname;
+ }
+
+ return sockname;
+
+ sock_or_realloc_error:
+ free(sockname);
+ return NULL;
+}
+
+int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
+{
+ /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c,
+ xtrans/Xtransutils.c */
+ struct sockaddr *sockname = NULL;
+ int gotsockname = 0;
+ Xauth *authptr = 0;
+ int ret = 1;
+
+ /* Some systems like hpux or Hurd do not expose peer names
+ * for UNIX Domain Sockets, but this is irrelevant,
+ * since compute_auth() ignores the peer name in this
+ * case anyway.*/
+ if ((sockname = get_peer_sock_name(getpeername, fd)) == NULL)
+ {
+ if ((sockname = get_peer_sock_name(getsockname, fd)) == NULL)
+ return 0; /* can only authenticate sockets */
+ if (sockname->sa_family != AF_UNIX)
+ {
+ free(sockname);
+ return 0; /* except for AF_UNIX, sockets should have peernames */
+ }
+ gotsockname = 1;
+ }
+
+ authptr = get_authptr(sockname, display);
+ if (authptr == 0)
+ {
+ free(sockname);
+ return 0; /* cannot find good auth data */
+ }
+
+ info->namelen = memdup(&info->name, authptr->name, authptr->name_length);
+ if (!info->namelen)
+ goto no_auth; /* out of memory */
+
+ if (!gotsockname && (sockname = get_peer_sock_name(getsockname, fd)) == NULL)
+ {
+ free(info->name);
+ goto no_auth; /* can only authenticate sockets */
+ }
+
+ ret = compute_auth(info, authptr, sockname);
+ if(!ret)
+ {
+ free(info->name);
+ goto no_auth; /* cannot build auth record */
+ }
+
+ free(sockname);
+ sockname = NULL;
+
+ XauDisposeAuth(authptr);
+ return ret;
+
+ no_auth:
+ free(sockname);
+
+ info->name = 0;
+ info->namelen = 0;
+ XauDisposeAuth(authptr);
+ return 0;
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* Connection management: the core of XCB. */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "xcb.h"
+#include "xcbint.h"
+#if USE_POLL
+#include <poll.h>
+#else
+#include <sys/select.h>
+#endif
+
+typedef struct {
+ uint8_t status;
+ uint8_t pad0[5];
+ uint16_t length;
+} xcb_setup_generic_t;
+
+static const int error_connection = 1;
+
+static int set_fd_flags(const int fd)
+{
+ int flags = fcntl(fd, F_GETFL, 0);
+ if(flags == -1)
+ return 0;
+ flags |= O_NONBLOCK;
+ if(fcntl(fd, F_SETFL, flags) == -1)
+ return 0;
+ if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
+ return 0;
+ return 1;
+}
+
+static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
+{
+ static const char pad[3];
+ xcb_setup_request_t out;
+ struct iovec parts[6];
+ int count = 0;
+ static const uint32_t endian = 0x01020304;
+ int ret;
+
+ memset(&out, 0, sizeof(out));
+
+ /* B = 0x42 = MSB first, l = 0x6c = LSB first */
+ if(htonl(endian) == endian)
+ out.byte_order = 0x42;
+ else
+ out.byte_order = 0x6c;
+ out.protocol_major_version = X_PROTOCOL;
+ out.protocol_minor_version = X_PROTOCOL_REVISION;
+ out.authorization_protocol_name_len = 0;
+ out.authorization_protocol_data_len = 0;
+ parts[count].iov_len = sizeof(xcb_setup_request_t);
+ parts[count++].iov_base = &out;
+ parts[count].iov_len = XCB_PAD(sizeof(xcb_setup_request_t));
+ parts[count++].iov_base = (char *) pad;
+
+ if(auth_info)
+ {
+ parts[count].iov_len = out.authorization_protocol_name_len = auth_info->namelen;
+ parts[count++].iov_base = auth_info->name;
+ parts[count].iov_len = XCB_PAD(out.authorization_protocol_name_len);
+ parts[count++].iov_base = (char *) pad;
+ parts[count].iov_len = out.authorization_protocol_data_len = auth_info->datalen;
+ parts[count++].iov_base = auth_info->data;
+ parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len);
+ parts[count++].iov_base = (char *) pad;
+ }
+ assert(count <= (int) (sizeof(parts) / sizeof(*parts)));
+
+ pthread_mutex_lock(&c->iolock);
+ ret = _xcb_out_send(c, parts, count);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+static int read_setup(xcb_connection_t *c)
+{
+ /* Read the server response */
+ c->setup = malloc(sizeof(xcb_setup_generic_t));
+ if(!c->setup)
+ return 0;
+
+ if(_xcb_in_read_block(c, c->setup, sizeof(xcb_setup_generic_t)) != sizeof(xcb_setup_generic_t))
+ return 0;
+
+ {
+ void *tmp = realloc(c->setup, c->setup->length * 4 + sizeof(xcb_setup_generic_t));
+ if(!tmp)
+ return 0;
+ c->setup = tmp;
+ }
+
+ if(_xcb_in_read_block(c, (char *) c->setup + sizeof(xcb_setup_generic_t), c->setup->length * 4) <= 0)
+ return 0;
+
+ /* 0 = failed, 2 = authenticate, 1 = success */
+ switch(c->setup->status)
+ {
+ case 0: /* failed */
+ {
+ xcb_setup_failed_t *setup = (xcb_setup_failed_t *) c->setup;
+ write(STDERR_FILENO, xcb_setup_failed_reason(setup), xcb_setup_failed_reason_length(setup));
+ return 0;
+ }
+
+ case 2: /* authenticate */
+ {
+ xcb_setup_authenticate_t *setup = (xcb_setup_authenticate_t *) c->setup;
+ write(STDERR_FILENO, xcb_setup_authenticate_reason(setup), xcb_setup_authenticate_reason_length(setup));
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/* precondition: there must be something for us to write. */
+static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count)
+{
+ int n;
+ assert(!c->out.queue_len);
+ n = writev(c->fd, *vector, *count);
+ if(n < 0 && errno == EAGAIN)
+ return 1;
+ if(n <= 0)
+ {
+ _xcb_conn_shutdown(c);
+ return 0;
+ }
+
+ for(; *count; --*count, ++*vector)
+ {
+ int cur = (*vector)->iov_len;
+ if(cur > n)
+ cur = n;
+ (*vector)->iov_len -= cur;
+ (*vector)->iov_base = (char *) (*vector)->iov_base + cur;
+ n -= cur;
+ if((*vector)->iov_len)
+ break;
+ }
+ if(!*count)
+ *vector = 0;
+ assert(n == 0);
+ return 1;
+}
+
+/* Public interface */
+
+const xcb_setup_t *xcb_get_setup(xcb_connection_t *c)
+{
+ if(c->has_error)
+ return 0;
+ /* doesn't need locking because it's never written to. */
+ return c->setup;
+}
+
+int xcb_get_file_descriptor(xcb_connection_t *c)
+{
+ if(c->has_error)
+ return -1;
+ /* doesn't need locking because it's never written to. */
+ return c->fd;
+}
+
+int xcb_connection_has_error(xcb_connection_t *c)
+{
+ /* doesn't need locking because it's read and written atomically. */
+ return c->has_error;
+}
+
+xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info)
+{
+ xcb_connection_t* c;
+
+#ifndef USE_POLL
+ if(fd >= FD_SETSIZE) /* would overflow in FD_SET */
+ {
+ close(fd);
+ return (xcb_connection_t *) &error_connection;
+ }
+#endif
+
+ c = calloc(1, sizeof(xcb_connection_t));
+ if(!c) {
+ close(fd);
+ return (xcb_connection_t *) &error_connection;
+ }
+
+ c->fd = fd;
+
+ if(!(
+ set_fd_flags(fd) &&
+ pthread_mutex_init(&c->iolock, 0) == 0 &&
+ _xcb_in_init(&c->in) &&
+ _xcb_out_init(&c->out) &&
+ write_setup(c, auth_info) &&
+ read_setup(c) &&
+ _xcb_ext_init(c) &&
+ _xcb_xid_init(c)
+ ))
+ {
+ xcb_disconnect(c);
+ return (xcb_connection_t *) &error_connection;
+ }
+
+ return c;
+}
+
+void xcb_disconnect(xcb_connection_t *c)
+{
+ if(c->has_error)
+ return;
+
+ free(c->setup);
+ close(c->fd);
+
+ pthread_mutex_destroy(&c->iolock);
+ _xcb_in_destroy(&c->in);
+ _xcb_out_destroy(&c->out);
+
+ _xcb_ext_destroy(c);
+ _xcb_xid_destroy(c);
+
+ free(c);
+}
+
+/* Private interface */
+
+void _xcb_conn_shutdown(xcb_connection_t *c)
+{
+ c->has_error = 1;
+}
+
+int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count)
+{
+ int ret;
+#if USE_POLL
+ struct pollfd fd;
+#else
+ fd_set rfds, wfds;
+#endif
+
+ /* If the thing I should be doing is already being done, wait for it. */
+ if(count ? c->out.writing : c->in.reading)
+ {
+ pthread_cond_wait(cond, &c->iolock);
+ return 1;
+ }
+
+#if USE_POLL
+ memset(&fd, 0, sizeof(fd));
+ fd.fd = c->fd;
+ fd.events = POLLIN;
+#else
+ FD_ZERO(&rfds);
+ FD_SET(c->fd, &rfds);
+#endif
+ ++c->in.reading;
+
+#if USE_POLL
+ if(count)
+ {
+ fd.events |= POLLOUT;
+ ++c->out.writing;
+ }
+#else
+ FD_ZERO(&wfds);
+ if(count)
+ {
+ FD_SET(c->fd, &wfds);
+ ++c->out.writing;
+ }
+#endif
+
+ pthread_mutex_unlock(&c->iolock);
+ do {
+#if USE_POLL
+ ret = poll(&fd, 1, -1);
+#else
+ ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
+#endif
+ } while (ret == -1 && errno == EINTR);
+ if(ret < 0)
+ {
+ _xcb_conn_shutdown(c);
+ ret = 0;
+ }
+ pthread_mutex_lock(&c->iolock);
+
+ if(ret)
+ {
+#if USE_POLL
+ if((fd.revents & POLLIN) == POLLIN)
+#else
+ if(FD_ISSET(c->fd, &rfds))
+#endif
+ ret = ret && _xcb_in_read(c);
+
+#if USE_POLL
+ if((fd.revents & POLLOUT) == POLLOUT)
+#else
+ if(FD_ISSET(c->fd, &wfds))
+#endif
+ ret = ret && write_vec(c, vector, count);
+ }
+
+ if(count)
+ --c->out.writing;
+ --c->in.reading;
+
+ return ret;
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* A cache for QueryExtension results. */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "xcb.h"
+#include "xcbext.h"
+#include "xcbint.h"
+
+typedef struct lazyreply {
+ enum lazy_reply_tag tag;
+ union {
+ xcb_query_extension_cookie_t cookie;
+ xcb_query_extension_reply_t *reply;
+ } value;
+} lazyreply;
+
+static lazyreply *get_index(xcb_connection_t *c, int idx)
+{
+ if(idx > c->ext.extensions_size)
+ {
+ int new_size = idx << 1;
+ lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size);
+ if(!new_extensions)
+ return 0;
+ memset(new_extensions + c->ext.extensions_size, 0, sizeof(lazyreply) * (new_size - c->ext.extensions_size));
+ c->ext.extensions = new_extensions;
+ c->ext.extensions_size = new_size;
+ }
+ return c->ext.extensions + idx - 1;
+}
+
+static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext)
+{
+ static pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER;
+ static int next_global_id;
+
+ lazyreply *data;
+
+ pthread_mutex_lock(&global_lock);
+ if(!ext->global_id)
+ ext->global_id = ++next_global_id;
+ pthread_mutex_unlock(&global_lock);
+
+ data = get_index(c, ext->global_id);
+ if(data && data->tag == LAZY_NONE)
+ {
+ /* cache miss: query the server */
+ data->tag = LAZY_COOKIE;
+ data->value.cookie = xcb_query_extension(c, strlen(ext->name), ext->name);
+ }
+ return data;
+}
+
+/* Public interface */
+
+/* Do not free the returned xcb_query_extension_reply_t - on return, it's aliased
+ * from the cache. */
+const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext)
+{
+ lazyreply *data;
+ if(c->has_error)
+ return 0;
+
+ pthread_mutex_lock(&c->ext.lock);
+ data = get_lazyreply(c, ext);
+ if(data && data->tag == LAZY_COOKIE)
+ {
+ data->tag = LAZY_FORCED;
+ data->value.reply = xcb_query_extension_reply(c, data->value.cookie, 0);
+ }
+ pthread_mutex_unlock(&c->ext.lock);
+
+ return data ? data->value.reply : 0;
+}
+
+void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext)
+{
+ if(c->has_error)
+ return;
+ pthread_mutex_lock(&c->ext.lock);
+ get_lazyreply(c, ext);
+ pthread_mutex_unlock(&c->ext.lock);
+}
+
+/* Private interface */
+
+int _xcb_ext_init(xcb_connection_t *c)
+{
+ if(pthread_mutex_init(&c->ext.lock, 0))
+ return 0;
+ return 1;
+}
+
+void _xcb_ext_destroy(xcb_connection_t *c)
+{
+ pthread_mutex_destroy(&c->ext.lock);
+ while(c->ext.extensions_size-- > 0)
+ if(c->ext.extensions[c->ext.extensions_size].tag == LAZY_FORCED)
+ free(c->ext.extensions[c->ext.extensions_size].value.reply);
+ free(c->ext.extensions);
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* Stuff that reads stuff from the server. */
+
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include "xcb.h"
+#include "xcbext.h"
+#include "xcbint.h"
+#if USE_POLL
+#include <poll.h>
+#else
+#include <sys/select.h>
+#endif
+
+#define XCB_ERROR 0
+#define XCB_REPLY 1
+#define XCB_XGE_EVENT 35
+
+struct event_list {
+ xcb_generic_event_t *event;
+ struct event_list *next;
+};
+
+struct reply_list {
+ void *reply;
+ struct reply_list *next;
+};
+
+typedef struct pending_reply {
+ uint64_t first_request;
+ uint64_t last_request;
+ enum workarounds workaround;
+ int flags;
+ struct pending_reply *next;
+} pending_reply;
+
+typedef struct reader_list {
+ unsigned int request;
+ pthread_cond_t *data;
+ struct reader_list *next;
+} reader_list;
+
+static int read_packet(xcb_connection_t *c)
+{
+ xcb_generic_reply_t genrep;
+ int length = 32;
+ int eventlength = 0; /* length after first 32 bytes for GenericEvents */
+ void *buf;
+ pending_reply *pend = 0;
+ struct event_list *event;
+
+ /* Wait for there to be enough data for us to read a whole packet */
+ if(c->in.queue_len < length)
+ return 0;
+
+ /* Get the response type, length, and sequence number. */
+ memcpy(&genrep, c->in.queue, sizeof(genrep));
+
+ /* Compute 32-bit sequence number of this packet. */
+ if((genrep.response_type & 0x7f) != XCB_KEYMAP_NOTIFY)
+ {
+ uint64_t lastread = c->in.request_read;
+ c->in.request_read = (lastread & UINT64_C(0xffffffffffff0000)) | genrep.sequence;
+ if(XCB_SEQUENCE_COMPARE(c->in.request_read, <, lastread))
+ c->in.request_read += 0x10000;
+ if(XCB_SEQUENCE_COMPARE(c->in.request_read, >, c->in.request_expected))
+ c->in.request_expected = c->in.request_read;
+
+ if(c->in.request_read != lastread)
+ {
+ if(c->in.current_reply)
+ {
+ _xcb_map_put(c->in.replies, lastread, c->in.current_reply);
+ c->in.current_reply = 0;
+ c->in.current_reply_tail = &c->in.current_reply;
+ }
+ c->in.request_completed = c->in.request_read - 1;
+ }
+
+ while(c->in.pending_replies &&
+ c->in.pending_replies->workaround != WORKAROUND_EXTERNAL_SOCKET_OWNER &&
+ XCB_SEQUENCE_COMPARE (c->in.pending_replies->last_request, <=, c->in.request_completed))
+ {
+ pending_reply *oldpend = c->in.pending_replies;
+ c->in.pending_replies = oldpend->next;
+ if(!oldpend->next)
+ c->in.pending_replies_tail = &c->in.pending_replies;
+ free(oldpend);
+ }
+
+ if(genrep.response_type == XCB_ERROR)
+ c->in.request_completed = c->in.request_read;
+ }
+
+ if(genrep.response_type == XCB_ERROR || genrep.response_type == XCB_REPLY)
+ {
+ pend = c->in.pending_replies;
+ if(pend &&
+ !(XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->in.request_read) &&
+ (pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER ||
+ XCB_SEQUENCE_COMPARE(c->in.request_read, <=, pend->last_request))))
+ pend = 0;
+ }
+
+ /* For reply packets, check that the entire packet is available. */
+ if(genrep.response_type == XCB_REPLY)
+ {
+ if(pend && pend->workaround == WORKAROUND_GLX_GET_FB_CONFIGS_BUG)
+ {
+ uint32_t *p = (uint32_t *) c->in.queue;
+ genrep.length = p[2] * p[3] * 2;
+ }
+ length += genrep.length * 4;
+ }
+
+ /* XGE events may have sizes > 32 */
+#ifndef _F_ENABLE_XI2_SENDEVENT_
+ if (genrep.response_type == XCB_XGE_EVENT)
+#else//_F_ENABLE_XI2_SENDEVENT_
+ if ((genrep.response_type & 0x7f) == XCB_XGE_EVENT)
+#endif//_F_ENABLE_XI2_SENDEVENT_
+ {
+ eventlength = genrep.length * 4;
+ }
+
+ buf = malloc(length + eventlength +
+ (genrep.response_type == XCB_REPLY ? 0 : sizeof(uint32_t)));
+ if(!buf)
+ {
+ _xcb_conn_shutdown(c);
+ return 0;
+ }
+
+ if(_xcb_in_read_block(c, buf, length) <= 0)
+ {
+ free(buf);
+ return 0;
+ }
+
+ /* pull in XGE event data if available, append after event struct */
+ if (eventlength)
+ {
+ if(_xcb_in_read_block(c, &((xcb_generic_event_t*)buf)[1], eventlength) <= 0)
+ {
+ free(buf);
+ return 0;
+ }
+ }
+
+ if(pend && (pend->flags & XCB_REQUEST_DISCARD_REPLY))
+ {
+ free(buf);
+ return 1;
+ }
+
+ if(genrep.response_type != XCB_REPLY)
+ ((xcb_generic_event_t *) buf)->full_sequence = c->in.request_read;
+
+ /* reply, or checked error */
+ if( genrep.response_type == XCB_REPLY ||
+ (genrep.response_type == XCB_ERROR && pend && (pend->flags & XCB_REQUEST_CHECKED)))
+ {
+ reader_list *reader;
+ struct reply_list *cur = malloc(sizeof(struct reply_list));
+ if(!cur)
+ {
+ _xcb_conn_shutdown(c);
+ free(buf);
+ return 0;
+ }
+ cur->reply = buf;
+ cur->next = 0;
+ *c->in.current_reply_tail = cur;
+ c->in.current_reply_tail = &cur->next;
+ for(reader = c->in.readers;
+ reader &&
+ XCB_SEQUENCE_COMPARE_32(reader->request, <=, c->in.request_read);
+ reader = reader->next)
+ {
+ if(XCB_SEQUENCE_COMPARE_32(reader->request, ==, c->in.request_read))
+ {
+ pthread_cond_signal(reader->data);
+ break;
+ }
+ }
+ return 1;
+ }
+
+ /* event, or unchecked error */
+ event = malloc(sizeof(struct event_list));
+ if(!event)
+ {
+ _xcb_conn_shutdown(c);
+ free(buf);
+ return 0;
+ }
+ event->event = buf;
+ event->next = 0;
+ *c->in.events_tail = event;
+ c->in.events_tail = &event->next;
+ pthread_cond_signal(&c->in.event_cond);
+ return 1; /* I have something for you... */
+}
+
+static xcb_generic_event_t *get_event(xcb_connection_t *c)
+{
+ struct event_list *cur = c->in.events;
+ xcb_generic_event_t *ret;
+ if(!c->in.events)
+ return 0;
+ ret = cur->event;
+ c->in.events = cur->next;
+ if(!cur->next)
+ c->in.events_tail = &c->in.events;
+ free(cur);
+ return ret;
+}
+
+static void free_reply_list(struct reply_list *head)
+{
+ while(head)
+ {
+ struct reply_list *cur = head;
+ head = cur->next;
+ free(cur->reply);
+ free(cur);
+ }
+}
+
+static int read_block(const int fd, void *buf, const ssize_t len)
+{
+ int done = 0;
+ while(done < len)
+ {
+ int ret = read(fd, ((char *) buf) + done, len - done);
+ if(ret > 0)
+ done += ret;
+ if(ret < 0 && errno == EAGAIN)
+ {
+#if USE_POLL
+ struct pollfd pfd;
+ pfd.fd = fd;
+ pfd.events = POLLIN;
+ pfd.revents = 0;
+ do {
+ ret = poll(&pfd, 1, -1);
+ } while (ret == -1 && errno == EINTR);
+#else
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(fd, &fds);
+ do {
+ ret = select(fd + 1, &fds, 0, 0, 0);
+ } while (ret == -1 && errno == EINTR);
+#endif
+ }
+ if(ret <= 0)
+ return ret;
+ }
+ return len;
+}
+
+static int poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error)
+{
+ struct reply_list *head;
+
+ /* If an error occurred when issuing the request, fail immediately. */
+ if(!request)
+ head = 0;
+ /* We've read requests past the one we want, so if it has replies we have
+ * them all and they're in the replies map. */
+ else if(XCB_SEQUENCE_COMPARE_32(request, <, c->in.request_read))
+ {
+ head = _xcb_map_remove(c->in.replies, request);
+ if(head && head->next)
+ _xcb_map_put(c->in.replies, request, head->next);
+ }
+ /* We're currently processing the responses to the request we want, and we
+ * have a reply ready to return. So just return it without blocking. */
+ else if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_read) && c->in.current_reply)
+ {
+ head = c->in.current_reply;
+ c->in.current_reply = head->next;
+ if(!head->next)
+ c->in.current_reply_tail = &c->in.current_reply;
+ }
+ /* We know this request can't have any more replies, and we've already
+ * established it doesn't have a reply now. Don't bother blocking. */
+ else if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_completed))
+ head = 0;
+ /* We may have more replies on the way for this request: block until we're
+ * sure. */
+ else
+ return 0;
+
+ if(error)
+ *error = 0;
+ *reply = 0;
+
+ if(head)
+ {
+ if(((xcb_generic_reply_t *) head->reply)->response_type == XCB_ERROR)
+ {
+ if(error)
+ *error = head->reply;
+ else
+ free(head->reply);
+ }
+ else
+ *reply = head->reply;
+
+ free(head);
+ }
+
+ return 1;
+}
+
+/* Public interface */
+
+void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e)
+{
+ uint64_t widened_request;
+ void *ret = 0;
+ if(e)
+ *e = 0;
+ if(c->has_error)
+ return 0;
+
+ pthread_mutex_lock(&c->iolock);
+
+ widened_request = (c->out.request & UINT64_C(0xffffffff00000000)) | request;
+ if(widened_request > c->out.request)
+ widened_request -= UINT64_C(1) << 32;
+
+ /* If this request has not been written yet, write it. */
+ if(c->out.return_socket || _xcb_out_flush_to(c, widened_request))
+ {
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ reader_list reader;
+ reader_list **prev_reader;
+
+ for(prev_reader = &c->in.readers;
+ *prev_reader &&
+ XCB_SEQUENCE_COMPARE_32((*prev_reader)->request, <=, request);
+ prev_reader = &(*prev_reader)->next)
+ {
+ /* empty */;
+ }
+ reader.request = request;
+ reader.data = &cond;
+ reader.next = *prev_reader;
+ *prev_reader = &reader;
+
+ while(!poll_for_reply(c, request, &ret, e))
+ if(!_xcb_conn_wait(c, &cond, 0, 0))
+ break;
+
+ for(prev_reader = &c->in.readers;
+ *prev_reader &&
+ XCB_SEQUENCE_COMPARE_32((*prev_reader)->request, <=, request);
+ prev_reader = &(*prev_reader)->next)
+ {
+ if(*prev_reader == &reader)
+ {
+ *prev_reader = (*prev_reader)->next;
+ break;
+ }
+ }
+ pthread_cond_destroy(&cond);
+ }
+
+ _xcb_in_wake_up_next_reader(c);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+static void insert_pending_discard(xcb_connection_t *c, pending_reply **prev_next, uint64_t seq)
+{
+ pending_reply *pend;
+ pend = malloc(sizeof(*pend));
+ if(!pend)
+ {
+ _xcb_conn_shutdown(c);
+ return;
+ }
+
+ pend->first_request = seq;
+ pend->last_request = seq;
+ pend->workaround = 0;
+ pend->flags = XCB_REQUEST_DISCARD_REPLY;
+ pend->next = *prev_next;
+ *prev_next = pend;
+
+ if(!pend->next)
+ c->in.pending_replies_tail = &pend->next;
+}
+
+static void discard_reply(xcb_connection_t *c, unsigned int request)
+{
+ pending_reply *pend = 0;
+ pending_reply **prev_pend;
+ uint64_t widened_request;
+
+ /* We've read requests past the one we want, so if it has replies we have
+ * them all and they're in the replies map. */
+ if(XCB_SEQUENCE_COMPARE_32(request, <, c->in.request_read))
+ {
+ struct reply_list *head;
+ head = _xcb_map_remove(c->in.replies, request);
+ while (head)
+ {
+ struct reply_list *next = head->next;
+ free(head->reply);
+ free(head);
+ head = next;
+ }
+ return;
+ }
+
+ /* We're currently processing the responses to the request we want, and we
+ * have a reply ready to return. Free it, and mark the pend to free any further
+ * replies. */
+ if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_read) && c->in.current_reply)
+ {
+ struct reply_list *head;
+ head = c->in.current_reply;
+ c->in.current_reply = NULL;
+ c->in.current_reply_tail = &c->in.current_reply;
+ while (head)
+ {
+ struct reply_list *next = head->next;
+ free(head->reply);
+ free(head);
+ head = next;
+ }
+
+ pend = c->in.pending_replies;
+ if(pend &&
+ !(XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->in.request_read) &&
+ (pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER ||
+ XCB_SEQUENCE_COMPARE(c->in.request_read, <=, pend->last_request))))
+ pend = 0;
+ if(pend)
+ pend->flags |= XCB_REQUEST_DISCARD_REPLY;
+ else
+ insert_pending_discard(c, &c->in.pending_replies, c->in.request_read);
+
+ return;
+ }
+
+ /* Walk the list of pending requests. Mark the first match for deletion. */
+ for(prev_pend = &c->in.pending_replies; *prev_pend; prev_pend = &(*prev_pend)->next)
+ {
+ if(XCB_SEQUENCE_COMPARE_32((*prev_pend)->first_request, >, request))
+ break;
+
+ if(XCB_SEQUENCE_COMPARE_32((*prev_pend)->first_request, ==, request))
+ {
+ /* Pending reply found. Mark for discard: */
+ (*prev_pend)->flags |= XCB_REQUEST_DISCARD_REPLY;
+ return;
+ }
+ }
+
+ /* Pending reply not found (likely due to _unchecked request). Create one: */
+ widened_request = (c->out.request & UINT64_C(0xffffffff00000000)) | request;
+ if(widened_request > c->out.request)
+ widened_request -= UINT64_C(1) << 32;
+
+ insert_pending_discard(c, prev_pend, widened_request);
+}
+
+void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence)
+{
+ if(c->has_error)
+ return;
+
+ /* If an error occurred when issuing the request, fail immediately. */
+ if(!sequence)
+ return;
+
+ pthread_mutex_lock(&c->iolock);
+ discard_reply(c, sequence);
+ pthread_mutex_unlock(&c->iolock);
+}
+
+int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error)
+{
+ int ret;
+ if(c->has_error)
+ {
+ *reply = 0;
+ if(error)
+ *error = 0;
+ return 1; /* would not block */
+ }
+ assert(reply != 0);
+ pthread_mutex_lock(&c->iolock);
+ ret = poll_for_reply(c, request, reply, error);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c)
+{
+ xcb_generic_event_t *ret;
+ if(c->has_error)
+ return 0;
+ pthread_mutex_lock(&c->iolock);
+ /* get_event returns 0 on empty list. */
+ while(!(ret = get_event(c)))
+ if(!_xcb_conn_wait(c, &c->in.event_cond, 0, 0))
+ break;
+
+ _xcb_in_wake_up_next_reader(c);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c)
+{
+ xcb_generic_event_t *ret = 0;
+ if(!c->has_error)
+ {
+ pthread_mutex_lock(&c->iolock);
+ /* FIXME: follow X meets Z architecture changes. */
+ ret = get_event(c);
+ if(!ret && _xcb_in_read(c)) /* _xcb_in_read shuts down the connection on error */
+ ret = get_event(c);
+ pthread_mutex_unlock(&c->iolock);
+ }
+ return ret;
+}
+
+xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie)
+{
+ /* FIXME: this could hold the lock to avoid syncing unnecessarily, but
+ * that would require factoring the locking out of xcb_get_input_focus,
+ * xcb_get_input_focus_reply, and xcb_wait_for_reply. */
+ xcb_generic_error_t *ret;
+ void *reply;
+ if(c->has_error)
+ return 0;
+ if(XCB_SEQUENCE_COMPARE_32(cookie.sequence,>,c->in.request_expected)
+ && XCB_SEQUENCE_COMPARE_32(cookie.sequence,>,c->in.request_completed))
+ {
+ free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), &ret));
+ assert(!ret);
+ }
+ reply = xcb_wait_for_reply(c, cookie.sequence, &ret);
+ assert(!reply);
+ return ret;
+}
+
+/* Private interface */
+
+int _xcb_in_init(_xcb_in *in)
+{
+ if(pthread_cond_init(&in->event_cond, 0))
+ return 0;
+ in->reading = 0;
+
+ in->queue_len = 0;
+
+ in->request_read = 0;
+ in->request_completed = 0;
+
+ in->replies = _xcb_map_new();
+ if(!in->replies)
+ return 0;
+
+ in->current_reply_tail = &in->current_reply;
+ in->events_tail = &in->events;
+ in->pending_replies_tail = &in->pending_replies;
+
+ return 1;
+}
+
+void _xcb_in_destroy(_xcb_in *in)
+{
+ pthread_cond_destroy(&in->event_cond);
+ free_reply_list(in->current_reply);
+ _xcb_map_delete(in->replies, (void (*)(void *)) free_reply_list);
+ while(in->events)
+ {
+ struct event_list *e = in->events;
+ in->events = e->next;
+ free(e->event);
+ free(e);
+ }
+ while(in->pending_replies)
+ {
+ pending_reply *pend = in->pending_replies;
+ in->pending_replies = pend->next;
+ free(pend);
+ }
+}
+
+void _xcb_in_wake_up_next_reader(xcb_connection_t *c)
+{
+ int pthreadret;
+ if(c->in.readers)
+ pthreadret = pthread_cond_signal(c->in.readers->data);
+ else
+ pthreadret = pthread_cond_signal(&c->in.event_cond);
+ assert(pthreadret == 0);
+}
+
+int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags)
+{
+ pending_reply *pend = malloc(sizeof(pending_reply));
+ assert(workaround != WORKAROUND_NONE || flags != 0);
+ if(!pend)
+ {
+ _xcb_conn_shutdown(c);
+ return 0;
+ }
+ pend->first_request = pend->last_request = request;
+ pend->workaround = workaround;
+ pend->flags = flags;
+ pend->next = 0;
+ *c->in.pending_replies_tail = pend;
+ c->in.pending_replies_tail = &pend->next;
+ return 1;
+}
+
+void _xcb_in_replies_done(xcb_connection_t *c)
+{
+ struct pending_reply *pend;
+ if (c->in.pending_replies_tail != &c->in.pending_replies)
+ {
+ pend = container_of(c->in.pending_replies_tail, struct pending_reply, next);
+ if(pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER)
+ {
+ pend->last_request = c->out.request;
+ pend->workaround = WORKAROUND_NONE;
+ }
+ }
+}
+
+int _xcb_in_read(xcb_connection_t *c)
+{
+ int n = read(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len);
+ if(n > 0)
+ c->in.queue_len += n;
+ while(read_packet(c))
+ /* empty */;
+ if((n > 0) || (n < 0 && errno == EAGAIN))
+ return 1;
+ _xcb_conn_shutdown(c);
+ return 0;
+}
+
+int _xcb_in_read_block(xcb_connection_t *c, void *buf, int len)
+{
+ int done = c->in.queue_len;
+ if(len < done)
+ done = len;
+
+ memcpy(buf, c->in.queue, done);
+ c->in.queue_len -= done;
+ memmove(c->in.queue, c->in.queue + done, c->in.queue_len);
+
+ if(len > done)
+ {
+ int ret = read_block(c->fd, (char *) buf + done, len - done);
+ if(ret <= 0)
+ {
+ _xcb_conn_shutdown(c);
+ return ret;
+ }
+ }
+
+ return len;
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* A generic implementation of a list of void-pointers. */
+
+#include <stdlib.h>
+
+#include "xcb.h"
+#include "xcbint.h"
+
+typedef struct node {
+ struct node *next;
+ unsigned int key;
+ void *data;
+} node;
+
+struct _xcb_map {
+ node *head;
+ node **tail;
+};
+
+/* Private interface */
+
+_xcb_map *_xcb_map_new()
+{
+ _xcb_map *list;
+ list = malloc(sizeof(_xcb_map));
+ if(!list)
+ return 0;
+ list->head = 0;
+ list->tail = &list->head;
+ return list;
+}
+
+void _xcb_map_delete(_xcb_map *list, xcb_list_free_func_t do_free)
+{
+ if(!list)
+ return;
+ while(list->head)
+ {
+ node *cur = list->head;
+ if(do_free)
+ do_free(cur->data);
+ list->head = cur->next;
+ free(cur);
+ }
+ free(list);
+}
+
+int _xcb_map_put(_xcb_map *list, unsigned int key, void *data)
+{
+ node *cur = malloc(sizeof(node));
+ if(!cur)
+ return 0;
+ cur->key = key;
+ cur->data = data;
+ cur->next = 0;
+ *list->tail = cur;
+ list->tail = &cur->next;
+ return 1;
+}
+
+void *_xcb_map_remove(_xcb_map *list, unsigned int key)
+{
+ node **cur;
+ for(cur = &list->head; *cur; cur = &(*cur)->next)
+ if((*cur)->key == key)
+ {
+ node *tmp = *cur;
+ void *ret = (*cur)->data;
+ *cur = (*cur)->next;
+ if(!*cur)
+ list->tail = cur;
+
+ free(tmp);
+ return ret;
+ }
+ return 0;
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* Stuff that sends stuff to the server. */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "xcb.h"
+#include "xcbext.h"
+#include "xcbint.h"
+#include "bigreq.h"
+
+static int write_block(xcb_connection_t *c, struct iovec *vector, int count)
+{
+ while(count && c->out.queue_len + vector[0].iov_len <= sizeof(c->out.queue))
+ {
+ memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len);
+ c->out.queue_len += vector[0].iov_len;
+ vector[0].iov_base = (char *) vector[0].iov_base + vector[0].iov_len;
+ vector[0].iov_len = 0;
+ ++vector, --count;
+ }
+ if(!count)
+ return 1;
+
+ --vector, ++count;
+ vector[0].iov_base = c->out.queue;
+ vector[0].iov_len = c->out.queue_len;
+ c->out.queue_len = 0;
+ return _xcb_out_send(c, vector, count);
+}
+
+static void get_socket_back(xcb_connection_t *c)
+{
+ while(c->out.return_socket && c->out.socket_moving)
+ pthread_cond_wait(&c->out.socket_cond, &c->iolock);
+ if(!c->out.return_socket)
+ return;
+
+ c->out.socket_moving = 1;
+ pthread_mutex_unlock(&c->iolock);
+ c->out.return_socket(c->out.socket_closure);
+ pthread_mutex_lock(&c->iolock);
+ c->out.socket_moving = 0;
+
+ pthread_cond_broadcast(&c->out.socket_cond);
+ c->out.return_socket = 0;
+ c->out.socket_closure = 0;
+ _xcb_in_replies_done(c);
+}
+
+/* Public interface */
+
+void xcb_prefetch_maximum_request_length(xcb_connection_t *c)
+{
+ if(c->has_error)
+ return;
+ pthread_mutex_lock(&c->out.reqlenlock);
+ if(c->out.maximum_request_length_tag == LAZY_NONE)
+ {
+ const xcb_query_extension_reply_t *ext;
+ ext = xcb_get_extension_data(c, &xcb_big_requests_id);
+ if(ext && ext->present)
+ {
+ c->out.maximum_request_length_tag = LAZY_COOKIE;
+ c->out.maximum_request_length.cookie = xcb_big_requests_enable(c);
+ }
+ else
+ {
+ c->out.maximum_request_length_tag = LAZY_FORCED;
+ c->out.maximum_request_length.value = c->setup->maximum_request_length;
+ }
+ }
+ pthread_mutex_unlock(&c->out.reqlenlock);
+}
+
+uint32_t xcb_get_maximum_request_length(xcb_connection_t *c)
+{
+ if(c->has_error)
+ return 0;
+ xcb_prefetch_maximum_request_length(c);
+ pthread_mutex_lock(&c->out.reqlenlock);
+ if(c->out.maximum_request_length_tag == LAZY_COOKIE)
+ {
+ xcb_big_requests_enable_reply_t *r = xcb_big_requests_enable_reply(c, c->out.maximum_request_length.cookie, 0);
+ c->out.maximum_request_length_tag = LAZY_FORCED;
+ if(r)
+ {
+ c->out.maximum_request_length.value = r->maximum_request_length;
+ free(r);
+ }
+ else
+ c->out.maximum_request_length.value = c->setup->maximum_request_length;
+ }
+ pthread_mutex_unlock(&c->out.reqlenlock);
+ return c->out.maximum_request_length.value;
+}
+
+unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *req)
+{
+ static const union {
+ struct {
+ uint8_t major;
+ uint8_t pad;
+ uint16_t len;
+ } fields;
+ uint32_t packet;
+ } sync_req = { { /* GetInputFocus */ 43, 0, 1 } };
+ uint64_t request;
+ uint32_t prefix[3] = { 0 };
+ int veclen = req->count;
+ enum workarounds workaround = WORKAROUND_NONE;
+
+ if(c->has_error)
+ return 0;
+
+ assert(c != 0);
+ assert(vector != 0);
+ assert(req->count > 0);
+
+ if(!(flags & XCB_REQUEST_RAW))
+ {
+ static const char pad[3];
+ unsigned int i;
+ uint16_t shortlen = 0;
+ size_t longlen = 0;
+ assert(vector[0].iov_len >= 4);
+ /* set the major opcode, and the minor opcode for extensions */
+ if(req->ext)
+ {
+ const xcb_query_extension_reply_t *extension = xcb_get_extension_data(c, req->ext);
+ if(!(extension && extension->present))
+ {
+ _xcb_conn_shutdown(c);
+ return 0;
+ }
+ ((uint8_t *) vector[0].iov_base)[0] = extension->major_opcode;
+ ((uint8_t *) vector[0].iov_base)[1] = req->opcode;
+ }
+ else
+ ((uint8_t *) vector[0].iov_base)[0] = req->opcode;
+
+ /* put together the length field, possibly using BIGREQUESTS */
+ for(i = 0; i < req->count; ++i)
+ {
+ longlen += vector[i].iov_len;
+ if(!vector[i].iov_base)
+ {
+ vector[i].iov_base = (char *) pad;
+ assert(vector[i].iov_len <= sizeof(pad));
+ }
+ }
+ assert((longlen & 3) == 0);
+ longlen >>= 2;
+
+ if(longlen <= c->setup->maximum_request_length)
+ {
+ /* we don't need BIGREQUESTS. */
+ shortlen = longlen;
+ longlen = 0;
+ }
+ else if(longlen > xcb_get_maximum_request_length(c))
+ {
+ _xcb_conn_shutdown(c);
+ return 0; /* server can't take this; maybe need BIGREQUESTS? */
+ }
+
+ /* set the length field. */
+ ((uint16_t *) vector[0].iov_base)[1] = shortlen;
+ if(!shortlen)
+ prefix[2] = ++longlen;
+ }
+ flags &= ~XCB_REQUEST_RAW;
+
+ /* do we need to work around the X server bug described in glx.xml? */
+ /* XXX: GetFBConfigs won't use BIG-REQUESTS in any sane
+ * configuration, but that should be handled here anyway. */
+ if(req->ext && !req->isvoid && !strcmp(req->ext->name, "GLX") &&
+ ((req->opcode == 17 && ((uint32_t *) vector[0].iov_base)[1] == 0x10004) ||
+ req->opcode == 21))
+ workaround = WORKAROUND_GLX_GET_FB_CONFIGS_BUG;
+
+ /* get a sequence number and arrange for delivery. */
+ pthread_mutex_lock(&c->iolock);
+ /* wait for other writing threads to get out of my way. */
+ while(c->out.writing)
+ pthread_cond_wait(&c->out.cond, &c->iolock);
+ get_socket_back(c);
+
+ request = ++c->out.request;
+ /* send GetInputFocus (sync_req) when 64k-2 requests have been sent without
+ * a reply.
+ * Also send sync_req (could use NoOp) at 32-bit wrap to avoid having
+ * applications see sequence 0 as that is used to indicate
+ * an error in sending the request */
+ while((req->isvoid &&
+ c->out.request == c->in.request_expected + (1 << 16) - 1) ||
+ request == 0)
+ {
+ prefix[0] = sync_req.packet;
+ _xcb_in_expect_reply(c, request, WORKAROUND_NONE, XCB_REQUEST_DISCARD_REPLY);
+ c->in.request_expected = c->out.request;
+ request = ++c->out.request;
+ }
+
+ if(workaround != WORKAROUND_NONE || flags != 0)
+ _xcb_in_expect_reply(c, request, workaround, flags);
+ if(!req->isvoid)
+ c->in.request_expected = c->out.request;
+
+ if(prefix[0] || prefix[2])
+ {
+ --vector, ++veclen;
+ if(prefix[2])
+ {
+ prefix[1] = ((uint32_t *) vector[1].iov_base)[0];
+ vector[1].iov_base = (uint32_t *) vector[1].iov_base + 1;
+ vector[1].iov_len -= sizeof(uint32_t);
+ }
+ vector[0].iov_len = sizeof(uint32_t) * ((prefix[0] ? 1 : 0) + (prefix[2] ? 2 : 0));
+ vector[0].iov_base = prefix + !prefix[0];
+ }
+
+ if(!write_block(c, vector, veclen))
+ {
+ _xcb_conn_shutdown(c);
+ request = 0;
+ }
+ pthread_mutex_unlock(&c->iolock);
+ return request;
+}
+
+int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent)
+{
+ int ret;
+ if(c->has_error)
+ return 0;
+ pthread_mutex_lock(&c->iolock);
+ get_socket_back(c);
+ ret = _xcb_out_flush_to(c, c->out.request);
+ if(ret)
+ {
+ c->out.return_socket = return_socket;
+ c->out.socket_closure = closure;
+ if(flags)
+ _xcb_in_expect_reply(c, c->out.request, WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
+ assert(c->out.request == c->out.request_written);
+ *sent = c->out.request;
+ }
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests)
+{
+ int ret;
+ if(c->has_error)
+ return 0;
+ pthread_mutex_lock(&c->iolock);
+ c->out.request += requests;
+ ret = _xcb_out_send(c, vector, count);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+int xcb_flush(xcb_connection_t *c)
+{
+ int ret;
+ if(c->has_error)
+ return 0;
+ pthread_mutex_lock(&c->iolock);
+ ret = _xcb_out_flush_to(c, c->out.request);
+ pthread_mutex_unlock(&c->iolock);
+ return ret;
+}
+
+/* Private interface */
+
+int _xcb_out_init(_xcb_out *out)
+{
+ if(pthread_cond_init(&out->socket_cond, 0))
+ return 0;
+ out->return_socket = 0;
+ out->socket_closure = 0;
+ out->socket_moving = 0;
+
+ if(pthread_cond_init(&out->cond, 0))
+ return 0;
+ out->writing = 0;
+
+ out->queue_len = 0;
+
+ out->request = 0;
+ out->request_written = 0;
+
+ if(pthread_mutex_init(&out->reqlenlock, 0))
+ return 0;
+ out->maximum_request_length_tag = LAZY_NONE;
+
+ return 1;
+}
+
+void _xcb_out_destroy(_xcb_out *out)
+{
+ pthread_cond_destroy(&out->cond);
+ pthread_mutex_destroy(&out->reqlenlock);
+}
+
+int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count)
+{
+ int ret = 1;
+ while(ret && count)
+ ret = _xcb_conn_wait(c, &c->out.cond, &vector, &count);
+ c->out.request_written = c->out.request;
+ pthread_cond_broadcast(&c->out.cond);
+ _xcb_in_wake_up_next_reader(c);
+ return ret;
+}
+
+int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request)
+{
+ assert(XCB_SEQUENCE_COMPARE(request, <=, c->out.request));
+ if(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request))
+ return 1;
+ if(c->out.queue_len)
+ {
+ struct iovec vec;
+ vec.iov_base = c->out.queue;
+ vec.iov_len = c->out.queue_len;
+ c->out.queue_len = 0;
+ return _xcb_out_send(c, &vec, 1);
+ }
+ while(c->out.writing)
+ pthread_cond_wait(&c->out.cond, &c->iolock);
+ assert(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request));
+ return 1;
+}
--- /dev/null
+/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* Utility functions implementable using only public APIs. */
+
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <limits.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#ifdef DNETCONN
+#include <netdnet/dnetdb.h>
+#include <netdnet/dn.h>
+#endif
+#include <netdb.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+#include "xcb.h"
+#include "xcbext.h"
+#include "xcbint.h"
+
+static const int error_connection = 1;
+
+int xcb_popcount(uint32_t mask)
+{
+ uint32_t y;
+ y = (mask >> 1) & 033333333333;
+ y = mask - y - ((y >> 1) & 033333333333);
+ return ((y + (y >> 3)) & 030707070707) % 077;
+}
+
+static int _xcb_parse_display(const char *name, char **host, char **protocol,
+ int *displayp, int *screenp)
+{
+ int len, display, screen;
+ char *slash, *colon, *dot, *end;
+
+ if(!name || !*name)
+ name = getenv("DISPLAY");
+ if(!name)
+ return 0;
+
+#ifdef HAVE_LAUNCHD
+ if(strncmp(name, "/tmp/launch", 11) == 0)
+ slash = NULL;
+ else
+#endif
+ slash = strrchr(name, '/');
+
+ if (slash) {
+ len = slash - name;
+ if (protocol) {
+ *protocol = malloc(len + 1);
+ if(!*protocol)
+ return 0;
+ memcpy(*protocol, name, len);
+ (*protocol)[len] = '\0';
+ }
+ name = slash + 1;
+ } else
+ if (protocol)
+ *protocol = NULL;
+
+ colon = strrchr(name, ':');
+ if(!colon)
+ goto error_out;
+ len = colon - name;
+ ++colon;
+ display = strtoul(colon, &dot, 10);
+ if(dot == colon)
+ goto error_out;
+ if(*dot == '\0')
+ screen = 0;
+ else
+ {
+ if(*dot != '.')
+ goto error_out;
+ ++dot;
+ screen = strtoul(dot, &end, 10);
+ if(end == dot || *end != '\0')
+ goto error_out;
+ }
+ /* At this point, the display string is fully parsed and valid, but
+ * the caller's memory is untouched. */
+
+ *host = malloc(len + 1);
+ if(!*host)
+ goto error_out;
+ memcpy(*host, name, len);
+ (*host)[len] = '\0';
+ *displayp = display;
+ if(screenp)
+ *screenp = screen;
+ return 1;
+
+error_out:
+ if (protocol) {
+ free(*protocol);
+ *protocol = NULL;
+ }
+
+ return 0;
+}
+
+int xcb_parse_display(const char *name, char **host, int *displayp,
+ int *screenp)
+{
+ return _xcb_parse_display(name, host, NULL, displayp, screenp);
+}
+
+static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port);
+static int _xcb_open_unix(char *protocol, const char *file);
+#ifdef DNETCONN
+static int _xcb_open_decnet(const char *host, char *protocol, const unsigned short port);
+#endif
+#ifdef HAVE_ABSTRACT_SOCKETS
+static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen);
+#endif
+
+static int _xcb_open(const char *host, char *protocol, const int display)
+{
+ int fd;
+ static const char unix_base[] = "/tmp/.X11-unix/X";
+ const char *base = unix_base;
+ size_t filelen;
+ char *file = NULL;
+ int actual_filelen;
+
+#ifdef HAVE_LAUNCHD
+ if(strncmp(host, "/tmp/launch", 11) == 0) {
+ base = host;
+ host = "";
+ protocol = NULL;
+ }
+#endif
+
+ if(*host || protocol)
+ {
+#ifdef DNETCONN
+ /* DECnet displays have two colons, so _xcb_parse_display will have
+ left one at the end. However, an IPv6 address can end with *two*
+ colons, so only treat this as a DECnet display if host ends with
+ exactly one colon. */
+ char *colon = strchr(host, ':');
+ if(colon && *(colon+1) == '\0')
+ {
+ *colon = '\0';
+ return _xcb_open_decnet(host, protocol, display);
+ }
+ else
+#endif
+ if (protocol
+ || strcmp("unix",host)) { /* follow the old unix: rule */
+
+ /* display specifies TCP */
+ unsigned short port = X_TCP_PORT + display;
+ return _xcb_open_tcp(host, protocol, port);
+ }
+ }
+
+ filelen = strlen(base) + 1 + sizeof(display) * 3 + 1;
+ file = malloc(filelen);
+ if(file == NULL)
+ return -1;
+
+ /* display specifies Unix socket */
+#ifdef HAVE_LAUNCHD
+ if(strncmp(base, "/tmp/launch", 11) == 0)
+ actual_filelen = snprintf(file, filelen, "%s:%d", base, display);
+ else
+#endif
+ actual_filelen = snprintf(file, filelen, "%s%d", base, display);
+ if(actual_filelen < 0)
+ {
+ free(file);
+ return -1;
+ }
+ /* snprintf may truncate the file */
+ filelen = MIN(actual_filelen, filelen - 1);
+#ifdef HAVE_ABSTRACT_SOCKETS
+ fd = _xcb_open_abstract(protocol, file, filelen);
+ if (fd >= 0 || (errno != ENOENT && errno != ECONNREFUSED))
+ {
+ free(file);
+ return fd;
+ }
+
+#endif
+ fd = _xcb_open_unix(protocol, file);
+ free(file);
+
+ return fd;
+}
+
+static int _xcb_socket(int family, int type, int proto)
+{
+ int fd;
+
+#ifdef SOCK_CLOEXEC
+ fd = socket(family, type | SOCK_CLOEXEC, proto);
+ if (fd == -1 && errno == EINVAL)
+#endif
+ {
+ fd = socket(family, type, proto);
+ if (fd >= 0)
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ }
+ return fd;
+}
+
+#ifdef DNETCONN
+static int _xcb_open_decnet(const char *host, const char *protocol, const unsigned short port)
+{
+ int fd;
+ struct sockaddr_dn addr;
+ struct accessdata_dn accessdata;
+ struct nodeent *nodeaddr = getnodebyname(host);
+
+ if(!nodeaddr)
+ return -1;
+ if (protocol && strcmp("dnet",protocol))
+ return -1;
+ addr.sdn_family = AF_DECnet;
+
+ addr.sdn_add.a_len = nodeaddr->n_length;
+ memcpy(addr.sdn_add.a_addr, nodeaddr->n_addr, addr.sdn_add.a_len);
+
+ addr.sdn_objnamel = sprintf((char *)addr.sdn_objname, "X$X%d", port);
+ if(addr.sdn_objnamel < 0)
+ return -1;
+ addr.sdn_objnum = 0;
+
+ fd = _xcb_socket(PF_DECnet, SOCK_STREAM, 0);
+ if(fd == -1)
+ return -1;
+
+ memset(&accessdata, 0, sizeof(accessdata));
+ accessdata.acc_accl = sprintf((char*)accessdata.acc_acc, "%d", getuid());
+ if(accessdata.acc_accl < 0)
+ return -1;
+ setsockopt(fd, DNPROTO_NSP, SO_CONACCESS, &accessdata, sizeof(accessdata));
+
+ if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+#endif
+
+static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port)
+{
+ int fd = -1;
+ struct addrinfo hints;
+ char service[6]; /* "65535" with the trailing '\0' */
+ struct addrinfo *results, *addr;
+ char *bracket;
+
+ if (protocol && strcmp("tcp",protocol) && strcmp("inet",protocol)
+#ifdef AF_INET6
+ && strcmp("inet6",protocol)
+#endif
+ )
+ return -1;
+
+ if (*host == '\0')
+ host = "localhost";
+
+ memset(&hints, 0, sizeof(hints));
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+#ifdef AI_NUMERICSERV
+ hints.ai_flags |= AI_NUMERICSERV;
+#endif
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+
+#ifdef AF_INET6
+ /* Allow IPv6 addresses enclosed in brackets. */
+ if(host[0] == '[' && (bracket = strrchr(host, ']')) && bracket[1] == '\0')
+ {
+ *bracket = '\0';
+ ++host;
+ hints.ai_flags |= AI_NUMERICHOST;
+ hints.ai_family = AF_INET6;
+ }
+#endif
+
+ snprintf(service, sizeof(service), "%hu", port);
+ if(getaddrinfo(host, service, &hints, &results))
+ /* FIXME: use gai_strerror, and fill in error connection */
+ return -1;
+
+ for(addr = results; addr; addr = addr->ai_next)
+ {
+ fd = _xcb_socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
+ if(fd >= 0) {
+ int on = 1;
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
+
+ if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
+ break;
+ close(fd);
+ fd = -1;
+ }
+ }
+ freeaddrinfo(results);
+ return fd;
+}
+
+static int _xcb_open_unix(char *protocol, const char *file)
+{
+ int fd;
+ struct sockaddr_un addr;
+
+ if (protocol && strcmp("unix",protocol))
+ return -1;
+
+ strcpy(addr.sun_path, file);
+ addr.sun_family = AF_UNIX;
+#ifdef HAVE_SOCKADDR_SUN_LEN
+ addr.sun_len = SUN_LEN(&addr);
+#endif
+ fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
+ if(fd == -1)
+ return -1;
+ if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+
+#ifdef HAVE_ABSTRACT_SOCKETS
+static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen)
+{
+ int fd;
+ struct sockaddr_un addr = {0};
+ socklen_t namelen;
+
+ if (protocol && strcmp("unix",protocol))
+ return -1;
+
+ strcpy(addr.sun_path + 1, file);
+ addr.sun_family = AF_UNIX;
+ namelen = offsetof(struct sockaddr_un, sun_path) + 1 + filelen;
+#ifdef HAVE_SOCKADDR_SUN_LEN
+ addr.sun_len = 1 + filelen;
+#endif
+ fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd == -1)
+ return -1;
+ if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) {
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+#endif
+
+xcb_connection_t *xcb_connect(const char *displayname, int *screenp)
+{
+ return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp);
+}
+
+xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp)
+{
+ int fd, display = 0;
+ char *host = NULL;
+ char *protocol = NULL;
+ xcb_auth_info_t ourauth;
+ xcb_connection_t *c;
+
+ int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
+
+ if(!parsed) {
+ c = (xcb_connection_t *) &error_connection;
+ goto out;
+ } else
+ fd = _xcb_open(host, protocol, display);
+
+ if(fd == -1) {
+ c = (xcb_connection_t *) &error_connection;
+ goto out;
+ }
+
+ if(auth) {
+ c = xcb_connect_to_fd(fd, auth);
+ goto out;
+ }
+
+ if(_xcb_get_auth_info(fd, &ourauth, display))
+ {
+ c = xcb_connect_to_fd(fd, &ourauth);
+ free(ourauth.name);
+ free(ourauth.data);
+ }
+ else
+ c = xcb_connect_to_fd(fd, 0);
+
+out:
+ free(host);
+ free(protocol);
+ return c;
+}
--- /dev/null
+/* Copyright (C) 2001-2008 Bart Massey and Jamey Sharp.
+ *
+ * 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.
+ */
+
+/* XID allocators. */
+
+#include <assert.h>
+#include <stdlib.h>
+#include "xcb.h"
+#include "xcbext.h"
+#include "xcbint.h"
+#include "xc_misc.h"
+
+/* Public interface */
+
+uint32_t xcb_generate_id(xcb_connection_t *c)
+{
+ uint32_t ret;
+ if(c->has_error)
+ return -1;
+ pthread_mutex_lock(&c->xid.lock);
+ if(c->xid.last >= c->xid.max - c->xid.inc + 1)
+ {
+ xcb_xc_misc_get_xid_range_reply_t *range;
+ assert(c->xid.last == c->xid.max);
+ if (c->xid.last == 0) {
+ /* finish setting up initial range */
+ c->xid.max = c->setup->resource_id_mask;
+ } else {
+ /* check for extension */
+ const xcb_query_extension_reply_t *xc_misc_reply =
+ xcb_get_extension_data(c, &xcb_xc_misc_id);
+ if (!xc_misc_reply) {
+ pthread_mutex_unlock(&c->xid.lock);
+ return -1;
+ }
+ /* get new range */
+ range = xcb_xc_misc_get_xid_range_reply(c,
+ xcb_xc_misc_get_xid_range(c), 0);
+ /* XXX The latter disjunct is what the server returns
+ when it is out of XIDs. Sweet. */
+ if(!range || (range->start_id == 0 && range->count == 1))
+ {
+ pthread_mutex_unlock(&c->xid.lock);
+ return -1;
+ }
+ assert(range->count > 0 && range->start_id > 0);
+ c->xid.last = range->start_id;
+ c->xid.max = range->start_id + (range->count - 1) * c->xid.inc;
+ free(range);
+ }
+ } else {
+ c->xid.last += c->xid.inc;
+ }
+ ret = c->xid.last | c->xid.base;
+ pthread_mutex_unlock(&c->xid.lock);
+ return ret;
+}
+
+/* Private interface */
+
+int _xcb_xid_init(xcb_connection_t *c)
+{
+ if(pthread_mutex_init(&c->xid.lock, 0))
+ return 0;
+ c->xid.last = 0;
+ c->xid.max = 0;
+ c->xid.base = c->setup->resource_id_base;
+ c->xid.inc = c->setup->resource_id_mask & -(c->setup->resource_id_mask);
+ return 1;
+}
+
+void _xcb_xid_destroy(xcb_connection_t *c)
+{
+ pthread_mutex_destroy(&c->xid.lock);
+}
--- /dev/null
+/*
+ * Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ * All Rights Reserved.
+ *
+ * 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.
+ */
+
+#ifndef __XCBEXT_H
+#define __XCBEXT_H
+
+#include "xcb.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* xcb_ext.c */
+
+struct xcb_extension_t {
+ const char *name;
+ int global_id;
+};
+
+
+/* xcb_out.c */
+
+typedef struct {
+ size_t count;
+ xcb_extension_t *ext;
+ uint8_t opcode;
+ uint8_t isvoid;
+} xcb_protocol_request_t;
+
+enum xcb_send_request_flags_t {
+ XCB_REQUEST_CHECKED = 1 << 0,
+ XCB_REQUEST_RAW = 1 << 1,
+ XCB_REQUEST_DISCARD_REPLY = 1 << 2
+};
+
+unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request);
+
+/* xcb_take_socket allows external code to ask XCB for permission to
+ * take over the write side of the socket and send raw data with
+ * xcb_writev. xcb_take_socket provides the sequence number of the last
+ * request XCB sent. The caller of xcb_take_socket must supply a
+ * callback which XCB can call when it wants the write side of the
+ * socket back to make a request. This callback synchronizes with the
+ * external socket owner, flushes any output queues if appropriate, and
+ * then returns the sequence number of the last request sent over the
+ * socket. */
+int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent);
+
+/* You must own the write-side of the socket (you've called
+ * xcb_take_socket, and haven't returned from return_socket yet) to call
+ * xcb_writev. Also, the iovec must have at least 1 byte of data in it.
+ * */
+int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests);
+
+
+/* xcb_in.c */
+
+void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e);
+int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error);
+
+
+/* xcb_util.c */
+
+int xcb_popcount(uint32_t mask);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
+ * All Rights Reserved.
+ *
+ * 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.
+ */
+
+#ifndef __XCBINT_H
+#define __XCBINT_H
+
+#include "bigreq.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef GCC_HAS_VISIBILITY
+#pragma GCC visibility push(hidden)
+#endif
+
+enum workarounds {
+ WORKAROUND_NONE,
+ WORKAROUND_GLX_GET_FB_CONFIGS_BUG,
+ WORKAROUND_EXTERNAL_SOCKET_OWNER
+};
+
+enum lazy_reply_tag
+{
+ LAZY_NONE = 0,
+ LAZY_COOKIE,
+ LAZY_FORCED
+};
+
+#define XCB_PAD(i) (-(i) & 3)
+
+#define XCB_SEQUENCE_COMPARE(a,op,b) ((int64_t) ((a) - (b)) op 0)
+#define XCB_SEQUENCE_COMPARE_32(a,op,b) (((int) (a) - (int) (b)) op 0)
+
+#ifndef offsetof
+#define offsetof(type,member) ((size_t) &((type *)0)->member)
+#endif
+
+#ifndef MIN
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+#endif
+
+#define container_of(pointer,type,member) ((type *)(((char *)(pointer)) - offsetof(type, member)))
+
+/* xcb_list.c */
+
+typedef void (*xcb_list_free_func_t)(void *);
+
+typedef struct _xcb_map _xcb_map;
+
+_xcb_map *_xcb_map_new(void);
+void _xcb_map_delete(_xcb_map *q, xcb_list_free_func_t do_free);
+int _xcb_map_put(_xcb_map *q, unsigned int key, void *data);
+void *_xcb_map_remove(_xcb_map *q, unsigned int key);
+
+
+/* xcb_out.c */
+
+typedef struct _xcb_out {
+ pthread_cond_t cond;
+ int writing;
+
+ pthread_cond_t socket_cond;
+ void (*return_socket)(void *closure);
+ void *socket_closure;
+ int socket_moving;
+
+ char queue[XCB_QUEUE_BUFFER_SIZE];
+ int queue_len;
+
+ uint64_t request;
+ uint64_t request_written;
+
+ pthread_mutex_t reqlenlock;
+ enum lazy_reply_tag maximum_request_length_tag;
+ union {
+ xcb_big_requests_enable_cookie_t cookie;
+ uint32_t value;
+ } maximum_request_length;
+} _xcb_out;
+
+int _xcb_out_init(_xcb_out *out);
+void _xcb_out_destroy(_xcb_out *out);
+
+int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count);
+int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request);
+
+
+/* xcb_in.c */
+
+typedef struct _xcb_in {
+ pthread_cond_t event_cond;
+ int reading;
+
+ char queue[4096];
+ int queue_len;
+
+ uint64_t request_expected;
+ uint64_t request_read;
+ uint64_t request_completed;
+ struct reply_list *current_reply;
+ struct reply_list **current_reply_tail;
+
+ _xcb_map *replies;
+ struct event_list *events;
+ struct event_list **events_tail;
+ struct reader_list *readers;
+
+ struct pending_reply *pending_replies;
+ struct pending_reply **pending_replies_tail;
+} _xcb_in;
+
+int _xcb_in_init(_xcb_in *in);
+void _xcb_in_destroy(_xcb_in *in);
+
+void _xcb_in_wake_up_next_reader(xcb_connection_t *c);
+
+int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags);
+void _xcb_in_replies_done(xcb_connection_t *c);
+
+int _xcb_in_read(xcb_connection_t *c);
+int _xcb_in_read_block(xcb_connection_t *c, void *buf, int nread);
+
+
+/* xcb_xid.c */
+
+typedef struct _xcb_xid {
+ pthread_mutex_t lock;
+ uint32_t last;
+ uint32_t base;
+ uint32_t max;
+ uint32_t inc;
+} _xcb_xid;
+
+int _xcb_xid_init(xcb_connection_t *c);
+void _xcb_xid_destroy(xcb_connection_t *c);
+
+
+/* xcb_ext.c */
+
+typedef struct _xcb_ext {
+ pthread_mutex_t lock;
+ struct lazyreply *extensions;
+ int extensions_size;
+} _xcb_ext;
+
+int _xcb_ext_init(xcb_connection_t *c);
+void _xcb_ext_destroy(xcb_connection_t *c);
+
+
+/* xcb_conn.c */
+
+struct xcb_connection_t {
+ int has_error;
+
+ /* constant data */
+ xcb_setup_t *setup;
+ int fd;
+
+ /* I/O data */
+ pthread_mutex_t iolock;
+ _xcb_in in;
+ _xcb_out out;
+
+ /* misc data */
+ _xcb_ext ext;
+ _xcb_xid xid;
+};
+
+void _xcb_conn_shutdown(xcb_connection_t *c);
+int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count);
+
+
+/* xcb_auth.c */
+
+int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display);
+
+#ifdef GCC_HAS_VISIBILITY
+#pragma GCC visibility pop
+#endif
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet
+ version="1.0"
+ xmlns:check="http://check.sourceforge.net/ns"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/TR/REC-html40">
+
+<xsl:output method="html"/>
+
+<xsl:template match="/">
+<html>
+ <head>
+ <title>Test Suite Results</title>
+ </head>
+
+ <body>
+ <xsl:apply-templates/>
+ </body>
+</html>
+</xsl:template>
+
+<xsl:template match="datetime">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="duration">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="check:suite">
+ <xsl:apply-templates select="check:title"/>
+ <center>
+ <table width="80%" border="1">
+ <thead>
+ <tr>
+ <td>Test Path</td>
+ <td>Test Function Location</td>
+ <td>C Identifier</td>
+ <td>Test Case</td>
+ <td>Result</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:apply-templates select="check:test"/>
+ </tbody>
+ </table>
+ </center>
+</xsl:template>
+
+<xsl:template match="check:testsuites">
+ <xsl:apply-templates select="check:suite"/>
+ <h3>Unit Test Statistics</h3>
+ <ul>
+ <li>date/time: <xsl:apply-templates select="check:datetime"/></li>
+ <li>duration: <xsl:apply-templates select="check:duration"/></li>
+ </ul>
+ <hr></hr>
+</xsl:template>
+
+<xsl:template match="check:title">
+ <h2>Test Suite: <xsl:apply-templates/></h2>
+</xsl:template>
+
+<xsl:template match="check:test[@result='success']">
+ <tr bgcolor="lime">
+ <xsl:apply-templates/>
+ </tr>
+</xsl:template>
+
+<xsl:template match="check:test[@result='failure']">
+ <tr bgcolor="red">
+ <xsl:apply-templates/>
+ </tr>
+</xsl:template>
+
+<xsl:template match="check:test[@result='error']">
+ <tr bgcolor="yellow">
+ <xsl:apply-templates/>
+ </tr>
+</xsl:template>
+
+<xsl:template match="check:path">
+ <td><xsl:apply-templates/></td>
+</xsl:template>
+
+<xsl:template match="check:fn">
+ <td><xsl:apply-templates/></td>
+</xsl:template>
+
+<xsl:template match="check:id">
+ <td><xsl:apply-templates/></td>
+</xsl:template>
+
+<xsl:template match="check:description">
+ <td><xsl:apply-templates/></td>
+</xsl:template>
+
+<xsl:template match="check:message">
+ <td><xsl:apply-templates/></td>
+</xsl:template>
+
+</xsl:stylesheet>
+
--- /dev/null
+########################
+## tests/Makefile.am
+########################
+SUBDIRS =
+EXTRA_DIST = CheckLog.xsl
+AM_MAKEFLAGS = -k
+AM_CFLAGS = -Wall -Werror @CHECK_CFLAGS@ -I$(top_srcdir)/src
+LDADD = @CHECK_LIBS@ $(top_builddir)/src/libxcb.la
+
+if HAVE_CHECK
+TESTS = check_all
+check_PROGRAMS = check_all
+check_all_SOURCES = check_all.c check_suites.h check_public.c
+
+all-local::
+ $(RM) CheckLog*.xml
+
+check-local: check-TESTS
+ $(RM) CheckLog.html
+ if test x$(HTML_CHECK_RESULT) = xtrue; then \
+ $(XSLTPROC) $(srcdir)/CheckLog.xsl CheckLog*.xml > CheckLog.html; \
+ else \
+ touch CheckLog.html; \
+ fi
+
+CheckLog.html: $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check;
+
+endif
+
+clean-local::
+ $(RM) CheckLog.html CheckLog*.txt CheckLog*.xml
--- /dev/null
+#include <stdlib.h>
+#include "check_suites.h"
+
+void suite_add_test(Suite *s, TFun tf, const char *name)
+{
+ TCase *tc = tcase_create(name);
+ tcase_add_test(tc, tf);
+ suite_add_tcase(s, tc);
+}
+
+int main(void)
+{
+ int nf;
+ SRunner *sr = srunner_create(public_suite());
+ srunner_set_xml(sr, "CheckLog_xcb.xml");
+ srunner_run_all(sr, CK_NORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
--- /dev/null
+#include <check.h>
+#include <string.h>
+#include <stdlib.h>
+#include "check_suites.h"
+#include "xcb.h"
+#include "xcbext.h"
+
+/* xcb_parse_display tests {{{ */
+
+typedef enum test_type_t {
+ TEST_ARGUMENT, TEST_ENVIRONMENT, TEST_END
+} test_type_t;
+static const char *const test_string[] = { "", "via $DISPLAY " };
+
+static void parse_display_pass(const char *name, const char *host, const int display, const int screen)
+{
+ int success;
+ char *got_host;
+ int got_display, got_screen;
+ const char *argument = 0;
+ test_type_t test_type;
+
+ for(test_type = TEST_ARGUMENT; test_type != TEST_END; test_type++)
+ {
+ if(test_type == TEST_ARGUMENT)
+ {
+ argument = name;
+ putenv("DISPLAY=");
+ }
+ else if(test_type == TEST_ENVIRONMENT)
+ {
+ argument = 0;
+ setenv("DISPLAY", name, 1);
+ }
+
+ got_host = (char *) -1;
+ got_display = got_screen = -42;
+ mark_point();
+ success = xcb_parse_display(argument, &got_host, &got_display, &got_screen);
+ fail_unless(success, "unexpected parse failure %sfor '%s'", test_string[test_type], name);
+ fail_unless(strcmp(host, got_host) == 0, "parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
+ fail_unless(display == got_display, "parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
+ fail_unless(screen == got_screen, "parse %sproduced unexpected screen '%d' for '%s': expected '%d'", test_string[test_type], got_screen, name, screen);
+
+ got_host = (char *) -1;
+ got_display = got_screen = -42;
+ mark_point();
+ success = xcb_parse_display(argument, &got_host, &got_display, 0);
+ fail_unless(success, "unexpected screenless parse failure %sfor '%s'", test_string[test_type], name);
+ fail_unless(strcmp(host, got_host) == 0, "screenless parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
+ fail_unless(display == got_display, "screenless parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
+ }
+ putenv("DISPLAY=");
+}
+
+static void parse_display_fail(const char *name)
+{
+ int success;
+ char *got_host;
+ int got_display, got_screen;
+ const char *argument = 0;
+ test_type_t test_type;
+
+ for(test_type = TEST_ARGUMENT; test_type != TEST_END; test_type++)
+ {
+ if(test_type == TEST_ARGUMENT)
+ {
+ argument = name;
+ putenv("DISPLAY=");
+ }
+ else if(test_type == TEST_ENVIRONMENT)
+ {
+ if (!name) break;
+ argument = 0;
+ setenv("DISPLAY", name, 1);
+ }
+
+ got_host = (char *) -1;
+ got_display = got_screen = -42;
+ mark_point();
+ success = xcb_parse_display(argument, &got_host, &got_display, &got_screen);
+ fail_unless(!success, "unexpected parse success %sfor '%s'", test_string[test_type], name);
+ fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
+ fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
+ fail_unless(got_screen == -42, "screen changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_screen);
+
+ got_host = (char *) -1;
+ got_display = got_screen = -42;
+ mark_point();
+ success = xcb_parse_display(argument, &got_host, &got_display, 0);
+ fail_unless(!success, "unexpected screenless parse success %sfor '%s'", test_string[test_type], name);
+ fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
+ fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
+ }
+ putenv("DISPLAY=");
+}
+
+START_TEST(parse_display_unix)
+{
+ parse_display_pass(":0", "", 0, 0);
+ parse_display_pass(":1", "", 1, 0);
+ parse_display_pass(":0.1", "", 0, 1);
+}
+END_TEST
+
+START_TEST(parse_display_ip)
+{
+ parse_display_pass("x.org:0", "x.org", 0, 0);
+ parse_display_pass("expo:0", "expo", 0, 0);
+ parse_display_pass("bigmachine:1", "bigmachine", 1, 0);
+ parse_display_pass("hydra:0.1", "hydra", 0, 1);
+}
+END_TEST
+
+START_TEST(parse_display_ipv4)
+{
+ parse_display_pass("198.112.45.11:0", "198.112.45.11", 0, 0);
+ parse_display_pass("198.112.45.11:0.1", "198.112.45.11", 0, 1);
+}
+END_TEST
+
+START_TEST(parse_display_ipv6)
+{
+ parse_display_pass(":::0", "::", 0, 0);
+ parse_display_pass("1:::0", "1::", 0, 0);
+ parse_display_pass("::1:0", "::1", 0, 0);
+ parse_display_pass("::1:0.1", "::1", 0, 1);
+ parse_display_pass("::127.0.0.1:0", "::127.0.0.1", 0, 0);
+ parse_display_pass("::ffff:127.0.0.1:0", "::ffff:127.0.0.1", 0, 0);
+ parse_display_pass("2002:83fc:d052::1:0", "2002:83fc:d052::1", 0, 0);
+ parse_display_pass("2002:83fc:d052::1:0.1", "2002:83fc:d052::1", 0, 1);
+ parse_display_pass("[::]:0", "[::]", 0, 0);
+ parse_display_pass("[1::]:0", "[1::]", 0, 0);
+ parse_display_pass("[::1]:0", "[::1]", 0, 0);
+ parse_display_pass("[::1]:0.1", "[::1]", 0, 1);
+ parse_display_pass("[::127.0.0.1]:0", "[::127.0.0.1]", 0, 0);
+ parse_display_pass("[::ffff:127.0.0.1]:0", "[::ffff:127.0.0.1]", 0, 0);
+ parse_display_pass("[2002:83fc:d052::1]:0", "[2002:83fc:d052::1]", 0, 0);
+ parse_display_pass("[2002:83fc:d052::1]:0.1", "[2002:83fc:d052::1]", 0, 1);
+}
+END_TEST
+
+START_TEST(parse_display_decnet)
+{
+ parse_display_pass("myws::0", "myws:", 0, 0);
+ parse_display_pass("big::1", "big:", 1, 0);
+ parse_display_pass("hydra::0.1", "hydra:", 0, 1);
+}
+END_TEST
+
+START_TEST(parse_display_negative)
+{
+ parse_display_fail(0);
+ parse_display_fail("");
+ parse_display_fail(":");
+ parse_display_fail("::");
+ parse_display_fail(":::");
+ parse_display_fail(":.");
+ parse_display_fail(":a");
+ parse_display_fail(":a.");
+ parse_display_fail(":0.");
+ parse_display_fail(":.a");
+ parse_display_fail(":.0");
+ parse_display_fail(":0.a");
+ parse_display_fail(":0.0.");
+
+ parse_display_fail("127.0.0.1");
+ parse_display_fail("127.0.0.1:");
+ parse_display_fail("127.0.0.1::");
+ parse_display_fail("::127.0.0.1");
+ parse_display_fail("::127.0.0.1:");
+ parse_display_fail("::127.0.0.1::");
+ parse_display_fail("::ffff:127.0.0.1");
+ parse_display_fail("::ffff:127.0.0.1:");
+ parse_display_fail("::ffff:127.0.0.1::");
+ parse_display_fail("localhost");
+ parse_display_fail("localhost:");
+ parse_display_fail("localhost::");
+}
+END_TEST
+
+/* }}} */
+
+static void popcount_eq(uint32_t bits, int count)
+{
+ fail_unless(xcb_popcount(bits) == count, "unexpected popcount(%08x) != %d", bits, count);
+}
+
+START_TEST(popcount)
+{
+ uint32_t mask;
+ int count;
+
+ for (mask = 0xffffffff, count = 32; count >= 0; mask >>= 1, --count) {
+ popcount_eq(mask, count);
+ }
+ for (mask = 0x80000000; mask; mask >>= 1) {
+ popcount_eq(mask, 1);
+ }
+ for (mask = 0x80000000; mask > 1; mask >>= 1) {
+ popcount_eq(mask | 1, 2);
+ }
+}
+END_TEST
+
+Suite *public_suite(void)
+{
+ Suite *s = suite_create("Public API");
+ putenv("DISPLAY=");
+ suite_add_test(s, parse_display_unix, "xcb_parse_display unix");
+ suite_add_test(s, parse_display_ip, "xcb_parse_display ip");
+ suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4");
+ suite_add_test(s, parse_display_ipv6, "xcb_parse_display ipv6");
+ suite_add_test(s, parse_display_decnet, "xcb_parse_display decnet");
+ suite_add_test(s, parse_display_negative, "xcb_parse_display negative");
+ suite_add_test(s, popcount, "xcb_popcount");
+ return s;
+}
--- /dev/null
+#include <check.h>
+
+void suite_add_test(Suite *s, TFun tf, const char *name);
+Suite *public_suite(void);
--- /dev/null
+
+api_conv.pl:
+------------
+
+ Description: used to convert old XCB names in camel case to lower
+ case names.
+
+ Usage:
+
+ * for several files:
+
+perl -i xcb/tools/api_conv.pl xcb/tools/constants <file1> <file2> ...
+
+ * for a directory:
+
+find dir -name '*.[ch]' -exec perl -i xcb/tools/api_conv.pl xcb/tools/constants {} +
+
--- /dev/null
+#!/usr/bin/perl -plw
+use strict;
+
+BEGIN {
+ %::const = map { $_ => 1 } (
+ # constants in xcb.h
+ "XCBNone",
+ "XCBCopyFromParent",
+ "XCBCurrentTime",
+ "XCBNoSymbol",
+ "XCBError",
+ "XCBReply",
+ # renamed constants
+ "XCBButtonAny",
+ "XCBButton1",
+ "XCBButton2",
+ "XCBButton3",
+ "XCBButton4",
+ "XCBButton5",
+ "XCBHostInsert",
+ "XCBHostDelete",
+ "XCBGlxGC_GL_CURRENT_BIT",
+ "XCBGlxGC_GL_POINT_BIT",
+ "XCBGlxGC_GL_LINE_BIT",
+ "XCBGlxGC_GL_POLYGON_BIT",
+ "XCBGlxGC_GL_POLYGON_STIPPLE_BIT",
+ "XCBGlxGC_GL_PIXEL_MODE_BIT",
+ "XCBGlxGC_GL_LIGHTING_BIT",
+ "XCBGlxGC_GL_FOG_BIT",
+ "XCBGlxGC_GL_DEPTH_BUFFER_BIT",
+ "XCBGlxGC_GL_ACCUM_BUFFER_BIT",
+ "XCBGlxGC_GL_STENCIL_BUFFER_BIT",
+ "XCBGlxGC_GL_VIEWPORT_BIT",
+ "XCBGlxGC_GL_TRANSFORM_BIT",
+ "XCBGlxGC_GL_ENABLE_BIT",
+ "XCBGlxGC_GL_COLOR_BUFFER_BIT",
+ "XCBGlxGC_GL_HINT_BIT",
+ "XCBGlxGC_GL_EVAL_BIT",
+ "XCBGlxGC_GL_LIST_BIT",
+ "XCBGlxGC_GL_TEXTURE_BIT",
+ "XCBGlxGC_GL_SCISSOR_BIT",
+ "XCBGlxGC_GL_ALL_ATTRIB_BITS",
+ "XCBGlxRM_GL_RENDER",
+ "XCBGlxRM_GL_FEEDBACK",
+ "XCBGlxRM_GL_SELECT",
+ );
+ open(CONST, shift) or die "failed to open constants list: $!";
+ while(<CONST>)
+ {
+ chomp;
+ die "invalid constant name: \"$_\"" unless /^XCB[A-Za-z0-9_]*$/;
+ $::const{$_} = 1;
+ }
+ close(CONST);
+}
+
+sub convert($$)
+{
+ local $_ = shift;
+ my ($fun) = @_;
+
+ return "xcb_generate_id" if /^xcb_[a-z0-9_]+_new$/ or /^XCB[A-Z0-9]+New$/;
+ return "uint$1_t" if /^CARD(8|16|32)$/;
+ return "int$1_t" if /^INT(8|16|32)$/;
+ return "uint8_t" if $_ eq 'BOOL' or $_ eq 'BYTE';
+ return $_ if /^[A-Z0-9]*_[A-Z0-9_]*$/ or !/^XCB(.+)/;
+ my $const = defined $::const{$_};
+ $_ = $1;
+
+ s/^(GX|RandR|XFixes|XP|XvMC|ScreenSaver)(.)/uc($1) . "_" . $2/e unless /^ScreenSaver(?:Reset|Active)$/;
+
+ my %abbr = (
+ "Iter" => "iterator",
+ "Req" => "request",
+ "Rep" => "reply",
+ );
+
+ my $word;
+ if(/CHAR2B|INT64|FLOAT32|FLOAT64|BOOL32|STRING8/)
+ {
+ $word = qr/[A-Z](?:[A-Z0-9]*|[a-z]*)/;
+ } else {
+ $word = qr/[0-9]+|[A-Z](?:[A-Z]*|[a-z]*)/;
+ }
+ s/($word)_?(?=[0-9A-Z]|$)/"_" . ($abbr{$1} or lc($1))/eg;
+
+ s/^_shape_shape_/_shape_/;
+ s/^_xf_?86_dri/_xf86dri/;
+ $_ = "_family_decnet" if $_ eq "_family_de_cnet";
+ return "XCB" . uc($_) if $const;
+
+ $_ .= "_t" unless $fun or /_id$/;
+
+ return "xcb" . $_;
+}
+
+s/^(\s*#\s*include\s*<)X11\/XCB\//$1xcb\//;
+s/([_A-Za-z][_A-Za-z0-9]*)([ \t]*\()?/convert($1, defined $2) . ($2 or "")/eg;
--- /dev/null
+XCBCompositeRedirectAutomatic
+XCBCompositeRedirectManual
+XCBDamageReportLevelRawRectangles
+XCBDamageReportLevelDeltaRectangles
+XCBDamageReportLevelBoundingBox
+XCBDamageReportLevelNonEmpty
+XCBDamageBadDamage
+XCBDamageNotify
+XCBGlxGeneric
+XCBGlxBadContext
+XCBGlxBadContextState
+XCBGlxBadDrawable
+XCBGlxBadPixmap
+XCBGlxBadContextTag
+XCBGlxBadCurrentWindow
+XCBGlxBadRenderRequest
+XCBGlxBadLargeRequest
+XCBGlxUnsupportedPrivateRequest
+XCBGlxBadFBConfig
+XCBGlxBadPbuffer
+XCBGlxBadCurrentDrawable
+XCBGlxBadWindow
+XCBGlxPbufferClobber
+XCBGlxPBCETDamaged
+XCBGlxPBCETSaved
+XCBGlxPBCDTWindow
+XCBGlxPBCDTPbuffer
+XCBGlxGC_GL_CURRENT_BIT
+XCBGlxGC_GL_POINT_BIT
+XCBGlxGC_GL_LINE_BIT
+XCBGlxGC_GL_POLYGON_BIT
+XCBGlxGC_GL_POLYGON_STIPPLE_BIT
+XCBGlxGC_GL_PIXEL_MODE_BIT
+XCBGlxGC_GL_LIGHTING_BIT
+XCBGlxGC_GL_FOG_BIT
+XCBGlxGC_GL_DEPTH_BUFFER_BIT
+XCBGlxGC_GL_ACCUM_BUFFER_BIT
+XCBGlxGC_GL_STENCIL_BUFFER_BIT
+XCBGlxGC_GL_VIEWPORT_BIT
+XCBGlxGC_GL_TRANSFORM_BIT
+XCBGlxGC_GL_ENABLE_BIT
+XCBGlxGC_GL_COLOR_BUFFER_BIT
+XCBGlxGC_GL_HINT_BIT
+XCBGlxGC_GL_EVAL_BIT
+XCBGlxGC_GL_LIST_BIT
+XCBGlxGC_GL_TEXTURE_BIT
+XCBGlxGC_GL_SCISSOR_BIT
+XCBGlxGC_GL_ALL_ATTRIB_BITS
+XCBGlxRM_GL_RENDER
+XCBGlxRM_GL_FEEDBACK
+XCBGlxRM_GL_SELECT
+XCBRandRRotationRotate_0
+XCBRandRRotationRotate_90
+XCBRandRRotationRotate_180
+XCBRandRRotationRotate_270
+XCBRandRRotationReflect_X
+XCBRandRRotationReflect_Y
+XCBRandRSetConfigSuccess
+XCBRandRSetConfigInvalidConfigTime
+XCBRandRSetConfigInvalidTime
+XCBRandRSetConfigFailed
+XCBRandRSMScreenChangeNotify
+XCBRandRScreenChangeNotify
+XCBRecordHTypeFromServerTime
+XCBRecordHTypeFromClientTime
+XCBRecordHTypeFromClientSequence
+XCBRecordCSCurrentClients
+XCBRecordCSFutureClients
+XCBRecordCSAllClients
+XCBRecordBadContext
+XCBRenderPictTypeIndexed
+XCBRenderPictTypeDirect
+XCBRenderPictOpClear
+XCBRenderPictOpSrc
+XCBRenderPictOpDst
+XCBRenderPictOpOver
+XCBRenderPictOpOverReverse
+XCBRenderPictOpIn
+XCBRenderPictOpInReverse
+XCBRenderPictOpOut
+XCBRenderPictOpOutReverse
+XCBRenderPictOpAtop
+XCBRenderPictOpAtopReverse
+XCBRenderPictOpXor
+XCBRenderPictOpAdd
+XCBRenderPictOpSaturate
+XCBRenderPictOpDisjointClear
+XCBRenderPictOpDisjointSrc
+XCBRenderPictOpDisjointDst
+XCBRenderPictOpDisjointOver
+XCBRenderPictOpDisjointOverReverse
+XCBRenderPictOpDisjointIn
+XCBRenderPictOpDisjointInReverse
+XCBRenderPictOpDisjointOut
+XCBRenderPictOpDisjointOutReverse
+XCBRenderPictOpDisjointAtop
+XCBRenderPictOpDisjointAtopReverse
+XCBRenderPictOpDisjointXor
+XCBRenderPictOpConjointClear
+XCBRenderPictOpConjointSrc
+XCBRenderPictOpConjointDst
+XCBRenderPictOpConjointOver
+XCBRenderPictOpConjointOverReverse
+XCBRenderPictOpConjointIn
+XCBRenderPictOpConjointInReverse
+XCBRenderPictOpConjointOut
+XCBRenderPictOpConjointOutReverse
+XCBRenderPictOpConjointAtop
+XCBRenderPictOpConjointAtopReverse
+XCBRenderPictOpConjointXor
+XCBRenderPolyEdgeSharp
+XCBRenderPolyEdgeSmooth
+XCBRenderPolyModePrecise
+XCBRenderPolyModeImprecise
+XCBRenderCPRepeat
+XCBRenderCPAlphaMap
+XCBRenderCPAlphaXOrigin
+XCBRenderCPAlphaYOrigin
+XCBRenderCPClipXOrigin
+XCBRenderCPClipYOrigin
+XCBRenderCPClipMask
+XCBRenderCPGraphicsExposure
+XCBRenderCPSubwindowMode
+XCBRenderCPPolyEdge
+XCBRenderCPPolyMode
+XCBRenderCPDither
+XCBRenderCPComponentAlpha
+XCBRenderSubPixelUnknown
+XCBRenderSubPixelHorizontalRGB
+XCBRenderSubPixelHorizontalBGR
+XCBRenderSubPixelVerticalRGB
+XCBRenderSubPixelVerticalBGR
+XCBRenderSubPixelNone
+XCBRenderPictFormat
+XCBRenderPicture
+XCBRenderPictOp
+XCBRenderGlyphSet
+XCBRenderGlyph
+XCBScreenSaverKindBlanked
+XCBScreenSaverKindInternal
+XCBScreenSaverKindExternal
+XCBScreenSaverEventNotifyMask
+XCBScreenSaverEventCycleMask
+XCBScreenSaverStateOff
+XCBScreenSaverStateOn
+XCBScreenSaverStateCycle
+XCBScreenSaverStateDisabled
+XCBScreenSaverNotify
+XCBShapeSOSet
+XCBShapeSOUnion
+XCBShapeSOIntersect
+XCBShapeSOSubtract
+XCBShapeSOInvert
+XCBShapeSKBounding
+XCBShapeSKClip
+XCBShapeSKInput
+XCBShapeNotify
+XCBShmCompletion
+XCBShmBadSeg
+XCBSyncALARMSTATEActive
+XCBSyncALARMSTATEInactive
+XCBSyncALARMSTATEDestroyed
+XCBSyncTESTTYPEPositiveTransition
+XCBSyncTESTTYPENegativeTransition
+XCBSyncTESTTYPEPositiveComparison
+XCBSyncTESTTYPENegativeComparison
+XCBSyncVALUETYPEAbsolute
+XCBSyncVALUETYPERelative
+XCBSyncCACounter
+XCBSyncCAValueType
+XCBSyncCAValue
+XCBSyncCATestType
+XCBSyncCADelta
+XCBSyncCAEvents
+XCBSyncCounter
+XCBSyncAlarm
+XCBSyncCounterNotify
+XCBSyncAlarmNotify
+XCBXevieDatatypeUnmodified
+XCBXevieDatatypeModified
+XCBXFixesSaveSetModeInsert
+XCBXFixesSaveSetModeDelete
+XCBXFixesSaveSetTargetNearest
+XCBXFixesSaveSetTargetRoot
+XCBXFixesSaveSetMappingMap
+XCBXFixesSaveSetMappingUnmap
+XCBXFixesSelectionEventSetSelectionOwner
+XCBXFixesSelectionEventSelectionWindowDestroy
+XCBXFixesSelectionEventSelectionClientClose
+XCBXFixesSelectionEventMaskSetSelectionOwner
+XCBXFixesSelectionEventMaskSelectionWindowDestroy
+XCBXFixesSelectionEventMaskSelectionClientClose
+XCBXFixesSelectionNotify
+XCBXFixesCursorNotifyDisplayCursor
+XCBXFixesCursorNotifyMaskDisplayCursor
+XCBXFixesCursorNotify
+XCBXFixesBadRegion
+XCBXPGetDocFinished
+XCBXPGetDocSecondConsumer
+XCBXPEvMaskNoEventMask
+XCBXPEvMaskPrintMask
+XCBXPEvMaskAttributeMask
+XCBXPDetailStartJobNotify
+XCBXPDetailEndJobNotify
+XCBXPDetailStartDocNotify
+XCBXPDetailEndDocNotify
+XCBXPDetailStartPageNotify
+XCBXPDetailEndPageNotify
+XCBXPAttrJobAttr
+XCBXPAttrDocAttr
+XCBXPAttrPageAttr
+XCBXPAttrPrinterAttr
+XCBXPAttrServerAttr
+XCBXPAttrMediumAttr
+XCBXPAttrSpoolerAttr
+XCBXPNotify
+XCBXPAttributNotify
+XCBXPBadContext
+XCBXPBadSequence
+XCBXvTypeInputMask
+XCBXvTypeOutputMask
+XCBXvTypeVideoMask
+XCBXvTypeStillMask
+XCBXvTypeImageMask
+XCBXvImageFormatInfoTypeRGB
+XCBXvImageFormatInfoTypeYUV
+XCBXvImageFormatInfoFormatPacked
+XCBXvImageFormatInfoFormatPlanar
+XCBXvAttributeFlagGettable
+XCBXvAttributeFlagSettable
+XCBXvBadPort
+XCBXvBadEncoding
+XCBXvBadControl
+XCBXvVideoNotify
+XCBXvPortNotify
+XCBTestCursorNone
+XCBTestCursorCurrent
+XCBVisualClassStaticGray
+XCBVisualClassGrayScale
+XCBVisualClassStaticColor
+XCBVisualClassPseudoColor
+XCBVisualClassTrueColor
+XCBVisualClassDirectColor
+XCBImageOrderLSBFirst
+XCBImageOrderMSBFirst
+XCBModMaskShift
+XCBModMaskLock
+XCBModMaskControl
+XCBModMask1
+XCBModMask2
+XCBModMask3
+XCBModMask4
+XCBModMask5
+XCBKeyPress
+XCBKeyRelease
+XCBButtonMask1
+XCBButtonMask2
+XCBButtonMask3
+XCBButtonMask4
+XCBButtonMask5
+XCBButtonMaskAny
+XCBButtonPress
+XCBButtonRelease
+XCBMotionNormal
+XCBMotionHint
+XCBMotionNotify
+XCBNotifyDetailAncestor
+XCBNotifyDetailVirtual
+XCBNotifyDetailInferior
+XCBNotifyDetailNonlinear
+XCBNotifyDetailNonlinearVirtual
+XCBNotifyDetailPointer
+XCBNotifyDetailPointerRoot
+XCBNotifyDetailNone
+XCBNotifyModeNormal
+XCBNotifyModeGrab
+XCBNotifyModeUngrab
+XCBNotifyModeWhileGrabbed
+XCBEnterNotify
+XCBLeaveNotify
+XCBFocusIn
+XCBFocusOut
+XCBKeymapNotify
+XCBExpose
+XCBGraphicsExposure
+XCBNoExposure
+XCBVisibilityUnobscured
+XCBVisibilityPartiallyObscured
+XCBVisibilityFullyObscured
+XCBVisibilityNotify
+XCBCreateNotify
+XCBDestroyNotify
+XCBUnmapNotify
+XCBMapNotify
+XCBMapRequest
+XCBReparentNotify
+XCBConfigureNotify
+XCBConfigureRequest
+XCBGravityNotify
+XCBResizeRequest
+XCBPlaceOnTop
+XCBPlaceOnBottom
+XCBCirculateNotify
+XCBCirculateRequest
+XCBPropertyNewValue
+XCBPropertyDelete
+XCBPropertyNotify
+XCBSelectionClear
+XCBSelectionRequest
+XCBSelectionNotify
+XCBColormapStateUninstalled
+XCBColormapStateInstalled
+XCBColormapNotify
+XCBClientMessage
+XCBMappingModifier
+XCBMappingKeyboard
+XCBMappingPointer
+XCBMappingNotify
+XCBRequest
+XCBValue
+XCBWindow
+XCBPixmap
+XCBAtom
+XCBCursor
+XCBFont
+XCBMatch
+XCBDrawable
+XCBAccess
+XCBAlloc
+XCBColormap
+XCBGContext
+XCBIDChoice
+XCBName
+XCBLength
+XCBImplementation
+XCBWindowClassCopyFromParent
+XCBWindowClassInputOutput
+XCBWindowClassInputOnly
+XCBCWBackPixmap
+XCBCWBackPixel
+XCBCWBorderPixmap
+XCBCWBorderPixel
+XCBCWBitGravity
+XCBCWWinGravity
+XCBCWBackingStore
+XCBCWBackingPlanes
+XCBCWBackingPixel
+XCBCWOverrideRedirect
+XCBCWSaveUnder
+XCBCWEventMask
+XCBCWDontPropagate
+XCBCWColormap
+XCBCWCursor
+XCBBackPixmapNone
+XCBBackPixmapParentRelative
+XCBGravityBitForget
+XCBGravityWinUnmap
+XCBGravityNorthWest
+XCBGravityNorth
+XCBGravityNorthEast
+XCBGravityWest
+XCBGravityCenter
+XCBGravityEast
+XCBGravitySouthWest
+XCBGravitySouth
+XCBGravitySouthEast
+XCBGravityStatic
+XCBBackingStoreNotUseful
+XCBBackingStoreWhenMapped
+XCBBackingStoreAlways
+XCBEventMaskNoEvent
+XCBEventMaskKeyPress
+XCBEventMaskKeyRelease
+XCBEventMaskButtonPress
+XCBEventMaskButtonRelease
+XCBEventMaskEnterWindow
+XCBEventMaskLeaveWindow
+XCBEventMaskPointerMotion
+XCBEventMaskPointerMotionHint
+XCBEventMaskButton1Motion
+XCBEventMaskButton2Motion
+XCBEventMaskButton3Motion
+XCBEventMaskButton4Motion
+XCBEventMaskButton5Motion
+XCBEventMaskButtonMotion
+XCBEventMaskKeymapState
+XCBEventMaskExposure
+XCBEventMaskVisibilityChange
+XCBEventMaskStructureNotify
+XCBEventMaskResizeRedirect
+XCBEventMaskSubstructureNotify
+XCBEventMaskSubstructureRedirect
+XCBEventMaskFocusChange
+XCBEventMaskPropertyChange
+XCBEventMaskColorMapChange
+XCBEventMaskOwnerGrabButton
+XCBMapStateUnmapped
+XCBMapStateUnviewable
+XCBMapStateViewable
+XCBSetModeInsert
+XCBSetModeDelete
+XCBConfigWindowX
+XCBConfigWindowY
+XCBConfigWindowWidth
+XCBConfigWindowHeight
+XCBConfigWindowBorderWidth
+XCBConfigWindowSibling
+XCBConfigWindowStackMode
+XCBStackModeAbove
+XCBStackModeBelow
+XCBStackModeTopIf
+XCBStackModeBottomIf
+XCBStackModeOpposite
+XCBCirculateRaiseLowest
+XCBCirculateLowerHighest
+XCBPropModeReplace
+XCBPropModePrepend
+XCBPropModeAppend
+XCBGetPropertyTypeAny
+XCBSendEventDestPointerWindow
+XCBSendEventDestItemFocus
+XCBGrabModeAsync
+XCBGrabModeSync
+XCBGrabStatusSuccess
+XCBGrabStatusAlreadyGrabbed
+XCBGrabStatusInvalidTime
+XCBGrabStatusNotViewable
+XCBGrabStatusFrozen
+XCBButtonAny
+XCBButton1
+XCBButton2
+XCBButton3
+XCBButton4
+XCBButton5
+XCBGrabAny
+XCBAllowAsyncPointer
+XCBAllowSyncPointer
+XCBAllowReplayPointer
+XCBAllowAsyncKeyboard
+XCBAllowSyncKeyboard
+XCBAllowReplayKeyboard
+XCBAllowAsyncBoth
+XCBAllowSyncBoth
+XCBInputFocusNone
+XCBInputFocusPointerRoot
+XCBInputFocusParent
+XCBFontDrawLeftToRight
+XCBFontDrawRightToLeft
+XCBGCFunction
+XCBGCPlaneMask
+XCBGCForeground
+XCBGCBackground
+XCBGCLineWidth
+XCBGCLineStyle
+XCBGCCapStyle
+XCBGCJoinStyle
+XCBGCFillStyle
+XCBGCFillRule
+XCBGCTile
+XCBGCStipple
+XCBGCTileStippleOriginX
+XCBGCTileStippleOriginY
+XCBGCFont
+XCBGCSubwindowMode
+XCBGCGraphicsExposures
+XCBGCClipOriginX
+XCBGCClipOriginY
+XCBGCClipMask
+XCBGCDashOffset
+XCBGCDashList
+XCBGCArcMode
+XCBGXclear
+XCBGXand
+XCBGXandReverse
+XCBGXcopy
+XCBGXandInverted
+XCBGXnoop
+XCBGXxor
+XCBGXor
+XCBGXnor
+XCBGXequiv
+XCBGXinvert
+XCBGXorReverse
+XCBGXcopyInverted
+XCBGXorInverted
+XCBGXnand
+XCBGXset
+XCBLineStyleSolid
+XCBLineStyleOnOffDash
+XCBLineStyleDoubleDash
+XCBCapStyleNotLast
+XCBCapStyleCap
+XCBCapStyleButt
+XCBCapStyleProjecting
+XCBJoinStyleMitre
+XCBJoinStyleRound
+XCBJoinStyleBevel
+XCBFillStyleSolid
+XCBFillStyleTiled
+XCBFillStyleStippled
+XCBFillStyleOpaqueStippled
+XCBFillRuleEvenOdd
+XCBFillRuleWinding
+XCBSubwindowModeClipByChildren
+XCBSubwindowModeIncludeInferiors
+XCBArcModeChord
+XCBArcModePieSlice
+XCBClipOrderingUnsorted
+XCBClipOrderingYSorted
+XCBClipOrderingYXSorted
+XCBClipOrderingYXBanded
+XCBCoordModeOrigin
+XCBCoordModePrevious
+XCBPolyShapeComplex
+XCBPolyShapeNonconvex
+XCBPolyShapeConvex
+XCBImageFormatXYBitmap
+XCBImageFormatXYPixmap
+XCBImageFormatZPixmap
+XCBColormapAllocNone
+XCBColormapAllocAll
+XCBColorFlagRed
+XCBColorFlagGreen
+XCBColorFlagBlue
+XCBQueryShapeOfLargestCursor
+XCBQueryShapeOfFastestTile
+XCBQueryShapeOfFastestStipple
+XCBKBKeyClickPercent
+XCBKBBellPercent
+XCBKBBellPitch
+XCBKBBellDuration
+XCBKBLed
+XCBKBLedMode
+XCBKBKey
+XCBKBAutoRepeatMode
+XCBLedModeOff
+XCBLedModeOn
+XCBAutoRepeatModeOff
+XCBAutoRepeatModeOn
+XCBAutoRepeatModeDefault
+XCBBlankingNotPreferred
+XCBBlankingPreferred
+XCBBlankingDefault
+XCBExposuresNotAllowed
+XCBExposuresAllowed
+XCBExposuresDefault
+XCBHostInsert
+XCBHostDelete
+XCBFamilyInternet
+XCBFamilyDECnet
+XCBFamilyChaos
+XCBFamilyServerInterpreted
+XCBFamilyInternet6
+XCBAccessControlDisable
+XCBAccessControlEnable
+XCBCloseDownDestroyAll
+XCBCloseDownRetainPermanent
+XCBCloseDownRetainTemporary
+XCBKillAllTemporary
+XCBScreenSaverReset
+XCBScreenSaverActive
+XCBMappingStatusSuccess
+XCBMappingStatusBusy
+XCBMappingStatusFailure
+XCBMapIndexShift
+XCBMapIndexLock
+XCBMapIndexControl
+XCBMapIndex1
+XCBMapIndex2
+XCBMapIndex3
+XCBMapIndex4
+XCBMapIndex5
+XCBAllPlanes
\ No newline at end of file
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Composite
+Description: XCB Composite Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb xcb-xfixes
+Libs: -L${libdir} -lxcb-composite
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Damage
+Description: XCB Damage Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb xcb-xfixes
+Libs: -L${libdir} -lxcb-damage
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB DPMS
+Description: XCB DPMS Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-dpms
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB DRI2
+Description: XCB DRI2 Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-dri2
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB GLX
+Description: XCB GLX Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-glx
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB RandR
+Description: XCB RandR Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-randr
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Record
+Description: XCB Record Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-record
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Render
+Description: XCB Render Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-render
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Res
+Description: XCB X-Resource Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-res
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Screensaver
+Description: XCB Screensaver Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-screensaver
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Shape
+Description: XCB Shape Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-shape
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Shm
+Description: XCB Shm Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-shm
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Sync
+Description: XCB Sync Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-sync
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Xevie
+Description: XCB Xevie Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xevie
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB XFree86-DRI
+Description: XCB XFree86-DRI Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xf86dri
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB XFixes
+Description: XCB XFixes Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb xcb-render xcb-shape
+Libs: -L${libdir} -lxcb-xfixes
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Xinerama
+Description: XCB Xinerama Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xinerama
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB XInput
+Description: XCB XInput Extension (EXPERIMENTAL)
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xinput
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Xprint
+Description: XCB Xprint Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xprint
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB SELinux
+Description: XCB SELinux Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xselinux
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB XTEST
+Description: XCB XTEST Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xtest
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Xv
+Description: XCB Xv Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb xcb-shm
+Libs: -L${libdir} -lxcb-xv
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB XvMC
+Description: XCB XvMC Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb xcb-xv
+Libs: -L${libdir} -lxcb-xvmc
+Cflags: -I${includedir}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+xcbproto_version=@XCBPROTO_VERSION@
+
+Name: XCB
+Description: X-protocol C Binding
+Version: @PACKAGE_VERSION@
+Requires.private: @NEEDED@
+Libs: -L${libdir} -lxcb
+Libs.private: @LIBS@
+Cflags: -I${includedir}