From 8542b45178e4cb4e9ed24a5ce0fafb0742894e8d Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 21 Aug 2012 18:04:11 +0900 Subject: upload tizen2.0 source --- ChangeLog | 855 +++++++++++++++++++++++ Doxyfile | 1305 ----------------------------------- INSTALL | 291 ++++++++ Makefile.am | 23 +- NEWS | 12 + README | 42 +- acinclude.m4 | 173 ----- atom/Makefile.am | 29 - atom/atomlist.m4 | 71 -- atom/atoms.gperf.m4 | 202 ------ atom/xcb-atom.pc.in | 11 - atom/xcb_atom.h.m4 | 50 -- aux/Makefile.am | 16 - aux/xcb-aux.pc.in | 11 - aux/xcb_aux.c | 374 ---------- aux/xcb_aux.h | 214 ------ aux/xcb_bitops.h | 212 ------ configure.ac | 116 +--- depcomp | 630 ----------------- event/Makefile.am | 17 - event/event.c | 337 --------- event/xcb-event.pc.in | 11 - event/xcb_event.h | 247 ------- gendoc | 7 - icccm/Makefile.am | 18 - icccm/icccm.c | 726 ------------------- icccm/xcb-icccm.pc.in | 11 - icccm/xcb_icccm.h | 916 ------------------------ image/Makefile.am | 44 -- image/test.xbm | 471 ------------- image/test_bitmap.c | 169 ----- image/test_formats.c | 202 ------ image/test_swap.c | 239 ------- image/test_xcb_image.c | 226 ------ image/test_xcb_image_shm.c | 183 ----- image/xcb-image.pc.in | 11 - image/xcb_image.c | 1009 --------------------------- image/xcb_image.h | 630 ----------------- image/xcb_pixel.h | 171 ----- install-sh | 520 -------------- keysyms/Makefile.am | 17 - keysyms/keysyms.c | 487 ------------- keysyms/xcb-keysyms.pc.in | 11 - keysyms/xcb_keysyms.h | 71 -- m4/ax_compare_version.m4 | 174 +++++ m4/xcb_util_common.m4 | 44 ++ m4/xcb_util_m4_with_include_path.m4 | 24 + missing | 376 ---------- packaging/xcb-util.spec | 405 +---------- property/Makefile.am | 17 - property/property.c | 147 ---- property/xcb-property.pc.in | 11 - property/xcb_property.h | 161 ----- renderutil/Makefile.am | 14 - renderutil/cache.c | 234 ------- renderutil/glyph.c | 287 -------- renderutil/util.c | 251 ------- renderutil/xcb-renderutil.pc.in | 11 - renderutil/xcb_renderutil.h | 142 ---- reply/Makefile.am | 25 - reply/reply.c | 146 ---- reply/test_reply.c | 86 --- reply/xcb-reply.pc.in | 11 - reply/xcb_reply.h | 122 ---- src/Makefile.am | 33 + src/atomlist.m4 | 71 ++ src/atoms.c | 690 ++++++++++++++++++ src/atoms.gperf.m4 | 121 ++++ src/event.c | 257 +++++++ src/xcb_atom.h | 21 + src/xcb_atom.h.m4 | 21 + src/xcb_aux.c | 374 ++++++++++ src/xcb_aux.h | 214 ++++++ src/xcb_bitops.h | 212 ++++++ src/xcb_event.h | 90 +++ src/xcb_util.h | 8 + xcb-atom.pc.in | 11 + xcb-aux.pc.in | 11 + xcb-event.pc.in | 11 + xcb-renderutil.pc.in | 11 + xcb-util-common.h | 37 - xcb-util.pc.in | 11 + 82 files changed, 3658 insertions(+), 12622 deletions(-) create mode 100644 ChangeLog delete mode 100644 Doxyfile create mode 100644 INSTALL create mode 100644 NEWS delete mode 100644 acinclude.m4 delete mode 100644 atom/Makefile.am delete mode 100644 atom/atomlist.m4 delete mode 100644 atom/atoms.gperf.m4 delete mode 100644 atom/xcb-atom.pc.in delete mode 100644 atom/xcb_atom.h.m4 delete mode 100644 aux/Makefile.am delete mode 100644 aux/xcb-aux.pc.in delete mode 100644 aux/xcb_aux.c delete mode 100644 aux/xcb_aux.h delete mode 100644 aux/xcb_bitops.h delete mode 100755 depcomp delete mode 100644 event/Makefile.am delete mode 100644 event/event.c delete mode 100644 event/xcb-event.pc.in delete mode 100644 event/xcb_event.h delete mode 100644 gendoc delete mode 100644 icccm/Makefile.am delete mode 100644 icccm/icccm.c delete mode 100644 icccm/xcb-icccm.pc.in delete mode 100644 icccm/xcb_icccm.h delete mode 100644 image/Makefile.am delete mode 100644 image/test.xbm delete mode 100644 image/test_bitmap.c delete mode 100644 image/test_formats.c delete mode 100644 image/test_swap.c delete mode 100644 image/test_xcb_image.c delete mode 100644 image/test_xcb_image_shm.c delete mode 100644 image/xcb-image.pc.in delete mode 100644 image/xcb_image.c delete mode 100644 image/xcb_image.h delete mode 100644 image/xcb_pixel.h delete mode 100755 install-sh delete mode 100644 keysyms/Makefile.am delete mode 100644 keysyms/keysyms.c delete mode 100644 keysyms/xcb-keysyms.pc.in delete mode 100644 keysyms/xcb_keysyms.h create mode 100644 m4/ax_compare_version.m4 create mode 100644 m4/xcb_util_common.m4 create mode 100644 m4/xcb_util_m4_with_include_path.m4 delete mode 100755 missing delete mode 100644 property/Makefile.am delete mode 100644 property/property.c delete mode 100644 property/xcb-property.pc.in delete mode 100644 property/xcb_property.h delete mode 100644 renderutil/Makefile.am delete mode 100644 renderutil/cache.c delete mode 100644 renderutil/glyph.c delete mode 100644 renderutil/util.c delete mode 100644 renderutil/xcb-renderutil.pc.in delete mode 100644 renderutil/xcb_renderutil.h delete mode 100644 reply/Makefile.am delete mode 100644 reply/reply.c delete mode 100644 reply/test_reply.c delete mode 100644 reply/xcb-reply.pc.in delete mode 100644 reply/xcb_reply.h create mode 100644 src/Makefile.am create mode 100644 src/atomlist.m4 create mode 100644 src/atoms.c create mode 100644 src/atoms.gperf.m4 create mode 100644 src/event.c create mode 100644 src/xcb_atom.h create mode 100644 src/xcb_atom.h.m4 create mode 100644 src/xcb_aux.c create mode 100644 src/xcb_aux.h create mode 100644 src/xcb_bitops.h create mode 100644 src/xcb_event.h create mode 100644 src/xcb_util.h create mode 100644 xcb-atom.pc.in create mode 100644 xcb-aux.pc.in create mode 100644 xcb-event.pc.in create mode 100644 xcb-renderutil.pc.in delete mode 100644 xcb-util-common.h create mode 100644 xcb-util.pc.in diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..3248a22 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,855 @@ +commit 8120792a02898625ed344828ad378b54b308e029 +Author: Arnaud Fontaine +Date: Tue Apr 26 01:30:17 2011 +0900 + + Release 0.3.8 + + Signed-off-by: Arnaud Fontaine + +commit 9c9d66a4dbe71328b9e38dc6d45b99eb06d19553 +Author: Arnaud Fontaine +Date: Tue Apr 26 01:30:13 2011 +0900 + + Fix package name + + Signed-off-by: Arnaud Fontaine + +commit eb0b55aa4ea037ebbe76c5820c3b1f4be30fcd33 +Author: Dirk Wallenstein +Date: Tue Apr 5 09:58:28 2011 +0200 + + Use an absolute URL for the m4 submodule + + A relative submodule URL requires m4 duplicates relative to every fork or local + mirror of this module. To select a different protocol with an absolute + submodule URL, the url..insteadOf configuration option can be used. + + Signed-off-by: Dirk Wallenstein + Reviewed-by: Arnaud Fontaine + Reviewed-by: Gaetan Nadon + +commit 4824b7dc328751dcfc48a3c2ae0f2be3df217ebd +Author: Jon TURNEY +Date: Tue Mar 22 15:34:46 2011 +0000 + + Link with -no-undefined + + Use -no-undefined to assure libtool that the library has no unresolved + symbols at link time, so that libtool will build a shared library for + platforms require that all symbols are resolved when the library is linked. + + Signed-off-by: Jon TURNEY + Acked-by: Julien Cristau + Reviewed-by: Arnaud Fontaine + +commit fd626329982cc2766e5a85a75ea2800b7aa3f114 +Author: Gaetan Nadon +Date: Thu Mar 10 19:50:36 2011 -0500 + + pkg-config files: remove LIBS which is unrequired and undesirable + + LIBS is not supplied by the package configuration, it may be anything + the builder sets through the command line. Only -lxcb-util is needed. + + Signed-off-by: Gaetan Nadon + Reviewed-by: Arnaud Fontaine + +commit 363622a64830c75ee1c014f49f72c698a390f24d +Author: Gaetan Nadon +Date: Thu Mar 10 19:50:35 2011 -0500 + + Remove the Doxyfile which is unused, out dated and wrong. + + Signed-off-by: Gaetan Nadon + Reviewed-by: Arnaud Fontaine + +commit ca5b57231c0e9a3d4eda3530c4973323ed7f6977 +Author: Gaetan Nadon +Date: Thu Mar 10 19:50:35 2011 -0500 + + Fix distcheck due to xcb_atom.h + + Make does not see this target as being located in the builddir. + The main issue is that "built source" is not build in the directory. + + Rather than investing efforts in workarounds, this patch + builds the library the same way all other xorg libraries are built. + + Signed-off-by: Gaetan Nadon + Reviewed-by: Arnaud Fontaine + +commit 0de786c46a81fa10e07ad77ff0992a44abe4ac2b +Author: Gaetan Nadon +Date: Sun Mar 6 17:52:44 2011 -0500 + + config: generate ChangeLog and INSTALL + + By copying a snippet of Makefile for xorg modules. + One side-effect is that Makefile.in is no longer + deleted on maintainer clean. This should never be done as + it leaves your configuration in a half-broken state. + + Signed-off-by: Gaetan Nadon + Signed-off-by: Arnaud Fontaine + +commit 14747e0ef8dfb6668e2bb2e8a6b0c9ef2dace7b3 +Author: Gaetan Nadon +Date: Sun Mar 6 17:52:43 2011 -0500 + + config: use the default xorg .gitignore file + + This will save future maintenance when module structure/tools change. + This patch depends on the util-common-m4 submodule patch in the m4 path + + Signed-off-by: Gaetan Nadon + Signed-off-by: Arnaud Fontaine + +commit 02289cab0b802a1d21fc9d480176e83b36e566b7 +Author: Arnaud Fontaine +Date: Sat Sep 4 17:42:12 2010 +0100 + + Bump version to 0.3.8 + +commit 4010e925c7afe0c38dc20a364bf6fc41c99f6da1 +Author: Arnaud Fontaine +Date: Sat Sep 4 17:27:52 2010 +0100 + + Remove useless xcb_atom_get_fast*() and xcb_atom_get_name(). + + These functions and their types would require to write their unchecked + equivalent however it's not worth the effort when considering that + they only hide InternAtom request/reply and nothing else. + +commit 00a192d88d96bc838366e1541eab80fa9ecd23b3 +Author: Arnaud Fontaine +Date: Sat Sep 4 17:20:55 2010 +0100 + + Remove synchronous xcb_atom_get() + +commit 2f0334b3eb49fa3a0d6daf6b9dde10e480a5c59f +Author: Arnaud Fontaine +Date: Sat Sep 4 17:18:02 2010 +0100 + + Remove deprecated atoms. + + Atoms defined in this library has been moved to xproto and marked as + deprecated almost one year ago. + +commit 118a3c86b3d3b2fab20f365e4a5703e40ad2e1b1 +Author: Arnaud Fontaine +Date: Mon Aug 9 15:47:02 2010 -0500 + + Create a single shared library and header file and reset SONAME + +commit d57825bee26d57625fe6629b44b33506894b9b6d +Author: Arnaud Fontaine +Date: Sat Sep 4 13:15:42 2010 +0100 + + Split up atom, aux event into their own repository + +commit 81c62e7a04213abefa1ea82819887aaaa3c31a74 +Author: Jamey Sharp +Date: Thu Jun 24 10:48:35 2010 -0700 + + Delete callback-based APIs for events, properties, and replies. + + They are poorly designed and not terribly useful. I wrote the original + versions of these libraries for demonstration purposes and would like to + actively discourage anyone from actually using them. + + After deleting the callback-based APIs, there was nothing interesting + left in property or reply, so those libraries are deleted outright. The + event library is no longer particularly related to event handling, but + that's a problem for another commit. + + The icccm library had some simple hooks for integrating with the + property library, which are precisely as useful as the property library + itself, so I deleted them too. (Arnaud suggested this in + .) + + Since the icccm and event libraries have changed interfaces, this commit + bumps their SONAME versions. + + Signed-off-by: Jamey Sharp + Reviewed-by: Mikhail Gusarov + Reviewed-by: Josh Triplett + Acked-by: Julien Cristau + +commit 16dd0d5a26b6efc8ed49daa56c9006a0abcc3f53 +Author: Jamey Sharp +Date: Thu Jun 24 11:06:48 2010 -0700 + + Delete redundant core-protocol error codes. + + XCB already defines the error codes, though with unfortunate names. The + following sed replacements should correct any code that was using these + definitions: + + s/\/0/g + s/\/XCB_COLORMAP/g + s/\/XCB_G_CONTEXT/g + s/\ + +commit 9139e56dfc3d9a66ab41df2032652aca58f32a77 +Author: Alan Coopersmith +Date: Mon Jun 14 13:49:09 2010 -0700 + + Rename XCB_EVENT_ERROR_SUCESS to XCB_EVENT_ERROR_SUCCESS + + Signed-off-by: Alan Coopersmith + Signed-off-by: Jamey Sharp + +commit 7a5ec0c175043d2b6c7a5e8fb381754884c141a2 +Author: Alan Coopersmith +Date: Mon Jun 14 13:49:08 2010 -0700 + + Fix typos in various header comments + + Signed-off-by: Alan Coopersmith + Signed-off-by: Jamey Sharp + +commit 2cbc3fcce36c2f5b2c5baec39bea26744bedd4fa +Author: Arnaud Fontaine +Date: Thu Feb 11 14:45:11 2010 +0000 + + Add AM_MAINTAINER_MODE for vendors + +commit bb143c54e578f69f33dab39fbdc62d2e9bb806cc +Author: Peter Harris +Date: Fri Nov 6 15:52:42 2009 -0500 + + Deprecate namespaceless pre-defined atoms + + Signed-off-by: Peter Harris + +commit 2ac7acd95bc775af21f65d8c5426e92d28780ab8 +Author: Jon TURNEY +Date: Tue Oct 20 18:17:46 2009 +0100 + + Update autogen.sh to one that does builddir != srcdir + +commit ee40bb3b6a7c5c69c8693a573a459484a24a49d1 +Author: Arnaud Fontaine +Date: Fri Sep 25 13:08:15 2009 +0100 + + Bump version to 0.3.7 + +commit 60766d8a99cc67df7aa84d6e242f738d38c21938 +Author: Arnaud Fontaine +Date: Mon Aug 3 17:18:41 2009 +0200 + + Bump version to 0.3.6 + +commit 9ce2a1868f4992b3854400348dfd1dc59a3acf11 +Author: Arnaud Fontaine +Date: Wed Jul 15 16:26:56 2009 +0100 + + event: fix compiler warning due to missing include for memset + +commit 17cfe28823085af5d7e174e77482e9157bdbe6d9 +Author: Arnaud Fontaine +Date: Wed Jul 15 16:23:41 2009 +0100 + + event: update to libxcb 1.4 + + Remove useless macros to get error information because libxcb 1.4 now + provides additional fields (major_opcode, minor_opcode and + resource_id) like Xlib. + +commit 5755a6ea3f5d0b92ddfccd2439d802ea0af70dc8 +Author: Arnaud Fontaine +Date: Wed Jun 3 20:50:32 2009 +0900 + + Check for ssize_t in configure for xcb-util-common.h + +commit 214afd4127898d047d2c2c66c974ec9b1d50b6e4 +Author: Mikhail Gusarov +Date: Sat May 30 17:10:35 2009 +0700 + + Typo in configure.ac + + Signed-off-by: Julien Danjou + +commit fbc320ee434b45c37f7501e1cb31c9e51369e79a +Author: Julien Danjou +Date: Fri May 29 08:34:20 2009 +0200 + + Release xcb-util 0.3.5 + + Signed-off-by: Julien Danjou + +commit dc9c1424ac0fe8543904bbe8365462246d703f39 +Author: Bob Ham +Date: Mon May 25 12:22:13 2009 +0200 + + Add a check on xproto version libxcb was compiled with + + Signed-off-by: Julien Danjou + +commit 5e88d1fa0a4bdd2b19c7d9b5fdfb2d70a7fdc2ae +Author: Bart Massey +Date: Thu May 21 10:44:47 2009 -0700 + + wrapped xcb_atom.h for C++ per bug report of + +commit 04003178b1f9bc0c69a6ced184fbf81e5ee7b5ad +Author: Mikhail Gusarov +Date: Sat May 16 02:08:46 2009 +0700 + + Zero out handlers list in xcb_event_handlers_init + + xcb_event_handle relies on the fact that handler for non-handled + event is NULL. Initialize handlers in xcb_event_handlers_init + to avoid calling function by uninitialized pointer. + + Signed-off-by: Mikhail Gusarov + Signed-off-by: Peter Harris + +commit 9002b649f3abb48337f16480cec2cc6f5eedef70 +Author: Alan Coopersmith +Date: Tue Apr 21 15:27:24 2009 -0700 + + Make sure m4 supports -I flag, if not, try finding gnu m4 + + Solaris m4 does not support -I flag, but gnu m4 is included in + recent Solaris & OpenSolaris releases (and must already be installed + on any machine that runs autoconf to generate configure scripts) + + Signed-off-by: Alan Coopersmith + Signed-off-by: Julien Danjou + +commit 296a3d0a11f0ed609fe5c5c9036d353fe9e715cd +Author: Mikhail Gusarov +Date: Sun Apr 19 20:01:00 2009 +0700 + + Add xcb_aux_change_window_attributes_checked + + There is xcb_aux_change_window_attributes, add the matching checked + function. + + Signed-off-by: Mikhail Gusarov + Signed-off-by: Julien Danjou + +commit 6b36dc016a6d51df63324079ef3178599e8f802b +Author: Julien Danjou +Date: Wed Apr 15 15:21:21 2009 +0200 + + bump version to 0.3.4 + + Signed-off-by: Julien Danjou + +commit 02c8c43a95bad0a390764c8aafe0699b69e6ee40 +Author: Julien Danjou +Date: Tue Apr 14 11:44:06 2009 +0200 + + event: add define to get request and error types + + Signed-off-by: Julien Danjou + +commit bd40d52032e2fe7307171dc090754550cb4a302d +Author: Julien Danjou +Date: Tue Apr 14 11:24:00 2009 +0200 + + event: add error values + + Signed-off-by: Julien Danjou + +commit 59b946a9429137cd9880e592e19f8db470dca049 +Author: Julien Danjou +Date: Tue Apr 14 11:16:52 2009 +0200 + + event: simplify proto + + Signed-off-by: Julien Danjou + +commit 94a25d209e1cdfcdaf8e4bfd2cdb1bcb82042d84 +Author: Julien Danjou +Date: Thu Apr 2 12:11:01 2009 +0200 + + event: add functions to convert event/errors to labels + + Signed-off-by: Julien Danjou + +commit 55ad587c67fe7890c71ef151ad15868d9929f2e1 +Author: Julien Danjou +Date: Sat Jan 31 15:08:44 2009 +0100 + + Release xcb-util 0.3.3 + +commit ca5debb213cd7f650c3ce80261e08c72620831a3 +Author: Julien Danjou +Date: Tue Dec 16 14:14:50 2008 +0100 + + Release xcb-util 0.3.2 + + Signed-off-by: Julien Danjou + +commit 3ea3d2816452896dc62d0e6838e8c421805a533d +Author: Peter Harris +Date: Sat Nov 29 12:26:46 2008 -0500 + + Don't call exit() in xcb_aux_get_depth; return 0 instead. + +commit b73811ede8e84896a202cd15121e0ed62d7143d0 +Author: Julien Danjou +Date: Fri Nov 21 10:49:09 2008 +0100 + + build: add check for xproto >= 7.0.8 + + This is needed to have _X_INLINE. + + Signed-off-by: Julien Danjou + +commit c335374c92f231365630708d028ffa7c927459f4 +Author: Jonathan Landis +Date: Fri Nov 21 10:10:15 2008 +0100 + + Fix copyright statement + + Signed-off-by: Julien Danjou + +commit 887d528bfa11fafc81431e41fe5e8655464a5195 +Author: Julien Danjou +Date: Thu Nov 20 15:34:54 2008 +0100 + + Release xcb-util 0.3.1 + +commit 5f491f9e612ff143a3e559820c5494b061be2433 +Author: Julien Danjou +Date: Fri Nov 7 11:02:08 2008 +0100 + + configure: stop if m4 is not found + + Signed-off-by: Julien Danjou + +commit e96984a40f43114b8ff7640a2c017442105ab28a +Author: Ulrich Eckhardt +Date: Mon Sep 29 16:35:10 2008 -0700 + + "Clean up" magic structure stuff for C++. + + Signed-off-by: Bart Massey + +commit 1b81ef7e1abffb9a244183d6fbf4a1e6e2cb11e1 +Author: Henning Sten +Date: Wed Sep 17 20:59:23 2008 +0200 + + introduce function xcb_atom_get (essentially a synchronous xcb_intern_atom, use it only on non-performance critical execution paths) + + Signed-off-by: Julien Danjou + +commit 68c0ed4b85a526ff70e5363d6468ee9603f448d1 +Author: Henning Sten +Date: Tue Sep 16 20:28:13 2008 +0200 + + add doxygen documentation markup for XCB_EVENT_RESPONSE_TYPE_MASK macro + + Signed-off-by: Julien Danjou + +commit 23b1626b4972c234a12200c46aa416846d8f9fb7 +Author: Julien Danjou +Date: Tue Sep 16 17:11:40 2008 +0200 + + doc: enable doxygen doc in various submodule + + Signed-off-by: Julien Danjou + +commit 612dc375bfbf5d92da31b0d4e24bd96a539be0f0 +Author: Julien Danjou +Date: Tue Sep 16 17:11:14 2008 +0200 + + doc: add various authors, remove old todo item + + Signed-off-by: Julien Danjou + +commit 06fe4ed34220807e0f0e7c75ad6d542b157e4ea4 +Author: Julien Danjou +Date: Tue Sep 16 15:27:49 2008 +0200 + + event: define XCB_EVENT_RESPONSE_TYPE_MASK + + And use it. + + Signed-off-by: Julien Danjou + +commit cb96efd21d7cfaa2e99d618fe6fac120d34aed02 +Author: Julien Danjou +Date: Tue Sep 16 15:23:24 2008 +0200 + + event: rework, rename and add some documentation + + Signed-off-by: Julien Danjou + +commit 38a56fc80ebbd683818231fe2f8253ef93071839 +Author: Julien Danjou +Date: Tue Sep 16 11:03:23 2008 +0200 + + atom: include xcb headers + + Signed-off-by: Julien Danjou + +commit f33cf7f649e14be9658e46d0978e687a76c4ea1c +Author: Julien Danjou +Date: Mon Sep 15 21:00:24 2008 +0200 + + atom: bump version info + + Signed-off-by: Julien Danjou + +commit 40a1102d1329e452a837bfe559fbd0a9cf3767b6 +Author: Julien Danjou +Date: Mon Sep 15 20:59:12 2008 +0200 + + atom: prefix functions and types + + Signed-off-by: Julien Danjou + +commit c607afb79b0a16b6f41d8999cb61e52a89241fac +Author: Arnaud Fontaine +Date: Mon Sep 8 17:46:42 2008 +0200 + + [icccm] Bump library version number to 0.3.0. + +commit 5f8dfed11b3fb485f952ab42971d05cf75a305b8 +Author: Arnaud Fontaine +Date: Thu Sep 11 19:06:57 2008 +0200 + + [atom] Move '*discriminated_atom*' functions from icccm to atom + +commit 8a4dfb917f12b4e3ef36d135081379927c1ca1db +Author: Keith Packard +Date: Sun Sep 7 21:46:45 2008 -0700 + + xcb_mask must not be zero when n == 32. + + left shift of a 32-bit value by 32 is undefined, don't try to use it. + +commit 07385216de016e272a7d65978e8c2a86782a62e3 +Author: Julien Danjou +Date: Fri Aug 1 11:43:26 2008 +0200 + + prepare 0.2.1 release + + Signed-off-by: Julien Danjou + +commit 428778df9148a070aaac067d8b9cccf7b6fa9406 +Author: Bart Massey +Date: Wed Mar 5 13:27:07 2008 -0800 + + fixed missed reference in previous patch + +commit 0f9f33d9419d6bbb79af81775f7ec5e8ba5f5e0a +Author: Arnaud Fontaine +Date: Mon Jan 28 14:26:05 2008 -0800 + + Add xcb_poll_for_event_loop and rename xcb_event_loop to match. + + I'm currently porting Awesome[0] from Xlib to XCB as a school project for + my bachelor. I discussed with Vincent about adding a non-blocking + xcb_event_loop on IRC because I had to write one for Awesome and wondered + if this kind of function could be added to xcb-util. + + [0] http://awesome.naquadah.org + + Signed-off-by: Jamey Sharp + +commit 3ce9210fe2a5597699b8e4fec8fc030999be51e7 +Author: Bart Massey +Date: Wed Mar 5 13:24:34 2008 -0800 + + made xcb_handle_event() externally visible + +commit ef27e7f190e9840efa000019b29fbdd7a865caeb +Author: Bart Massey +Date: Mon Dec 17 09:10:59 2007 -0800 + + re-fixed my stupid visual_class typo; thanks to Thomas Hunger for the report + +commit 5d22c197f90f5be91cb247b04581962f4426ef08 +Author: Bart Massey +Date: Sat Dec 8 15:27:04 2007 -0800 + + fixed existing roundups, added rounddowns + +commit 8b825188a070abef9767bc199868ae5bfc79068c +Author: Bart Massey +Date: Sat Dec 8 13:29:19 2007 -0800 + + added aux_clear_window() for xlib compatibility, in spite of misgivings + +commit 08e3c71b1ad0b75bd4231c23bb143e81b4d64473 +Author: Bart Massey +Date: Fri Dec 7 00:51:31 2007 -0800 + + fixed xcb_params_gc_t so that tile_stipple_origin members had reasonable naming + +commit de72d4184249afb381a6761cc369f2e7cfc16d3d +Author: Bart Massey +Date: Fri Dec 7 00:48:25 2007 -0800 + + used doxygen -u to create a much more elaborate doxyfile + +commit ed9113c3e79bd951ad3a36f64fc6a1fd6fca0648 +Author: Bart Massey +Date: Fri Dec 7 00:30:32 2007 -0800 + + added fast inline bitops xcb_bitops.h + +commit 78accd46db65b88e1e2c0e3d714038e7ba679533 +Author: Bart Massey +Date: Fri Dec 7 00:27:52 2007 -0800 + + added aux_set_line_attributes_checked + +commit 3bf56c9d1d1e8b2af7869e02a4a0d3804fca8212 +Author: Bart Massey +Date: Fri Dec 7 00:24:57 2007 -0800 + + added PARAM macros + +commit 5d00736869e46a5e142867c08d2727b2d30a6156 +Author: Bart Massey +Date: Fri Dec 7 00:22:51 2007 -0800 + + xcb_aux_parse_color() + +commit adc7f0f474cda01de0b26b0bc4dc7aa3960458c6 +Author: Bart Massey +Date: Fri Dec 7 00:20:11 2007 -0800 + + added checked version of aux_change_gc function + +commit 47ec324d913bc4e11b0db399ac28f1e106bc7037 +Author: Bart Massey +Date: Fri Dec 7 00:18:10 2007 -0800 + + added checked versions of aux_create_window and aux_create_gc functions + +commit 71f52d1a1807c471b713064adf249c90d73f3b3f +Author: Bart Massey +Date: Fri Dec 7 00:14:29 2007 -0800 + + added xcb_aux_find_visual functions + +commit 1e170eafd033687165d4c4c0b77358c35d6c30de +Author: Bart Massey +Date: Fri Dec 7 00:11:41 2007 -0800 + + added xcb_aux_get_depth_by_visual_id() + +commit e15f40b9758942568e09855e0a041654d53a3842 +Author: Jamey Sharp +Date: Tue Nov 6 17:37:07 2007 -0800 + + All util libraries require the XCB 1.0 API; check for it in configure. + +commit 0f1f1e2b85a2b867e9c50ad548475bbc3a8158f8 +Author: Tilman Sauerbeck +Date: Fri May 11 18:16:25 2007 +0200 + + atom: Replace 'char *atom_names[]' with one big string and array of offsets. + + This reduces the memory footprint of libxcb-atom.so, and the number of + relocations that have to be performed on load. + + before: + + atom/.libs/libxcb-atom.so: 73 relocations + + text data bss dec hex filename + 9587 588 132 10307 2843 atom/.libs/libxcb-atom.so + + after: + + atom/.libs/libxcb-atom.so: 5 relocations + + text data bss dec hex filename + 9183 316 132 9631 259f atom/.libs/libxcb-atom.so + + Signed-off-by: Jamey Sharp + +commit c7ce8e2377241dc436ea1623313178dec3acf2ad +Author: Tilman Sauerbeck +Date: Sun May 6 22:35:26 2007 +0200 + + Bug #10877: Fixed the atom values that are written to the hash table. + + Signed-off-by: Jamey Sharp + +commit c452816e77aa49b9b3564dae5ec2285a3249c7e2 +Author: TORRI Vincent +Date: Fri Apr 6 17:54:52 2007 +0200 + + event/events.c + event/xcb_event.h + icccm/icccm.c + icccm/xcb_icccm.h + property/prop.c + property/xcb_property.h + wm/manage.c + wm/xcb_wm.h + wm/xcbwm-test.c + + xcb namespace added, _t sufix added for some types, formatting + +commit 4a7f5c495cc0135d669f79fa22a965986fa6c35e +Author: Jamey Sharp +Date: Fri Mar 2 17:36:29 2007 -0800 + + Release xcb-util 0.2 + +commit 64e01af41f2056270537e43d26e46db6a1696b39 +Author: TORRI Vincent +Date: Wed Feb 21 20:27:07 2007 +0100 + + rename the libraries from libXCBFoo.* to libxcb-foo.*. Use foo_CPPFLAGS instead of foo_CFLAGS (*_CFLAGS variables store preprocessor options) + +commit a4d35e5dd8bff5c381594304a9d03de0c0a655f6 +Author: Alan Coopersmith +Date: Wed Jun 7 12:06:00 2006 -0700 + + Bug #7150: Rename "len" to "namelen" to avoid m4 substitution + + This is the second of two fixes needed to get xcb-util building on + Solaris. + + Signed-off-by: Jamey Sharp + +commit 7addcb94f4fb814d312bec27bcd7e30486d4061e +Author: Alan Coopersmith +Date: Wed Jun 7 12:06:00 2006 -0700 + + Bug #7150: Check for gcc & Sun cc in configure.ac and use correct flags to turn on more warnings for each + + This is the first of two fixes needed to get xcb-util building on + Solaris. + + Signed-off-by: Jamey Sharp + +commit 7c3ea033e51c0e00e68325ec53dca5ba3717b610 +Author: Jamey Sharp +Date: Sun Nov 12 17:48:28 2006 -0800 + + Clean up built sources. Makes `distcheck` pass. + +commit 809f0deeecf381d9350fa9dc0eed62a01ddc2abe +Author: Jamey Sharp +Date: Sun Nov 12 17:30:00 2006 -0800 + + Bug #6781: make util compile with srcdir != builddir. + +commit dd3f8dd5828eecd8395fc3ec1da8e21f57da3b6c +Author: Ian Osgood +Date: Sat Oct 7 11:45:07 2006 -0700 + + Adapt xcb/util libraries for removal of XID structures. + +commit 76940f795615b5315690bec277b011046cc14f2d +Author: Ian Osgood +Date: Tue Sep 26 08:36:01 2006 -0700 + + Install headers to "xcb", not "X11/XCB". + +commit 7d775611f0da257663b8b9bb865389908573b16e +Author: Ian Osgood +Date: Tue Sep 26 08:21:26 2006 -0700 + + Naming changes must go into m4 files. + +commit c0ca7a3e22afa03ba8b1a11e97aa8e56d45ee3e3 +Author: Jamey Sharp +Date: Mon Sep 25 04:13:01 2006 -0700 + + libxcb now installs header files in , not . + +commit 817d5a1b72d1e2822b8dc4706a276f3b025a464f +Author: Ian Osgood +Date: Sun Sep 24 13:34:03 2006 -0700 + + All xcb-util libraries compile after the Great Renaming. + + Many of the exported library functions still need to follow the new convention. + +commit ed0e9f4ed98188a80462c5c2964f7383faec2b4f +Author: Josh Triplett +Date: Sun Sep 24 03:15:39 2006 -0700 + + Integrate top-level .gitignore into .gitignore for each subdirectory + + In preparation for the repository split, move the relevant contents of the + top-level .gitignore into the .gitignore for each immediate subdirectory. + +commit 2ed2cfbb967c9a3a983c90514f8ff6784e5d47e0 +Author: Bart Massey +Date: Tue Sep 12 02:02:47 2006 -0700 + + Removed GNU make constructs from Makefile. + Prepared for repair of "make distcheck". + +commit d510a2e18805f33a19afd0bf5c45b32d56b40359 +Author: TORRI Vincent +Date: Fri Jul 28 09:00:37 2006 +0200 + + use XCBNone instead of None + +commit 66f8cf96ded8de4180b8955a83e0c0fce16fe579 +Author: TORRI Vincent +Date: Thu Jun 8 07:02:15 2006 +0200 + + fix compilation with c++ compilers. Remove some trailing spaces + +commit bad580c5803d918dedc2afbd96c2b3701bccfdf8 +Author: Donnie Berkholz +Date: Sun May 7 20:32:32 2006 -0700 + + Add correct dependencies in xcb-util. + +commit f42905de7b4cdea9aea3f9168d81f966f89ce2e6 +Author: Josh Triplett +Date: Fri Apr 28 16:00:37 2006 -0700 + + Add m4 files to EXTRA_DIST. + +commit 43afb8c92626370dd07615d234ad86d2b3e70b05 +Author: TORRI Vincent +Date: Fri Apr 28 20:50:19 2006 +0200 + + Merge branch 'master' of git+ssh://doursse@git.freedesktop.org/git/xcb + +commit 93c472fdbf8db1badc7ab093fe198f944ceaf058 +Author: Josh Triplett +Date: Thu Apr 27 11:25:28 2006 -0700 + + Set all package bugreporting addresses to xcb@lists.freedesktop.org + +commit 122cc67f76886e1f996645cd402c0d473d85f408 +Author: Josh Triplett +Date: Thu Apr 27 01:06:46 2006 -0700 + + Fix xcb-util library dependencies, including both the new dependency libXCBImage needs on libXCBShm, as well as many other issues discovered in the process. These include using automake variables appropriately in order to actually link shared libraries against each other and ensure libraries have NEEDED entries for the libraries they depend on, consequently needing to reorder the top-level SUBDIRS to build property before icccm, adding dependencies to .pc.in files, fixing .pc.in files to not all use the name and description for XCBImage, and adding appropriate library dependencies to test programs. + +commit c88fa5935eeee20481bfe466cc18e3870bb96b18 +Author: Jamey Sharp +Date: Wed Mar 8 22:49:59 2006 -0800 + + Unify autofoo .gitignore bits into one top-level file, and remove resulting redundancies. + +commit 9dca188b7f1d048d75cc7a13199cb4d0d436f274 +Author: Jamey Sharp +Date: Sat Feb 18 23:57:14 2006 -0800 + + Update .gitignores for .o files and autofoo stuff. + +commit f4b4cbd6a661cb06ff993365f3b9ec17a81e3c3f +Author: Eric Anholt +Date: Sat Feb 18 22:56:03 2006 -0800 + + Move .cvsignore to .gitignore. + +commit 7944b54ff8d97e29dad9947aac05780e5c389737 +Author: Josh Triplett +Date: Sat Feb 18 16:49:41 2006 -0800 + + Remove xcl and CVSROOT. diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index ffb0602..0000000 --- a/Doxyfile +++ /dev/null @@ -1,1305 +0,0 @@ -# Doxyfile 1.5.3-20071008 - -# 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 -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = XCBUtility - -# 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 = - -# 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 = 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 - -# 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 regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_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 = 2 - -# 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 you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_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 = NO - -# 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 this flag is set to YES, the members of anonymous namespaces will be extracted -# and appear in the documentation as a namespace called 'anonymous_namespace{file}', -# where file will be replaced with the base name of the file that contains the anonymous -# namespace. By default anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = 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 = YES - -# 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 = YES - -# 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 = YES - -# 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 = NO - -# 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 = NO - -# 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 , where is the value of -# the FILE_VERSION_FILTER tag, and 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 = NO - -# 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. - -WARN_IF_UNDOCUMENTED = YES - -# 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 = NO - -# 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 = xcb_util_intro \ - event/ \ - icccm/ \ - image/ \ - property/ \ - reply/ - -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# 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 EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# 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 = doc/img - -# 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 , where -# is the value of the INPUT_FILTER tag, and 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. If you have enabled CALL_GRAPH or CALLER_GRAPH -# then you must also enable this option. If you don't then doxygen will produce -# a warning and turn it on anyway - -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 = NO - -#--------------------------------------------------------------------------- -# 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 = YES - -# 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 = 2 - -# 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 = html - -# 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 HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = 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 = 1 - -# 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 = YES - -# 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 = YES - -# 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 = YES - -# 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 = YES - -#--------------------------------------------------------------------------- -# 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 = YES - -# 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 = NO - -# 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 = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. - -MSCGEN_PATH = - -# 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 = NO - -# 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 = NO - -# 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 = NO - -# 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 = NO - -# 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 = NO - -# If the CALL_GRAPH, SOURCE_BROWSER 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, SOURCE_BROWSER 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 = NO - -# 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_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the number -# of direct children of the root node in a graph is already larger than -# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# 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 the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -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 = YES - -# 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 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8b82ade --- /dev/null +++ b/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am index 5a98062..fbd016c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,23 @@ -MAINTAINERCLEANFILES = Makefile.in +ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = atom aux event property icccm image keysyms reply renderutil +SUBDIRS = src -EXTRA_DIST=xcb-util-common.h +pkgconfig_DATA = \ + xcb-atom.pc \ + xcb-aux.pc \ + xcb-event.pc \ + xcb-util.pc \ + xcb-renderutil.pc + +MAINTAINERCLEANFILES = ChangeLog INSTALL + +.PHONY: ChangeLog INSTALL + +INSTALL: + $(INSTALL_CMD) + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog INSTALL diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..6e05217 --- /dev/null +++ b/NEWS @@ -0,0 +1,12 @@ +Release 0.3.8 (2010-04-25) +========================== + +- Split up atom, aux event into their own repository. +- Create a single shared library and header file. +- Remove namespaceless pre-defined atoms. +- Remove synchronous xcb_atom_get(). +- Remove useless xcb_atom_get_fast*() and xcb_atom_get_name(). +- Delete redundant core-protocol error codes. +- Delete callback-based APIs for events, properties, and replies. +- Link with -no-undefined. +- Add AM_MAINTAINER_MODE for vendors. diff --git a/README b/README index 534a0be..7c87666 100644 --- a/README +++ b/README @@ -1,41 +1,39 @@ -About XCB util -============== +About XCB util modules +====================== -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension +The XCB util modules provides a number of libraries which sit on top +of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions and interfaces which make the raw X protocol more usable. Some of the libraries also provide client-side code which is not strictly part of the X protocol but which have traditionally been provided by Xlib. -These libraries are currently included, roughly ordered by maturity: - -render-util: Convenience functions for the Render extension. -aux: Convenient access to connection setup and some core requests. -atom: Standard core X atom constants and atom caching. -property: Callback X property-change handling. -icccm: Both client and window-manager helpers for ICCCM. -keysyms: Standard X key constants and conversion to/from keycodes. -event: Callback X event handling. -image: Port of Xlib's XImage and XShmImage functions. - If you find any of these libraries useful, please let us know what you're using and why you aren't in a mental hospital yet. We'd welcome patches/suggestions for enhancement and new libraries; Please report any issues you find to the freedesktop.org bug tracker, at: - + Discussion about XCB occurs on the XCB mailing list: - - + + + +About XCB util module +===================== + +XCB util module provides the following library: + + - aux: Convenient access to connection setup and some core requests. + - atom: Standard core X atom constants and atom caching. + - event: Some utilities that have little to do with events any more. -You can obtain the latest development versions of XCB using GIT. -For anonymous checkouts, use: +You can obtain the latest development versions of XCB util using +GIT. For anonymous checkouts, use: - git clone git://anongit.freedesktop.org/git/xcb/util + git clone --recursive git://anongit.freedesktop.org/git/xcb/util For developers, use: - git clone git+ssh://git.freedesktop.org/git/xcb/util + git clone --recursive git+ssh://git.freedesktop.org/git/xcb/util diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 72233c7..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,173 +0,0 @@ -# =========================================================================== -# http://www.nongnu.org/autoconf-archive/ax_compare_version.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# -# DESCRIPTION -# -# This macro compares two version strings. Due to the various number of -# minor-version numbers that can exist, and the fact that string -# comparisons are not compatible with numeric comparisons, this is not -# necessarily trivial to do in a autoconf script. This macro makes doing -# these comparisons easy. -# -# The six basic comparisons are available, as well as checking equality -# limited to a certain number of minor-version levels. -# -# The operator OP determines what type of comparison to do, and can be one -# of: -# -# eq - equal (test A == B) -# ne - not equal (test A != B) -# le - less than or equal (test A <= B) -# ge - greater than or equal (test A >= B) -# lt - less than (test A < B) -# gt - greater than (test A > B) -# -# Additionally, the eq and ne operator can have a number after it to limit -# the test to that number of minor versions. -# -# eq0 - equal up to the length of the shorter version -# ne0 - not equal up to the length of the shorter version -# eqN - equal up to N sub-version levels -# neN - not equal up to N sub-version levels -# -# When the condition is true, shell commands ACTION-IF-TRUE are run, -# otherwise shell commands ACTION-IF-FALSE are run. The environment -# variable 'ax_compare_version' is always set to either 'true' or 'false' -# as well. -# -# Examples: -# -# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) -# -# would both be true. -# -# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) -# -# would both be false. -# -# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) -# -# would be true because it is only comparing two minor versions. -# -# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) -# -# would be true because it is only comparing the lesser number of minor -# versions of the two values. -# -# Note: The characters that separate the version numbers do not matter. An -# empty string is the same as version 0. OP is evaluated by autoconf, not -# configure, so must be a string, not a variable. -# -# The author would like to acknowledge Guido Draheim whose advice about -# the m4_case and m4_ifvaln functions make this macro only include the -# portions necessary to perform the specific comparison specified by the -# OP argument in the final configure script. -# -# LICENSE -# -# Copyright (c) 2008 Tim Toolan -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. - -dnl ######################################################################### -AC_DEFUN([AX_COMPARE_VERSION], [ - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - AS_VAR_PUSHDEF([A],[ax_compare_version_A]) - A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - AS_VAR_PUSHDEF([B],[ax_compare_version_B]) - B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary - dnl # then the first line is used to determine if the condition is true. - dnl # The sed right after the echo is to remove any indented white space. - m4_case(m4_tolower($2), - [lt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [gt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [le],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ], - [ge],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ],[ - dnl Split the operator from the subversion count if present. - m4_bmatch(m4_substr($2,2), - [0],[ - # A count of zero means use the length of the shorter version. - # Determine the number of characters in A and B. - ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` - ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` - - # Set A to no more than B's length and B to no more than A's length. - A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` - B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` - ], - [[0-9]+],[ - # A count greater than zero means use only that many subversions - A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - ], - [.+],[ - AC_WARNING( - [illegal OP numeric parameter: $2]) - ],[]) - - # Pad zeros at end of numbers to make same length. - ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" - B="$B`echo $A | sed 's/./0/g'`" - A="$ax_compare_version_tmp_A" - - # Check for equality or inequality as necessary. - m4_case(m4_tolower(m4_substr($2,0,2)), - [eq],[ - test "x$A" = "x$B" && ax_compare_version=true - ], - [ne],[ - test "x$A" != "x$B" && ax_compare_version=true - ],[ - AC_WARNING([illegal OP parameter: $2]) - ]) - ]) - - AS_VAR_POPDEF([A])dnl - AS_VAR_POPDEF([B])dnl - - dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. - if test "$ax_compare_version" = "true" ; then - m4_ifvaln([$4],[$4],[:])dnl - m4_ifvaln([$5],[else $5])dnl - fi -]) dnl AX_COMPARE_VERSION diff --git a/atom/Makefile.am b/atom/Makefile.am deleted file mode 100644 index 8be6e60..0000000 --- a/atom/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-atom.la - -xcbinclude_HEADERS = xcb_atom.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_atom_la_SOURCES = atoms.c atomlist.m4 atoms.gperf.m4 xcb_atom.h.m4 -libxcb_atom_la_CPPFLAGS = $(XCB_CFLAGS) -libxcb_atom_la_LIBADD = $(XCB_LIBS) -libxcb_atom_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-atom.pc - -EXTRA_DIST = xcb-atom.pc.in - -BUILT_SOURCES = atoms.c atoms.gperf xcb_atom.h -CLEANFILES = $(BUILT_SOURCES) - -atoms.c: atoms.gperf - $(GPERF) --output-file $@ $< - -atoms.gperf: atoms.gperf.m4 atomlist.m4 - $(M4) -I$(srcdir) $< >$@ - -xcb_atom.h: xcb_atom.h.m4 atomlist.m4 - $(M4) -I$(srcdir) $< >$@ diff --git a/atom/atomlist.m4 b/atom/atomlist.m4 deleted file mode 100644 index 1c84740..0000000 --- a/atom/atomlist.m4 +++ /dev/null @@ -1,71 +0,0 @@ -define(`FOREACH', `ifelse(`$1', , , `DO($1) -FOREACH(shift($@))')')FOREACH( -PRIMARY, -SECONDARY, -ARC, -ATOM, -BITMAP, -CARDINAL, -COLORMAP, -CURSOR, -CUT_BUFFER0, -CUT_BUFFER1, -CUT_BUFFER2, -CUT_BUFFER3, -CUT_BUFFER4, -CUT_BUFFER5, -CUT_BUFFER6, -CUT_BUFFER7, -DRAWABLE, -FONT, -INTEGER, -PIXMAP, -POINT, -RECTANGLE, -RESOURCE_MANAGER, -RGB_COLOR_MAP, -RGB_BEST_MAP, -RGB_BLUE_MAP, -RGB_DEFAULT_MAP, -RGB_GRAY_MAP, -RGB_GREEN_MAP, -RGB_RED_MAP, -STRING, -VISUALID, -WINDOW, -WM_COMMAND, -WM_HINTS, -WM_CLIENT_MACHINE, -WM_ICON_NAME, -WM_ICON_SIZE, -WM_NAME, -WM_NORMAL_HINTS, -WM_SIZE_HINTS, -WM_ZOOM_HINTS, -MIN_SPACE, -NORM_SPACE, -MAX_SPACE, -END_SPACE, -SUPERSCRIPT_X, -SUPERSCRIPT_Y, -SUBSCRIPT_X, -SUBSCRIPT_Y, -UNDERLINE_POSITION, -UNDERLINE_THICKNESS, -STRIKEOUT_ASCENT, -STRIKEOUT_DESCENT, -ITALIC_ANGLE, -X_HEIGHT, -QUAD_WIDTH, -WEIGHT, -POINT_SIZE, -RESOLUTION, -COPYRIGHT, -NOTICE, -FONT_NAME, -FAMILY_NAME, -FULL_NAME, -CAP_HEIGHT, -WM_CLASS, -WM_TRANSIENT_FOR, -)dnl diff --git a/atom/atoms.gperf.m4 b/atom/atoms.gperf.m4 deleted file mode 100644 index d26814e..0000000 --- a/atom/atoms.gperf.m4 +++ /dev/null @@ -1,202 +0,0 @@ -%{ - -/* Rely on vasprintf (GNU extension) instead of vsnprintf if - possible... */ -#ifdef HAVE_VASPRINTF -#define _GNU_SOURCE -#include -#endif - -#include -#include -#include -#include "xcb_atom.h" - -define(`COUNT', 0)dnl -define(`DO', `const xcb_atom_t $1 = define(`COUNT', incr(COUNT))COUNT;')dnl -include(atomlist.m4)`'dnl -%} - -%readonly-tables -%pic -%null-strings -%enum -%includes -%compare-strncmp - -%struct-type -struct atom_map { int name; xcb_atom_t value; }; -%% -define(`COUNT', 0)dnl -define(`DO', `$1,define(`COUNT', incr(COUNT))COUNT')dnl -include(atomlist.m4)`'dnl -%% - -static const char atom_names[] = -define(`DO', ` "$1\0"')dnl -include(atomlist.m4); - -static const uint16_t atom_name_offsets[] = { -define(`OFFSET', 0)dnl -define(`DO', ` OFFSET,define(`OFFSET', eval(OFFSET+1+len($1)))')dnl -include(atomlist.m4)`'dnl -}; - -xcb_atom_t xcb_atom_get(xcb_connection_t *connection, const char *atom_name) -{ - if(atom_name == NULL) - return XCB_NONE; - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, - xcb_intern_atom(connection, 0, strlen(atom_name), atom_name), NULL); - if(!reply) - return XCB_NONE; - xcb_atom_t atom = reply->atom; - free(reply); - return atom; -} - -xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name) -{ - const struct atom_map *value = in_word_set(name, name_len); - xcb_atom_t ret = XCB_NONE; - if(value) - ret = value->value; - return ret; -} - -xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_if_exists, uint16_t name_len, const char *name) -{ - xcb_atom_fast_cookie_t cookie; - - if((cookie.u.atom = xcb_atom_get_predefined(name_len, name)) != XCB_NONE) - { - cookie.tag = TAG_VALUE; - return cookie; - } - - cookie.tag = TAG_COOKIE; - cookie.u.cookie = xcb_intern_atom(c, only_if_exists, name_len, name); - return cookie; -} - -xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cookie_t cookie, xcb_generic_error_t **e) -{ - switch(cookie.tag) - { - xcb_intern_atom_reply_t *reply; - case TAG_VALUE: - if(e) - *e = 0; - break; - case TAG_COOKIE: - reply = xcb_intern_atom_reply(c, cookie.u.cookie, e); - if(reply) - { - cookie.u.atom = reply->atom; - free(reply); - } - else - cookie.u.atom = XCB_NONE; - break; - } - return cookie.u.atom; -} - -const char *xcb_atom_get_name_predefined(xcb_atom_t atom) -{ - if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_name_offsets))) - return 0; - return atom_names + atom_name_offsets[atom - 1]; -} - -int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, int *lengthp) -{ - static char buf[100]; - const char *name = xcb_atom_get_name_predefined(atom); - int namelen; - xcb_get_atom_name_cookie_t atomc; - xcb_get_atom_name_reply_t *atomr; - if(name) - { - *namep = name; - *lengthp = strlen(name); - return 1; - } - atomc = xcb_get_atom_name(c, atom); - atomr = xcb_get_atom_name_reply(c, atomc, 0); - if(!atomr) - return 0; - namelen = xcb_get_atom_name_name_length(atomr); - if(namelen > sizeof(buf)) - namelen = sizeof(buf); - *lengthp = namelen; - memcpy(buf, xcb_get_atom_name_name(atomr), namelen); - *namep = buf; - free(atomr); - return 1; -} - -static char *makename(const char *fmt, ...) -{ - char *ret; - int n; - va_list ap; - -#ifndef HAVE_VASPRINTF - char *np; - int size = 64; - - /* First allocate 'size' bytes, should be enough usually */ - if((ret = malloc(size)) == NULL) - return NULL; - - while(1) - { - va_start(ap, fmt); - n = vsnprintf(ret, size, fmt, ap); - va_end(ap); - - if(n < 0) - return NULL; - - if(n < size) - return ret; - - size = n + 1; - if((np = realloc(ret, size)) == NULL) - { - free(ret); - return NULL; - } - - ret = np; - } -#else - va_start(ap, fmt); - n = vasprintf(&ret, fmt, ap); - va_end(ap); - - if(n < 0) - return NULL; - - return ret; -#endif -} - -char *xcb_atom_name_by_screen(const char *base, uint8_t screen) -{ - return makename("%s_S%u", base, screen); -} - -char *xcb_atom_name_by_resource(const char *base, uint32_t resource) -{ - return makename("%s_R%08X", base, resource); -} - -char *xcb_atom_name_unique(const char *base, uint32_t id) -{ - if(base) - return makename("%s_U%lu", base, id); - else - return makename("U%lu", id); -} diff --git a/atom/xcb-atom.pc.in b/atom/xcb-atom.pc.in deleted file mode 100644 index b59b57f..0000000 --- a/atom/xcb-atom.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Atom library -Description: XCB atom cache -Version: @PACKAGE_VERSION@ -Requires: xcb -Libs: -L${libdir} -lxcb-atom @LIBS@ -Cflags: -I${includedir} diff --git a/atom/xcb_atom.h.m4 b/atom/xcb_atom.h.m4 deleted file mode 100644 index 3579211..0000000 --- a/atom/xcb_atom.h.m4 +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef __XCB_ATOM_H__ -#define __XCB_ATOM_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -enum xcb_atom_fast_tag_t { - TAG_COOKIE, - TAG_VALUE -}; -typedef struct { - enum xcb_atom_fast_tag_t tag; - union { - xcb_intern_atom_cookie_t cookie; - xcb_atom_t atom; - } u; -} xcb_atom_fast_cookie_t; - -/** - * @brief Get an atom synchronously. - * @param connection The connection to the X server. - * @param atom_name The name of the atom that should be returned. - * @return The requested atom, or XCB_NONE if there is an error. - * - * xcb_atom_get() is essentially a synchronous version of xcb_intern_atom(), - * use it only on non-performance critical execution paths. - */ -xcb_atom_t xcb_atom_get(xcb_connection_t *connection, const char *atom_name); -xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name); -xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_if_exists, uint16_t name_len, const char *name); -xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cookie_t cookie, xcb_generic_error_t **e); - -const char *xcb_atom_get_name_predefined(xcb_atom_t atom); -int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, int *lengthp); - -char *xcb_atom_name_by_screen(const char *base, uint8_t screen); -char *xcb_atom_name_by_resource(const char *base, uint32_t resource); -char *xcb_atom_name_unique(const char *base, uint32_t id); - -define(`DO', `extern const xcb_atom_t $1;')dnl -include(atomlist.m4)`'dnl - -#ifdef __cplusplus -} -#endif - -#endif /* __XCB_ATOM_H__ */ diff --git a/aux/Makefile.am b/aux/Makefile.am deleted file mode 100644 index 56660e7..0000000 --- a/aux/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-aux.la - -xcbinclude_HEADERS = xcb_aux.h xcb_bitops.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_aux_la_SOURCES = xcb_aux.c -libxcb_aux_la_CPPFLAGS = $(XCB_CFLAGS) -libxcb_aux_la_LIBADD = $(XCB_LIBS) - -pkgconfig_DATA = xcb-aux.pc - -EXTRA_DIST=xcb-aux.pc.in diff --git a/aux/xcb-aux.pc.in b/aux/xcb-aux.pc.in deleted file mode 100644 index 79ed95c..0000000 --- a/aux/xcb-aux.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Aux library -Description: XCB convenient functions -Version: @PACKAGE_VERSION@ -Requires: xcb -Libs: -L${libdir} -lxcb-aux @LIBS@ -Cflags: -I${includedir} diff --git a/aux/xcb_aux.c b/aux/xcb_aux.c deleted file mode 100644 index c810398..0000000 --- a/aux/xcb_aux.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright © 2008 Bart Massey - * Copyright © 2008 Ian Osgood - * Copyright © 2008 Jamey Sharp - * Copyright © 2008 Josh Triplett - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include - -#include -#include "xcb_aux.h" - -/* Connection related functions */ - -uint8_t -xcb_aux_get_depth (xcb_connection_t *c, - xcb_screen_t *screen) -{ - xcb_drawable_t drawable; - xcb_get_geometry_reply_t *geom; - int depth = 0; - - drawable = screen->root; - geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0); - - if (geom) { - depth = geom->depth; - free (geom); - } - - return depth; -} - -uint8_t -xcb_aux_get_depth_of_visual (xcb_screen_t *screen, - xcb_visualid_t id) -{ - xcb_depth_iterator_t i; - xcb_visualtype_iterator_t j; - for (i = xcb_screen_allowed_depths_iterator(screen); - i.rem; xcb_depth_next(&i)) - for (j = xcb_depth_visuals_iterator(i.data); - j.rem; xcb_visualtype_next(&j)) - if (j.data->visual_id == id) - return i.data->depth; - return 0; -} - -xcb_screen_t * -xcb_aux_get_screen (xcb_connection_t *c, - int screen) -{ - xcb_screen_iterator_t i = xcb_setup_roots_iterator(xcb_get_setup(c)); - for (; i.rem; --screen, xcb_screen_next(&i)) - if (screen == 0) - return i.data; - return 0; -} - -xcb_visualtype_t * -xcb_aux_get_visualtype (xcb_connection_t *c, - int scr, - xcb_visualid_t vid) -{ - xcb_screen_t *screen; - xcb_depth_t *depth; - xcb_visualtype_iterator_t iter; - int cur; - - screen = xcb_aux_get_screen (c, scr); - if (!screen) return NULL; - - depth = xcb_screen_allowed_depths_iterator(screen).data; - if (!depth) return NULL; - - iter = xcb_depth_visuals_iterator(depth); - for (cur = 0 ; cur < iter.rem ; xcb_visualtype_next(&iter), ++cur) - if (vid == iter.data->visual_id) - return iter.data; - - return NULL; -} - -xcb_visualtype_t * -xcb_aux_find_visual_by_id (xcb_screen_t *screen, - xcb_visualid_t id) -{ - xcb_depth_iterator_t i; - xcb_visualtype_iterator_t j; - for (i = xcb_screen_allowed_depths_iterator(screen); - i.rem; xcb_depth_next(&i)) - for (j = xcb_depth_visuals_iterator(i.data); - j.rem; xcb_visualtype_next(&j)) - if (j.data->visual_id == id) - return j.data; - return 0; -} - -xcb_visualtype_t * -xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, - int8_t class, - int8_t depth) -{ - xcb_depth_iterator_t i; - xcb_visualtype_iterator_t j; - for (i = xcb_screen_allowed_depths_iterator(screen); - i.rem; xcb_depth_next(&i)) { - if (depth != -1 && i.data->depth != depth) - continue; - for (j = xcb_depth_visuals_iterator(i.data); - j.rem; xcb_visualtype_next(&j)) - if (class == -1 || j.data->_class == class) - return j.data; - } - return 0; -} - -void -xcb_aux_sync (xcb_connection_t *c) -{ - free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL)); -} - -/* structs instead of value lists */ -/* TODO: generate the struct types and functions from protocol masks and descriptions */ - -/* This generic implementation of pack_list depends on: - a) structs packed to uint32_t size - b) structs consist of just uint32_t/int32_t fields in the same order as bitmask -*/ - -static void -pack_list( uint32_t mask, const uint32_t *src, uint32_t *dest ) -{ - for ( ; mask; mask >>= 1, src++) - if (mask & 1) - *dest++ = *src; -} - -xcb_void_cookie_t -xcb_aux_create_window (xcb_connection_t *c, - uint8_t depth, - xcb_window_t wid, - xcb_window_t parent, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint16_t border_width, - uint16_t _class, - xcb_visualid_t visual, - uint32_t mask, - const xcb_params_cw_t *params) -{ - uint32_t value_list[16]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_create_window(c, depth, wid, parent, - x, y, width, height, border_width, - _class, visual, mask, value_list); -} - -xcb_void_cookie_t -xcb_aux_create_window_checked (xcb_connection_t *c, - uint8_t depth, - xcb_window_t wid, - xcb_window_t parent, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint16_t border_width, - uint16_t _class, - xcb_visualid_t visual, - uint32_t mask, - const xcb_params_cw_t *params) -{ - uint32_t value_list[16]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_create_window_checked(c, depth, wid, parent, - x, y, width, height, border_width, - _class, visual, mask, value_list); -} - -xcb_void_cookie_t -xcb_aux_change_window_attributes_checked (xcb_connection_t *c, - xcb_window_t window, - uint32_t mask, - const xcb_params_cw_t *params) -{ - uint32_t value_list[16]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_change_window_attributes_checked( c, window, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_change_window_attributes (xcb_connection_t *c, - xcb_window_t window, - uint32_t mask, - const xcb_params_cw_t *params) -{ - uint32_t value_list[16]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_change_window_attributes( c, window, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_configure_window (xcb_connection_t *c, - xcb_window_t window, - uint16_t mask, - const xcb_params_configure_window_t *params) -{ - uint32_t value_list[8]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_configure_window( c, window, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_create_gc (xcb_connection_t *c, - xcb_gcontext_t gid, - xcb_drawable_t drawable, - uint32_t mask, - const xcb_params_gc_t *params) -{ - uint32_t value_list[32]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_create_gc( c, gid, drawable, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_create_gc_checked (xcb_connection_t *c, - xcb_gcontext_t gid, - xcb_drawable_t drawable, - uint32_t mask, - const xcb_params_gc_t *params) -{ - uint32_t value_list[32]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_create_gc_checked( c, gid, drawable, mask, value_list); -} - -xcb_void_cookie_t -xcb_aux_change_gc (xcb_connection_t *c, - xcb_gcontext_t gc, - uint32_t mask, - const xcb_params_gc_t *params) -{ - uint32_t value_list[32]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_change_gc( c, gc, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_change_gc_checked (xcb_connection_t *c, - xcb_gcontext_t gc, - uint32_t mask, - const xcb_params_gc_t *params) -{ - uint32_t value_list[32]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_change_gc_checked( c, gc, mask, value_list ); -} - -xcb_void_cookie_t -xcb_aux_change_keyboard_control (xcb_connection_t *c, - uint32_t mask, - const xcb_params_keyboard_t *params) -{ - uint32_t value_list[16]; - pack_list(mask, (const uint32_t *)params, value_list); - return xcb_change_keyboard_control( c, mask, value_list ); -} - -/* Color related functions */ - -/* Return true if the given color name can be translated locally, - in which case load the components. Otherwise, a lookup_color request - will be needed, so return false. */ -int -xcb_aux_parse_color(char *color_name, - uint16_t *red, uint16_t *green, uint16_t *blue) -{ - int n, r, g, b, i; - if (!color_name || *color_name != '#') - return 0; - /* - * Excitingly weird RGB parsing code from Xlib. - */ - n = strlen (color_name); - color_name++; - n--; - if (n != 3 && n != 6 && n != 9 && n != 12) - return 0; - n /= 3; - g = b = 0; - do { - r = g; - g = b; - b = 0; - for (i = n; --i >= 0; ) { - char c = *color_name++; - b <<= 4; - if (c >= '0' && c <= '9') - b |= c - '0'; - else if (c >= 'A' && c <= 'F') - b |= c - ('A' - 10); - else if (c >= 'a' && c <= 'f') - b |= c - ('a' - 10); - else return 0; - } - } while (*color_name != '\0'); - n <<= 2; - n = 16 - n; - *red = r << n; - *green = g << n; - *blue = b << n; - return 1; -} - -/* Drawing related functions */ - -/* Adapted from Xlib */ -xcb_void_cookie_t -xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, - xcb_gcontext_t gc, - uint16_t linewidth, - int32_t linestyle, - int32_t capstyle, - int32_t joinstyle) -{ - uint32_t mask = 0; - xcb_params_gc_t gv; - - XCB_AUX_ADD_PARAM(&mask, &gv, line_width, linewidth); - XCB_AUX_ADD_PARAM(&mask, &gv, line_style, linestyle); - XCB_AUX_ADD_PARAM(&mask, &gv, cap_style, capstyle); - XCB_AUX_ADD_PARAM(&mask, &gv, join_style, joinstyle); - return xcb_aux_change_gc_checked(dpy, gc, mask, &gv); -} - -/* Adapted from Xlib */ -/* XXX It would be wiser for apps just to call - clear_area() directly. */ -xcb_void_cookie_t -xcb_aux_clear_window(xcb_connection_t * dpy, - xcb_window_t w) -{ - return xcb_clear_area(dpy, 0, w, 0, 0, 0, 0); -} diff --git a/aux/xcb_aux.h b/aux/xcb_aux.h deleted file mode 100644 index d49d438..0000000 --- a/aux/xcb_aux.h +++ /dev/null @@ -1,214 +0,0 @@ -#ifndef __XCB_AUX_H__ -#define __XCB_AUX_H__ - - -#ifdef __cplusplus -extern "C" { -#endif - - -uint8_t xcb_aux_get_depth (xcb_connection_t *c, - xcb_screen_t *screen); - -uint8_t xcb_aux_get_depth_of_visual (xcb_screen_t *screen, - xcb_visualid_t id); - -xcb_screen_t *xcb_aux_get_screen (xcb_connection_t *c, - int screen); - -xcb_visualtype_t *xcb_aux_get_visualtype (xcb_connection_t *c, - int screen, - xcb_visualid_t vid); - -xcb_visualtype_t * -xcb_aux_find_visual_by_id (xcb_screen_t *screen, - xcb_visualid_t id); - -xcb_visualtype_t * -xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, - int8_t class_, - int8_t depth); - -void xcb_aux_sync (xcb_connection_t *c); - -/* internal helper macro for XCB_AUX_ADD_PARAM -It gives the offset of the field 'param' in the structure pointed to by -'paramsp' in multiples of an uint32_t's size. */ -#define XCB_AUX_INTERNAL_OFFSETOF(paramsp, param) \ - ((uint32_t const*)(&((paramsp)->param))-(uint32_t const*)(paramsp)) - -/* add an optional parameter to an xcb_params_* structure -parameters: - maskp: pointer to bitmask whos bits mark used parameters - paramsp: pointer to structure with parameters - param: parameter to set - value: value to set the parameter to -*/ -#define XCB_AUX_ADD_PARAM(maskp, paramsp, param, value) \ - ((*(maskp)|=1<param=(value))) - -typedef struct { - uint32_t back_pixmap; - uint32_t back_pixel; - uint32_t border_pixmap; - uint32_t border_pixel; - uint32_t bit_gravity; - uint32_t win_gravity; - uint32_t backing_store; - uint32_t backing_planes; - uint32_t backing_pixel; - uint32_t override_redirect; - uint32_t save_under; - uint32_t event_mask; - uint32_t dont_propagate; - uint32_t colormap; - uint32_t cursor; -} xcb_params_cw_t; - -xcb_void_cookie_t -xcb_aux_create_window (xcb_connection_t *c, - uint8_t depth, - xcb_window_t wid, - xcb_window_t parent, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint16_t border_width, - uint16_t class_, - xcb_visualid_t visual, - uint32_t mask, - const xcb_params_cw_t *params); - -xcb_void_cookie_t -xcb_aux_create_window_checked (xcb_connection_t *c, - uint8_t depth, - xcb_window_t wid, - xcb_window_t parent, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint16_t border_width, - uint16_t class_, - xcb_visualid_t visual, - uint32_t mask, - const xcb_params_cw_t *params); - -xcb_void_cookie_t -xcb_aux_change_window_attributes (xcb_connection_t *c, - xcb_window_t window, - uint32_t mask, - const xcb_params_cw_t *params); - -xcb_void_cookie_t -xcb_aux_change_window_attributes_checked (xcb_connection_t *c, - xcb_window_t window, - uint32_t mask, - const xcb_params_cw_t *params); - -typedef struct { - int32_t x; - int32_t y; - uint32_t width; - uint32_t height; - uint32_t border_width; - uint32_t sibling; - uint32_t stack_mode; -} xcb_params_configure_window_t; - -xcb_void_cookie_t -xcb_aux_configure_window (xcb_connection_t *c, - xcb_window_t window, - uint16_t mask, - const xcb_params_configure_window_t *params); - -typedef struct { - uint32_t function; - uint32_t plane_mask; - uint32_t foreground; - uint32_t background; - uint32_t line_width; - uint32_t line_style; - uint32_t cap_style; - uint32_t join_style; - uint32_t fill_style; - uint32_t fill_rule; - uint32_t tile; - uint32_t stipple; - uint32_t tile_stipple_origin_x; - uint32_t tile_stipple_origin_y; - uint32_t font; - uint32_t subwindow_mode; - uint32_t graphics_exposures; - uint32_t clip_originX; - uint32_t clip_originY; - uint32_t mask; - uint32_t dash_offset; - uint32_t dash_list; - uint32_t arc_mode; -} xcb_params_gc_t; - -xcb_void_cookie_t -xcb_aux_create_gc (xcb_connection_t *c, - xcb_gcontext_t cid, - xcb_drawable_t drawable, - uint32_t mask, - const xcb_params_gc_t *params); - -xcb_void_cookie_t -xcb_aux_create_gc_checked (xcb_connection_t *c, - xcb_gcontext_t gid, - xcb_drawable_t drawable, - uint32_t mask, - const xcb_params_gc_t *params); -xcb_void_cookie_t -xcb_aux_change_gc (xcb_connection_t *c, - xcb_gcontext_t gc, - uint32_t mask, - const xcb_params_gc_t *params); - -xcb_void_cookie_t -xcb_aux_change_gc_checked (xcb_connection_t *c, - xcb_gcontext_t gc, - uint32_t mask, - const xcb_params_gc_t *params); -typedef struct { - uint32_t key_click_percent; - uint32_t bell_percent; - uint32_t bell_pitch; - uint32_t bell_duration; - uint32_t led; - uint32_t led_mode; - uint32_t key; - uint32_t auto_repeat_mode; -} xcb_params_keyboard_t; - -xcb_void_cookie_t -xcb_aux_change_keyboard_control (xcb_connection_t *c, - uint32_t mask, - const xcb_params_keyboard_t *params); - -int -xcb_aux_parse_color(char *color_name, - uint16_t *red, uint16_t *green, uint16_t *blue); - -xcb_void_cookie_t -xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, - xcb_gcontext_t gc, - uint16_t linewidth, - int32_t linestyle, - int32_t capstyle, - int32_t joinstyle); - -xcb_void_cookie_t -xcb_aux_clear_window(xcb_connection_t * dpy, - xcb_window_t w); - -#ifdef __cplusplus -} -#endif - - -#endif /* __XCB_AUX_H__ */ diff --git a/aux/xcb_bitops.h b/aux/xcb_bitops.h deleted file mode 100644 index a6872a1..0000000 --- a/aux/xcb_bitops.h +++ /dev/null @@ -1,212 +0,0 @@ -#ifndef __XCB_BITOPS_H__ -#define __XCB_BITOPS_H__ - -/* Copyright (C) 2007 Bart Massey - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include -#include - -/** - * @defgroup xcb__bitops XCB Bit Operations - * - * Inline functions for common bit ops used in XCB and elsewhere. - * - * @{ - */ - - -/** - * Create a low-order bitmask. - * @param n Mask size. - * @return Mask. - * - * Create a bitmask with the lower @p n bits set and the - * rest of the word clear. - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_mask(uint32_t n) -{ - return n == 32 ? ~0 : (1 << n) - 1; -} - - -/** - * Population count. - * @param n Integer representing a bitset. - * @return Number of 1 bits in the bitset. - * - * This is a reasonably fast algorithm for counting the bits - * in a 32-bit word. Currently a classic binary - * divide-and-conquer popcount: popcount_2() from - * http://en.wikipedia.org/wiki/Hamming_weight. - * @ingroup xcb__bitops - */ - - -/* 15 ops, 3 long immediates, 14 stages, 9 alu ops, 9 alu stages */ -_X_INLINE static uint32_t -xcb_popcount(uint32_t x) -{ - uint32_t m1 = 0x55555555; - uint32_t m2 = 0x33333333; - uint32_t m4 = 0x0f0f0f0f; - x -= (x >> 1) & m1; - x = (x & m2) + ((x >> 2) & m2); - x = (x + (x >> 4)) & m4; - x += x >> 8; - return (x + (x >> 16)) & 0x3f; -} - - -/** - * Round up to the next power-of-two unit size. - * @param base Number to be rounded up. - * @param pad Multiple to be rounded to; must be a power of two. - * @return Rounded-up number. - * - * Rounds @p base up to a multiple of @p pad, where @p pad - * is a power of two. The more general case is handled by - * xcb_roundup(). - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_roundup_2 (uint32_t base, uint32_t pad) -{ - return (base + pad - 1) & -pad; -} - -/** - * Round down to the next power-of-two unit size. - * @param base Number to be rounded down. - * @param pad Multiple to be rounded to; must be a power of two. - * @return Rounded-down number. - * - * Rounds @p base down to a multiple of @p pad, where @p pad - * is a power of two. The more general case is handled by - * xcb_rounddown(). - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_rounddown_2 (uint32_t base, uint32_t pad) -{ - return base & -pad; -} - -/** - * Round up to the next unit size. - * @param base Number to be rounded up. - * @param pad Multiple to be rounded to. - * @return Rounded-up number. - * - * This is a general routine for rounding @p base up - * to a multiple of @p pad. If you know that @p pad - * is a power of two, you should probably call xcb_roundup_2() - * instead. - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_roundup (uint32_t base, uint32_t pad) -{ - uint32_t b = base + pad - 1; - /* faster if pad is a power of two */ - if (((pad - 1) & pad) == 0) - return b & -pad; - return b - b % pad; -} - - -/** - * Round down to the next unit size. - * @param base Number to be rounded down. - * @param pad Multiple to be rounded to. - * @return Rounded-down number. - * - * This is a general routine for rounding @p base down - * to a multiple of @p pad. If you know that @p pad - * is a power of two, you should probably call xcb_rounddown_2() - * instead. - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_rounddown (uint32_t base, uint32_t pad) -{ - /* faster if pad is a power of two */ - if (((pad - 1) & pad) == 0) - return base & -pad; - return base - base % pad; -} - - -/** - * Reverse bits of word. - * @param x Target word. - * @param n Number of low-order bits to reverse. - * @return Word with low @p n bits reversed, all others 0. - * - * Reverses the bottom @p n bits of @p x. - * @ingroup xcb__bitops - */ -_X_INLINE static uint32_t -xcb_bit_reverse(uint32_t x, uint8_t n) { - uint32_t m1 = 0x00ff00ff; - uint32_t m2 = 0x0f0f0f0f; - uint32_t m3 = 0x33333333; - uint32_t m4 = 0x55555555; - x = ((x << 16) | (x >> 16)); - x = ((x & m1) << 8) | ((x >> 8) & m1); - x = ((x & m2) << 4) | ((x >> 4) & m2); - x = ((x & m3) << 2) | ((x >> 2) & m3); - x = ((x & m4) << 1) | ((x >> 1) & m4); - x >>= 32 - n; - return x; -} - - -/** - * Host byte order. - * @return The byte order of the host. - * - * Tests the host's byte order and returns either - * XCB_IMAGE_ORDER_MSB_FIRST or XCB_IMAGE_ORDER_LSB_FIRST - * as appropriate. - * @ingroup xcb__bitops - */ -_X_INLINE static xcb_image_order_t -xcb_host_byte_order(void) { - uint32_t endian_test = 0x01020304; - - switch (*(char *)&endian_test) { - case 0x01: - return XCB_IMAGE_ORDER_MSB_FIRST; - case 0x04: - return XCB_IMAGE_ORDER_LSB_FIRST; - } - assert(0); -} - -#endif /* __XCB_BITOPS_H__ */ diff --git a/configure.ac b/configure.ac index 75a89d1..3272ca0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,110 +1,30 @@ -dnl AC_TYPE_SSIZE_T is defined from 2.59c -AC_PREREQ(2.59c) -AC_INIT([xcb-util],0.3.6,[xcb@lists.freedesktop.org]) +dnl XCB_UTIL_M4_WITH_INCLUDE_PATH requires Autoconf >= 2.62 +AC_PREREQ(2.62) +AC_INIT([xcb-util],0.3.8,[xcb@lists.freedesktop.org]) AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_MAINTAINER_MODE + +XCB_UTIL_M4_WITH_INCLUDE_PATH +XCB_UTIL_COMMON([1.4], [1.6]) -AC_CHECK_PROGS(M4, [m4 gm4], [no]) -if test $M4 != "no" ; then - AC_MSG_CHECKING([if $M4 supports -I]) - if $M4 -I. /dev/null > /dev/null 2>&1 ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - # Try finding the gnu version - AC_CHECK_PROGS(GM4, gm4, [no]) - if test $GM4 = "no" ; then - AC_PATH_PROGS(GNUM4, m4, [no], [/usr/gnu/bin]) - M4="$GNUM4" - else - M4="$GM4" - fi - fi -fi -if test $M4 = "no"; then - AC_MSG_ERROR([Can't find usable m4, please install it and try again]) -fi AC_CHECK_PROGS(GPERF, gperf, [no]) if test $GPERF = "no"; then - AC_MSG_ERROR([Can't find gperf, please install it and try again]) + AC_MSG_ERROR([Can't find gperf, please install it and try again]) fi -AC_PROG_CC -AC_PROG_LIBTOOL -if test "x$GCC" = xyes ; then - CWARNFLAGS="-Wall" -else - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - if test "x$SUNCC" = "xyes"; then - CWARNFLAGS="-v" - fi -fi -AC_SUBST(CWARNFLAGS) AC_CHECK_FUNCS_ONCE(vasprintf) - -dnl Checking whether ssize_t is defined (xcb-util-common.h) AC_TYPE_SSIZE_T -xcbincludedir='${includedir}/xcb' -AC_SUBST(xcbincludedir) - -pkgconfigdir='${libdir}/pkgconfig' -AC_SUBST(pkgconfigdir) - -PKG_CHECK_MODULES(XCB, xcb >= 1.4) - -###### -# Check version of xcb-proto that xcb was compiled against -###### -xcbproto_required=1.5 - -# Moved from AX_COMPARE_VERSION to maintain proper output -AC_PROG_AWK - -AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required]) -xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb` -AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes", xcbproto_ok="no") -AC_MSG_RESULT([$xcbproto_ok]) - -if test $xcbproto_ok = no; then - AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher]) -fi - - -PKG_CHECK_MODULES(XCB_SHM, xcb-shm) -PKG_CHECK_MODULES(XCB_RENDER, xcb-render) PKG_CHECK_MODULES(XPROTO, xproto >= 7.0.8) -XCB_AUX_CFLAGS='-I$(top_srcdir)/aux' -XCB_AUX_LIBS='$(top_builddir)/aux/libxcb-aux.la' -XCB_ATOM_CFLAGS='-I$(top_srcdir)/atom -I$(top_builddir)/atom' -XCB_ATOM_LIBS='$(top_builddir)/atom/libxcb-atom.la' -XCB_EVENT_CFLAGS='-I$(top_srcdir)/event' -XCB_EVENT_LIBS='$(top_builddir)/event/libxcb-event.la' -XCB_PROPERTY_CFLAGS='-I$(top_srcdir)/property' -XCB_PROPERTY_LIBS='$(top_builddir)/property/libxcb-property.la' -XCB_ICCCM_CFLAGS='-I$(top_srcdir)/icccm' -XCB_ICCCM_LIBS='$(top_builddir)/icccm/libxcb-icccm.la' -AC_SUBST(XCB_AUX_CFLAGS) -AC_SUBST(XCB_AUX_LIBS) -AC_SUBST(XCB_ATOM_CFLAGS) -AC_SUBST(XCB_ATOM_LIBS) -AC_SUBST(XCB_EVENT_CFLAGS) -AC_SUBST(XCB_EVENT_LIBS) -AC_SUBST(XCB_PROPERTY_CFLAGS) -AC_SUBST(XCB_PROPERTY_LIBS) -AC_SUBST(XCB_ICCCM_CFLAGS) -AC_SUBST(XCB_ICCCM_LIBS) - -AC_OUTPUT([Makefile - aux/Makefile aux/xcb-aux.pc - reply/Makefile reply/xcb-reply.pc - image/Makefile image/xcb-image.pc - atom/Makefile atom/xcb-atom.pc - event/Makefile event/xcb-event.pc - keysyms/Makefile keysyms/xcb-keysyms.pc - property/Makefile property/xcb-property.pc - icccm/Makefile icccm/xcb-icccm.pc - renderutil/Makefile renderutil/xcb-renderutil.pc - xcb_util_intro - ]) +AC_CONFIG_FILES([Makefile + src/Makefile + xcb-atom.pc + xcb-aux.pc + xcb-event.pc + xcb-util.pc + xcb-renderutil.pc + xcb_util_intro]) +AC_OUTPUT diff --git a/depcomp b/depcomp deleted file mode 100755 index df8eea7..0000000 --- a/depcomp +++ /dev/null @@ -1,630 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" - depmode=msvisualcpp -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" - echo >> "$depfile" - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/event/Makefile.am b/event/Makefile.am deleted file mode 100644 index 5a7d819..0000000 --- a/event/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-event.la - -xcbinclude_HEADERS = xcb_event.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_event_la_SOURCES = event.c -libxcb_event_la_CPPFLAGS = $(XCB_CFLAGS) -libxcb_event_la_LIBADD = $(XCB_LIBS) -libxcb_event_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-event.pc - -EXTRA_DIST = xcb-event.pc.in diff --git a/event/event.c b/event/event.c deleted file mode 100644 index 7faac1c..0000000 --- a/event/event.c +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright © 2008-2009 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include - -#include "xcb_event.h" -#include "../xcb-util-common.h" - -void -xcb_event_handlers_init(xcb_connection_t *c, xcb_event_handlers_t *evenths) -{ - memset(evenths, 0, sizeof(xcb_event_handlers_t)); - evenths->c = c; -} - -xcb_connection_t * -xcb_event_get_xcb_connection(xcb_event_handlers_t *evenths) -{ - return evenths->c; -} - -static xcb_event_handler_t * -get_event_handler(xcb_event_handlers_t *evenths, int event) -{ - assert(event < 256); - event &= XCB_EVENT_RESPONSE_TYPE_MASK; - assert(event >= 2); - return &evenths->event[event - 2]; -} - -static xcb_event_handler_t * -get_error_handler(xcb_event_handlers_t *evenths, int error) -{ - assert(error >= 0 && error < 256); - return &evenths->error[error]; -} - -int -xcb_event_handle(xcb_event_handlers_t *evenths, xcb_generic_event_t *event) -{ - xcb_event_handler_t *eventh = 0; - assert(event->response_type != 1); - - if(event->response_type == 0) - eventh = get_error_handler(evenths, ((xcb_generic_error_t *) event)->error_code); - else - eventh = get_event_handler(evenths, event->response_type); - - if(eventh->handler) - return eventh->handler(eventh->data, evenths->c, event); - return 0; -} - -void -xcb_event_wait_for_event_loop(xcb_event_handlers_t *evenths) -{ - xcb_generic_event_t *event; - while((event = xcb_wait_for_event(evenths->c))) - { - xcb_event_handle(evenths, event); - free(event); - } -} - -void -xcb_event_poll_for_event_loop(xcb_event_handlers_t *evenths) -{ - xcb_generic_event_t *event; - while ((event = xcb_poll_for_event(evenths->c))) - { - xcb_event_handle(evenths, event); - free(event); - } -} - -static void -set_handler(xcb_generic_event_handler_t handler, void *data, xcb_event_handler_t *place) -{ - xcb_event_handler_t eventh = { handler, data }; - *place = eventh; -} - -void -xcb_event_set_handler(xcb_event_handlers_t *evenths, int event, xcb_generic_event_handler_t handler, void *data) -{ - set_handler(handler, data, get_event_handler(evenths, event)); -} - -void -xcb_event_set_error_handler(xcb_event_handlers_t *evenths, int error, xcb_generic_error_handler_t handler, void *data) -{ - set_handler((xcb_generic_event_handler_t) handler, data, get_error_handler(evenths, error)); -} - -static const char *labelError[] = -{ - "Success", - "BadRequest", - "BadValue", - "BadWindow", - "BadPixmap", - "BadAtom", - "BadCursor", - "BadFont", - "BadMatch", - "BadDrawable", - "BadAccess", - "BadAlloc", - "BadColor", - "BadGC", - "BadIDChoice", - "BadName", - "BadLength", - "BadImplementation", -}; - -static const char *labelRequest[] = -{ - "no request", - "CreateWindow", - "ChangeWindowAttributes", - "GetWindowAttributes", - "DestroyWindow", - "DestroySubwindows", - "ChangeSaveSet", - "ReparentWindow", - "MapWindow", - "MapSubwindows", - "UnmapWindow", - "UnmapSubwindows", - "ConfigureWindow", - "CirculateWindow", - "GetGeometry", - "QueryTree", - "InternAtom", - "GetAtomName", - "ChangeProperty", - "DeleteProperty", - "GetProperty", - "ListProperties", - "SetSelectionOwner", - "GetSelectionOwner", - "ConvertSelection", - "SendEvent", - "GrabPointer", - "UngrabPointer", - "GrabButton", - "UngrabButton", - "ChangeActivePointerGrab", - "GrabKeyboard", - "UngrabKeyboard", - "GrabKey", - "UngrabKey", - "AllowEvents", - "GrabServer", - "UngrabServer", - "QueryPointer", - "GetMotionEvents", - "TranslateCoords", - "WarpPointer", - "SetInputFocus", - "GetInputFocus", - "QueryKeymap", - "OpenFont", - "CloseFont", - "QueryFont", - "QueryTextExtents", - "ListFonts", - "ListFontsWithInfo", - "SetFontPath", - "GetFontPath", - "CreatePixmap", - "FreePixmap", - "CreateGC", - "ChangeGC", - "CopyGC", - "SetDashes", - "SetClipRectangles", - "FreeGC", - "ClearArea", - "CopyArea", - "CopyPlane", - "PolyPoint", - "PolyLine", - "PolySegment", - "PolyRectangle", - "PolyArc", - "FillPoly", - "PolyFillRectangle", - "PolyFillArc", - "PutImage", - "GetImage", - "PolyText", - "PolyText", - "ImageText", - "ImageText", - "CreateColormap", - "FreeColormap", - "CopyColormapAndFree", - "InstallColormap", - "UninstallColormap", - "ListInstalledColormaps", - "AllocColor", - "AllocNamedColor", - "AllocColorCells", - "AllocColorPlanes", - "FreeColors", - "StoreColors", - "StoreNamedColor", - "QueryColors", - "LookupColor", - "CreateCursor", - "CreateGlyphCursor", - "FreeCursor", - "RecolorCursor", - "QueryBestSize", - "QueryExtension", - "ListExtensions", - "ChangeKeyboardMapping", - "GetKeyboardMapping", - "ChangeKeyboardControl", - "GetKeyboardControl", - "Bell", - "ChangePointerControl", - "GetPointerControl", - "SetScreenSaver", - "GetScreenSaver", - "ChangeHosts", - "ListHosts", - "SetAccessControl", - "SetCloseDownMode", - "KillClient", - "RotateProperties", - "ForceScreenSaver", - "SetPointerMapping", - "GetPointerMapping", - "SetModifierMapping", - "GetModifierMapping", - "major 120", - "major 121", - "major 122", - "major 123", - "major 124", - "major 125", - "major 126", - "NoOperation", -}; - -static const char *labelEvent[] = -{ - "error", - "reply", - "KeyPress", - "KeyRelease", - "ButtonPress", - "ButtonRelease", - "MotionNotify", - "EnterNotify", - "LeaveNotify", - "FocusIn", - "FocusOut", - "KeymapNotify", - "Expose", - "GraphicsExpose", - "NoExpose", - "VisibilityNotify", - "CreateNotify", - "DestroyNotify", - "UnmapNotify", - "MapNotify", - "MapRequest", - "ReparentNotify", - "ConfigureNotify", - "ConfigureRequest", - "GravityNotify", - "ResizeRequest", - "CirculateNotify", - "CirculateRequest", - "PropertyNotify", - "SelectionClear", - "SelectionRequest", - "SelectionNotify", - "ColormapNotify", - "ClientMessage", - "MappingNotify", -}; - -const char * -xcb_event_get_label(uint8_t type) -{ - if(type < countof(labelEvent)) - return labelEvent[type]; - return NULL; -} - -const char * -xcb_event_get_error_label(uint8_t type) -{ - if(type < countof(labelError)) - return labelError[type]; - return NULL; -} - -const char * -xcb_event_get_request_label(uint8_t type) -{ - if(type < countof(labelRequest)) - return labelRequest[type]; - return NULL; -} diff --git a/event/xcb-event.pc.in b/event/xcb-event.pc.in deleted file mode 100644 index 535607e..0000000 --- a/event/xcb-event.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Event library -Description: XCB event callback interface -Version: @PACKAGE_VERSION@ -Requires: xcb -Libs: -L${libdir} -lxcb-event @LIBS@ -Cflags: -I${includedir} diff --git a/event/xcb_event.h b/event/xcb_event.h deleted file mode 100644 index 9bd286b..0000000 --- a/event/xcb_event.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2008-2009 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -/** - * @defgroup xcb__event_t XCB Event Functions - * - * These functions ease the handling of X events received. - * - * @{ - */ - -#ifndef __XCB_EVENT_H__ -#define __XCB_EVENT_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Bit mask to find event type regardless of event source. - * - * Each event in the X11 protocol contains an 8-bit type code. - * The most-significant bit in this code is set if the event was - * generated from a SendEvent request. This mask can be used to - * determine the type of event regardless of how the event was - * generated. See the X11R6 protocol specification for details. - */ -#define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) -#define XCB_EVENT_RESPONSE_TYPE(e) (e->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) -#define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONSE_TYPE_MASK) - -typedef int (*xcb_generic_event_handler_t)(void *data, xcb_connection_t *c, xcb_generic_event_t *event); -typedef int (*xcb_generic_error_handler_t)(void *data, xcb_connection_t *c, xcb_generic_error_t *error); - -typedef struct xcb_event_handler xcb_event_handler_t; -struct xcb_event_handler -{ - xcb_generic_event_handler_t handler; - void *data; -}; - -typedef struct xcb_event_handlers xcb_event_handlers_t; -struct xcb_event_handlers -{ - xcb_event_handler_t event[126]; - xcb_event_handler_t error[256]; - xcb_connection_t *c; -}; - -/** - * @brief Initialize event handlers data structure. - * @param c The connection to the X server. - * @param evenths A pointer to the event handler data structure to initialize. - */ -void xcb_event_handlers_init(xcb_connection_t *c, xcb_event_handlers_t *evenths); - -/** - * @brief Get X connection used in event handlers. - * @param evenths The event handlers. - * @return The connection to the X server. - */ -xcb_connection_t *xcb_event_get_xcb_connection(xcb_event_handlers_t *evenths); - -/** - * @brief Wait for event and handle it with event handler. - * @param evenths The event handlers. - */ -void xcb_event_wait_for_event_loop(xcb_event_handlers_t *evenths); - -/** - * @brief Poll for event and handle it with event handler. - * @param evenths The event handlers. - */ -void xcb_event_poll_for_event_loop(xcb_event_handlers_t *evenths); - -/** - * @brief Handle an event using event handlers from event handlers data - * structure. - * @param evenths The event handlers. - * @param event The event to handle. - * @return The return value of the handler, or 0 if no handler exists for this - * event. - */ -int xcb_event_handle(xcb_event_handlers_t *evenths, xcb_generic_event_t *event); - -/** - * @brief Set an event handler for an event type. - * @param evenths The event handlers data structure. - * @param event The event type. - * @param handler The callback function to call for this event type. - * @param data Optional data pointer to pass to handler callback function. - */ -void xcb_event_set_handler(xcb_event_handlers_t *evenths, int event, xcb_generic_event_handler_t handler, void *data); - -/** - * @brief Set an error handler for an error type. - * @param evenths The error handlers data structure. - * @param error The error type. - * @param handler The callback function to call for this error type. - * @param data Optional data pointer to pass to handler callback function. - */ -void xcb_event_set_error_handler(xcb_event_handlers_t *evenths, int error, xcb_generic_error_handler_t handler, void *data); - -#define XCB_EVENT_MAKE_EVENT_HANDLER(lkind, ukind) \ -static inline void xcb_event_set_##lkind##_handler(xcb_event_handlers_t *evenths, int (*handler)(void *, xcb_connection_t *, xcb_##lkind##_event_t *), void *data) \ -{ \ - xcb_event_set_handler(evenths, XCB_##ukind, (xcb_generic_event_handler_t) handler, data); \ -} - -XCB_EVENT_MAKE_EVENT_HANDLER(key_press, KEY_PRESS) -XCB_EVENT_MAKE_EVENT_HANDLER(key_release, KEY_RELEASE) -XCB_EVENT_MAKE_EVENT_HANDLER(button_press, BUTTON_PRESS) -XCB_EVENT_MAKE_EVENT_HANDLER(button_release, BUTTON_RELEASE) -XCB_EVENT_MAKE_EVENT_HANDLER(motion_notify, MOTION_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(enter_notify, ENTER_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(leave_notify, LEAVE_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(focus_in, FOCUS_IN) -XCB_EVENT_MAKE_EVENT_HANDLER(focus_out, FOCUS_OUT) -XCB_EVENT_MAKE_EVENT_HANDLER(keymap_notify, KEYMAP_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(expose, EXPOSE) -XCB_EVENT_MAKE_EVENT_HANDLER(graphics_exposure, GRAPHICS_EXPOSURE) -XCB_EVENT_MAKE_EVENT_HANDLER(no_exposure, NO_EXPOSURE) -XCB_EVENT_MAKE_EVENT_HANDLER(visibility_notify, VISIBILITY_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(create_notify, CREATE_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(destroy_notify, DESTROY_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(unmap_notify, UNMAP_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(map_notify, MAP_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(map_request, MAP_REQUEST) -XCB_EVENT_MAKE_EVENT_HANDLER(reparent_notify, REPARENT_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(configure_notify, CONFIGURE_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(configure_request, CONFIGURE_REQUEST) -XCB_EVENT_MAKE_EVENT_HANDLER(gravity_notify, GRAVITY_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(resize_request, RESIZE_REQUEST) -XCB_EVENT_MAKE_EVENT_HANDLER(circulate_notify, CIRCULATE_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(circulate_request, CIRCULATE_REQUEST) -XCB_EVENT_MAKE_EVENT_HANDLER(property_notify, PROPERTY_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(selection_clear, SELECTION_CLEAR) -XCB_EVENT_MAKE_EVENT_HANDLER(selection_request, SELECTION_REQUEST) -XCB_EVENT_MAKE_EVENT_HANDLER(selection_notify, SELECTION_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(colormap_notify, COLORMAP_NOTIFY) -XCB_EVENT_MAKE_EVENT_HANDLER(client_message, CLIENT_MESSAGE) -XCB_EVENT_MAKE_EVENT_HANDLER(mapping_notify, MAPPING_NOTIFY) - -/** Everyting is ok */ -#define XCB_EVENT_ERROR_SUCESS 0 -/** Bad request code */ -#define XCB_EVENT_ERROR_BAD_REQUEST 1 -/** Int parameter out of range */ -#define XCB_EVENT_ERROR_BAD_VALUE 2 -/** Parameter not a Window */ -#define XCB_EVENT_ERROR_BAD_WINDOW 3 -/** Parameter not a Pixmap */ -#define XCB_EVENT_ERROR_BAD_PIXMAP 4 -/** Parameter not an Atom */ -#define XCB_EVENT_ERROR_BAD_ATOM 5 -/** Parameter not a Cursor */ -#define XCB_EVENT_ERROR_BAD_CURSOR 6 -/** Parameter not a Font */ -#define XCB_EVENT_ERROR_BAD_FONT 7 -/** Parameter mismatch */ -#define XCB_EVENT_ERROR_BAD_MATCH 8 -/** Parameter not a Pixmap or Window */ -#define XCB_EVENT_ERROR_BAD_DRAWABLE 9 -/* Depending on context: - - key/button already grabbed - - attempt to free an illegal - cmap entry - - attempt to store into a read-only - color map entry. - - attempt to modify the access control - list from other than the local host. -*/ -#define XCB_EVENT_ERROR_BAD_ACCESS 10 -/** Insufficient resources */ -#define XCB_EVENT_ERROR_BAD_ALLOC 11 -/** No such colormap */ -#define XCB_EVENT_ERROR_BAD_COLOR 12 -/** Parameter not a GC */ -#define XCB_EVENT_ERROR_BAD_GC 13 -/** Choice not in range or already used */ -#define XCB_EVENT_ERROR_BAD_ID_CHOICE 14 -/** Font or color name doesn't exist */ -#define XCB_EVENT_ERROR_BAD_NAME 15 -/** Request length incorrect */ -#define XCB_EVENT_ERROR_BAD_LENGTH 16 -/** Server is defective */ -#define XCB_EVENT_ERROR_BAD_IMPLEMENTATION 17 - -/** - * @brief Convert an event reponse type to a label. - * @param type The event type. - * @return A string with the event name, or NULL if unknown. - */ -const char * xcb_event_get_label(uint8_t type); - -/** - * @brief Convert an event error type to a label. - * @param type The erro type. - * @return A string with the event name, or NULL if unknown or if the event is - * not an error. - */ -const char * xcb_event_get_error_label(uint8_t type); - -/** - * @brief Convert an event request type to a label. - * @param type The request type. - * @return A string with the event name, or NULL if unknown or if the event is - * not an error. - */ -const char * xcb_event_get_request_label(uint8_t type); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* __XCB_EVENT_H__ */ diff --git a/gendoc b/gendoc deleted file mode 100644 index 7b53f45..0000000 --- a/gendoc +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -rm -rf ./doc/html ./doc/latex ./doc/man -doxygen -rm -f xcb_util_docs.tar xcb_util_docs.tar.gz -tar -cvf xcb_util_docs.tar doc/html doc/man doc/latex doc/xml -gzip -9 xcb_util_docs.tar -exit 0 diff --git a/icccm/Makefile.am b/icccm/Makefile.am deleted file mode 100644 index 9ad4238..0000000 --- a/icccm/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-icccm.la - -xcbinclude_HEADERS = xcb_icccm.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_icccm_la_SOURCES = icccm.c -libxcb_icccm_la_CPPFLAGS = $(XCB_CFLAGS) $(XCB_ATOM_CFLAGS) $(XCB_EVENT_CFLAGS) \ - $(XCB_PROPERTY_CFLAGS) -libxcb_icccm_la_LIBADD = $(XCB_LIBS) $(XCB_ATOM_LIBS) $(XCB_PROPERTY_LIBS) -libxcb_icccm_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-icccm.pc - -EXTRA_DIST = xcb-icccm.pc.in diff --git a/icccm/icccm.c b/icccm/icccm.c deleted file mode 100644 index 776c299..0000000 --- a/icccm/icccm.c +++ /dev/null @@ -1,726 +0,0 @@ -/* - * Copyright © 2008 Arnaud Fontaine - * Copyright © 2007-2008 Vincent Torri - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include - -#include "xcb_icccm.h" -#include "xcb_atom.h" - -xcb_get_property_cookie_t -xcb_get_text_property(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property) -{ - return xcb_get_any_property(c, 0, window, property, UINT_MAX); -} - -xcb_get_property_cookie_t -xcb_get_text_property_unchecked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property) -{ - return xcb_get_any_property_unchecked(c, 0, window, property, UINT_MAX); -} - -uint8_t -xcb_get_text_property_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - - if(!reply) - return 0; - - prop->_reply = reply; - prop->encoding = prop->_reply->type; - prop->format = prop->_reply->format; - prop->name_len = xcb_get_property_value_length(prop->_reply); - prop->name = xcb_get_property_value(prop->_reply); - - return 1; -} - -void -xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop) -{ - free(prop->_reply); -} - -/* WM_NAME */ - -void -xcb_set_wm_name_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_NAME, - encoding, 8, name_len, name); -} - -void -xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window, xcb_atom_t encoding, - uint32_t name_len, const char *name) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, WM_NAME, encoding, 8, - name_len, name); -} - -xcb_get_property_cookie_t -xcb_get_wm_name(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property(c, window, WM_NAME); -} - -xcb_get_property_cookie_t -xcb_get_wm_name_unchecked(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property_unchecked(c, window, WM_NAME); -} - -uint8_t -xcb_get_wm_name_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e) -{ - return xcb_get_text_property_reply(c, cookie, prop, e); -} - -void -xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len, - xcb_generic_property_handler_t handler, void *data) -{ - xcb_property_set_handler(prophs, WM_NAME, long_len, handler, data); -} - -/* WM_ICON_NAME */ - -void -xcb_set_wm_icon_name_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_ICON_NAME, - encoding, 8, name_len, name); -} - -void -xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, const char *name) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, WM_ICON_NAME, encoding, - 8, name_len, name); -} - -xcb_get_property_cookie_t -xcb_get_wm_icon_name(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property(c, window, WM_ICON_NAME); -} - -xcb_get_property_cookie_t -xcb_get_wm_icon_name_unchecked(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property_unchecked(c, window, WM_ICON_NAME); -} - -uint8_t -xcb_get_wm_icon_name_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e) -{ - return xcb_get_text_property_reply(c, cookie, prop, e); -} - -void -xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs, uint32_t long_len, - xcb_generic_property_handler_t handler, void *data) -{ - xcb_property_set_handler(prophs, WM_ICON_NAME, long_len, handler, data); -} - -/* WM_CLIENT_MACHINE */ - -void -xcb_set_wm_client_machine_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, - WM_CLIENT_MACHINE, encoding, 8, name_len, name); -} - -void -xcb_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, WM_CLIENT_MACHINE, - encoding, 8, name_len, name); -} - -xcb_get_property_cookie_t -xcb_get_wm_client_machine(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property(c, window, WM_CLIENT_MACHINE); -} - -xcb_get_property_cookie_t -xcb_get_wm_client_machine_unchecked(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_text_property_unchecked(c, window, WM_CLIENT_MACHINE); -} - -uint8_t -xcb_get_wm_client_machine_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e) -{ - return xcb_get_text_property_reply(c, cookie, prop, e); -} - -void -xcb_watch_wm_client_machine(xcb_property_handlers_t *prophs, uint32_t long_len, - xcb_generic_property_handler_t handler, void *data) -{ - xcb_property_set_handler(prophs, WM_CLIENT_MACHINE, long_len, handler, data); -} - -/* WM_CLASS */ - -xcb_get_property_cookie_t -xcb_get_wm_class(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_property(c, 0, window, WM_CLASS, STRING, 0L, 2048L); -} - -xcb_get_property_cookie_t -xcb_get_wm_class_unchecked(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_property_unchecked(c, 0, window, WM_CLASS, STRING, 0L, 2048L); -} - -uint8_t -xcb_get_wm_class_from_reply(xcb_get_wm_class_reply_t *prop, - xcb_get_property_reply_t *reply) -{ - if(!reply || reply->type != STRING || reply->format != 8) - return 0; - - prop->_reply = reply; - prop->instance_name = (char *) xcb_get_property_value(prop->_reply); - - int name_len = strlen(prop->instance_name); - if(name_len == xcb_get_property_value_length(prop->_reply)) - name_len--; - - prop->class_name = prop->instance_name + name_len + 1; - - return 1; -} - -uint8_t -xcb_get_wm_class_reply(xcb_connection_t *c, xcb_get_property_cookie_t cookie, - xcb_get_wm_class_reply_t *prop, xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - uint8_t ret = xcb_get_wm_class_from_reply(prop, reply); - /* if reply parsing failed, free the reply to avoid mem leak */ - if(!ret) - free(reply); - return ret; -} - -void -xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop) -{ - free(prop->_reply); -} - -/* WM_TRANSIENT_FOR */ - -xcb_get_property_cookie_t -xcb_get_wm_transient_for(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_property(c, 0, window, WM_TRANSIENT_FOR, WINDOW, 0, 1); -} - -xcb_get_property_cookie_t -xcb_get_wm_transient_for_unchecked(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_property_unchecked(c, 0, window, WM_TRANSIENT_FOR, WINDOW, 0, 1); -} - -uint8_t -xcb_get_wm_transient_for_from_reply(xcb_window_t *prop, - xcb_get_property_reply_t *reply) -{ - if(!reply || reply->type != WINDOW || reply->format != 32 || !reply->length) - return 0; - - *prop = *((xcb_window_t *) xcb_get_property_value(reply)); - - return 1; -} - -uint8_t -xcb_get_wm_transient_for_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_window_t *prop, - xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - uint8_t ret = xcb_get_wm_transient_for_from_reply(prop, reply); - free(reply); - return ret; -} - -/* WM_SIZE_HINTS */ - -void -xcb_size_hints_set_position(xcb_size_hints_t *hints, int user_specified, - int32_t x, int32_t y) -{ - hints->flags &= ~(XCB_SIZE_HINT_US_POSITION | XCB_SIZE_HINT_P_POSITION); - if (user_specified) - hints->flags |= XCB_SIZE_HINT_US_POSITION; - else - hints->flags |= XCB_SIZE_HINT_P_POSITION; - hints->x = x; - hints->y = y; -} - -void -xcb_size_hints_set_size(xcb_size_hints_t *hints, int user_specified, - int32_t width, int32_t height) -{ - hints->flags &= ~(XCB_SIZE_HINT_US_SIZE | XCB_SIZE_HINT_P_SIZE); - if (user_specified) - hints->flags |= XCB_SIZE_HINT_US_SIZE; - else - hints->flags |= XCB_SIZE_HINT_P_SIZE; - hints->width = width; - hints->height = height; -} - -void -xcb_size_hints_set_min_size(xcb_size_hints_t *hints, int32_t min_width, - int32_t min_height) -{ - hints->flags |= XCB_SIZE_HINT_P_MIN_SIZE; - hints->min_width = min_width; - hints->min_height = min_height; -} - -void -xcb_size_hints_set_max_size(xcb_size_hints_t *hints, int32_t max_width, - int32_t max_height) -{ - hints->flags |= XCB_SIZE_HINT_P_MAX_SIZE; - hints->max_width = max_width; - hints->max_height = max_height; -} - -void -xcb_size_hints_set_resize_inc(xcb_size_hints_t *hints, int32_t width_inc, - int32_t height_inc) -{ - hints->flags |= XCB_SIZE_HINT_P_RESIZE_INC; - hints->width_inc = width_inc; - hints->height_inc = height_inc; -} - -void -xcb_size_hints_set_aspect(xcb_size_hints_t *hints, int32_t min_aspect_num, - int32_t min_aspect_den, int32_t max_aspect_num, - int32_t max_aspect_den) -{ - hints->flags |= XCB_SIZE_HINT_P_ASPECT; - hints->min_aspect_num = min_aspect_num; - hints->min_aspect_den = min_aspect_den; - hints->max_aspect_num = max_aspect_num; - hints->max_aspect_den = max_aspect_den; -} - -void -xcb_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_width, - int32_t base_height) -{ - hints->flags |= XCB_SIZE_HINT_BASE_SIZE; - hints->base_width = base_width; - hints->base_height = base_height; -} - -void -xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints, xcb_gravity_t win_gravity) -{ - hints->flags |= XCB_SIZE_HINT_P_WIN_GRAVITY; - hints->win_gravity = win_gravity; -} - -void -xcb_set_wm_size_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property, xcb_size_hints_t *hints) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, property, - WM_SIZE_HINTS, 32, sizeof(*hints) >> 2, hints); -} - -void -xcb_set_wm_size_hints(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property, xcb_size_hints_t *hints) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, property, - WM_SIZE_HINTS, 32, sizeof(*hints) >> 2, hints); -} - -xcb_get_property_cookie_t -xcb_get_wm_size_hints(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property) -{ - /* NumPropSizeElements = 18 (ICCCM version 1). */ - return xcb_get_property(c, 0, window, property, WM_SIZE_HINTS, 0L, 18); -} - -xcb_get_property_cookie_t -xcb_get_wm_size_hints_unchecked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property) -{ - return xcb_get_property_unchecked(c, 0, window, property, WM_SIZE_HINTS, - 0L, 18); -} - -uint8_t -xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hints, xcb_get_property_reply_t *reply) -{ - uint32_t flags; - - if(!reply) - return 0; - - int length = xcb_get_property_value_length(reply) / (reply->format / 8); - - if (!(reply->type == WM_SIZE_HINTS && - (reply->format == 8 || reply->format == 16 || - reply->format == 32) && - /* OldNumPropSizeElements = 15 (pre-ICCCM) */ - length >= 15)) - return 0; - - memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value (reply), - length * reply->format >> 3); - - flags = (XCB_SIZE_HINT_US_POSITION | XCB_SIZE_HINT_US_SIZE | - XCB_SIZE_HINT_P_POSITION | XCB_SIZE_HINT_P_SIZE | - XCB_SIZE_HINT_P_MIN_SIZE | XCB_SIZE_HINT_P_MAX_SIZE | - XCB_SIZE_HINT_P_RESIZE_INC | XCB_SIZE_HINT_P_ASPECT); - - /* NumPropSizeElements = 18 (ICCCM version 1) */ - if(length >= 18) - flags |= (XCB_SIZE_HINT_BASE_SIZE | XCB_SIZE_HINT_P_WIN_GRAVITY); - else - { - hints->base_width = 0; - hints->base_height = 0; - hints->win_gravity = 0; - } - /* get rid of unwanted bits */ - hints->flags &= flags; - - return 1; -} - -uint8_t -xcb_get_wm_size_hints_reply(xcb_connection_t *c, xcb_get_property_cookie_t cookie, - xcb_size_hints_t *hints, xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - uint8_t ret = xcb_get_wm_size_hints_from_reply(hints, reply); - free(reply); - return ret; -} - -/* WM_NORMAL_HINTS */ - -void -xcb_set_wm_normal_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_size_hints_t *hints) -{ - xcb_set_wm_size_hints_checked(c, window, WM_NORMAL_HINTS, hints); -} - -void -xcb_set_wm_normal_hints(xcb_connection_t *c, xcb_window_t window, - xcb_size_hints_t *hints) -{ - xcb_set_wm_size_hints(c, window, WM_NORMAL_HINTS, hints); -} - -xcb_get_property_cookie_t -xcb_get_wm_normal_hints(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_wm_size_hints(c, window, WM_NORMAL_HINTS); -} - -xcb_get_property_cookie_t -xcb_get_wm_normal_hints_unchecked(xcb_connection_t *c, xcb_window_t window) -{ - return xcb_get_wm_size_hints_unchecked(c, window, WM_NORMAL_HINTS); -} - -uint8_t -xcb_get_wm_normal_hints_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_size_hints_t *hints, - xcb_generic_error_t **e) -{ - return xcb_get_wm_size_hints_reply(c, cookie, hints, e); -} - -/* WM_HINTS */ - -uint32_t -xcb_wm_hints_get_urgency(xcb_wm_hints_t *hints) -{ - return (hints->flags & XCB_WM_HINT_X_URGENCY); -} - -void -xcb_wm_hints_set_input(xcb_wm_hints_t *hints, uint8_t input) -{ - hints->input = input; - hints->flags |= XCB_WM_HINT_INPUT; -} - -void -xcb_wm_hints_set_iconic(xcb_wm_hints_t *hints) -{ - hints->initial_state = XCB_WM_STATE_ICONIC; - hints->flags |= XCB_WM_HINT_STATE; -} - -void -xcb_wm_hints_set_normal(xcb_wm_hints_t *hints) -{ - hints->initial_state = XCB_WM_STATE_NORMAL; - hints->flags |= XCB_WM_HINT_STATE; -} - -void -xcb_wm_hints_set_withdrawn(xcb_wm_hints_t *hints) -{ - hints->initial_state = XCB_WM_STATE_WITHDRAWN; - hints->flags |= XCB_WM_HINT_STATE; -} - -void -xcb_wm_hints_set_none(xcb_wm_hints_t *hints) -{ - hints->flags &= ~XCB_WM_HINT_STATE; -} - -void -xcb_wm_hints_set_icon_pixmap(xcb_wm_hints_t *hints, xcb_pixmap_t icon_pixmap) -{ - hints->icon_pixmap = icon_pixmap; - hints->flags |= XCB_WM_HINT_ICON_PIXMAP; -} - -void -xcb_wm_hints_set_icon_mask(xcb_wm_hints_t *hints, xcb_pixmap_t icon_mask) -{ - hints->icon_mask = icon_mask; - hints->flags |= XCB_WM_HINT_ICON_MASK; -} - -void -xcb_wm_hints_set_icon_window(xcb_wm_hints_t *hints, xcb_window_t icon_window) -{ - hints->icon_window = icon_window; - hints->flags |= XCB_WM_HINT_ICON_WINDOW; -} - -void -xcb_wm_hints_set_window_group(xcb_wm_hints_t *hints, xcb_window_t window_group) -{ - hints->window_group = window_group; - hints->flags |= XCB_WM_HINT_WINDOW_GROUP; -} - -void -xcb_wm_hints_set_urgency(xcb_wm_hints_t *hints) -{ - hints->flags |= XCB_WM_HINT_X_URGENCY; -} - -void -xcb_set_wm_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_wm_hints_t *hints) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, WM_HINTS, - WM_HINTS, 32, sizeof(*hints) >> 2, hints); -} - -void -xcb_set_wm_hints(xcb_connection_t *c, xcb_window_t window, - xcb_wm_hints_t *hints) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, WM_HINTS, WM_HINTS, 32, - sizeof(*hints) >> 2, hints); -} - -xcb_get_property_cookie_t -xcb_get_wm_hints(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_property(c, 0, window, WM_HINTS, WM_HINTS, 0L, - XCB_NUM_WM_HINTS_ELEMENTS); -} - -xcb_get_property_cookie_t -xcb_get_wm_hints_unchecked(xcb_connection_t *c, - xcb_window_t window) -{ - return xcb_get_property_unchecked(c, 0, window, WM_HINTS, WM_HINTS, 0L, - XCB_NUM_WM_HINTS_ELEMENTS); -} - -uint8_t -xcb_get_wm_hints_from_reply(xcb_wm_hints_t *hints, - xcb_get_property_reply_t *reply) -{ - if(!reply) - return 0; - - int length = xcb_get_property_value_length(reply); - int num_elem = length / (reply->format / 8); - - if (reply->type != WM_HINTS - || reply->format != 32 - || num_elem < XCB_NUM_WM_HINTS_ELEMENTS - 1) - return 0; - - memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value(reply), length); - - if(num_elem < XCB_NUM_WM_HINTS_ELEMENTS) - hints->window_group = XCB_NONE; - - return 1; -} - -uint8_t -xcb_get_wm_hints_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_wm_hints_t *hints, - xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - int ret = xcb_get_wm_hints_from_reply(hints, reply); - free(reply); - return ret; -} - -/* WM_PROTOCOLS */ - -void -xcb_set_wm_protocols_checked(xcb_connection_t *c, xcb_atom_t wm_protocols, - xcb_window_t window, uint32_t list_len, - xcb_atom_t *list) -{ - xcb_change_property_checked(c, XCB_PROP_MODE_REPLACE, window, wm_protocols, - ATOM, 32, list_len, list); -} - -void -xcb_set_wm_protocols(xcb_connection_t *c, xcb_atom_t wm_protocols, - xcb_window_t window, uint32_t list_len, xcb_atom_t *list) -{ - xcb_change_property(c, XCB_PROP_MODE_REPLACE, window, wm_protocols, ATOM, 32, - list_len, list); -} - -xcb_get_property_cookie_t -xcb_get_wm_protocols(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t wm_protocol_atom) -{ - return xcb_get_property(c, 0, window, wm_protocol_atom, ATOM, 0, UINT_MAX); -} - -xcb_get_property_cookie_t -xcb_get_wm_protocols_unchecked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t wm_protocol_atom) -{ - return xcb_get_property_unchecked(c, 0, window, wm_protocol_atom, ATOM, 0, - UINT_MAX); -} - -uint8_t -xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, xcb_get_wm_protocols_reply_t *protocols) -{ - if(!reply || reply->type != ATOM || reply->format != 32) - return 0; - - protocols->_reply = reply; - protocols->atoms_len = xcb_get_property_value_length(protocols->_reply) / (reply->format / 8); - protocols->atoms = (xcb_atom_t *) xcb_get_property_value(protocols->_reply); - - return 1; -} - -uint8_t -xcb_get_wm_protocols_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_wm_protocols_reply_t *protocols, - xcb_generic_error_t **e) -{ - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - uint8_t ret = xcb_get_wm_protocols_from_reply(reply, protocols); - if(!ret) - free(reply); - return ret; -} - -void -xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocols) -{ - free(protocols->_reply); -} diff --git a/icccm/xcb-icccm.pc.in b/icccm/xcb-icccm.pc.in deleted file mode 100644 index 0586560..0000000 --- a/icccm/xcb-icccm.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB ICCCM library -Description: XCB ICCCM binding -Version: @PACKAGE_VERSION@ -Requires: xcb xcb-atom xcb-property -Libs: -L${libdir} -lxcb-icccm @LIBS@ -Cflags: -I${includedir} diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h deleted file mode 100644 index 938fecb..0000000 --- a/icccm/xcb_icccm.h +++ /dev/null @@ -1,916 +0,0 @@ -#ifndef __XCB_ICCCM_H__ -#define __XCB_ICCCM_H__ - -/* - * Copyright (C) 2008 Arnaud Fontaine - * Copyright (C) 2007-2008 Vincent Torri - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -/** - * @defgroup xcb__icccm_t XCB ICCCM Functions - * - * These functions allow easy handling of the protocol described in the - * Inter-Client Communication Conventions Manual. - * - * @{ - */ - -#include -#include "xcb_property.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief TextProperty reply structure. - */ -typedef struct { - /** Store reply to avoid memory allocation, should normally not be - used directly */ - xcb_get_property_reply_t *_reply; - /** Encoding used */ - xcb_atom_t encoding; - /** Length of the name field above */ - uint32_t name_len; - /** Property value */ - char *name; - /** Format, may be 8, 16 or 32 */ - uint8_t format; -} xcb_get_text_property_reply_t; - -/** - * @brief Deliver a GetProperty request to the X server. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param property Property atom to get. - * @return The request cookie. - * - * Allow to get a window property, in most case you might want to use - * above functions to get an ICCCM property for a given window. - */ -xcb_get_property_cookie_t xcb_get_text_property(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property); - -/** - * @see xcb_get_text_property() - */ -xcb_get_property_cookie_t xcb_get_text_property_unchecked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property); - -/** - * @brief Fill given structure with the property value of a window. - * @param c The connection to the X server. - * @param cookie TextProperty request cookie. - * @param prop TextProperty reply which is to be filled. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * If the function return 0 (failure), the content of prop is unmodified and - * therefore the structure must not be wiped. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_text_property_unchecked() is used. Otherwise, it stores - * the error if any. prop structure members should be freed by - * xcb_get_text_property_reply_wipe(). - */ -uint8_t xcb_get_text_property_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e); - -/** - * @brief Wipe prop structure members previously allocated by - * xcb_get_text_property_reply(). - * @param prop prop structure whose members is going to be freed. - */ -void xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop); - -/* WM_NAME */ - -/** - * @brief Deliver a SetProperty request to set WM_NAME property value. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type. - * @param name_len Length of name value to set. - * @param name Name value to set. - */ -void xcb_set_wm_name_checked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t encoding, - uint32_t name_len, - const char *name); - -/** - * @see xcb_set_wm_name_checked() - */ -void xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name); - -/** - * @brief Deliver a GetProperty request to the X server for WM_NAME. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_name(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_name() - */ -xcb_get_property_cookie_t xcb_get_wm_name_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given structure with the WM_NAME property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param prop WM_NAME property value. - * @param e Error if any. - * @see xcb_get_text_property_reply() - * @return Return 1 on success, 0 otherwise. - */ -uint8_t xcb_get_wm_name_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e); - -/** - * @brief Set a callback on WM_NAME property changes. - * @param prophs Property handlers. - * @param long_len Length of data. - * @param handler The callback. - * @param data data given to the callback. - */ -void xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len, - xcb_generic_property_handler_t handler, void *data); - -/* WM_ICON_NAME */ - -/** - * @brief Deliver a SetProperty request to set WM_ICON_NAME property value. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type. - * @param name_len Length of name value to set. - * @param name Name value to set. - */ -void xcb_set_wm_icon_name_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name); - -/** - * @see xcb_set_wm_icon_name_checked() - */ -void xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name); - -/** - * @brief Send request to get WM_ICON_NAME property of a window. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_icon_name(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_icon_name() - */ -xcb_get_property_cookie_t xcb_get_wm_icon_name_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given structure with the WM_ICON_NAME property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param prop WM_ICON_NAME property value. - * @param e Error if any. - * @see xcb_get_text_property_reply() - * @return Return 1 on success, 0 otherwise. - */ -uint8_t xcb_get_wm_icon_name_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e); - -/** - * @brief Set a callback on WM_ICON_NAME property changes. - * @param prophs Property handlers. - * @param long_len Length of data. - * @param handler The callback. - * @param data data given to the callback. - */ -void xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs, uint32_t long_len, - xcb_generic_property_handler_t handler, - void *data); - -/* WM_CLIENT_MACHINE */ - -/** - * @brief Deliver a SetProperty request to set WM_CLIENT_MACHINE property value. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type. - * @param name_len Length of name value to set. - * @param name Name value to set. - */ -void xcb_set_wm_client_machine_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name); - -/** - * @see xcb_set_wm_client_machine_checked() - */ -void xcb_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t encoding, uint32_t name_len, - const char *name); - -/** - * @brief Send request to get WM_CLIENT_MACHINE property of a window. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_client_machine(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_client_machine() - */ -xcb_get_property_cookie_t xcb_get_wm_client_machine_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given structure with the WM_CLIENT_MACHINE property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param prop WM_CLIENT_MACHINE property value. - * @param e Error if any. - * @see xcb_get_text_property_reply() - * @return Return 1 on success, 0 otherwise. - */ -uint8_t xcb_get_wm_client_machine_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_text_property_reply_t *prop, - xcb_generic_error_t **e); - -/** - * @brief Set a callback on WM_CLIENT_MACHINE property changes. - * @param prophs Property handlers. - * @param long_len Length of data. - * @param handler The callback. - * @param data data given to the callback. - */ -void xcb_watch_wm_client_machine(xcb_property_handlers_t *prophs, - uint32_t long_len, - xcb_generic_property_handler_t handler, - void *data); - -/* WM_CLASS */ - -/** - * @brief WM_CLASS hint structure - */ -typedef struct { - /** Instance name */ - char *instance_name; - /** Class of application */ - char *class_name; - /** Store reply to avoid memory allocation, should normally not be - used directly */ - xcb_get_property_reply_t *_reply; -} xcb_get_wm_class_reply_t; - -/** - * @brief Deliver a GetProperty request to the X server for WM_CLASS. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_class(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_class() - */ -xcb_get_property_cookie_t xcb_get_wm_class_unchecked(xcb_connection_t *c, - xcb_window_t window); - - -/** - * @brief Fill give structure with the WM_CLASS property of a window. - * @param prop The property structur to fill. - * @param reply The property request reply. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t -xcb_get_wm_class_from_reply(xcb_get_wm_class_reply_t *prop, - xcb_get_property_reply_t *reply); - -/** - * @brief Fill given structure with the WM_CLASS property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param prop WM_CLASS property value. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_class_unchecked() is used. Otherwise, it stores the - * error if any. prop structure members should be freed by - * xcb_get_wm_class_reply_wipe(). - */ -uint8_t xcb_get_wm_class_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_wm_class_reply_t *prop, - xcb_generic_error_t **e); - -/** - * @brief Wipe prop structure members previously allocated by - * xcb_get_wm_class_reply(). - * @param prop prop structure whose members is going to be freed. - */ -void xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop); - -/* WM_TRANSIENT_FOR */ - -/** - * @brief Send request to get WM_TRANSIENT_FOR property of a window. - * @param c The connection to the X server - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_transient_for(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_transient_for_unchecked() - */ -xcb_get_property_cookie_t xcb_get_wm_transient_for_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given window pointer with the WM_TRANSIENT_FOR property of a window. - * @param prop WM_TRANSIENT_FOR property value. - * @param reply The get property request reply. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t -xcb_get_wm_transient_for_from_reply(xcb_window_t *prop, - xcb_get_property_reply_t *reply); -/** - * @brief Fill given structure with the WM_TRANSIENT_FOR property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param prop WM_TRANSIENT_FOR property value. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_transient_for_unchecked() is used. Otherwise, it stores - * the error if any. - */ -uint8_t xcb_get_wm_transient_for_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_window_t *prop, - xcb_generic_error_t **e); - -/* WM_SIZE_HINTS */ - -typedef enum { - XCB_SIZE_HINT_US_POSITION = 1 << 0, - XCB_SIZE_HINT_US_SIZE = 1 << 1, - XCB_SIZE_HINT_P_POSITION = 1 << 2, - XCB_SIZE_HINT_P_SIZE = 1 << 3, - XCB_SIZE_HINT_P_MIN_SIZE = 1 << 4, - XCB_SIZE_HINT_P_MAX_SIZE = 1 << 5, - XCB_SIZE_HINT_P_RESIZE_INC = 1 << 6, - XCB_SIZE_HINT_P_ASPECT = 1 << 7, - XCB_SIZE_HINT_BASE_SIZE = 1 << 8, - XCB_SIZE_HINT_P_WIN_GRAVITY = 1 << 9 -} xcb_size_hints_flags_t; - -/** - * @brief Size hints structure. - */ -typedef struct { - /** User specified flags */ - uint32_t flags; - /** User-specified position */ - int32_t x, y; - /** User-specified size */ - int32_t width, height; - /** Program-specified minimum size */ - int32_t min_width, min_height; - /** Program-specified maximum size */ - int32_t max_width, max_height; - /** Program-specified resize increments */ - int32_t width_inc, height_inc; - /** Program-specified minimum aspect ratios */ - int32_t min_aspect_num, min_aspect_den; - /** Program-specified maximum aspect ratios */ - int32_t max_aspect_num, max_aspect_den; - /** Program-specified base size */ - int32_t base_width, base_height; - /** Program-specified window gravity */ - uint32_t win_gravity; -} xcb_size_hints_t; - -/** - * @brief Set size hints to a given position. - * @param hints SIZE_HINTS structure. - * @param user_specified Is the size user-specified? - * @param x The X position. - * @param y The Y position. - */ -void xcb_size_hints_set_position(xcb_size_hints_t *hints, int user_specified, - int32_t x, int32_t y); - -/** - * @brief Set size hints to a given size. - * @param hints SIZE_HINTS structure. - * @param user_specified is the size user-specified? - * @param width The width. - * @param height The height. - */ -void xcb_size_hints_set_size(xcb_size_hints_t *hints, int user_specified, - int32_t width, int32_t height); - -/** - * @brief Set size hints to a given minimum size. - * @param hints SIZE_HINTS structure. - * @param width The minimum width. - * @param height The minimum height. - */ -void xcb_size_hints_set_min_size(xcb_size_hints_t *hints, int32_t min_width, - int32_t min_height); - -/** - * @brief Set size hints to a given maximum size. - * @param hints SIZE_HINTS structure. - * @param width The maximum width. - * @param height The maximum height. - */ -void xcb_size_hints_set_max_size(xcb_size_hints_t *hints, int32_t max_width, - int32_t max_height); - -/** - * @brief Set size hints to a given resize increments. - * @param hints SIZE_HINTS structure. - * @param width The resize increments width. - * @param height The resize increments height. - */ -void xcb_size_hints_set_resize_inc(xcb_size_hints_t *hints, int32_t width_inc, - int32_t height_inc); - -/** - * @brief Set size hints to a given aspect ratios. - * @param hints SIZE_HINTS structure. - * @param min_aspect_num The minimum aspect ratios for the width. - * @param min_aspect_den The minimum aspect ratios for the height. - * @param max_aspect_num The maximum aspect ratios for the width. - * @param max_aspect_den The maximum aspect ratios for the height. - */ -void xcb_size_hints_set_aspect(xcb_size_hints_t *hints, int32_t min_aspect_num, - int32_t min_aspect_den, int32_t max_aspect_num, - int32_t max_aspect_den); - -/** - * @brief Set size hints to a given base size. - * @param hints SIZE_HINTS structure. - * @param base_width Base width. - * @param base_height Base height. - */ -void xcb_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_width, - int32_t base_height); - -/** - * @brief Set size hints to a given window gravity. - * @param hints SIZE_HINTS structure. - * @param win_gravity Window gravity value. - */ -void xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints, - uint32_t win_gravity); - -/** - * @brief Deliver a ChangeProperty request to set a value to a given property. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param property Property to set value for. - * @param hints Hints value to set. - */ -void xcb_set_wm_size_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property, xcb_size_hints_t *hints); - -/** - * @see xcb_set_wm_size_hints_checked() - */ -void xcb_set_wm_size_hints(xcb_connection_t *c, xcb_window_t window, - xcb_atom_t property, xcb_size_hints_t *hints); - -/** - * @brief Send request to get size hints structure for the named property. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param property Specify the property name. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_size_hints(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property); - -/** - * @see xcb_get_wm_size_hints() - */ -xcb_get_property_cookie_t xcb_get_wm_size_hints_unchecked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t property); - -/** - * @brief Fill given structure with the size hints of the named property. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param hints Size hints structure. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_size_hints_unchecked() is used. Otherwise, it stores - * the error if any. The returned pointer should be freed. - */ -uint8_t xcb_get_wm_size_hints_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_size_hints_t *hints, - xcb_generic_error_t **e); - -/* WM_NORMAL_HINTS */ - -/** - * @brief Deliver a ChangeProperty request to set WM_NORMAL_HINTS property value. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param hints Hints value to set. - */ -void xcb_set_wm_normal_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_size_hints_t *hints); - -/** - * @see xcb_set_wm_normal_hints_checked() - */ -void xcb_set_wm_normal_hints(xcb_connection_t *c, xcb_window_t window, - xcb_size_hints_t *hints); - -/** - * @brief Send request to get WM_NORMAL_HINTS property of a window. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_normal_hints(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_normal_hints() - */ -xcb_get_property_cookie_t xcb_get_wm_normal_hints_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given structure with the WM_NORMAL_HINTS property of a window. - * @param hints WM_NORMAL_HINTS property value. - * @param reply The get property request reply. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t -xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hints, - xcb_get_property_reply_t *reply); - -/** - * @brief Fill given structure with the WM_NORMAL_HINTS property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param hints WM_NORMAL_HINTS property value. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_normal_hints_unchecked() is used. Otherwise, it stores - * the error if any. The returned pointer should be freed. - */ -uint8_t xcb_get_wm_normal_hints_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_size_hints_t *hints, - xcb_generic_error_t **e); - -/* WM_HINTS */ - -/** - * @brief WM hints structure (may be extended in the future). - */ -typedef struct { - /** Marks which fields in this structure are defined */ - int32_t flags; - /** Does this application rely on the window manager to get keyboard - input? */ - uint32_t input; - /** See below */ - int32_t initial_state; - /** Pixmap to be used as icon */ - xcb_pixmap_t icon_pixmap; - /** Window to be used as icon */ - xcb_window_t icon_window; - /** Initial position of icon */ - int32_t icon_x, icon_y; - /** Icon mask bitmap */ - xcb_pixmap_t icon_mask; - /* Identifier of related window group */ - xcb_window_t window_group; -} xcb_wm_hints_t; - -/** Number of elements in this structure */ -#define XCB_NUM_WM_HINTS_ELEMENTS 9 - -/** - * @brief WM_HINTS window states. - */ -typedef enum { - XCB_WM_STATE_WITHDRAWN = 0, - XCB_WM_STATE_NORMAL = 1, - XCB_WM_STATE_ICONIC = 3 -} xcb_wm_state_t; - -typedef enum { - XCB_WM_HINT_INPUT = (1L << 0), - XCB_WM_HINT_STATE = (1L << 1), - XCB_WM_HINT_ICON_PIXMAP = (1L << 2), - XCB_WM_HINT_ICON_WINDOW = (1L << 3), - XCB_WM_HINT_ICON_POSITION = (1L << 4), - XCB_WM_HINT_ICON_MASK = (1L << 5), - XCB_WM_HINT_WINDOW_GROUP = (1L << 6), - XCB_WM_HINT_X_URGENCY = (1L << 8) -} xcb_wm_t; - -#define XCB_WM_ALL_HINTS (XCB_WM_HINT_INPUT | XCB_WM_HINT_STATE |\ - XCB_WM_HINT_ICON_PIXMAP | XCB_WM_HINT_ICON_WINDOW |\ - XCB_WM_HINT_ICON_POSITION | XCB_WM_HINT_ICON_MASK |\ - XCB_WM_HINT_WINDOW_GROUP) - -/** - * @brief Get urgency hint. - * @param hints WM_HINTS structure. - * @return Urgency hint value. - */ -uint32_t xcb_wm_hints_get_urgency(xcb_wm_hints_t *hints); - -/** - * @brief Set input focus. - * @param hints WM_HINTS structure. - * @param input Input focus. - */ -void xcb_wm_hints_set_input(xcb_wm_hints_t *hints, uint8_t input); - -/** - * @brief Set hints state to 'iconic'. - * @param hints WM_HINTS structure. - */ -void xcb_wm_hints_set_iconic(xcb_wm_hints_t *hints); - -/** - * @brief Set hints state to 'normal'. - * @param hints WM_HINTS structure. - */ -void xcb_wm_hints_set_normal(xcb_wm_hints_t *hints); - -/** - * @brief Set hints state to 'withdrawn'. - * @param hints WM_HINTS structure. - */ -void xcb_wm_hints_set_withdrawn(xcb_wm_hints_t *hints); - -/** - * @brief Set hints state to none. - * @param hints WM_HINTS structure. - */ -void xcb_wm_hints_set_none(xcb_wm_hints_t *hints); - -/** - * @brief Set pixmap to be used as icon. - * @param hints WM_HINTS structure. - * @param icon_pixmap Pixmap. - */ -void xcb_wm_hints_set_icon_pixmap(xcb_wm_hints_t *hints, - xcb_pixmap_t icon_pixmap); - -/** - * @brief Set icon mask bitmap. - * @param hints WM_HINTS structure. - * @param icon_mask Pixmap. - */ -void xcb_wm_hints_set_icon_mask(xcb_wm_hints_t *hints, xcb_pixmap_t icon_mask); - -/** - * @brief Set window identifier to be used as icon. - * @param hints WM_HINTS structure. - * @param icon_window Window X identifier. - */ -void xcb_wm_hints_set_icon_window(xcb_wm_hints_t *hints, - xcb_window_t icon_window); - -/** - * @brief Set identifier of related window group. - * @param hints WM_HINTS structure. - * @param window_group Window X identifier. - */ -void xcb_wm_hints_set_window_group(xcb_wm_hints_t *hints, - xcb_window_t window_group); - -/** - * @brief Set urgency hints flag. - * @param hints WM_HINTS structure. - */ -void xcb_wm_hints_set_urgency(xcb_wm_hints_t *hints); - -/** - * @brief Deliver a SetProperty request to set WM_HINTS property value. - * @param c The connection to the X server. - * @param window Window X identifier. - * @param hints Hints value to set. - */ -void xcb_set_wm_hints_checked(xcb_connection_t *c, xcb_window_t window, - xcb_wm_hints_t *hints); - -/** - * @see xcb_set_wm_hints_checked() - */ -void xcb_set_wm_hints(xcb_connection_t *c, xcb_window_t window, - xcb_wm_hints_t *hints); - -/** - * @brief Send request to get WM_HINTS property of a window. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_hints(xcb_connection_t *c, - xcb_window_t window); - -/** - * @see xcb_get_wm_hints() - */ -xcb_get_property_cookie_t xcb_get_wm_hints_unchecked(xcb_connection_t *c, - xcb_window_t window); - -/** - * @brief Fill given structure with the WM_HINTS property of a window. - * @param hints WM_HINTS property value. - * @param reply The get property request reply. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t -xcb_get_wm_hints_from_reply(xcb_wm_hints_t *hints, - xcb_get_property_reply_t *reply); - -/** - * @brief Fill given structure with the WM_HINTS property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param hints WM_HINTS property value. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_hints_unchecked() is used. Otherwise, it stores the - * error if any. The returned pointer should be freed. - */ -uint8_t xcb_get_wm_hints_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_wm_hints_t *hints, - xcb_generic_error_t **e); - -/* WM_PROTOCOLS */ - -/** - * @brief Deliver a SetProperty request to set WM_PROTOCOLS property value. - * @param c The connection to the X server. - * @param wm_protocols The WM_PROTOCOLS atom. - * @param window Window X identifier. - * @param list_len Atom list len. - * @param list Atom list. - */ -void xcb_set_wm_protocols_checked(xcb_connection_t *c, xcb_atom_t wm_protocols, - xcb_window_t window, uint32_t list_len, - xcb_atom_t *list); - -/** - * @see xcb_set_wm_protocols_checked() - */ -void xcb_set_wm_protocols(xcb_connection_t *c, xcb_atom_t wm_protocols, - xcb_window_t window, uint32_t list_len, - xcb_atom_t *list); - -/** - * @brief WM_PROTOCOLS structure. - */ -typedef struct { - /** Length of the atoms list */ - uint32_t atoms_len; - /** Atoms list */ - xcb_atom_t *atoms; - /** Store reply to avoid memory allocation, should normally not be - used directly */ - xcb_get_property_reply_t *_reply; -} xcb_get_wm_protocols_reply_t; - -/** - * @brief Send request to get WM_PROTOCOLS property of a given window. - * @param c The connection to the X server. - * @param window Window X identifier. - * @return The request cookie. - */ -xcb_get_property_cookie_t xcb_get_wm_protocols(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t wm_protocol_atom); - -/** - * @see xcb_get_wm_protocols() - */ -xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *c, - xcb_window_t window, - xcb_atom_t wm_protocol_atom); - -/** - * @brief Fill the given structure with the WM_PROTOCOLS property of a window. - * @param reply The reply of the GetProperty request. - * @param protocols WM_PROTOCOLS property value. - * @return Return 1 on success, 0 otherwise. - * - * protocols structure members should be freed by - * xcb_get_wm_protocols_reply_wipe(). - */ -uint8_t xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply, - xcb_get_wm_protocols_reply_t *protocols); -/** - * @brief Fill the given structure with the WM_PROTOCOLS property of a window. - * @param c The connection to the X server. - * @param cookie Request cookie. - * @param protocols WM_PROTOCOLS property value. - * @param e Error if any. - * @return Return 1 on success, 0 otherwise. - * - * The parameter e supplied to this function must be NULL if - * xcb_get_wm_protocols_unchecked() is used. Otherwise, it stores the - * error if any. protocols structure members should be freed by - * xcb_get_wm_protocols_reply_wipe(). - */ -uint8_t xcb_get_wm_protocols_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_get_wm_protocols_reply_t *protocols, - xcb_generic_error_t **e); - -/** - * @brief Wipe protocols structure members previously allocated by - * xcb_get_wm_protocols_reply(). - * @param protocols protocols structure whose members is going to be freed. - */ -void xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocols); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* __XCB_ICCCM_H__ */ diff --git a/image/Makefile.am b/image/Makefile.am deleted file mode 100644 index a18b228..0000000 --- a/image/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-image.la - -xcbinclude_HEADERS = xcb_image.h xcb_pixel.h - -AM_CFLAGS = $(CWARNFLAGS) - -XCB_IMAGE_LIBS = libxcb-image.la - -libxcb_image_la_SOURCES = xcb_image.c -libxcb_image_la_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -libxcb_image_la_LIBADD = $(XCB_LIBS) $(XCB_SHM_LIBS) $(XCB_AUX_LIBS) - -pkgconfig_DATA = xcb-image.pc - -EXTRA_DIST=xcb-image.pc.in - -EXTRA_PROGRAMS = test_xcb_image test_xcb_image_shm test_formats test_bitmap - -check_PROGRAMS = test_swap - -TESTS=test_swap - -test_swap_SOURCES = test_swap.c -test_swap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -test_swap_LDADD = $(XCB_LIBS) $(XCB_AUX_LIBS) $(XCB_IMAGE_LIBS) - -test_xcb_image_SOURCES = test_xcb_image.c -test_xcb_image_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -test_xcb_image_LDADD = $(XCB_LIBS) $(XCB_AUX_LIBS) $(XCB_IMAGE_LIBS) - -test_xcb_image_shm_SOURCES = test_xcb_image_shm.c -test_xcb_image_shm_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -test_xcb_image_shm_LDADD = $(XCB_LIBS) $(XCB_SHM_LIBS) \ - $(XCB_AUX_LIBS) $(XCB_IMAGE_LIBS) - -test_formats_SOURCES = test_formats.c -test_formats_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -test_formats_LDADD = $(XCB_LIBS) $(XCB_AUX_LIBS) $(XCB_IMAGE_LIBS) - -test_bitmap_SOURCES = test_bitmap.c -test_bitmap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_AUX_CFLAGS) -test_bitmap_LDADD = $(XCB_LIBS) $(XCB_AUX_LIBS) $(XCB_IMAGE_LIBS) diff --git a/image/test.xbm b/image/test.xbm deleted file mode 100644 index 804b996..0000000 --- a/image/test.xbm +++ /dev/null @@ -1,471 +0,0 @@ -#define test_width 216 -#define test_height 208 -static uint8_t test_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x5f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0x6f, 0xf6, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0xff, 0x3a, 0x13, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0d, 0x02, 0x51, 0x71, 0x0e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0x20, 0xd9, 0x88, - 0x9b, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x82, - 0xac, 0x44, 0x4e, 0x1c, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1e, 0x40, 0x02, 0x44, 0x60, 0xe2, 0xfc, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x25, 0x09, 0x90, 0x22, 0x13, 0xb7, 0x9a, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x10, 0x89, - 0x18, 0xe3, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x04, 0x08, - 0x01, 0x10, 0xc8, 0xa8, 0xd5, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x83, 0x80, 0x20, 0x40, 0x82, 0x00, 0x66, 0x9c, 0xec, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x24, 0x12, 0x93, 0x5b, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x12, 0x80, 0x04, 0x01, 0x00, 0x80, - 0x19, 0x33, 0xfa, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x80, 0x00, - 0x20, 0x08, 0x12, 0xc4, 0x68, 0x26, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x02, 0x04, 0x24, 0x00, 0x01, 0x40, 0x24, 0x8c, 0xcd, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, - 0x00, 0x80, 0x49, 0x10, 0x90, 0x00, 0x21, 0x20, 0x08, 0x11, 0x43, 0xd9, - 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, - 0xff, 0xff, 0x0b, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x30, 0xb9, 0xf2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0x97, 0x04, 0x08, 0xfe, 0x05, 0x30, 0x10, 0x12, 0x20, 0x20, - 0x04, 0x00, 0x80, 0x48, 0x0c, 0xa3, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3e, 0x92, 0x20, 0x49, 0x40, 0x3e, 0x0e, 0x82, - 0x00, 0x84, 0x25, 0x01, 0x80, 0x00, 0x80, 0xc8, 0x34, 0xed, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x25, 0x01, 0x04, 0x01, 0x08, - 0xd0, 0x17, 0x00, 0x80, 0x25, 0x01, 0xad, 0x04, 0x12, 0x20, 0x23, 0x4c, - 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x48, - 0x92, 0x20, 0x41, 0x92, 0x9e, 0x80, 0x24, 0x24, 0x29, 0x00, 0x04, 0x00, - 0x10, 0x98, 0xcc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x4f, 0x10, 0x01, 0x90, 0x24, 0x40, 0x12, 0xf0, 0x00, 0x24, 0x41, 0x0b, - 0xa9, 0x10, 0x00, 0x00, 0x04, 0xd9, 0x96, 0x0e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xe0, 0x00, 0x92, 0x48, 0x02, 0x04, 0x09, 0xc0, 0x84, 0x8f, - 0x29, 0x2d, 0xf8, 0xa9, 0x02, 0x00, 0x00, 0x20, 0x90, 0xf4, 0x1e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x24, 0x91, 0x04, 0x50, 0x22, 0x24, - 0x1b, 0x12, 0x7a, 0x48, 0xca, 0x03, 0x21, 0x10, 0x00, 0x00, 0x48, 0x93, - 0xff, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x24, 0x92, 0x20, - 0x81, 0xda, 0x24, 0xc8, 0x16, 0xd0, 0xe7, 0x50, 0xd2, 0xbf, 0x03, 0x00, - 0x80, 0x00, 0x30, 0x29, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, - 0x20, 0x80, 0x24, 0x41, 0x12, 0x2a, 0x41, 0xb2, 0x80, 0x33, 0x0e, 0x7e, - 0x88, 0x1c, 0x01, 0x00, 0xa0, 0x24, 0x69, 0x75, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe0, 0x82, 0x44, 0x11, 0x24, 0x09, 0x90, 0xa4, 0x4d, 0xd2, 0x92, - 0x9e, 0xd3, 0x83, 0x6b, 0x62, 0x00, 0x00, 0x10, 0x22, 0xff, 0x7f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x30, 0x42, 0x04, 0x92, 0x24, 0x6b, 0x53, 0x32, - 0x59, 0x90, 0x16, 0xfa, 0xb4, 0xf4, 0xff, 0x0f, 0x01, 0x00, 0x90, 0x68, - 0x4a, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x90, 0x24, 0x11, 0x24, - 0x49, 0xda, 0x82, 0xc5, 0x92, 0xd2, 0xd0, 0x9e, 0x1e, 0x00, 0x78, 0x0a, - 0x00, 0x00, 0x05, 0xd2, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x02, - 0x44, 0xb2, 0x65, 0xea, 0x49, 0x9e, 0x2c, 0x4b, 0x1a, 0xd2, 0xeb, 0xe3, - 0xff, 0xc7, 0x09, 0x00, 0x20, 0x68, 0xff, 0xd6, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x0b, 0x90, 0x40, 0x92, 0x24, 0x09, 0x5f, 0xd2, 0x64, 0x59, 0x72, - 0x56, 0x7f, 0xfd, 0xdf, 0x1f, 0x12, 0x00, 0x20, 0x49, 0x92, 0xde, 0x01, - 0x00, 0x00, 0x00, 0x80, 0x41, 0x92, 0x4c, 0x92, 0x24, 0x25, 0xc9, 0x8b, - 0x2e, 0xcb, 0x92, 0x4b, 0x5a, 0x2f, 0x75, 0xf4, 0x04, 0x00, 0x00, 0x41, - 0xf6, 0x74, 0x01, 0x00, 0x00, 0x00, 0x40, 0x49, 0x02, 0x00, 0xba, 0xb6, - 0xfd, 0x49, 0xf8, 0x74, 0x6d, 0x4b, 0x72, 0xed, 0xdb, 0xff, 0xcf, 0x53, - 0x00, 0x00, 0x48, 0xb6, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x60, 0x48, 0x10, - 0xc9, 0x93, 0x24, 0x00, 0x7b, 0xc3, 0xa6, 0x69, 0x58, 0x5a, 0xfb, 0xfa, - 0xa5, 0xbe, 0x16, 0x00, 0x00, 0x92, 0xa4, 0xfd, 0x03, 0x00, 0x00, 0x00, - 0x30, 0x01, 0x20, 0x5d, 0xa2, 0xfe, 0x7f, 0x01, 0x4f, 0x1a, 0xcd, 0x6b, - 0x6a, 0xa9, 0x5f, 0xff, 0xf3, 0x24, 0x01, 0x40, 0xc0, 0xb4, 0xf4, 0x03, - 0x00, 0x00, 0x00, 0x2c, 0x88, 0x84, 0x89, 0xb6, 0x00, 0x24, 0x7d, 0x69, - 0xf2, 0x34, 0xad, 0x99, 0x2d, 0xf7, 0xff, 0x9f, 0x4b, 0x00, 0x00, 0x92, - 0xa6, 0xad, 0x07, 0x00, 0x00, 0x00, 0x06, 0x91, 0x24, 0xe9, 0xa4, 0xfd, - 0xa5, 0xa9, 0x4b, 0x93, 0xe7, 0x34, 0x63, 0xf9, 0xfc, 0xd5, 0xef, 0x16, - 0x00, 0x40, 0x90, 0xb4, 0xbd, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x80, 0x4c, - 0x96, 0xbe, 0x2d, 0xfd, 0x2f, 0x7c, 0x5e, 0x9c, 0x67, 0xad, 0xa5, 0xfd, - 0xff, 0xbf, 0x29, 0x00, 0x00, 0x92, 0x76, 0xed, 0x06, 0x00, 0x00, 0x00, - 0x05, 0x12, 0x48, 0x53, 0x25, 0x65, 0x25, 0xf4, 0xe5, 0xd3, 0x72, 0x9c, - 0x35, 0xdf, 0xf6, 0x7f, 0xf5, 0x56, 0x00, 0x00, 0x92, 0xa4, 0xed, 0x0f, - 0x00, 0x00, 0x80, 0x49, 0x20, 0x59, 0x38, 0xec, 0xff, 0xff, 0xad, 0x2f, - 0x5d, 0xd3, 0x33, 0xe6, 0x24, 0xed, 0xff, 0xdf, 0x2d, 0x01, 0x40, 0x80, - 0x24, 0xbd, 0x07, 0x00, 0x00, 0xc0, 0x48, 0x24, 0x49, 0x87, 0x37, 0x21, - 0xa0, 0xbd, 0xf4, 0x79, 0x4f, 0xc7, 0x9c, 0xde, 0xf6, 0xff, 0xff, 0x5b, - 0x08, 0x00, 0x92, 0xfc, 0xe9, 0x0e, 0x00, 0x00, 0x20, 0x89, 0x40, 0xd3, - 0xf4, 0x49, 0xff, 0xff, 0xe7, 0x2f, 0xcf, 0x79, 0x9c, 0x53, 0xb2, 0x35, - 0xff, 0xff, 0x37, 0x00, 0x40, 0x90, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x30, - 0x91, 0x49, 0x32, 0x2d, 0xff, 0x6b, 0xb7, 0xbd, 0xbc, 0x3c, 0xef, 0x79, - 0xce, 0xde, 0xd6, 0xfd, 0xff, 0x9f, 0x00, 0x00, 0x92, 0xa6, 0xad, 0x0b, - 0x00, 0x00, 0x30, 0x11, 0x89, 0x8c, 0xcb, 0x5b, 0xba, 0xaf, 0xf6, 0xd7, - 0xe7, 0x35, 0xe7, 0x59, 0xb3, 0xfb, 0xff, 0xff, 0x7f, 0x04, 0x40, 0x80, - 0xe4, 0xb9, 0x1f, 0x00, 0x00, 0x48, 0x22, 0x91, 0x66, 0x79, 0xeb, 0xff, - 0xff, 0xdf, 0xbe, 0xbe, 0xe7, 0x8c, 0x75, 0x6b, 0x4a, 0xfa, 0xbf, 0x7f, - 0x00, 0x00, 0x82, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x4c, 0x22, 0xb2, 0x79, - 0x5e, 0xfa, 0x5b, 0xa9, 0xfd, 0xeb, 0xf5, 0x9c, 0x3d, 0xc6, 0xcc, 0xee, - 0xed, 0x01, 0xf8, 0x00, 0x40, 0x82, 0xb6, 0xa9, 0x1b, 0x00, 0x00, 0x94, - 0x64, 0x66, 0x8e, 0xd3, 0x97, 0xfe, 0xff, 0xd7, 0xdf, 0x9f, 0x7b, 0xf3, - 0x3c, 0x35, 0x59, 0x6b, 0x00, 0x70, 0x00, 0x00, 0x40, 0xe4, 0xed, 0x1e, - 0x00, 0x00, 0x92, 0xc4, 0x34, 0xf3, 0xfc, 0xfd, 0x5f, 0xad, 0x7d, 0xfa, - 0x7a, 0xce, 0x8e, 0xb3, 0x76, 0x2f, 0xfd, 0x00, 0xe0, 0x04, 0x00, 0x9a, - 0x26, 0xaf, 0x1e, 0x00, 0x00, 0x13, 0x88, 0xcc, 0xb5, 0x3f, 0xbf, 0xff, - 0xff, 0xd7, 0xef, 0xef, 0xbd, 0x79, 0x6a, 0xde, 0xec, 0xab, 0x01, 0xc0, - 0x00, 0x00, 0x40, 0xb6, 0xbd, 0x1b, 0x00, 0x00, 0x05, 0x91, 0xeb, 0x5c, - 0xeb, 0xeb, 0xff, 0xff, 0xff, 0x7e, 0xef, 0x6b, 0xef, 0xcd, 0x99, 0xb3, - 0xe4, 0x07, 0x80, 0x00, 0x40, 0x49, 0xb2, 0xe5, 0x1a, 0x00, 0x80, 0x20, - 0x32, 0xb1, 0xe7, 0x79, 0x7f, 0xf7, 0xff, 0xfd, 0xeb, 0xbd, 0xfe, 0x2c, - 0x3d, 0x6b, 0xb6, 0xaf, 0x06, 0x80, 0x00, 0x00, 0x41, 0x96, 0xfe, 0x1e, - 0x00, 0x80, 0x44, 0xb2, 0x9b, 0xf9, 0xde, 0xff, 0xff, 0xff, 0x7f, 0xbf, - 0xf7, 0xbb, 0xb3, 0x77, 0xce, 0xce, 0xb6, 0x0d, 0x80, 0x01, 0x00, 0x49, - 0xf2, 0x94, 0x1f, 0x00, 0x40, 0x49, 0x44, 0xe6, 0x9e, 0x77, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xbf, 0xf7, 0x7e, 0xd6, 0xbc, 0xd9, 0xba, 0x3b, 0x80, - 0x00, 0x00, 0x64, 0x93, 0xf7, 0x1b, 0x00, 0x40, 0x89, 0xec, 0x7e, 0x67, - 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xdb, 0x99, 0x33, 0x37, - 0xd3, 0x36, 0x80, 0x01, 0x80, 0x24, 0xda, 0xd6, 0x1e, 0x00, 0x20, 0x90, - 0x99, 0x99, 0x7b, 0xef, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xef, 0xbd, 0x37, - 0x63, 0xf3, 0x66, 0xdb, 0x7a, 0x80, 0x00, 0x00, 0x24, 0x59, 0xde, 0x1f, - 0x00, 0x60, 0x12, 0xb3, 0xf7, 0xdd, 0xfb, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xbf, 0xf7, 0xfe, 0x6e, 0xce, 0xdd, 0x6d, 0xd7, 0x80, 0x00, 0x80, 0x20, - 0xcb, 0xfb, 0x1f, 0x00, 0x10, 0x20, 0x6e, 0x66, 0x76, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xef, 0xde, 0xdb, 0x9b, 0x99, 0xb3, 0x5d, 0x6b, 0x81, - 0x00, 0x40, 0x96, 0x59, 0x6a, 0x1f, 0x00, 0x98, 0xc4, 0xe4, 0xdf, 0xff, - 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x6f, 0x7b, 0x37, 0x7f, - 0xb3, 0xdd, 0x83, 0x00, 0x00, 0xb0, 0xed, 0xef, 0x1d, 0x00, 0x10, 0x88, - 0x9e, 0xdd, 0xcd, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xed, - 0x6c, 0xe6, 0xcc, 0x76, 0x6d, 0xc1, 0x00, 0x40, 0x91, 0x24, 0x7b, 0x1f, - 0x00, 0x08, 0xd1, 0xf1, 0x66, 0x76, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xdf, 0xbd, 0xbf, 0xd9, 0xdd, 0xdd, 0xb6, 0x47, 0x00, 0x00, 0xd8, - 0xb4, 0xad, 0x1f, 0x00, 0x24, 0x24, 0x6f, 0xf6, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xb7, 0x9d, 0x33, 0xd9, 0x96, 0x4e, - 0x00, 0x20, 0x49, 0xf7, 0xfd, 0x1e, 0x00, 0x48, 0xe4, 0xac, 0xb9, 0xdd, - 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xdd, 0x76, 0xb6, - 0xb7, 0xfd, 0x7a, 0x00, 0x00, 0x44, 0x96, 0xb7, 0x1f, 0x00, 0x02, 0x9a, - 0xbe, 0x6f, 0x77, 0xff, 0xff, 0x7f, 0x61, 0xd9, 0xff, 0xff, 0xff, 0xfd, - 0xdd, 0x66, 0xed, 0x66, 0x5b, 0x37, 0x00, 0x90, 0x64, 0xb9, 0xf6, 0x1f, - 0x00, 0x02, 0xc9, 0xf3, 0xee, 0xfd, 0xff, 0xff, 0x2f, 0x24, 0x4f, 0xfe, - 0xff, 0xff, 0x7f, 0x37, 0xdb, 0xcd, 0x7c, 0xff, 0x3a, 0x00, 0x88, 0x24, - 0xdb, 0xde, 0x1a, 0x00, 0x13, 0x31, 0x6f, 0xbb, 0xdf, 0xff, 0xff, 0x21, - 0xa0, 0x64, 0xf3, 0xff, 0xff, 0xe7, 0xff, 0x96, 0xbb, 0x9b, 0xa5, 0x1d, - 0x00, 0x60, 0x32, 0xe9, 0xdb, 0x0f, 0x00, 0x65, 0xe6, 0x3c, 0xfb, 0xf6, - 0xff, 0x7f, 0x10, 0xa4, 0xb5, 0x9d, 0xfe, 0xdf, 0xdf, 0xdd, 0x6d, 0x32, - 0xb3, 0x7d, 0x0d, 0x00, 0x0b, 0x93, 0x7c, 0x7b, 0x0f, 0x00, 0x89, 0xdc, - 0xb3, 0xed, 0xfb, 0xff, 0x1f, 0x10, 0x90, 0x92, 0xd9, 0xfe, 0x7f, 0xff, - 0x77, 0xdb, 0xee, 0x6e, 0xdb, 0x0e, 0x00, 0x20, 0xdd, 0x66, 0x6f, 0x0f, - 0x80, 0x91, 0x5a, 0xfb, 0xbe, 0xef, 0xff, 0x0f, 0x10, 0xda, 0x92, 0xee, - 0xff, 0xff, 0xff, 0xf7, 0xb7, 0xcd, 0xee, 0xde, 0x07, 0x00, 0x24, 0x49, - 0xb6, 0xed, 0x0f, 0x00, 0x12, 0x6b, 0xcd, 0xf3, 0xbe, 0xff, 0x07, 0x08, - 0x48, 0xda, 0x76, 0xb7, 0xff, 0xff, 0xdd, 0x6e, 0xba, 0x99, 0x65, 0x03, - 0x40, 0x92, 0xe4, 0xba, 0xbd, 0x0e, 0x80, 0x62, 0xed, 0x7d, 0x5f, 0xf7, - 0xff, 0x01, 0x08, 0x28, 0xc9, 0x26, 0xbb, 0xff, 0xff, 0xff, 0x99, 0xb7, - 0xbb, 0x7d, 0x03, 0x00, 0x89, 0x64, 0xdb, 0xf6, 0x07, 0x40, 0x0c, 0x35, - 0xe7, 0x79, 0xdd, 0xff, 0x01, 0x84, 0xa5, 0x7d, 0xba, 0xdd, 0xfe, 0x7f, - 0xbf, 0xbf, 0x6d, 0x76, 0xdb, 0x01, 0x00, 0x48, 0x36, 0xdb, 0xd6, 0x07, - 0xc0, 0x88, 0xb4, 0xb6, 0xbf, 0xff, 0x7f, 0x00, 0x0c, 0x24, 0x44, 0xdb, - 0xed, 0xff, 0xdf, 0xef, 0x6e, 0xdb, 0x6e, 0xb7, 0x00, 0x80, 0x44, 0x93, - 0xed, 0x5b, 0x07, 0x40, 0x91, 0xd2, 0xfa, 0xfc, 0xf6, 0x7f, 0x00, 0x02, - 0xb4, 0x35, 0xd9, 0xef, 0xff, 0xff, 0xfb, 0xef, 0xb6, 0xc9, 0xe4, 0x00, - 0x10, 0x24, 0xd9, 0x6d, 0xfb, 0x03, 0x00, 0x27, 0xfe, 0xd3, 0xd6, 0xdb, - 0x3f, 0x00, 0xa2, 0x94, 0xb4, 0xdb, 0x7c, 0xff, 0xff, 0xbf, 0xd9, 0xad, - 0xdb, 0x7d, 0x00, 0x40, 0x32, 0xd9, 0xb6, 0xef, 0x03, 0x60, 0xe4, 0x5a, - 0x5f, 0x5f, 0xff, 0x1f, 0x00, 0x02, 0x52, 0x92, 0xec, 0xb6, 0xff, 0xff, - 0xef, 0xff, 0x6d, 0xb6, 0x3b, 0x00, 0x28, 0x90, 0xcc, 0xbe, 0xfd, 0x03, - 0xa0, 0x88, 0xeb, 0xf9, 0xfd, 0xf5, 0x1f, 0x00, 0x82, 0x53, 0xbb, 0x6d, - 0xf7, 0xff, 0xf9, 0xff, 0x6f, 0xdb, 0x6d, 0x1b, 0x00, 0x04, 0xc9, 0x66, - 0xdb, 0x57, 0x03, 0xa0, 0x52, 0xaf, 0xa7, 0x97, 0xff, 0x0f, 0x00, 0x51, - 0x48, 0xda, 0x66, 0xdb, 0xff, 0xf8, 0xdf, 0xed, 0xbe, 0xed, 0x0e, 0x00, - 0x92, 0x64, 0x32, 0xeb, 0xf6, 0x01, 0x20, 0x63, 0xbd, 0xbc, 0xfc, 0xfa, - 0x0f, 0x00, 0x09, 0x20, 0x89, 0x3e, 0xff, 0xff, 0xe0, 0x7f, 0xdf, 0x6f, - 0xdb, 0x07, 0x00, 0x01, 0x24, 0xbb, 0xed, 0xfe, 0x01, 0xa0, 0xce, 0xf5, - 0xf6, 0xdb, 0xdf, 0x07, 0x00, 0x41, 0xad, 0x5f, 0xf2, 0xed, 0xff, 0xc0, - 0xff, 0xbf, 0xdd, 0x92, 0x03, 0x00, 0x44, 0xb2, 0xd9, 0x7d, 0xfb, 0x01, - 0xe0, 0xaa, 0xdf, 0x9b, 0x7f, 0xfb, 0x07, 0x80, 0x28, 0x21, 0x64, 0xbb, - 0x7f, 0x7f, 0x80, 0xff, 0xf6, 0xbb, 0xee, 0x03, 0x80, 0x22, 0x99, 0xed, - 0xb6, 0xff, 0x00, 0x90, 0xb8, 0x5e, 0x5b, 0x6b, 0xed, 0x03, 0x00, 0x01, - 0xa6, 0x6d, 0xdb, 0xf6, 0x7f, 0x00, 0xff, 0xff, 0xf6, 0xcd, 0x00, 0x40, - 0x10, 0xc9, 0x6c, 0xff, 0xf7, 0x00, 0xa0, 0xe3, 0x72, 0xeb, 0xef, 0xff, - 0x03, 0x80, 0xe0, 0x90, 0x24, 0xdb, 0xbd, 0x3f, 0x00, 0xfe, 0xdb, 0x6f, - 0xfb, 0x00, 0x00, 0x89, 0x4c, 0xb6, 0xd9, 0x7e, 0x00, 0x70, 0xaf, 0xaf, - 0x6f, 0xb5, 0xde, 0x03, 0x80, 0x94, 0x92, 0xb6, 0xf9, 0xf6, 0x3f, 0x00, - 0xfc, 0xbf, 0xdd, 0x7b, 0x00, 0x10, 0x48, 0x26, 0xb3, 0xdf, 0x7f, 0x00, - 0x70, 0xd8, 0xae, 0xfd, 0xff, 0xf7, 0x03, 0x80, 0x00, 0xd2, 0x36, 0xcf, - 0xdf, 0x3f, 0x00, 0xb8, 0x6d, 0xdf, 0x16, 0x00, 0x48, 0x44, 0xb2, 0xfb, - 0x6c, 0x3f, 0x00, 0x50, 0x75, 0xfd, 0xa5, 0xd5, 0xfe, 0x01, 0x40, 0xd1, - 0x12, 0xa2, 0x7d, 0xfb, 0x1f, 0x00, 0xf0, 0xff, 0xbf, 0x0d, 0x00, 0x20, - 0x12, 0x9b, 0xcd, 0xf6, 0x3f, 0x00, 0x90, 0xd5, 0xa7, 0xfd, 0x77, 0xab, - 0x03, 0x40, 0x1c, 0xc8, 0xbe, 0x6d, 0xfb, 0x1f, 0x00, 0xe0, 0xff, 0xee, - 0x07, 0x00, 0x04, 0x91, 0xc9, 0x7e, 0xbf, 0x1f, 0x00, 0x30, 0x57, 0xbf, - 0xa6, 0xde, 0xfd, 0x01, 0x40, 0x40, 0x6b, 0xd3, 0x6e, 0xef, 0x0f, 0x00, - 0xc0, 0xeb, 0x7d, 0x03, 0x00, 0x90, 0xc8, 0x6c, 0x76, 0xfb, 0x0f, 0x00, - 0x70, 0x5c, 0xe5, 0xf7, 0xfa, 0xeb, 0x01, 0x40, 0x50, 0x49, 0x92, 0xf4, - 0xfd, 0x0f, 0x00, 0xc0, 0xff, 0xdb, 0x01, 0x80, 0x44, 0x44, 0x66, 0xbb, - 0x6f, 0x0f, 0x00, 0xd0, 0xf1, 0x95, 0xf6, 0x6f, 0xad, 0x01, 0x40, 0x08, - 0x78, 0xdb, 0xb6, 0xef, 0x0f, 0x00, 0x00, 0xdf, 0xd6, 0x00, 0x00, 0x20, - 0x32, 0xb3, 0xdb, 0xfd, 0x0f, 0x00, 0x10, 0xd7, 0xf7, 0xb6, 0xd8, 0xeb, - 0x03, 0x20, 0x43, 0x27, 0xd9, 0xb6, 0xfd, 0x0f, 0x00, 0x00, 0xff, 0x7e, - 0x00, 0x40, 0x12, 0x93, 0xd9, 0xec, 0xb6, 0x07, 0x00, 0x70, 0x55, 0xdd, - 0xf6, 0x6f, 0xbb, 0x01, 0x40, 0x28, 0xa1, 0x6f, 0xb6, 0xb7, 0x0f, 0x00, - 0x00, 0xde, 0x1f, 0x00, 0x80, 0x88, 0xd8, 0xcc, 0x66, 0xff, 0x03, 0x00, - 0x70, 0xf4, 0xf5, 0xdb, 0xaa, 0xee, 0x01, 0x60, 0x28, 0x2d, 0x49, 0xf7, - 0xf6, 0x07, 0x00, 0x00, 0x7c, 0x0f, 0x00, 0x08, 0x48, 0x66, 0x6e, 0xfb, - 0xef, 0x03, 0x00, 0xd0, 0xd5, 0xdf, 0x52, 0xff, 0xda, 0x03, 0x20, 0xa3, - 0xa5, 0xd9, 0xb2, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x20, 0x22, - 0x33, 0x37, 0xbf, 0xfd, 0x01, 0x00, 0x70, 0x5f, 0xf7, 0xfe, 0xab, 0x6b, - 0x02, 0xa0, 0xa8, 0xb4, 0x6d, 0xdf, 0xf6, 0x07, 0x00, 0x00, 0xf8, 0x01, - 0x00, 0x12, 0x33, 0x11, 0xd9, 0xdd, 0xff, 0x01, 0x00, 0x70, 0x75, 0xd5, - 0x52, 0xea, 0x8a, 0x03, 0x20, 0x84, 0x36, 0x69, 0xba, 0xdb, 0x07, 0x00, - 0x00, 0xf0, 0x01, 0x00, 0x81, 0xc8, 0xcc, 0xdd, 0xed, 0xff, 0x00, 0x00, - 0x60, 0xd5, 0xdf, 0xf6, 0xae, 0x6b, 0x03, 0x00, 0xa1, 0xa4, 0x6d, 0xdf, - 0xfe, 0x07, 0x00, 0x00, 0x60, 0x00, 0x40, 0x44, 0xc6, 0xcc, 0x64, 0xb7, - 0xfd, 0x00, 0x00, 0xe0, 0x55, 0xf7, 0xd6, 0xea, 0xba, 0x07, 0x20, 0x94, - 0x94, 0x6d, 0xfb, 0xdb, 0x07, 0x00, 0x00, 0x20, 0x00, 0x20, 0x20, 0x32, - 0x76, 0x77, 0xff, 0x7f, 0x00, 0x00, 0x60, 0x7d, 0xd5, 0xb6, 0x3f, 0xaf, - 0x06, 0xa0, 0xa4, 0x95, 0x6c, 0x9b, 0xee, 0x07, 0x00, 0x00, 0x18, 0x00, - 0x10, 0x92, 0x15, 0x73, 0xbb, 0xd9, 0x3f, 0x00, 0x00, 0xe0, 0xf5, 0xff, - 0xf7, 0x6a, 0xa9, 0x06, 0x80, 0xa2, 0xb4, 0x6d, 0xfb, 0xfb, 0x07, 0x00, - 0x00, 0x04, 0x00, 0x84, 0x88, 0xc8, 0x99, 0xdd, 0xff, 0x3f, 0x00, 0x00, - 0xe0, 0x8b, 0xff, 0x96, 0x6a, 0xb6, 0x0a, 0xa0, 0x94, 0x96, 0x64, 0xdb, - 0xee, 0x07, 0x00, 0x00, 0x03, 0x08, 0x20, 0x60, 0x66, 0xec, 0xee, 0xb6, - 0x1d, 0x00, 0x00, 0xc0, 0x7e, 0xa5, 0xf4, 0xab, 0x55, 0x0d, 0x20, 0xe7, - 0xd4, 0x6d, 0xdb, 0xfb, 0x07, 0x00, 0x80, 0x00, 0x00, 0x09, 0x12, 0x33, - 0x67, 0x77, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xfa, 0xff, 0xb7, 0x7a, 0x55, - 0x19, 0x90, 0x91, 0xd4, 0x64, 0xdb, 0xee, 0x07, 0x00, 0x40, 0x00, 0x81, - 0x04, 0x88, 0x91, 0x3b, 0xbb, 0xfd, 0x0f, 0x00, 0x00, 0xc0, 0xab, 0xbf, - 0xed, 0x4e, 0xbb, 0x32, 0x20, 0x94, 0x96, 0x6c, 0xff, 0xfa, 0x03, 0x00, - 0x30, 0x40, 0x20, 0x20, 0x64, 0xcc, 0xdc, 0xdd, 0xff, 0x07, 0x00, 0x00, - 0xc0, 0xeb, 0xea, 0xfd, 0xd5, 0xaa, 0x2a, 0x20, 0xd7, 0xb0, 0x6d, 0x93, - 0xef, 0x07, 0x00, 0x08, 0x00, 0x08, 0x01, 0x23, 0xee, 0xee, 0xee, 0xfb, - 0x03, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x2d, 0xdd, 0x6a, 0x49, 0xd0, 0x90, - 0x9a, 0x64, 0xdf, 0xea, 0x07, 0x00, 0x03, 0x80, 0x40, 0x8c, 0x98, 0x33, - 0xb3, 0xbb, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xa5, 0x7b, 0x6d, 0xa7, 0x56, - 0xc5, 0xa0, 0x94, 0x94, 0x6f, 0xd3, 0xbb, 0x07, 0x80, 0x10, 0x0c, 0x12, - 0x40, 0xc6, 0xb9, 0xdb, 0xfb, 0xfd, 0x01, 0x00, 0x00, 0x80, 0x97, 0xee, - 0xdf, 0xba, 0x54, 0x1a, 0xa1, 0xe5, 0xd2, 0x64, 0x7e, 0xee, 0x07, 0x60, - 0x02, 0x80, 0x00, 0x31, 0x62, 0xcc, 0xdc, 0xee, 0x7f, 0x00, 0x00, 0x00, - 0x80, 0xff, 0xff, 0xdb, 0xaa, 0xb5, 0x8a, 0x86, 0x98, 0x96, 0x6d, 0x9b, - 0xea, 0x07, 0x98, 0x00, 0x22, 0x44, 0x88, 0x39, 0x77, 0x77, 0xff, 0x7f, - 0x00, 0x00, 0x00, 0x80, 0x7d, 0x77, 0xba, 0x7b, 0x2d, 0x55, 0x3c, 0xa6, - 0xb4, 0x6c, 0xf6, 0xaf, 0x07, 0x07, 0x90, 0x88, 0x20, 0x42, 0x9c, 0xbb, - 0xbb, 0xbb, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xbd, 0xbf, 0x55, 0x53, - 0xa5, 0xb2, 0xa1, 0xb4, 0xc9, 0x9f, 0xda, 0xcf, 0x28, 0x24, 0x42, 0x08, - 0x31, 0xe6, 0xcc, 0xdd, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xef, - 0xb7, 0xbd, 0xde, 0x12, 0xd1, 0xac, 0x95, 0x4d, 0xf2, 0x56, 0x9f, 0x88, - 0x80, 0x10, 0xc2, 0x9c, 0x73, 0x77, 0xef, 0xfe, 0x7f, 0x00, 0x00, 0x00, - 0x00, 0xbf, 0xfb, 0xed, 0xeb, 0x35, 0x95, 0x72, 0xa2, 0x35, 0xcd, 0xb6, - 0xd6, 0x2f, 0x21, 0x24, 0x04, 0x31, 0xc6, 0x98, 0x33, 0xf7, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0xd6, 0x6a, 0x7f, 0x5b, 0xab, 0x2d, 0x28, 0x23, - 0x65, 0xd9, 0xb6, 0x55, 0x5f, 0x88, 0x08, 0x43, 0x0c, 0x61, 0xde, 0xdd, - 0xfb, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x76, 0xff, 0x4d, 0xd7, 0x4d, - 0x4a, 0xa5, 0x29, 0x2d, 0xdb, 0xbe, 0x55, 0x1f, 0x22, 0x42, 0x28, 0xc2, - 0x39, 0xe7, 0xee, 0xee, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x7f, - 0xfb, 0xb6, 0xb6, 0x95, 0x70, 0x2e, 0xa5, 0xd9, 0x24, 0x5d, 0x5f, 0x8a, - 0x28, 0x88, 0x31, 0x9e, 0x39, 0x73, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0xec, 0xb7, 0xdf, 0x6c, 0xb5, 0x65, 0x26, 0xa3, 0x39, 0x9b, 0xfc, - 0x85, 0x5d, 0x21, 0x04, 0x63, 0x1c, 0xe6, 0xdd, 0xbd, 0xfb, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0xb8, 0xfa, 0xb6, 0x6f, 0x4d, 0x9a, 0x28, 0x59, - 0x4d, 0xd3, 0x2f, 0xf5, 0x3f, 0x8c, 0xd1, 0x18, 0xc6, 0x31, 0xf6, 0xdd, - 0xfe, 0xff, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xb9, 0xb6, - 0x25, 0xe1, 0x4d, 0x69, 0xba, 0x6c, 0xad, 0x3c, 0x41, 0x14, 0x84, 0xe9, - 0x9e, 0x37, 0xf7, 0xff, 0xff, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x70, 0x5d, - 0x3d, 0x9f, 0x3d, 0x6d, 0x26, 0x52, 0x59, 0xb6, 0x6d, 0xab, 0x7f, 0x14, - 0x82, 0xe1, 0x39, 0xe6, 0xdd, 0xfb, 0xff, 0xbf, 0xff, 0x01, 0x00, 0x00, - 0x00, 0xf0, 0xf6, 0x6f, 0x77, 0xcd, 0x92, 0xd0, 0x52, 0x4b, 0xb3, 0x49, - 0x0b, 0x3a, 0x41, 0x61, 0x38, 0x9e, 0x73, 0xee, 0xdc, 0xff, 0xff, 0xfd, - 0x03, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xd7, 0x65, 0xda, 0x66, 0x63, 0x9d, - 0xf2, 0x36, 0x7b, 0x6a, 0x7f, 0x14, 0x18, 0x8e, 0xe7, 0xd9, 0x7b, 0xff, - 0xff, 0xef, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xdd, 0xb6, - 0xc9, 0x4c, 0x46, 0x9a, 0x64, 0xcb, 0x5b, 0xed, 0x06, 0xc6, 0xe3, 0x71, - 0xde, 0xbd, 0xff, 0xff, 0x7f, 0xff, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x7f, - 0x7f, 0xff, 0x59, 0x37, 0x75, 0xbb, 0x96, 0x66, 0xdb, 0x56, 0xf7, 0xe0, - 0xf2, 0x74, 0x9e, 0x77, 0xef, 0xfd, 0xff, 0xeb, 0xed, 0x03, 0x00, 0x00, - 0x00, 0xc0, 0xea, 0xdf, 0xb3, 0xdb, 0xde, 0xc6, 0x81, 0xb0, 0x6c, 0xba, - 0xb4, 0xf6, 0x38, 0x18, 0x3c, 0xe7, 0x9c, 0xfb, 0xff, 0x7f, 0xff, 0xff, - 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0x6e, 0x66, 0xd9, 0x99, 0xac, - 0xa4, 0xcd, 0x96, 0xa5, 0xea, 0x03, 0xa7, 0xcf, 0x79, 0xef, 0xfd, 0xff, - 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfd, 0xef, 0xdf, - 0x6f, 0xef, 0x72, 0x65, 0xd9, 0xb6, 0xad, 0xe8, 0xc1, 0xe1, 0xf1, 0xbe, - 0x7b, 0xef, 0xff, 0xdf, 0x7a, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0x5f, 0xdd, 0x9d, 0xac, 0x99, 0x84, 0x29, 0xcd, 0x3c, 0x4f, 0x9d, 0x7d, - 0x3c, 0x9e, 0xe7, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xff, 0x77, 0x7b, 0x33, 0xe7, 0x5a, 0x49, 0x9b, 0x65, - 0x59, 0x75, 0x07, 0x97, 0xf7, 0xbb, 0xef, 0xff, 0xff, 0xdb, 0xfe, 0xff, - 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0x3f, 0xe7, 0xcf, 0x9c, 0x51, - 0x4d, 0xb0, 0x6d, 0x4b, 0xc9, 0xd3, 0xf5, 0x79, 0xfe, 0xfb, 0xff, 0xff, - 0xdb, 0xda, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xde, - 0xdd, 0xf3, 0x4d, 0x52, 0x36, 0xcb, 0xd2, 0x3a, 0x7e, 0x3c, 0xde, 0xe7, - 0xbe, 0xff, 0x7f, 0xda, 0xff, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, - 0xff, 0xfb, 0xdd, 0x73, 0x8f, 0xa5, 0x9a, 0xe6, 0xd9, 0xb6, 0xe2, 0x4e, - 0xc7, 0xf7, 0xfd, 0xff, 0xff, 0xff, 0xf7, 0xf6, 0xff, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xee, 0x79, 0xb2, 0xb2, 0x2c, 0x9f, - 0xb6, 0x54, 0xfe, 0xfb, 0x79, 0xbf, 0xff, 0xff, 0x5f, 0xda, 0xff, 0xfa, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xf7, 0xbf, 0xe7, 0x4b, - 0xb4, 0x69, 0xd3, 0x2c, 0x25, 0xbd, 0xbc, 0xcf, 0xf7, 0xfd, 0xff, 0xd7, - 0xf6, 0xfe, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xbf, 0x9d, - 0xf1, 0x3e, 0x57, 0x25, 0xcb, 0xb6, 0x6d, 0xa9, 0xb5, 0xef, 0xfb, 0xff, - 0xff, 0xff, 0xd5, 0xda, 0xd6, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xff, 0xff, 0xfb, 0xcf, 0xf5, 0x25, 0x65, 0xd9, 0x66, 0x5b, 0x4a, 0xfa, - 0xf9, 0x7e, 0xff, 0xff, 0xff, 0xf6, 0xd6, 0xdf, 0xfa, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xfe, 0xff, 0xef, 0x3e, 0xf7, 0x9f, 0x5b, 0x92, 0x6c, - 0xdb, 0x52, 0xe5, 0xbe, 0xdf, 0xff, 0xff, 0xbf, 0x51, 0xda, 0xfa, 0x7f, - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7b, 0x9f, 0xe7, - 0x4c, 0xb3, 0x4d, 0xd3, 0x54, 0xd9, 0xe7, 0xfb, 0xff, 0xff, 0x5f, 0xdc, - 0xfa, 0xdf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, - 0xe7, 0xf9, 0x3a, 0xd3, 0xa6, 0xe9, 0xb6, 0xa5, 0xca, 0xf9, 0xfd, 0xff, - 0xff, 0x83, 0x42, 0xd2, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xfd, 0xbf, 0xef, 0x4f, 0xd5, 0x64, 0xdb, 0x26, 0x4d, 0x30, - 0x7f, 0xff, 0xff, 0xff, 0x91, 0xda, 0xdb, 0xda, 0xdf, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf, 0xff, 0x7d, 0xbe, 0xb5, 0x6d, 0x97, - 0x6d, 0x93, 0x56, 0xdf, 0xff, 0xff, 0x7f, 0x81, 0x4a, 0xda, 0x7f, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xef, 0xeb, 0xbb, - 0xa6, 0x4d, 0x73, 0xcd, 0x92, 0xaa, 0xfe, 0xff, 0xff, 0x1f, 0x01, 0x6a, - 0x5b, 0xfb, 0xfb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xfd, 0xbf, 0x5f, 0x3b, 0xdb, 0x36, 0xbb, 0x26, 0x4c, 0xf9, 0xff, 0xff, - 0x0f, 0xa3, 0x2a, 0xe9, 0x7f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xee, 0xff, 0xff, 0xfe, 0xfe, 0xcc, 0x91, 0xec, 0x93, 0x6d, 0x93, - 0xf2, 0xff, 0xff, 0x03, 0x00, 0x6a, 0x6d, 0x6f, 0xff, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x6f, 0x76, 0xb6, 0xcd, - 0x76, 0xc9, 0x2a, 0xe9, 0xff, 0xff, 0x00, 0x02, 0x24, 0xed, 0xf9, 0xed, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xdf, 0xff, - 0xd9, 0x66, 0x9b, 0x6c, 0x93, 0x54, 0xc5, 0xff, 0x3f, 0x00, 0x01, 0x95, - 0xb5, 0xaf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, - 0xff, 0xff, 0xfd, 0xae, 0x7d, 0xde, 0x6d, 0xf6, 0xa1, 0x8a, 0xff, 0x0f, - 0x00, 0x81, 0x90, 0xb4, 0xfd, 0xfd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xcd, 0xb2, 0xdb, 0x2c, 0xcb, - 0x54, 0xfe, 0x01, 0x00, 0x01, 0xd2, 0xb6, 0xb7, 0xff, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x39, 0xdb, 0x76, - 0xb3, 0x4b, 0xb6, 0x0a, 0xfe, 0x00, 0x00, 0x01, 0x48, 0xda, 0xfe, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, - 0xcf, 0xb9, 0x6d, 0xb6, 0xd9, 0xa5, 0x75, 0x1c, 0x00, 0x80, 0x80, 0x20, - 0xdb, 0xda, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, - 0xff, 0xff, 0xff, 0x77, 0x96, 0xd9, 0x26, 0xb3, 0x4d, 0x82, 0x11, 0x00, - 0x80, 0x80, 0x24, 0x6d, 0xff, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xbb, 0x67, 0xdb, 0xdd, 0x36, 0xd9, - 0x54, 0x60, 0x00, 0xc0, 0x00, 0x92, 0x65, 0x6b, 0xff, 0x0f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x4f, 0x7d, 0x96, - 0xd9, 0x6c, 0x36, 0xad, 0xc2, 0x00, 0x60, 0x00, 0xc8, 0xb6, 0x6d, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, - 0xff, 0xc8, 0x76, 0xbb, 0xcb, 0x64, 0x52, 0x02, 0x03, 0x10, 0x00, 0x64, - 0xda, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0xff, 0xff, 0x5f, 0xd7, 0x4d, 0x33, 0x99, 0xdd, 0x96, 0x04, 0x2c, - 0x1c, 0x40, 0x22, 0xdb, 0xb6, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xdf, 0xb5, 0xed, 0xe6, 0x36, 0x9b, - 0x6c, 0x29, 0xf0, 0x03, 0x00, 0x99, 0x6c, 0xfb, 0xfd, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x35, 0xbb, - 0xec, 0x76, 0x33, 0x91, 0x02, 0x00, 0x00, 0x00, 0x64, 0x67, 0xdf, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, - 0xbf, 0x6f, 0x9b, 0x9d, 0xc9, 0xce, 0x36, 0x49, 0x00, 0x00, 0x00, 0x93, - 0xb1, 0xdd, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0xff, 0x6a, 0x76, 0xbb, 0xdd, 0xd9, 0x64, 0x12, 0x01, - 0x00, 0x40, 0x98, 0xdd, 0x6d, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x66, 0x73, 0x33, 0xbb, - 0x9d, 0x4d, 0x00, 0x00, 0x00, 0x63, 0xe6, 0xf6, 0xff, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0xfd, - 0xee, 0xee, 0x36, 0x73, 0x2b, 0x04, 0x00, 0xa0, 0x38, 0x75, 0xbf, 0xff, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7f, 0xd9, 0xec, 0xce, 0x66, 0x66, 0x66, 0x22, 0x04, 0x00, 0xc6, - 0x99, 0xbb, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5e, 0xb3, 0xdb, 0xb9, 0xcd, 0xc9, 0x88, 0x89, - 0x00, 0x68, 0x31, 0xee, 0xdd, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbe, 0xbb, 0x9b, 0x3f, - 0xbb, 0x33, 0x23, 0x04, 0x00, 0x8c, 0xf3, 0xee, 0xff, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x67, - 0x76, 0x77, 0xb2, 0x66, 0xce, 0x0c, 0xd1, 0xd6, 0xe3, 0x79, 0xf7, 0xff, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0xfd, 0xef, 0xe6, 0xee, 0xce, 0x9c, 0x31, 0x16, 0x00, 0x3c, - 0x9e, 0xfb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x78, 0x9f, 0xdb, 0xdc, 0x9d, 0x99, 0x33, 0xc6, - 0xc1, 0xff, 0x8f, 0xe7, 0xbb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xbd, 0xbb, 0x33, - 0x7b, 0xee, 0x18, 0x1e, 0x50, 0xf0, 0xf9, 0xfe, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b, - 0xf7, 0x77, 0xf7, 0xe6, 0x9c, 0xe3, 0xf0, 0x4d, 0xff, 0x7c, 0xef, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0xdf, 0x76, 0x7f, 0xcf, 0x9e, 0x73, 0x8f, 0x07, 0xff, 0x0b, - 0xdf, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x80, 0xee, 0xcd, 0xdd, 0x9d, 0x7b, 0xf7, 0x7c, - 0x7a, 0x00, 0xf0, 0xe7, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xbf, 0xdd, 0x7b, - 0x6b, 0x9e, 0xf3, 0xe1, 0xff, 0xff, 0x7d, 0xff, 0x7f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, - 0xb7, 0xbb, 0x7b, 0xee, 0x79, 0x8f, 0x0f, 0xfa, 0x2f, 0xff, 0xf7, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0xff, 0x77, 0xef, 0xdd, 0x77, 0x7c, 0xfe, 0x02, 0xe8, - 0xcf, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xef, 0xee, 0xdd, 0xb3, 0xcf, 0xf3, - 0xf1, 0xff, 0xff, 0xf9, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0xff, 0xbf, - 0xef, 0xbe, 0xcf, 0x8f, 0xfe, 0x5f, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, - 0xbf, 0xbb, 0xf7, 0xde, 0x79, 0x3e, 0xff, 0x52, 0xd2, 0xdf, 0xff, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xe0, 0xef, 0xef, 0xef, 0x3c, 0xef, 0xf9, 0xf8, 0xff, 0xff, - 0xf7, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xee, 0xdc, 0xf7, 0xfe, 0xe7, - 0x97, 0xfe, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, - 0xef, 0xbf, 0x3e, 0xff, 0xda, 0xf6, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0xbf, 0xf7, 0xfe, 0xf7, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xfe, 0xff, 0xde, 0xbd, 0xef, 0xfb, 0xd7, 0xff, 0xbf, - 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x7d, 0xbf, - 0xff, 0xd2, 0xf6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf, - 0xef, 0xfb, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0xff, 0xef, 0xbe, 0xf7, 0xef, 0xef, 0xff, 0xff, 0xff, 0x3f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xdf, 0xbf, 0xff, 0xff, 0xff, - 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, - 0xfe, 0xff, 0xfb, 0xf7, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf0, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xfd, 0xff, 0xff, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/image/test_bitmap.c b/image/test_bitmap.c deleted file mode 100644 index 3464743..0000000 --- a/image/test_bitmap.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright © 2008 Bart Massey - * Copyright © 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include -#include -#include -#include "../aux/xcb_aux.h" -#include "../event/xcb_event.h" -#include "xcb_image.h" - -#include "test.xbm" - -static xcb_window_t make_window(xcb_connection_t *c, - xcb_screen_t *s, - uint32_t bg, - uint32_t fg, - uint32_t width, - uint32_t height) { - uint32_t mask = 0; - xcb_params_cw_t cwa; - xcb_window_t w; - xcb_void_cookie_t check_cookie; - xcb_generic_error_t *error; - xcb_visualtype_t *v = xcb_aux_find_visual_by_id(s, s->root_visual); - assert(v); - XCB_AUX_ADD_PARAM(&mask, &cwa, back_pixel, bg); - XCB_AUX_ADD_PARAM(&mask, &cwa, border_pixel, fg); - XCB_AUX_ADD_PARAM(&mask, &cwa, override_redirect, 1); - XCB_AUX_ADD_PARAM(&mask, &cwa, event_mask, - XCB_EVENT_MASK_BUTTON_PRESS | - XCB_EVENT_MASK_EXPOSURE); - w = xcb_generate_id(c); - check_cookie = xcb_aux_create_window_checked(c, - s->root_depth, w, s->root, 0, 0, width, height, 1, - XCB_WINDOW_CLASS_INPUT_OUTPUT, v->visual_id, mask, &cwa); - error = xcb_request_check(c, check_cookie); - assert(!error); - check_cookie = xcb_map_window_checked(c, w); - error = xcb_request_check(c, check_cookie); - assert(!error); - return w; -} - -void process_events(xcb_connection_t *c, - xcb_gcontext_t g, - xcb_window_t w, - xcb_pixmap_t p, - uint32_t width, - uint32_t height) { - xcb_generic_event_t *e; - xcb_void_cookie_t cookie; - - while ((e = xcb_wait_for_event(c))) { - uint32_t r = XCB_EVENT_RESPONSE_TYPE(e); - xcb_generic_error_t *err; - - fprintf(stderr, "event %d\n", r); - switch (r) { - case XCB_EXPOSE: - case XCB_MAP_NOTIFY: - cookie = xcb_copy_area_checked(c, p, w, g, - 0, 0, 0, 0, - width, height); - assert(!xcb_request_check(c, cookie)); - break; - case XCB_BUTTON_PRESS: - exit(0); - break; - case 0: - err = (xcb_generic_error_t *) e; - printf("error: %d (sequence %d)\n", - err->error_code, (unsigned int) err->full_sequence); - exit(1); - default: - break; - } - free(e); - } -} - -#define INSET_X 31 -#define INSET_Y 32 - -int main(int argc, char **argv) { - uint32_t width = test_width - 2 * INSET_X; - uint32_t height = test_height - 2 * INSET_Y; - int snum; - xcb_void_cookie_t check_cookie; - xcb_window_t w; - xcb_gcontext_t gc; - xcb_pixmap_t pix; - xcb_connection_t *c = xcb_connect(0, &snum); - xcb_screen_t *s = xcb_aux_get_screen(c, snum); - xcb_alloc_named_color_cookie_t bg_cookie = - xcb_alloc_named_color(c, s->default_colormap, - strlen("white"), "white"); - xcb_alloc_named_color_cookie_t fg_cookie = - xcb_alloc_named_color(c, s->default_colormap, - strlen("black"), "black"); - xcb_alloc_named_color_reply_t *bg_reply = - xcb_alloc_named_color_reply(c, bg_cookie, 0); - xcb_alloc_named_color_reply_t *fg_reply = - xcb_alloc_named_color_reply(c, fg_cookie, 0); - uint32_t fg, bg; - xcb_image_t *image, *native_image, *subimage; - uint32_t mask = 0; - xcb_params_gc_t gcv; - - assert(bg_reply && fg_reply); - bg = bg_reply->pixel; - fg = fg_reply->pixel; - free(bg_reply); - free(fg_reply); - w = make_window(c, s, bg, fg, width, height); - gc = xcb_generate_id(c); - check_cookie = xcb_create_gc_checked(c, gc, w, 0, 0); - assert(!xcb_request_check(c, check_cookie)); - image = xcb_image_create_from_bitmap_data((uint8_t *)test_bits, - test_width, test_height); - native_image = xcb_image_native(c, image, 1); - assert(native_image); - if (native_image != image) - xcb_image_destroy(image); - subimage = xcb_image_subimage(native_image, INSET_X, INSET_Y, - width, height, - 0, 0, 0); - assert(subimage); - xcb_image_destroy(native_image); - subimage->format = XCB_IMAGE_FORMAT_XY_BITMAP; - pix = xcb_generate_id(c); - xcb_create_pixmap(c, s->root_depth, pix, w, - subimage->width, subimage->height); - gc = xcb_generate_id(c); - XCB_AUX_ADD_PARAM(&mask, &gcv, foreground, fg); - XCB_AUX_ADD_PARAM(&mask, &gcv, background, bg); - xcb_aux_create_gc(c, gc, pix, mask, &gcv); - xcb_image_put(c, pix, gc, subimage, 0, 0, 0); - process_events(c, gc, w, pix, width, height); - xcb_disconnect(c); - return 1; -} diff --git a/image/test_formats.c b/image/test_formats.c deleted file mode 100644 index be3b217..0000000 --- a/image/test_formats.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright © 2008 Bart Massey - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include -#include -#include "../aux/xcb_aux.h" -#include "../aux/xcb_bitops.h" -#include "xcb_image.h" - -#define WIDTH 50 -#define HEIGHT 50 - -static uint32_t -color (uint32_t depth, uint32_t x, uint32_t y) -{ - uint32_t p; - - if (depth == 1) { - extern long random(); - int frac = random() % (WIDTH * HEIGHT); - p = x * y >= frac; - return p; - } - depth /= 3; - p = ((1 << depth) - 1) * x * y / WIDTH / HEIGHT; - return (p << depth) | (p << (2 * depth)); -} - -static xcb_image_t *create_image(xcb_connection_t *c, int depth, int format) -{ - xcb_image_t *im; - int x, y; - printf("Image depth %d, format %d\n", depth, format); - im = xcb_image_create_native(c, WIDTH, HEIGHT, - format, depth, 0, 0, 0); - for(x = 0; x < WIDTH; ++x) - for(y = 0; y < HEIGHT; ++y) - xcb_image_put_pixel(im, x, y, color(depth, x, y)); - return im; -} - -static xcb_window_t create_window(xcb_connection_t *c, xcb_screen_t *root) -{ - static const uint32_t mask = XCB_CW_EVENT_MASK; - static const uint32_t values[] = { XCB_EVENT_MASK_EXPOSURE }; - unsigned int seq; - xcb_window_t w = xcb_generate_id(c); - seq = xcb_create_window(c, root->root_depth, w, root->root, 30, 30, WIDTH, HEIGHT, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual, mask, values).sequence; - printf("CreateWindow sequence %d, depth %d\n", seq, root->root_depth); - seq = xcb_map_window(c, w).sequence; - printf("MapWindow sequence %d\n", seq); - return w; -} - -static xcb_pixmap_t create_pixmap(xcb_connection_t *c, xcb_drawable_t d, uint8_t depth) -{ - xcb_pixmap_t p = xcb_generate_id(c); - unsigned int seq; - seq = xcb_create_pixmap(c, depth, p, d, WIDTH, HEIGHT).sequence; - printf("CreatePixmap sequence %d, depth %d\n", seq, depth); - return p; -} - -static xcb_gcontext_t create_gcontext(xcb_connection_t *c, - xcb_drawable_t d, - xcb_screen_t *root) -{ - static const uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND; - const uint32_t values[] = { root->black_pixel, 0xffff }; - unsigned int seq; - xcb_gcontext_t gc = xcb_generate_id(c); - seq = xcb_create_gc(c, gc, d, mask, values).sequence; - printf("CreateGC sequence %d\n", seq); - return gc; -} - - -typedef struct { - char *name; - xcb_image_format_t format; - uint8_t depth; -} format_t; - -static format_t formats[] = { - {"z-pixmap", XCB_IMAGE_FORMAT_Z_PIXMAP, 24}, - {"xy-bitmap", XCB_IMAGE_FORMAT_XY_BITMAP, 1}, - {"xy-pixmap-1", XCB_IMAGE_FORMAT_XY_PIXMAP, 1}, - {"xy-pixmap-24", XCB_IMAGE_FORMAT_XY_PIXMAP, 24}, - {0, 0, 0} -}; - -static format_t * -parse_format (char *name) { - format_t *f; - for (f = formats; f->name; f++) - if (!strcmp(name, f->name)) - return f; - fprintf(stderr, "%s: bad format: known formats are:\n", name); - for (f = formats; f->name; f++) - fprintf(stderr, "\t%s\n", f->name); - exit(1); -} - -int main(int argc, char **argv) -{ - int screen, depth; - format_t *format = &formats[0]; - xcb_screen_t *root; - xcb_visualtype_t *visual; - xcb_image_t *im; - xcb_drawable_t d, w = XCB_NONE; - xcb_gcontext_t dgc, wgc = 0; - xcb_generic_event_t *ev; - xcb_connection_t *c = xcb_connect(0, &screen); - if(!c) - { - printf("Connection failed.\n"); - exit(1); - } - root = xcb_aux_get_screen(c, screen); - assert(root); - visual = xcb_aux_find_visual_by_id(root, root->root_visual); - assert(visual); - if(argc > 1) - format = parse_format(argv[1]); - if (root->root_depth != 24 || - visual->_class != XCB_VISUAL_CLASS_TRUE_COLOR) - { - printf("Only 24 bit TrueColor visuals for now\n"); - exit(1); - } - depth = format->depth; - - im = create_image(c, depth, format->format); - d = create_window(c, root); - if(format->format == XCB_IMAGE_FORMAT_XY_PIXMAP && depth == 1) - { - w = d; - d = create_pixmap(c, w, depth); - } - dgc = create_gcontext(c, d, root); - if (w) - wgc = create_gcontext(c, w, root); - xcb_flush(c); - - if(im) - { - while((ev = xcb_wait_for_event(c))) - { - if(ev->response_type == XCB_EXPOSE && ((xcb_expose_event_t *) ev)->count == 0) - { - printf("ImagePut sequence %d\n", xcb_image_put(c, d, dgc, im, 0, 0, 0).sequence); - if(w) - { - unsigned int seq; - seq = xcb_copy_plane(c, d, w, wgc, - 0, 0, 0, 0, - WIDTH, HEIGHT, 1).sequence; - printf("CopyPlane sequence %d\n", seq); - } - xcb_flush(c); - } - else if(ev->response_type == 0) - { - xcb_generic_error_t *err = (xcb_generic_error_t *) ev; - printf("Error: %d after sequence %d\n", err->error_code, (unsigned int) err->full_sequence); - } - free(ev); - } - xcb_image_destroy(im); - } - - xcb_disconnect(c); - exit(0); -} diff --git a/image/test_swap.c b/image/test_swap.c deleted file mode 100644 index becf26b..0000000 --- a/image/test_swap.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright © 2008 Keith Packard - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include -#include -#include -#include -#include "../aux/xcb_aux.h" -#include "xcb_image.h" - -xcb_image_format_t formats[] = { - XCB_IMAGE_FORMAT_Z_PIXMAP, - XCB_IMAGE_FORMAT_XY_PIXMAP, - XCB_IMAGE_FORMAT_XY_BITMAP, -}; -#define SIZE(a) (sizeof (a) / sizeof (a[0])) -#define NFORMAT SIZE(formats) - -int bpps[] = { - 1, 4, 8, 16, 32 -}; -#define NBPP SIZE(bpps) - -int units[] = { - 8, 16, 32 -}; -#define NUNIT SIZE(units) - -xcb_image_order_t byte_orders[] = { - XCB_IMAGE_ORDER_LSB_FIRST, - XCB_IMAGE_ORDER_MSB_FIRST -}; -#define NBYTE_ORDER SIZE(byte_orders) - -static -uint32_t pixel_mask (int bpp) -{ - if (bpp == 32) - return 0xffffffff; - return (1 << bpp) - 1; -} - -int -compare_image(xcb_image_t *a, xcb_image_t *b) -{ - int x, y; - uint32_t a_pixel, b_pixel; - uint32_t mask = pixel_mask (a->bpp) & pixel_mask (b->bpp); - - for (y = 0; y < a->height; y++) - for (x = 0; x < a->width; x++) { - a_pixel = xcb_image_get_pixel (a, x, y) & mask; - b_pixel = xcb_image_get_pixel (b, x, y) & mask; - if (a_pixel != b_pixel) { - fprintf (stderr, "fail at %d,%d: 0x%x != 0x%x\n", - x, y, a_pixel, b_pixel); - return 0; - } - } - return 1; -} - -#define test_width 63 -#define test_height 2 - -static xcb_image_t * -create_test_image (void) -{ - xcb_image_t *test_image; - int x, y; - uint32_t pixel; - test_image = xcb_image_create(test_width, test_height, - XCB_IMAGE_FORMAT_Z_PIXMAP, - 32, - 32, - 32, - 32, - XCB_IMAGE_ORDER_LSB_FIRST, - XCB_IMAGE_ORDER_LSB_FIRST, - NULL, 0, NULL); - - pixel = 0; - for (y = 0; y < test_height; y++) - for (x = 0; x < test_width; x++) { - xcb_image_put_pixel (test_image, x, y, pixel); - pixel++; - } - return test_image; -} - -static void -convert_test (xcb_image_t *test, xcb_image_t *a) -{ - int x, y; - - for (y = 0; y < test->height; y++) - for (x = 0; x < test->width; x++) - xcb_image_put_pixel (a, x, y, xcb_image_get_pixel (test, x, y)); -} - -static char * -order_name (xcb_image_order_t order) { - if (order == XCB_IMAGE_ORDER_MSB_FIRST) - return "MSB"; - else - return "LSB"; -} - -static void -print_format (xcb_image_t *image) -{ - switch (image->format) { - case XCB_IMAGE_FORMAT_Z_PIXMAP: fprintf (stderr, "Z pixmap"); break; - case XCB_IMAGE_FORMAT_XY_PIXMAP: fprintf (stderr, "XY pixmap"); break; - case XCB_IMAGE_FORMAT_XY_BITMAP: fprintf (stderr, "XY bitmap"); break; - } - fprintf (stderr, " pad: %d bpp: %d depth: %d unit: %d planemask: 0x%08x", - image->scanline_pad, image->bpp, image->depth, image->unit, - image->plane_mask); - fprintf (stderr, " byte order: %s bit order: %s stride: %d\n", - order_name (image->byte_order), order_name (image->bit_order), - image->stride); -} - -int main (int argc, char **argv) { - xcb_image_t *test_image; - xcb_image_t *src_image; - xcb_image_t *dst_image; - int dst_format_i, dst_bpp_i, dst_unit_i, dst_byte_order_i, dst_bit_order_i; - int src_format_i, src_bpp_i, src_unit_i, src_byte_order_i, src_bit_order_i; - xcb_image_format_t dst_format, src_format; - int dst_bpp, src_bpp; - int dst_unit, src_unit; - int dst_byte_order, src_byte_order; - int dst_bit_order, src_bit_order; - - test_image = create_test_image (); - - for (dst_format_i = 0; dst_format_i < NFORMAT; dst_format_i++) { - dst_format = formats[dst_format_i]; - for (src_format_i = 0; src_format_i < NFORMAT; src_format_i++) { - src_format = formats[src_format_i]; - for (dst_bpp_i = 0; dst_bpp_i < NBPP; dst_bpp_i++) { - dst_bpp = bpps[dst_bpp_i]; - for (src_bpp_i = 0; src_bpp_i < NBPP; src_bpp_i++) { - src_bpp = bpps[src_bpp_i]; - for (dst_unit_i = 0; dst_unit_i < NUNIT; dst_unit_i++) { - dst_unit = units[dst_unit_i]; - if (dst_format == XCB_IMAGE_FORMAT_Z_PIXMAP) { - if (dst_bpp == 4 && dst_unit != 8) - continue; - if (dst_bpp > 4 && dst_unit != dst_bpp) - continue; - } - if (dst_format == XCB_IMAGE_FORMAT_XY_BITMAP && dst_bpp != 1) - continue; - for (src_unit_i = 0; src_unit_i < NUNIT; src_unit_i++) { - src_unit = units[src_unit_i]; - if (src_format == XCB_IMAGE_FORMAT_Z_PIXMAP) { - if (src_bpp == 4 && src_unit != 8) - continue; - if (src_bpp > 4 && src_unit != src_bpp) - continue; - } - if (src_format == XCB_IMAGE_FORMAT_XY_BITMAP && src_bpp != 1) - continue; - for (dst_byte_order_i = 0; dst_byte_order_i < NBYTE_ORDER; dst_byte_order_i++) { - dst_byte_order = byte_orders[dst_byte_order_i]; - for (src_byte_order_i = 0; src_byte_order_i < NBYTE_ORDER; src_byte_order_i++) { - src_byte_order = byte_orders[src_byte_order_i]; - for (dst_bit_order_i = 0; dst_bit_order_i < NBYTE_ORDER; dst_bit_order_i++) { - dst_bit_order = byte_orders[dst_bit_order_i]; - if (dst_format == XCB_IMAGE_FORMAT_Z_PIXMAP && dst_bit_order != dst_byte_order) - continue; - for (src_bit_order_i = 0; src_bit_order_i < NBYTE_ORDER; src_bit_order_i++) { - src_bit_order = byte_orders[src_bit_order_i]; - if (src_format == XCB_IMAGE_FORMAT_Z_PIXMAP && src_bit_order != src_byte_order) - continue; - src_image = xcb_image_create (test_width, test_height, src_format, 32, src_bpp, src_bpp, src_unit, - src_byte_order, src_bit_order, NULL, 0, NULL); - dst_image = xcb_image_create (test_width, test_height, dst_format, 32, dst_bpp, dst_bpp, dst_unit, - dst_byte_order, dst_bit_order, NULL, 0, NULL); - convert_test (test_image, src_image); - if (!compare_image (test_image, src_image)) { - fprintf (stderr, "Initialization failure:\n"); - fprintf (stderr, "src format: "); print_format(src_image); - exit (1); - } - xcb_image_convert (src_image, dst_image); - if (!compare_image (src_image, dst_image)) { - /* - * Call the conversion function again so that debugging - * is easier - */ - fprintf (stderr, "Conversion failure:\n"); - fprintf (stderr, "src format: "); print_format(src_image); - fprintf (stderr, "dst format: "); print_format(dst_image); - exit (1); - } - xcb_image_destroy (src_image); - xcb_image_destroy (dst_image); - } - } - } - } - } - } - } - } - } - } - return 0; -} diff --git a/image/test_xcb_image.c b/image/test_xcb_image.c deleted file mode 100644 index ec1c924..0000000 --- a/image/test_xcb_image.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright © 2008 Bart Massey - * - * 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. - */ - -/* gcc -g -O2 -Wall `pkg-config --cflags --libs xcb` -o test xcb_image.o test_xcb_image.c */ - -#include -#include - -#include - -#include "../aux/xcb_aux.h" -#include "xcb_image.h" - -#define W_W 64 -#define W_H 64 - -void -reflect_window (xcb_connection_t *c, - xcb_drawable_t win, - xcb_drawable_t new_win, - xcb_gcontext_t gc, - uint16_t width, - uint16_t height) -{ - xcb_image_t *image; - uint32_t pixel1; - uint32_t pixel2; - int32_t left_x; - int32_t right_x; - int32_t y; - int format; - - format = XCB_IMAGE_FORMAT_Z_PIXMAP; - - printf ("get_image %d %d\n", width, height); - image = xcb_image_get (c, win, - 0, 0, width, height, - ~0, - format); - - printf ("Create image summary:\n"); - printf (" * format................: %d\n", image->format); - printf (" * byte order............: %d\n", image->byte_order); - printf (" * bitmap order..........: %d\n", image->bit_order); - printf (" * bitmap pad............: %d\n", image->scanline_pad); - printf (" * depth.................: %d\n", image->depth); - printf (" * bytes/line............: %d\n", image->stride); - printf (" * bits/pixel (or unit)..: %d\n", image->bpp); - - printf ("bpl %d %d\n", image->stride, image->height); - - printf("calculating reflection -- this may take awhile...\n"); - - for (left_x = 0 ; left_x < width/2 ; left_x++) - { - for (y = 0 ; y < height ; y++) - { - pixel1 = xcb_image_get_pixel (image, left_x, y); - right_x = width - left_x-1; - if (left_x != right_x) - { - pixel2 = xcb_image_get_pixel (image, right_x, y); - xcb_image_put_pixel (image, left_x, y, pixel2); - } - xcb_image_put_pixel (image, right_x, y, pixel1); - } - } - - printf("putting image\n"); - - xcb_image_put (c, new_win, gc, image, 0, 0, 0); - image = xcb_image_get (c, new_win, - 0, 0, width, height, - ~0, - format); - - printf ("done\n"); -} - -int -main (int argc, char *argv[]) -{ - xcb_connection_t *c; - xcb_screen_t *screen; - xcb_drawable_t win; - xcb_drawable_t new_win; - xcb_drawable_t rect; - xcb_rectangle_t rect_coord = { 0, 0, W_W, W_H}; - xcb_gcontext_t bgcolor, fgcolor; - xcb_point_t points[2]; - uint32_t mask; - uint32_t valgc[2]; - uint32_t valwin[3]; - int depth; - int screen_nbr; - xcb_generic_event_t *e; - - /* Open the connexion to the X server and get the first screen */ - c = xcb_connect (NULL, &screen_nbr); - screen = xcb_aux_get_screen (c, screen_nbr); - depth = xcb_aux_get_depth (c, screen); - - /* Create a black graphic context for drawing in the foreground */ - win = screen->root; - - fgcolor = xcb_generate_id(c); - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - valgc[0] = screen->black_pixel; - valgc[1] = 0; /* no graphics exposures */ - xcb_create_gc(c, fgcolor, win, mask, valgc); - - bgcolor = xcb_generate_id(c); - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - valgc[0] = screen->white_pixel; - valgc[1] = 0; /* no graphics exposures */ - xcb_create_gc(c, bgcolor, win, mask, valgc); - - /* Ask for our window's Id */ - win = xcb_generate_id(c); - - /* Create the window */ - mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE; - valwin[0] = screen->white_pixel; - valwin[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_EXPOSURE; - valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS; - xcb_create_window (c, /* Connection */ - 0, /* depth */ - win, /* window Id */ - screen->root, /* parent window */ - 0, 0, /* x, y */ - W_W, W_H, /* width, height */ - 10, /* border_width */ - XCB_WINDOW_CLASS_INPUT_OUTPUT,/* class */ - screen->root_visual, /* visual */ - mask, valwin); /* masks, not used yet */ - - /* Map the window on the screen */ - xcb_map_window (c, win); - - /* Create a Pixmap that will fill the window */ - rect = xcb_generate_id (c); - xcb_create_pixmap(c, depth, rect, win, W_W, W_H); - xcb_poly_fill_rectangle(c, rect, bgcolor, 1, &rect_coord); - points[0].x = 0; - points[0].y = 0; - points[1].x = W_W; - points[1].y = W_H; - xcb_poly_line(c, XCB_COORD_MODE_ORIGIN, rect, fgcolor, 2, points); - points[0].x = W_W / 4; - points[0].y = 0; - points[1].x = W_W / 2; - points[1].y = W_H / 2; - xcb_poly_line(c, XCB_COORD_MODE_ORIGIN, rect, fgcolor, 2, points); - - /* Ask for our window's Id */ - new_win = xcb_generate_id(c); - - /* Create the window */ - mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE; - valwin[0] = screen->white_pixel; - valwin[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_EXPOSURE; - valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS; - xcb_create_window (c, /* Connection */ - 0, /* depth */ - new_win, /* window Id */ - screen->root, /* parent window */ - 0, 0, /* x, y */ - W_W, W_H, /* width, height */ - 10, /* border_width */ - XCB_WINDOW_CLASS_INPUT_OUTPUT,/* class */ - screen->root_visual, /* visual */ - mask, valwin); /* masks, not used yet */ - - - - /* Map the window on the screen */ - xcb_map_window (c, new_win); - - - xcb_flush (c); - - while ((e = xcb_wait_for_event(c))) - { - switch (e->response_type) - { - case XCB_EXPOSE: - { - xcb_copy_area(c, rect, win, bgcolor, - 0, 0, 0, 0, W_W, W_H); - reflect_window (c, win, new_win, - fgcolor, - W_W, W_H); - xcb_flush (c); - break; - } - } - free (e); - } - - return 1; -} diff --git a/image/test_xcb_image_shm.c b/image/test_xcb_image_shm.c deleted file mode 100644 index b68d637..0000000 --- a/image/test_xcb_image_shm.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright © 2007 Bart Massey - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include - -#include -#include - -#include -#include - -#include "../aux/xcb_aux.h" -#include "xcb_image.h" - -#define W_W 40 -#define W_H 40 - - - -int -main (int argc, char *argv[]) -{ - xcb_connection_t *c; - xcb_screen_t *screen; - xcb_drawable_t win; - xcb_drawable_t rect; - xcb_rectangle_t rect_coord = { 0, 0, W_W, W_H}; - xcb_gcontext_t bgcolor, fgcolor; - xcb_point_t points[2]; - uint32_t mask; - uint32_t valgc[2]; - uint32_t valwin[3]; - int depth; - int screen_nbr; - xcb_generic_event_t *e; - uint8_t format; - - /* Open the connexion to the X server and get the first screen */ - c = xcb_connect (NULL, &screen_nbr); - screen = xcb_aux_get_screen (c, screen_nbr); - depth = xcb_aux_get_depth (c, screen); - - /* Create a black graphic context for drawing in the foreground */ - win = screen->root; - - fgcolor = xcb_generate_id(c); - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - valgc[0] = screen->black_pixel; - valgc[1] = 0; /* no graphics exposures */ - xcb_create_gc(c, fgcolor, win, mask, valgc); - - bgcolor = xcb_generate_id(c); - mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; - valgc[0] = screen->white_pixel; - valgc[1] = 0; /* no graphics exposures */ - xcb_create_gc(c, bgcolor, win, mask, valgc); - - /* Shm test */ - printf ("shm test begin\n"); - xcb_image_t *img = 0; - xcb_shm_query_version_reply_t *rep; - xcb_shm_segment_info_t shminfo; - - rep = xcb_shm_query_version_reply (c, - xcb_shm_query_version (c), - NULL); - if (!rep || !rep->shared_pixmaps || - rep->major_version < 1 || - (rep->major_version == 1 && rep->minor_version == 0)) - { - printf ("No or insufficient shm support...\n"); - exit (0); - } - format = rep->pixmap_format; - img = xcb_image_create_native (c, W_W, W_H, format, depth, - 0, ~0, 0); - - if (!img) - { - printf ("Can't create image...\n"); - exit (0); - } - - printf ("Create image summary:\n"); - printf (" * format..........: %d\n", img->format); - printf (" * byte order......: %d\n", img->byte_order); - printf (" * bitmap unit.....: %d\n", img->bpp); - printf (" * bitmap order....: %d\n", img->bit_order); - printf (" * bitmap pad......: %d\n", img->scanline_pad); - - shminfo.shmid = shmget (IPC_PRIVATE, img->size, IPC_CREAT|0777); - shminfo.shmaddr = shmat(shminfo.shmid, 0, 0); - img->data = shminfo.shmaddr; - - shminfo.shmseg = xcb_generate_id (c); - xcb_shm_attach(c, shminfo.shmseg, shminfo.shmid, 0); - shmctl(shminfo.shmid, IPC_RMID, 0); - - /* Draw in the image */ - printf ("put the pixel\n"); - xcb_image_put_pixel (img, 20, 20, 65535); - printf ("fin put pixel\n"); - - /* Ask for our window's Id */ - win = xcb_generate_id(c); - - /* Create the window */ - mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_DONT_PROPAGATE; - valwin[0] = screen->white_pixel; - valwin[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_EXPOSURE; - valwin[2] = XCB_EVENT_MASK_BUTTON_PRESS; - xcb_create_window (c, /* Connection */ - 0, /* depth */ - win, /* window Id */ - screen->root, /* parent window */ - 0, 0, /* x, y */ - W_W, W_H, /* width, height */ - 10, /* border_width */ - XCB_WINDOW_CLASS_INPUT_OUTPUT,/* class */ - screen->root_visual, /* visual */ - mask, valwin); /* masks, not used yet */ - - /* Map the window on the screen */ - xcb_map_window (c, win); - - /* Create a Pixmap that will fill the window */ - rect = xcb_generate_id (c); - xcb_create_pixmap(c, depth, rect, win, W_W, W_H); - xcb_poly_fill_rectangle(c, rect, bgcolor, 1, &rect_coord); - points[0].x = 0; - points[0].y = 0; - points[1].x = 1; - points[1].y = 1; - xcb_poly_line(c, XCB_COORD_MODE_ORIGIN, rect, fgcolor, 2, points); - - xcb_flush (c); - - while ((e = xcb_wait_for_event(c))) - { - switch (e->response_type) - { - case XCB_EXPOSE: - { - xcb_copy_area(c, rect, win, bgcolor, - 0, 0, 0, 0, W_W, W_H); - printf ("put image\n"); - xcb_image_shm_put (c, win, fgcolor, - img, shminfo, - 0, 0, 0, 0, W_W,W_H, - 0); - xcb_flush (c); - break; - } - } - free (e); - } - - return 1; -} diff --git a/image/xcb-image.pc.in b/image/xcb-image.pc.in deleted file mode 100644 index 403fdd0..0000000 --- a/image/xcb-image.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Image library -Description: XCB image convenience library -Version: @PACKAGE_VERSION@ -Requires: xcb xcb-shm -Libs: -L${libdir} -lxcb-image @LIBS@ -Cflags: -I${includedir} diff --git a/image/xcb_image.c b/image/xcb_image.c deleted file mode 100644 index 413bdc5..0000000 --- a/image/xcb_image.c +++ /dev/null @@ -1,1009 +0,0 @@ -/* Copyright © 2007 Bart Massey - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include -#include - -#include -#include -#include "../aux/xcb_aux.h" -#include "../aux/xcb_bitops.h" -#include "xcb_image.h" -#define BUILD -#include "xcb_pixel.h" - - -static xcb_format_t * -find_format_by_depth (const xcb_setup_t *setup, uint8_t depth) -{ - xcb_format_t *fmt = xcb_setup_pixmap_formats(setup); - xcb_format_t *fmtend = fmt + xcb_setup_pixmap_formats_length(setup); - for(; fmt != fmtend; ++fmt) - if(fmt->depth == depth) - return fmt; - return 0; -} - - -static xcb_image_format_t -effective_format(xcb_image_format_t format, uint8_t bpp) -{ - if (format == XCB_IMAGE_FORMAT_Z_PIXMAP && bpp != 1) - return format; - return XCB_IMAGE_FORMAT_XY_PIXMAP; -} - - -static int -format_valid (uint8_t depth, uint8_t bpp, uint8_t unit, - xcb_image_format_t format, uint8_t xpad) -{ - xcb_image_format_t ef = effective_format(format, bpp); - if (depth > bpp) - return 0; - switch(ef) { - case XCB_IMAGE_FORMAT_XY_PIXMAP: - switch(unit) { - case 8: - case 16: - case 32: - break; - default: - return 0; - } - if (xpad < bpp) - return 0; - switch (xpad) { - case 8: - case 16: - case 32: - break; - default: - return 0; - } - break; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - switch (bpp) { - case 4: - if (unit != 8) - return 0; - break; - case 8: - case 16: - case 24: - case 32: - if (unit != bpp) - return 0; - break; - default: - return 0; - } - break; - default: - return 0; - } - return 1; -} - - -static int -image_format_valid (xcb_image_t *image) { - return format_valid(image->depth, - image->bpp, - image->unit, - image->format, - image->scanline_pad); -} - - -void -xcb_image_annotate (xcb_image_t *image) -{ - xcb_image_format_t ef = effective_format(image->format, image->bpp); - switch (ef) { - case XCB_IMAGE_FORMAT_XY_PIXMAP: - image->stride = xcb_roundup(image->width, image->scanline_pad) >> 3; - image->size = image->height * image->stride * image->depth; - break; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - image->stride = xcb_roundup((uint32_t)image->width * - (uint32_t)image->bpp, - image->scanline_pad) >> 3; - image->size = image->height * image->stride; - break; - default: - assert(0); - } -} - - -xcb_image_t * -xcb_image_create_native (xcb_connection_t * c, - uint16_t width, - uint16_t height, - xcb_image_format_t format, - uint8_t depth, - void * base, - uint32_t bytes, - uint8_t * data) -{ - const xcb_setup_t * setup = xcb_get_setup(c); - xcb_format_t * fmt; - xcb_image_format_t ef = format; - - if (ef == XCB_IMAGE_FORMAT_Z_PIXMAP && depth == 1) - ef = XCB_IMAGE_FORMAT_XY_PIXMAP; - switch (ef) { - case XCB_IMAGE_FORMAT_XY_BITMAP: - if (depth != 1) - return 0; - /* fall through */ - case XCB_IMAGE_FORMAT_XY_PIXMAP: - if (depth > 1) { - fmt = find_format_by_depth(setup, depth); - if (!fmt) - return 0; - } - return xcb_image_create(width, height, format, - setup->bitmap_format_scanline_pad, - depth, depth, setup->bitmap_format_scanline_unit, - setup->image_byte_order, - setup->bitmap_format_bit_order, - base, bytes, data); - case XCB_IMAGE_FORMAT_Z_PIXMAP: - fmt = find_format_by_depth(setup, depth); - if (!fmt) - return 0; - return xcb_image_create(width, height, format, - fmt->scanline_pad, - fmt->depth, fmt->bits_per_pixel, 0, - setup->image_byte_order, - XCB_IMAGE_ORDER_MSB_FIRST, - base, bytes, data); - default: - assert(0); - } - assert(0); -} - - -xcb_image_t * -xcb_image_create (uint16_t width, - uint16_t height, - xcb_image_format_t format, - uint8_t xpad, - uint8_t depth, - uint8_t bpp, - uint8_t unit, - xcb_image_order_t byte_order, - xcb_image_order_t bit_order, - void * base, - uint32_t bytes, - uint8_t * data) -{ - xcb_image_t * image; - - if (unit == 0) { - switch (format) { - case XCB_IMAGE_FORMAT_XY_BITMAP: - case XCB_IMAGE_FORMAT_XY_PIXMAP: - unit = 32; - break; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - if (bpp == 1) { - unit = 32; - break; - } - if (bpp < 8) { - unit = 8; - break; - } - unit = bpp; - break; - } - } - if (!format_valid(depth, bpp, unit, format, xpad)) - return 0; - image = malloc(sizeof(*image)); - if (image == 0) - return 0; - image->width = width; - image->height = height; - image->format = format; - image->scanline_pad = xpad; - image->depth = depth; - image->bpp = bpp; - image->unit = unit; - image->plane_mask = xcb_mask(depth); - image->byte_order = byte_order; - image->bit_order = bit_order; - xcb_image_annotate(image); - - /* - * Ways this function can be called: - * * with data: we fail if bytes isn't - * large enough, else leave well enough alone. - * * with base and !data: if bytes is zero, we - * default; otherwise we fail if bytes isn't - * large enough, else fill in data - * * with !base and !data: we malloc storage - * for the data, save that address as the base, - * and fail if malloc does. - * - * When successful, we establish the invariant that data - * points at sufficient storage that may have been - * supplied, and base is set iff it should be - * auto-freed when the image is destroyed. - * - * Except as a special case when base = 0 && data == 0 && - * bytes == ~0 we just return the image structure and let - * the caller deal with getting the allocation right. - */ - if (!base && !data && bytes == ~0) { - image->base = 0; - image->data = 0; - return image; - } - if (!base && data && bytes == 0) - bytes = image->size; - image->base = base; - image->data = data; - if (!image->data) { - if (image->base) { - image->data = image->base; - } else { - bytes = image->size; - image->base = malloc(bytes); - image->data = image->base; - } - } - if (!image->data || bytes < image->size) { - free(image); - return 0; - } - return image; -} - - -void -xcb_image_destroy (xcb_image_t *image) -{ - if (image->base) - free (image->base); - free (image); -} - - -xcb_image_t * -xcb_image_get (xcb_connection_t * conn, - xcb_drawable_t draw, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint32_t plane_mask, - xcb_image_format_t format) -{ - xcb_get_image_cookie_t image_cookie; - xcb_get_image_reply_t * imrep; - xcb_image_t * image = 0; - uint32_t bytes; - uint8_t * data; - - image_cookie = xcb_get_image(conn, format, draw, x, y, - width, height, plane_mask); - imrep = xcb_get_image_reply(conn, image_cookie, 0); - if (!imrep) - return 0; - bytes = xcb_get_image_data_length(imrep); - data = xcb_get_image_data(imrep); - switch (format) { - case XCB_IMAGE_FORMAT_XY_PIXMAP: - plane_mask &= xcb_mask(imrep->depth); - if (plane_mask != xcb_mask(imrep->depth)) { - xcb_image_t * tmp_image = - xcb_image_create_native(conn, width, height, format, - imrep->depth, 0, 0, 0); - int i; - uint32_t rpm = plane_mask; - uint8_t * src_plane = image->data; - uint8_t * dst_plane = tmp_image->data; - uint32_t size = image->height * image->stride; - - if (!tmp_image) { - free(imrep); - return 0; - } - if (tmp_image->bit_order == XCB_IMAGE_ORDER_MSB_FIRST) - rpm = xcb_bit_reverse(plane_mask, imrep->depth); - for (i = 0; i < imrep->depth; i++) { - if (rpm & 1) { - memcpy(dst_plane, src_plane, size); - src_plane += size; - } else { - memset(dst_plane, 0, size); - } - dst_plane += size; - } - tmp_image->plane_mask = plane_mask; - image = tmp_image; - free(imrep); - break; - } - /* fall through */ - case XCB_IMAGE_FORMAT_Z_PIXMAP: - image = xcb_image_create_native(conn, width, height, format, - imrep->depth, imrep, bytes, data); - if (!image) { - free(imrep); - return 0; - } - break; - default: - assert(0); - } - assert(bytes == image->size); - return image; -} - - -xcb_image_t * -xcb_image_native (xcb_connection_t * c, - xcb_image_t * image, - int convert) -{ - xcb_image_t * tmp_image = 0; - const xcb_setup_t * setup = xcb_get_setup(c); - xcb_format_t * fmt = 0; - xcb_image_format_t ef = effective_format(image->format, image->bpp); - uint8_t bpp = 1; - - if (image->depth > 1 || ef == XCB_IMAGE_FORMAT_Z_PIXMAP) { - fmt = find_format_by_depth(setup, image->depth); - /* XXX For now, we don't do depth conversions, even - for xy-pixmaps */ - if (!fmt) - return 0; - bpp = fmt->bits_per_pixel; - } - switch (ef) { - case XCB_IMAGE_FORMAT_XY_PIXMAP: - if (setup->bitmap_format_scanline_unit != image->unit || - setup->bitmap_format_scanline_pad != image->scanline_pad || - setup->image_byte_order != image->byte_order || - setup->bitmap_format_bit_order != image->bit_order || - bpp != image->bpp) { - if (!convert) - return 0; - tmp_image = - xcb_image_create(image->width, image->height, image->format, - setup->bitmap_format_scanline_pad, - image->depth, bpp, - setup->bitmap_format_scanline_unit, - setup->image_byte_order, - setup->bitmap_format_bit_order, - 0, 0, 0); - if (!tmp_image) - return 0; - } - break; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - if (fmt->scanline_pad != image->scanline_pad || - setup->image_byte_order != image->byte_order || - bpp != image->bpp) { - if (!convert) - return 0; - tmp_image = - xcb_image_create(image->width, image->height, image->format, - fmt->scanline_pad, - image->depth, bpp, 0, - setup->image_byte_order, - XCB_IMAGE_ORDER_MSB_FIRST, - 0, 0, 0); - if (!tmp_image) - return 0; - } - break; - default: - assert(0); - } - if (tmp_image) { - if (!xcb_image_convert(image, tmp_image)) { - xcb_image_destroy(tmp_image); - return 0; - } - image = tmp_image; - } - return image; -} - - -xcb_void_cookie_t -xcb_image_put (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_gcontext_t gc, - xcb_image_t * image, - int16_t x, - int16_t y, - uint8_t left_pad) -{ - return xcb_put_image(conn, image->format, draw, gc, - image->width, image->height, - x, y, left_pad, - image->depth, - image->size, - image->data); -} - - - -/* - * Shm stuff - */ - -xcb_image_t * -xcb_image_shm_put (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_gcontext_t gc, - xcb_image_t * image, - xcb_shm_segment_info_t shminfo, - int16_t src_x, - int16_t src_y, - int16_t dest_x, - int16_t dest_y, - uint16_t src_width, - uint16_t src_height, - uint8_t send_event) -{ - if (!xcb_image_native(conn, image, 0)) - return 0; - if (!shminfo.shmaddr) - return 0; - xcb_shm_put_image(conn, draw, gc, - image->width, image->height, - src_x, src_y, src_width, src_height, - dest_x, dest_y, - image->depth, image->format, - send_event, - shminfo.shmseg, - image->data - shminfo.shmaddr); - return image; -} - - -int -xcb_image_shm_get (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_image_t * image, - xcb_shm_segment_info_t shminfo, - int16_t x, - int16_t y, - uint32_t plane_mask) -{ - xcb_shm_get_image_reply_t * setup; - xcb_shm_get_image_cookie_t cookie; - xcb_generic_error_t * err = 0; - - if (!shminfo.shmaddr) - return 0; - cookie = xcb_shm_get_image(conn, draw, - x, y, - image->width, image->height, - plane_mask, - image->format, - shminfo.shmseg, - image->data - shminfo.shmaddr); - setup = xcb_shm_get_image_reply(conn, cookie, &err); - if (err) { - fprintf(stderr, "ShmGetImageReply error %d\n", (int)err->error_code); - free(err); - return 0; - } else { - free (setup); - return 1; - } -} - - -static uint32_t -xy_image_byte (xcb_image_t *image, uint32_t x) -{ - x >>= 3; - if (image->byte_order == image->bit_order) - return x; - switch (image->unit) { - default: - case 8: - return x; - case 16: - return x ^ 1; - case 32: - return x ^ 3; - } -} - -static uint32_t -xy_image_bit (xcb_image_t *image, uint32_t x) -{ - x &= 7; - if (image->bit_order == XCB_IMAGE_ORDER_MSB_FIRST) - x = 7 - x; - return x; -} - -/* GetPixel/PutPixel */ - -/* XXX this is the most hideously done cut-and-paste - to below. Any bugs fixed there should be fixed here - and vice versa. */ -void -xcb_image_put_pixel (xcb_image_t *image, - uint32_t x, - uint32_t y, - uint32_t pixel) -{ - uint8_t *row; - - if (x > image->width || y > image->height) - return; - row = image->data + (y * image->stride); - switch (effective_format(image->format, image->bpp)) { - case XCB_IMAGE_FORMAT_XY_BITMAP: - case XCB_IMAGE_FORMAT_XY_PIXMAP: - /* block */ { - int p; - uint32_t plane_mask = image->plane_mask; - uint8_t * plane = row; - uint32_t byte = xy_image_byte(image, x); - uint32_t bit = xy_image_bit(image,x); - uint8_t mask = 1 << bit; - - for (p = image->bpp - 1; p >= 0; p--) { - if ((plane_mask >> p) & 1) { - uint8_t * bp = plane + byte; - uint8_t this_bit = ((pixel >> p) & 1) << bit; - *bp = (*bp & ~mask) | this_bit; - } - plane += image->stride * image->height; - } - } - break; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - switch (image->bpp) { - uint32_t mask; - case 4: - mask = 0xf; - pixel &= 0xf; - if ((x & 1) == - (image->byte_order == XCB_IMAGE_ORDER_MSB_FIRST)) { - pixel <<= 4; - mask <<= 4; - } - row[x >> 1] = (row[x >> 1] & ~mask) | pixel; - break; - case 8: - row[x] = pixel; - break; - case 16: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - row[x << 1] = pixel; - row[(x << 1) + 1] = pixel >> 8; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - row[x << 1] = pixel >> 8; - row[(x << 1) + 1] = pixel; - break; - } - break; - case 24: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - row[x * 3] = pixel; - row[x * 3 + 1] = pixel >> 8; - row[x * 3 + 2] = pixel >> 16; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - row[x * 3] = pixel >> 16; - row[x * 3 + 1] = pixel >> 8; - row[x * 3 + 2] = pixel; - break; - } - break; - case 32: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - row[x << 2] = pixel; - row[(x << 2) + 1] = pixel >> 8; - row[(x << 2) + 2] = pixel >> 16; - row[(x << 2) + 3] = pixel >> 24; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - row[x << 2] = pixel >> 24; - row[(x << 2) + 1] = pixel >> 16; - row[(x << 2) + 2] = pixel >> 8; - row[(x << 2) + 3] = pixel; - break; - } - break; - default: - assert(0); - } - break; - default: - assert(0); - } -} - - -/* XXX this is the most hideously done cut-and-paste - from above. Any bugs fixed there should be fixed here - and vice versa. */ -uint32_t -xcb_image_get_pixel (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - uint32_t pixel = 0; - uint8_t *row; - - assert(x < image->width && y < image->height); - row = image->data + (y * image->stride); - switch (effective_format(image->format, image->bpp)) { - case XCB_IMAGE_FORMAT_XY_BITMAP: - case XCB_IMAGE_FORMAT_XY_PIXMAP: - /* block */ { - int p; - uint32_t plane_mask = image->plane_mask; - uint8_t * plane = row; - uint32_t byte = xy_image_byte(image, x); - uint32_t bit = xy_image_bit(image,x); - - for (p = image->bpp - 1; p >= 0; p--) { - pixel <<= 1; - if ((plane_mask >> p) & 1) { - uint8_t * bp = plane + byte; - pixel |= (*bp >> bit) & 1; - } - plane += image->stride * image->height; - } - } - return pixel; - case XCB_IMAGE_FORMAT_Z_PIXMAP: - switch (image->bpp) { - case 4: - if ((x & 1) == (image->byte_order == XCB_IMAGE_ORDER_MSB_FIRST)) - return row[x >> 1] >> 4; - return row[x >> 1] & 0xf; - case 8: - return row[x]; - case 16: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - pixel = row[x << 1]; - pixel |= row[(x << 1) + 1] << 8; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - pixel = row[x << 1] << 8; - pixel |= row[(x << 1) + 1]; - break; - } - break; - case 24: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - pixel = row[x * 3]; - pixel |= row[x * 3 + 1] << 8; - pixel |= row[x * 3 + 2] << 16; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - pixel = row[x * 3] << 16; - pixel |= row[x * 3 + 1] << 8; - pixel |= row[x * 3 + 2]; - break; - } - break; - case 32: - switch (image->byte_order) { - case XCB_IMAGE_ORDER_LSB_FIRST: - pixel = row[x << 2]; - pixel |= row[(x << 2) + 1] << 8; - pixel |= row[(x << 2) + 2] << 16; - pixel |= row[(x << 2) + 3] << 24; - break; - case XCB_IMAGE_ORDER_MSB_FIRST: - pixel = row[x << 2] << 24; - pixel |= row[(x << 2) + 1] << 16; - pixel |= row[(x << 2) + 2] << 8; - pixel |= row[(x << 2) + 3]; - break; - } - break; - default: - assert(0); - } - return pixel; - default: - assert(0); - } -} - - -xcb_image_t * -xcb_image_create_from_bitmap_data (uint8_t * data, - uint32_t width, - uint32_t height) -{ - return xcb_image_create(width, height, XCB_IMAGE_FORMAT_XY_PIXMAP, - 8, 1, 1, 8, - XCB_IMAGE_ORDER_LSB_FIRST, - XCB_IMAGE_ORDER_LSB_FIRST, - 0, 0, data); -} - - -/* - * (Adapted from libX11.) - * - * xcb_create_pixmap_from_bitmap_data: Routine to make a pixmap of - * given depth from user supplied bitmap data. - * D is any drawable on the same screen that the pixmap will be used in. - * Data is a pointer to the bit data, and - * width & height give the size in bits of the pixmap. - * - * The following format is assumed for data: - * - * format=XY (will use XYPixmap for depth 1 and XYBitmap for larger) - * bit_order=LSBFirst - * padding=8 - * bitmap_unit=8 - */ -xcb_pixmap_t -xcb_create_pixmap_from_bitmap_data (xcb_connection_t * display, - xcb_drawable_t d, - uint8_t * data, - uint32_t width, - uint32_t height, - uint32_t depth, - uint32_t fg, - uint32_t bg, - xcb_gcontext_t * gcp) -{ - xcb_pixmap_t pix; - xcb_image_t * image; - xcb_image_t * final_image; - xcb_gcontext_t gc; - uint32_t mask = 0; - xcb_params_gc_t gcv; - - image = xcb_image_create_from_bitmap_data(data, width, height); - if (!image) - return 0; - if (depth > 1) - image->format = XCB_IMAGE_FORMAT_XY_BITMAP; - final_image = xcb_image_native(display, image, 1); - if (!final_image) { - xcb_image_destroy(image); - return 0; - } - pix = xcb_generate_id(display); - xcb_create_pixmap(display, depth, pix, d, width, height); - gc = xcb_generate_id(display); - XCB_AUX_ADD_PARAM(&mask, &gcv, foreground, fg); - XCB_AUX_ADD_PARAM(&mask, &gcv, background, bg); - xcb_aux_create_gc(display, gc, pix, mask, &gcv); - xcb_image_put(display, pix, gc, final_image, 0, 0, 0); - if (final_image != image) - xcb_image_destroy(final_image); - xcb_image_destroy(image); - if (gcp) - *gcp = gc; - else - xcb_free_gc(display, gc); - return pix; -} - - -/* Thanks to Keith Packard for this code */ -static void -swap_image(uint8_t * src, - uint32_t src_stride, - uint8_t * dst, - uint32_t dst_stride, - uint32_t height, - uint32_t byteswap, - int bitswap, - int nibbleswap) -{ - while (height--) { - uint32_t s; - - for (s = 0; s < src_stride; s++) { - uint8_t b; - uint32_t d = s ^ byteswap; - - if (d > dst_stride) - continue; - - b = src[s]; - if (bitswap) - b = xcb_bit_reverse(b, 8); - if (nibbleswap) - b = (b << 4) | (b >> 4); - dst[d] = b; - } - src += src_stride; - dst += dst_stride; - } -} - -/* Which order are bytes in (low two bits), given - * code which accesses an image one byte at a time - */ -static uint32_t -byte_order(xcb_image_t *i) -{ - uint32_t flip = i->byte_order == XCB_IMAGE_ORDER_MSB_FIRST; - - switch (i->bpp) { - default: - case 8: - return 0; - case 16: - return flip; - case 32: - return flip | (flip << 1); - } -} - -static uint32_t -bit_order(xcb_image_t *i) -{ - uint32_t flip = i->byte_order != i->bit_order; - - switch (i->unit) { - default: - case 8: - return 0; - case 16: - return flip; - case 32: - return flip | (flip << 1); - } -} - -/* Convert from one byte order to another by flipping the - * low two bits of the byte index along a scanline - */ -static uint32_t -conversion_byte_swap(xcb_image_t *src, xcb_image_t *dst) -{ - xcb_image_format_t ef = effective_format(src->format, src->bpp); - - /* src_ef == dst_ef in all callers of this function */ - if (ef == XCB_IMAGE_FORMAT_XY_PIXMAP) { - return bit_order(src) ^ bit_order(dst); - } else { - /* src_bpp == dst_bpp in all callers of this function */ - return byte_order(src) ^ byte_order(dst); - } -} - -xcb_image_t * -xcb_image_convert (xcb_image_t * src, - xcb_image_t * dst) -{ - xcb_image_format_t ef = effective_format(src->format, src->bpp); - - /* Things will go horribly wrong here if a bad - image is passed in, so we check some things - up front just to be nice. */ - assert(image_format_valid(src)); - assert(image_format_valid(dst)); - - /* images must be the same size - * (yes, we could copy a sub-set) - */ - if (src->width != dst->width || - src->height != dst->height) - return 0; - - if (ef == effective_format(dst->format, dst->bpp) && - src->bpp == dst->bpp) - { - if (src->unit == dst->unit && - src->scanline_pad == dst->scanline_pad && - src->byte_order == dst->byte_order && - (ef == XCB_IMAGE_FORMAT_Z_PIXMAP || - src->bit_order == dst->bit_order)) { - memcpy(dst->data, src->data, src->size); - } else { - int bitswap = 0; - int nibbleswap = 0; - uint32_t byteswap = conversion_byte_swap(src, dst); - uint32_t height = src->height;; - - if (ef == XCB_IMAGE_FORMAT_Z_PIXMAP) { - if (src->bpp == 4 && src->byte_order != dst->byte_order) - nibbleswap = 1; - } else { - if (src->bit_order != dst->bit_order) - bitswap = 1; - height *= src->depth; - } - swap_image (src->data, src->stride, dst->data, dst->stride, - height, byteswap, bitswap, nibbleswap); - } - } - else - { - uint32_t x; - uint32_t y; - /* General case: Slow pixel copy. Should we optimize - Z24<->Z32 copies of either endianness? */ - for (y = 0; y < src->height; y++) { - for (x = 0; x < src->width; x++) { - uint32_t pixel = xcb_image_get_pixel(src, x, y); - xcb_image_put_pixel(dst, x, y, pixel); - } - } - } - return dst; -} - -xcb_image_t * -xcb_image_subimage(xcb_image_t * image, - uint32_t x, - uint32_t y, - uint32_t width, - uint32_t height, - void * base, - uint32_t bytes, - uint8_t * data) -{ - int i, j; - xcb_image_t * result; - - if (x + width > image->width) - return 0; - if (y + height > image->height) - return 0; - result = xcb_image_create(width, height, image->format, - image->scanline_pad, image->depth, - image->bpp, image->unit, image->byte_order, - image->bit_order, - base, bytes, data); - if (!result) - return 0; - /* XXX FIXME For now, lose on performance. Sorry. */ - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) { - uint32_t pixel = xcb_image_get_pixel(image, x + i, y + j); - xcb_image_put_pixel(result, i, j, pixel); - } - } - return result; -} diff --git a/image/xcb_image.h b/image/xcb_image.h deleted file mode 100644 index 3b54da3..0000000 --- a/image/xcb_image.h +++ /dev/null @@ -1,630 +0,0 @@ -#ifndef __XCB_IMAGE_H__ -#define __XCB_IMAGE_H__ - -/* Copyright (C) 2007 Bart Massey - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @defgroup xcb__image_t XCB Image Functions - * - * These are functions used to create and manipulate X images. - * - * The X image format we use is specific to this software, - * which is probably a bug; it represents an intermediate - * position between the wire format used by the X GetImage - * and PutImage requests and standard formats like PBM. An - * image consists of a header of type @ref xcb_image_t - * describing the properties of the image, together with a - * pointer to the image data itself. - * - * X wire images come in three formats. An xy-bitmap is a - * bit-packed format that will be expanded to a two-color - * pixmap using a GC when sent over the wire by PutImage. - * An xy-pixmap is one or more bit-planes, each in the same - * format as xy-bitmap. A z-pixmap is a more conventional - * pixmap representation, with each pixel packed into a - * word. Pixmaps are sent and received over the wire only - * to/from drawables of their depth. - * - * Each X server defines, for each depth and format, - * properties of images in that format that are sent and - * received on the wire. We refer to this as a "native" - * image for a given X server. It is not uncommon to want - * to work with non-native images on the client side, or to - * convert between the native images of different servers. - * - * This library provides several things. Facilities for - * creating and destroying images are, of course, provided. - * Wrappers for xcb_get_image() and xcb_put_image() are - * provided; these utilize the image header to simplify the - * interface. Routines for getting and putting image pixels - * are provided: both a generic form that works with - * arbitrary images, and fastpath forms for some common - * cases. Conversion routines are provided for X images; - * these routines have been fairly well optimized for the - * common cases, and should run fast even on older hardware. - * A routine analogous to Xlib's XCreate*FromBitmapData() is - * provided for creating X images from xbm-format data; this - * routine is in this library only because it is a trivial - * use case for the library. - * - * @{ - */ - - -typedef struct xcb_image_t xcb_image_t; - -/** - * @struct xcb_image_t - * A structure that describes an xcb_image_t. - */ -struct xcb_image_t -{ - uint16_t width; /**< Width in pixels, excluding pads etc. */ - uint16_t height; /**< Height in pixels. */ - xcb_image_format_t format; /**< Format. */ - uint8_t scanline_pad; /**< Right pad in bits. Valid pads - * are 8, 16, 32. - */ - uint8_t depth; /**< Depth in bits. Valid depths - * are 1, 4, 8, 16, 24 for z format, - * 1 for xy-bitmap-format, anything - * for xy-pixmap-format. - */ - uint8_t bpp; /**< Storage per pixel in bits. - * Must be >= depth. Valid bpp - * are 1, 4, 8, 16, 24, 32 for z - * format, 1 for xy-bitmap format, - * anything for xy-pixmap-format. - */ - uint8_t unit; /**< Scanline unit in bits for - * xy formats and for bpp == 1, - * in which case valid scanline - * units are 8, 16, 32. Otherwise, - * will be max(8, bpp). Must be >= bpp. - */ - uint32_t plane_mask; /**< When format is - * xy-pixmap and depth > - * 1, this says which - * planes are "valid" in - * some vague sense. - * Currently used only - * by xcb_image_get/put_pixel(), - * and set only by - * xcb_image_get(). - */ - xcb_image_order_t byte_order; /**< Component byte order - * for z-pixmap, byte - * order of scanline unit - * for xy-bitmap and - * xy-pixmap. Nybble - * order for z-pixmap - * when bpp == 4. - */ - xcb_image_order_t bit_order; /**< Bit order of - * scanline unit for - * xy-bitmap and - * xy-pixmap. - */ - uint32_t stride; /**< Bytes per image row. - * Computable from other - * data, but cached for - * convenience/performance. - */ - uint32_t size; /**< Size of image data in bytes. - * Computable from other - * data, but cached for - * convenience/performance. - */ - void * base; /**< Malloced block of storage that - * will be freed by - * @ref xcb_image_destroy() if non-null. - */ - uint8_t * data; /**< The actual image. */ -}; - -typedef struct xcb_shm_segment_info_t xcb_shm_segment_info_t; - -/** - * @struct xcb_shm_segment_info_t - * A structure that stores the informations needed by the MIT Shm - * Extension. - */ -struct xcb_shm_segment_info_t -{ - xcb_shm_seg_t shmseg; - uint32_t shmid; - uint8_t *shmaddr; -}; - - -/** - * Update the cached data of an image. - * @param image The image. - * - * An image's size and stride, among other things, are - * cached in its structure. This function recomputes those - * cached values for the given image. - * @ingroup xcb__image_t - */ -void -xcb_image_annotate (xcb_image_t *image); - -/** - * Create a new image. - * @param width The width of the image, in pixels. - * @param height The height of the image, in pixels. - * @param format The format of the image. - * @param xpad The scanline pad of the image. - * @param depth The depth of the image. - * @param bpp The depth of the image storage. - * @param unit The unit of image representation, in bits. - * @param byte_order The byte order of the image. - * @param bit_order The bit order of the image. - * @param base The base address of malloced image data. - * @param bytes The size in bytes of the storage pointed to by base. - * If base == 0 and bytes == ~0 and data == 0 on - * entry, no storage will be auto-allocated. - * @param data The image data. If data is null and bytes != ~0, then - * an attempt will be made to fill in data; from - * base if it is non-null (and bytes is large enough), else - * by mallocing sufficient storage and filling in base. - * @return The new image. - * - * This function allocates the memory needed for an @ref xcb_image_t structure - * with the given properties. See the description of xcb_image_t for details. - * This function initializes and returns a pointer to the - * xcb_image_t structure. It may try to allocate or reserve data for the - * structure, depending on how @p base, @p bytes and @p data are set. - * - * The image must be destroyed with xcb_image_destroy(). - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_create (uint16_t width, - uint16_t height, - xcb_image_format_t format, - uint8_t xpad, - uint8_t depth, - uint8_t bpp, - uint8_t unit, - xcb_image_order_t byte_order, - xcb_image_order_t bit_order, - void * base, - uint32_t bytes, - uint8_t * data); - - -/** - * Create a new image in connection-native format. - * @param c The connection. - * @param width The width of the image, in pixels. - * @param height The height of the image, in pixels. - * @param format The format of the image. - * @param depth The depth of the image. - * @param base The base address of malloced image data. - * @param bytes The size in bytes of the storage pointed to by base. - * If base == 0 and bytes == ~0 and data == 0 on - * entry, no storage will be auto-allocated. - * @param data The image data. If data is null and bytes != ~0, then - * an attempt will be made to fill in data; from - * base if it is non-null (and bytes is large enough), else - * by mallocing sufficient storage and filling in base. - * @return The new image. - * - * This function calls @ref xcb_image_create() with the given - * properties, and with the remaining properties chosen - * according to the "native format" with the given - * properties on the current connection. - * - * It is usual to use this rather - * than calling xcb_image_create() directly. - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_create_native (xcb_connection_t * c, - uint16_t width, - uint16_t height, - xcb_image_format_t format, - uint8_t depth, - void * base, - uint32_t bytes, - uint8_t * data); - - -/** - * Destroy an image. - * @param image The image to be destroyed. - * - * This function frees the memory associated with the @p image - * parameter. If its base pointer is non-null, it frees - * that also. - * @ingroup xcb__image_t - */ -void -xcb_image_destroy (xcb_image_t *image); - - -/** - * Get an image from the X server. - * @param conn The connection to the X server. - * @param draw The drawable to get the image from. - * @param x The x coordinate in pixels, relative to the origin of the - * drawable and defining the upper-left corner of the rectangle. - * @param y The y coordinate in pixels, relative to the origin of the - * drawable and defining the upper-left corner of the rectangle. - * @param width The width of the subimage in pixels. - * @param height The height of the subimage in pixels. - * @param plane_mask The plane mask. See the protocol document for details. - * @param format The format of the image. - * @return The subimage of @p draw defined by @p x, @p y, @p w, @p h. - * - - * This function returns a new image taken from the - * given drawable @p draw. - * The image will be in connection native format. If the @p format - * is xy-bitmap and the @p plane_mask masks bit planes out, those - * bit planes will be made part of the returned image anyway, - * by zero-filling them; this will require a fresh memory allocation - * and some copying. Otherwise, the resulting image will use the - * xcb_get_image_reply() record as its backing store. - * - * If a problem occurs, the function returns null. - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_get (xcb_connection_t * conn, - xcb_drawable_t draw, - int16_t x, - int16_t y, - uint16_t width, - uint16_t height, - uint32_t plane_mask, - xcb_image_format_t format); - - -/** - * Put an image onto the X server. - * @param conn The connection to the X server. - * @param draw The draw you get the image from. - * @param gc The graphic context. - * @param image The image you want to combine with the rectangle. - * @param x The x coordinate, which is relative to the origin of the - * drawable and defines the x coordinate of the upper-left corner of the - * rectangle. - * @param y The y coordinate, which is relative to the origin of the - * drawable and defines the x coordinate of the upper-left corner of - * the rectangle. - * @param left_pad Notionally shift an xy-bitmap or xy-pixmap image - * to the right some small amount, for some reason. XXX Not clear - * this is currently supported correctly. - * @return The cookie returned by xcb_put_image(). - * - * This function combines an image with a rectangle of the - * specified drawable @p draw. The image must be in native - * format for the connection. The image is drawn at the - * specified location in the drawable. For the xy-bitmap - * format, the foreground pixel in @p gc defines the source - * for the one bits in the image, and the background pixel - * defines the source for the zero bits. For xy-pixmap and - * z-pixmap formats, the depth of the image must match the - * depth of the drawable; the gc is ignored. - * - * @ingroup xcb__image_t - */ -xcb_void_cookie_t -xcb_image_put (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_gcontext_t gc, - xcb_image_t * image, - int16_t x, - int16_t y, - uint8_t left_pad); - - -/** - * Check image for or convert image to native format. - * @param c The connection to the X server. - * @param image The image. - * @param convert If 0, just check the image for native format. - * Otherwise, actually convert it. - * @return Null if the image is not in native format and can or will not - * be converted. Otherwise, the native format image. - * - * Each X display has its own "native format" for images of a given - * format and depth. This function either checks whether the given - * @p image is in native format for the given connection @p c, or - * actually tries to convert the image to native format, depending - * on whether @p convert is true or false. - * - * When @p convert is true, and the image is not in native format - * but can be converted, it will be, and a pointer to the new image - * will be returned. The image passed in will be unharmed in this - * case; it is the caller's responsibility to check that the returned - * pointer is different and to dispose of the old image if desired. - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_native (xcb_connection_t * c, - xcb_image_t * image, - int convert); - - -/** - * Put a pixel to an image. - * @param image The image. - * @param x The x coordinate of the pixel. - * @param y The y coordinate of the pixel. - * @param pixel The new pixel value. - * - * This function overwrites the pixel in the given @p image with the - * specified @p pixel value (in client format). The image must contain the @p x - * and @p y coordinates, as no clipping is done. This function honors - * the plane-mask for xy-pixmap images. - * @ingroup xcb__image_t - */ -void -xcb_image_put_pixel (xcb_image_t *image, - uint32_t x, - uint32_t y, - uint32_t pixel); - -/** - * Get a pixel from an image. - * @param image The image. - * @param x The x coordinate of the pixel. - * @param y The y coordinate of the pixel. - * @return The pixel value. - * - * This function retrieves a pixel from the given @p image. - * The image must contain the @p x - * and @p y coordinates, as no clipping is done. This function honors - * the plane-mask for xy-pixmap images. - * @ingroup xcb__image_t - */ -uint32_t -xcb_image_get_pixel (xcb_image_t *image, - uint32_t x, - uint32_t y); - - -/** - * Convert an image to a new format. - * @param src Source image. - * @param dst Destination image. - * @return The @p dst image, or null on error. - * - * This function tries to convert the image data of the @p - * src image to the format implied by the @p dst image, - * overwriting the current destination image data. - * The source and destination must have the same - * width, height, and depth. When the source and destination - * are already the same format, a simple copy is done. Otherwise, - * when the destination has the same bits-per-pixel/scanline-unit - * as the source, an optimized copy routine (thanks to Keith Packard) - * is used for the conversion. Otherwise, the copy is done the - * slow, slow way with @ref xcb_image_get_pixel() and - * @ref xcb_image_put_pixel() calls. - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_convert (xcb_image_t * src, - xcb_image_t * dst); - - -/** - * Extract a subimage of an image. - * @param image Source image. - * @param x X coordinate of subimage. - * @param y Y coordinate of subimage. - * @param width Width of subimage. - * @param height Height of subimage. - * @param base Base of memory allocation. - * @param bytes Size of base allocation. - * @param data Memory allocation. - * @return The subimage, or null on error. - * - * Given an image, this function extracts the subimage at the - * given coordinates. The requested subimage must be entirely - * contained in the source @p image. The resulting image will have the same - * general image parameters as the source image. The @p base, @p bytes, - * and @p data arguments are passed to @ref xcb_create_image() unaltered - * to create the destination image---see its documentation for details. - * - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_subimage(xcb_image_t * image, - uint32_t x, - uint32_t y, - uint32_t width, - uint32_t height, - void * base, - uint32_t bytes, - uint8_t * data); - - -/* - * Shm stuff - */ - -/** - * Put the data of an xcb_image_t onto a drawable using the MIT Shm - * Extension. - * @param conn The connection to the X server. - * @param draw The draw you get the image from. - * @param gc The graphic context. - * @param image The image you want to combine with the rectangle. - * @param shminfo A @ref xcb_shm_segment_info_t structure. - * @param src_x The offset in x from the left edge of the image - * defined by the xcb_image_t structure. - * @param src_y The offset in y from the left edge of the image - * defined by the xcb_image_t structure. - * @param dest_x The x coordinate, which is relative to the origin of the - * drawable and defines the x coordinate of the upper-left corner of the - * rectangle. - * @param dest_y The y coordinate, which is relative to the origin of the - * drawable and defines the x coordinate of the upper-left corner of - * the rectangle. - * @param src_width The width of the subimage, in pixels. - * @param src_height The height of the subimage, in pixels. - * @param send_event Indicates whether or not a completion event - * should occur when the image write is complete. - * @return 1 is no problems occurs. - * - * This function combines an image in memory with a shape of the - * specified drawable. The section of the image defined by the @p x, @p y, - * @p width, and @p height arguments is drawn on the specified part of - * the drawable. If XYBitmap format is used, the depth must be - * one, or a``BadMatch'' error results. The foreground pixel in the - * Graphic Context @p gc defines the source for the one bits in the - * image, and the background pixel defines the source for the zero - * bits. For XYPixmap and ZPixmap, the depth must match the depth of - * the drawable, or a ``BadMatch'' error results. - * - * If a problem occurs, the functons returns @c 0. Otherwise, it - * returns @c 1. - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_shm_put (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_gcontext_t gc, - xcb_image_t * image, - xcb_shm_segment_info_t shminfo, - int16_t src_x, - int16_t src_y, - int16_t dest_x, - int16_t dest_y, - uint16_t src_width, - uint16_t src_height, - uint8_t send_event); - - -/** - * Read image data into a shared memory xcb_image_t. - * @param conn The connection to the X server. - * @param draw The draw you get the image from. - * @param image The image you want to combine with the rectangle. - * @param shminfo A @ref xcb_shm_segment_info_t structure. - * @param x The x coordinate, which are relative to the origin of the - * drawable and define the upper-left corner of the rectangle. - * @param y The y coordinate, which are relative to the origin of the - * drawable and define the upper-left corner of the rectangle. - * @param plane_mask The plane mask. - * @return The subimage of @p draw defined by @p x, @p y, @p w, @p h. - * - * This function reads image data into a shared memory xcb_image_t where - * @p conn is the connection to the X server, @p draw is the source - * drawable, @p image is the destination xcb_image_t, @p x and @p y are offsets - * within the drawable, and @p plane_mask defines which planes are to be - * read. - * - * If a problem occurs, the functons returns @c 0. It returns 1 - * otherwise. - * @ingroup xcb__image_t - */ -int xcb_image_shm_get (xcb_connection_t * conn, - xcb_drawable_t draw, - xcb_image_t * image, - xcb_shm_segment_info_t shminfo, - int16_t x, - int16_t y, - uint32_t plane_mask); - - -/** - * Create an image from user-supplied bitmap data. - * @param data Image data in packed bitmap format. - * @param width Width in bits of image data. - * @param height Height in bits of image data. - * @return The image constructed from the image data, or 0 on error. - * - * This function creates an image from the user-supplied - * bitmap @p data. The bitmap data is assumed to be in - * xbm format (i.e., 8-bit scanline unit, LSB-first, 8-bit pad). - * @ingroup xcb__image_t - */ -xcb_image_t * -xcb_image_create_from_bitmap_data (uint8_t * data, - uint32_t width, - uint32_t height); - -/** - * Create a pixmap from user-supplied bitmap data. - * @param display The connection to the X server. - * @param d The parent drawable for the pixmap. - * @param data Image data in packed bitmap format. - * @param width Width in bits of image data. - * @param height Height in bits of image data. - * @param depth Depth of the desired pixmap. - * @param fg Pixel for one-bits of pixmaps with depth larger than one. - * @param bg Pixel for zero-bits of pixmaps with depth larger than one. - * @param gcp If this pointer is non-null, the GC created to - * fill in the pixmap is stored here; it will have its foreground - * and background set to the supplied value. Otherwise, the GC - * will be freed. - * @return The pixmap constructed from the image data, or 0 on error. - * - * This function creates a pixmap from the user-supplied - * bitmap @p data. The bitmap data is assumed to be in - * xbm format (i.e., 8-bit scanline unit, LSB-first, 8-bit pad). - * If @p depth is greater than 1, the - * bitmap will be expanded to a pixmap using the given - * foreground and background pixels @p fg and @p bg. - * @ingroup xcb__image_t - */ -xcb_pixmap_t -xcb_create_pixmap_from_bitmap_data (xcb_connection_t * display, - xcb_drawable_t d, - uint8_t * data, - uint32_t width, - uint32_t height, - uint32_t depth, - uint32_t fg, - uint32_t bg, - xcb_gcontext_t * gcp); - - -/** - * @} - */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* __XCB_IMAGE_H__ */ diff --git a/image/xcb_pixel.h b/image/xcb_pixel.h deleted file mode 100644 index fcb22b4..0000000 --- a/image/xcb_pixel.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef __XCB_PIXEL_H__ -#define __XCB_PIXEL_H__ - -/* Copyright (C) 2007 Bart Massey - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include -#ifndef BUILD -#include -#include -#endif - -/** - * XCB Image fast pixel ops. - * - * Fast inline versions of xcb_image_get_pixel() and - * xcb_image_put_pixel() for various common cases. - * The naming convention is xcb_image_put_pixel_FUB() - * where F is the format and is either XY for bitmaps - * or Z for pixmaps, U is the bitmap unit size or pixmap - * bits-per-pixel, and B is the endianness (if needed) - * and is either M for most-significant-first or L for - * least-significant-first. Note that no checking - * is done on the arguments to these routines---caller beware. - * Also note that the pixel type is chosen to be appropriate - * to the unit; bitmaps use int and pixmaps use the appropriate - * size of unsigned. - * @ingroup xcb__image_t - */ - -_X_INLINE static void -xcb_image_put_pixel_XY32M (xcb_image_t *image, - uint32_t x, - uint32_t y, - int pixel) -{ - uint32_t unit = (x >> 3) & ~xcb_mask(2); - uint32_t byte = xcb_mask(2) - ((x >> 3) & xcb_mask(2)); - uint32_t bit = xcb_mask(3) - (x & xcb_mask(3)); - uint8_t m = 1 << bit; - uint8_t p = pixel << bit; - uint8_t * bp = image->data + (y * image->stride) + (unit | byte); - *bp = (*bp & ~m) | p; -} - -_X_INLINE static void -xcb_image_put_pixel_XY32L (xcb_image_t *image, - uint32_t x, - uint32_t y, - int pixel) -{ - uint32_t bit = x & xcb_mask(3); - uint8_t m = 1 << bit; - uint8_t p = pixel << bit; - uint8_t * bp = image->data + (y * image->stride) + (x >> 3); - *bp = (*bp & ~m) | p; -} - -_X_INLINE static int -xcb_image_get_pixel_XY32M (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - uint32_t unit = (x >> 3) & ~xcb_mask(2); - uint32_t byte = xcb_mask(2) - ((x >> 3) & xcb_mask(2)); - uint32_t bit = xcb_mask(3) - (x & xcb_mask(3)); - uint8_t * bp = image->data + (y * image->stride) + (unit | byte); - return (*bp >> bit) & 1; -} - -_X_INLINE static int -xcb_image_get_pixel_XY32L (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - uint32_t bit = x & xcb_mask(3); - uint8_t * bp = image->data + (y * image->stride) + (x >> 3); - return (*bp >> bit) & 1; -} - -_X_INLINE static void -xcb_image_put_pixel_Z8 (xcb_image_t *image, - uint32_t x, - uint32_t y, - uint8_t pixel) -{ - image->data[x + y * image->stride] = pixel; -} - -_X_INLINE static uint8_t -xcb_image_get_pixel_Z8 (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - return image->data[x + y * image->stride]; -} - -_X_INLINE static void -xcb_image_put_pixel_Z32M (xcb_image_t *image, - uint32_t x, - uint32_t y, - uint32_t pixel) -{ - uint8_t * row = image->data + (y * image->stride); - row[x << 2] = pixel >> 24; - row[(x << 2) + 1] = pixel >> 16; - row[(x << 2) + 2] = pixel >> 8; - row[(x << 2) + 3] = pixel; -} - -_X_INLINE static void -xcb_image_put_pixel_Z32L (xcb_image_t *image, - uint32_t x, - uint32_t y, - uint32_t pixel) -{ - uint8_t * row = image->data + (y * image->stride); - row[x << 2] = pixel; - row[(x << 2) + 1] = pixel >> 8; - row[(x << 2) + 2] = pixel >> 16; - row[(x << 2) + 3] = pixel >> 24; -} - -_X_INLINE static uint32_t -xcb_image_get_pixel_Z32M (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - uint8_t * row = image->data + (y * image->stride); - uint32_t pixel = row[x << 2] << 24; - pixel |= row[(x << 2) + 1] << 16; - pixel |= row[(x << 2) + 2] << 8; - return pixel | row[(x << 2) + 3]; -} - -_X_INLINE static uint32_t -xcb_image_get_pixel_Z32L (xcb_image_t *image, - uint32_t x, - uint32_t y) -{ - uint8_t * row = image->data + (y * image->stride); - uint32_t pixel = row[x << 2]; - pixel |= row[(x << 2) + 1] << 8; - pixel |= row[(x << 2) + 2] << 16; - return pixel | row[(x << 2) + 3] << 24; -} - -#endif /* __XCB_PIXEL_H__ */ diff --git a/install-sh b/install-sh deleted file mode 100755 index 6781b98..0000000 --- a/install-sh +++ /dev/null @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# 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 -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/keysyms/Makefile.am b/keysyms/Makefile.am deleted file mode 100644 index f7965ab..0000000 --- a/keysyms/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-keysyms.la - -xcbinclude_HEADERS = xcb_keysyms.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_keysyms_la_SOURCES = keysyms.c -libxcb_keysyms_la_CPPFLAGS = $(XCB_CFLAGS) -libxcb_keysyms_la_LIBADD = $(XCB_LIBS) -libxcb_keysyms_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-keysyms.pc - -EXTRA_DIST=xcb-keysyms.pc.in diff --git a/keysyms/keysyms.c b/keysyms/keysyms.c deleted file mode 100644 index c3e7f2e..0000000 --- a/keysyms/keysyms.c +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright © 2008 Ian Osgood - * Copyright © 2008 Jamey Sharp - * Copyright © 2008 Josh Triplett - * Copyright © 2008 Ulrich Eckhardt - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include - -#include -#define XK_MISCELLANY -#define XK_XKB_KEYS -#define XK_LATIN1 -#define XK_LATIN2 -#define XK_LATIN3 -#define XK_LATIN4 -#define XK_CYRILLIC -#define XK_GREEK -#define XK_ARMENIAN -#include - -#include "xcb_keysyms.h" - -/* Private declaration */ -enum tag_t { - TAG_COOKIE, - TAG_VALUE -}; - -struct _XCBKeySymbols -{ - xcb_connection_t *c; - enum tag_t tag; - union { - xcb_get_keyboard_mapping_cookie_t cookie; - xcb_get_keyboard_mapping_reply_t *reply; - } u; -}; - -static void xcb_convert_case(xcb_keysym_t sym, - xcb_keysym_t *lower, - xcb_keysym_t *upper); - -static void xcb_key_symbols_get_reply (xcb_key_symbols_t *syms, - xcb_generic_error_t **e); - -/* public implementation */ - -xcb_key_symbols_t * -xcb_key_symbols_alloc (xcb_connection_t *c) -{ - xcb_key_symbols_t *syms; - xcb_keycode_t min_keycode; - xcb_keycode_t max_keycode; - - if (!c) - return NULL; - - syms = malloc (sizeof (xcb_key_symbols_t)); - - syms->c = c; - syms->tag = TAG_COOKIE; - - min_keycode = xcb_get_setup (c)->min_keycode; - max_keycode = xcb_get_setup (c)->max_keycode; - - syms->u.cookie = xcb_get_keyboard_mapping(c, - min_keycode, - max_keycode - min_keycode + 1); - - return syms; -} - -void -xcb_key_symbols_free (xcb_key_symbols_t *syms) -{ - if (syms) - { - if (syms->tag == TAG_VALUE) - free (syms->u.reply); - free (syms); - syms = NULL; - } -} - -/* Use of the 'col' parameter: - -A list of KeySyms is associated with each KeyCode. The list is intended -to convey the set of symbols on the corresponding key. If the list -(ignoring trailing NoSymbol entries) is a single KeySym ``K'', then the -list is treated as if it were the list ``K NoSymbol K NoSymbol''. If the -list (ignoring trailing NoSymbol entries) is a pair of KeySyms ``K1 -K2'', then the list is treated as if it were the list ``K1 K2 K1 K2''. -If the list (ignoring trailing NoSymbol entries) is a triple of KeySyms -``K1 K2 K3'', then the list is treated as if it were the list ``K1 K2 K3 -NoSymbol''. When an explicit ``void'' element is desired in the list, -the value VoidSymbol can be used. - -The first four elements of the list are split into two groups of -KeySyms. Group 1 contains the first and second KeySyms; Group 2 contains -the third and fourth KeySyms. Within each group, if the second element -of the group is NoSymbol , then the group should be treated as if the -second element were the same as the first element, except when the first -element is an alphabetic KeySym ``K'' for which both lowercase and -uppercase forms are defined. In that case, the group should be treated -as if the first element were the lowercase form of ``K'' and the second -element were the uppercase form of ``K.'' - -The standard rules for obtaining a KeySym from a KeyPress event make use -of only the Group 1 and Group 2 KeySyms; no interpretation of other -KeySyms in the list is given. Which group to use is determined by the -modifier state. Switching between groups is controlled by the KeySym -named MODE SWITCH, by attaching that KeySym to some KeyCode and -attaching that KeyCode to any one of the modifiers Mod1 through Mod5. -This modifier is called the group modifier. For any KeyCode, Group 1 is -used when the group modifier is off, and Group 2 is used when the group -modifier is on. - -The Lock modifier is interpreted as CapsLock when the KeySym named -XK_Caps_Lock is attached to some KeyCode and that KeyCode is attached to -the Lock modifier. The Lock modifier is interpreted as ShiftLock when -the KeySym named XK_Shift_Lock is attached to some KeyCode and that -KeyCode is attached to the Lock modifier. If the Lock modifier could be -interpreted as both CapsLock and ShiftLock, the CapsLock interpretation -is used. - -The operation of keypad keys is controlled by the KeySym named -XK_Num_Lock, by attaching that KeySym to some KeyCode and attaching that -KeyCode to any one of the modifiers Mod1 through Mod5 . This modifier is -called the numlock modifier. The standard KeySyms with the prefix -``XK_KP_'' in their name are called keypad KeySyms; these are KeySyms -with numeric value in the hexadecimal range 0xFF80 to 0xFFBD inclusive. -In addition, vendor-specific KeySyms in the hexadecimal range 0x11000000 -to 0x1100FFFF are also keypad KeySyms. - -Within a group, the choice of KeySym is determined by applying the first -rule that is satisfied from the following list: - -* The numlock modifier is on and the second KeySym is a keypad KeySym. In - this case, if the Shift modifier is on, or if the Lock modifier is on - and is interpreted as ShiftLock, then the first KeySym is used, - otherwise the second KeySym is used. - -* The Shift and Lock modifiers are both off. In this case, the first - KeySym is used. - -* The Shift modifier is off, and the Lock modifier is on and is - interpreted as CapsLock. In this case, the first KeySym is used, but - if that KeySym is lowercase alphabetic, then the corresponding - uppercase KeySym is used instead. - -* The Shift modifier is on, and the Lock modifier is on and is - interpreted as CapsLock. In this case, the second KeySym is used, but - if that KeySym is lowercase alphabetic, then the corresponding - uppercase KeySym is used instead. - -* The Shift modifier is on, or the Lock modifier is on and is - interpreted as ShiftLock, or both. In this case, the second KeySym is - used. - -*/ - -xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms, - xcb_keycode_t keycode, - int col) -{ - xcb_keysym_t *keysyms; - xcb_keysym_t keysym_null = { XCB_NO_SYMBOL }; - xcb_keysym_t lsym; - xcb_keysym_t usym; - xcb_keycode_t min_keycode; - xcb_keycode_t max_keycode; - int per; - - if (!syms) - return keysym_null; - - xcb_key_symbols_get_reply (syms, NULL); - - keysyms = xcb_get_keyboard_mapping_keysyms (syms->u.reply); - min_keycode = xcb_get_setup (syms->c)->min_keycode; - max_keycode = xcb_get_setup (syms->c)->max_keycode; - - per = syms->u.reply->keysyms_per_keycode; - if ((col < 0) || ((col >= per) && (col > 3)) || - (keycode < min_keycode) || - (keycode > max_keycode)) - return keysym_null; - - keysyms = &keysyms[(keycode - min_keycode) * per]; - if (col < 4) - { - if (col > 1) - { - while ((per > 2) && (keysyms[per - 1] == XCB_NO_SYMBOL)) - per--; - if (per < 3) - col -= 2; - } - if ((per <= (col|1)) || (keysyms[col|1] == XCB_NO_SYMBOL)) - { - xcb_convert_case(keysyms[col&~1], &lsym, &usym); - if (!(col & 1)) - return lsym; - else if (usym == lsym) - return keysym_null; - else - return usym; - } - } - return keysyms[col]; -} - -xcb_keycode_t * -xcb_key_symbols_get_keycode(xcb_key_symbols_t *syms, - xcb_keysym_t keysym) -{ - xcb_keysym_t ks; - int j, nresult = 0; - xcb_keycode_t i, min, max, *result = NULL; - - if(syms) - { - xcb_key_symbols_get_reply (syms, NULL); - min = xcb_get_setup(syms->c)->min_keycode; - max = xcb_get_setup(syms->c)->max_keycode; - - for(j = 0; j < syms->u.reply->keysyms_per_keycode; j++) - for(i = min; i && i <= max; i++) - { - ks = xcb_key_symbols_get_keysym(syms, i, j); - if(ks == keysym) - { - nresult++; - result = realloc(result, sizeof(xcb_keycode_t) * (nresult + 1)); - result[nresult - 1] = i; - result[nresult] = XCB_NO_SYMBOL; - } - } - } - - return result; -} - -xcb_keysym_t -xcb_key_press_lookup_keysym (xcb_key_symbols_t *syms, - xcb_key_press_event_t *event, - int col) -{ - return xcb_key_symbols_get_keysym (syms, event->detail, col); -} - -xcb_keysym_t -xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms, - xcb_key_release_event_t *event, - int col) -{ - return xcb_key_symbols_get_keysym (syms, event->detail, col); -} - -int -xcb_refresh_keyboard_mapping (xcb_key_symbols_t *syms, - xcb_mapping_notify_event_t *event) -{ - if (event->request == XCB_MAPPING_KEYBOARD && syms) { - if (syms->tag == TAG_VALUE) { - xcb_keycode_t min_keycode; - xcb_keycode_t max_keycode; - - if (syms->u.reply) { - free (syms->u.reply); - syms->u.reply = NULL; - } - syms->tag = TAG_COOKIE; - min_keycode = xcb_get_setup (syms->c)->min_keycode; - max_keycode = xcb_get_setup (syms->c)->max_keycode; - - syms->u.cookie = xcb_get_keyboard_mapping(syms->c, - min_keycode, - max_keycode - min_keycode + 1); - - } - return 1; - } - return 0; -} - - -/* Tests for classes of symbols */ - -int -xcb_is_keypad_key (xcb_keysym_t keysym) -{ - return ((keysym >= XK_KP_Space) && (keysym <= XK_KP_Equal)); -} - -int -xcb_is_private_keypad_key (xcb_keysym_t keysym) -{ - return ((keysym >= 0x11000000) && (keysym <= 0x1100FFFF)); -} - -int -xcb_is_cursor_key (xcb_keysym_t keysym) -{ - return ((keysym >= XK_Home) && (keysym <= XK_Select)); -} - -int -xcb_is_pf_key (xcb_keysym_t keysym) -{ - return ((keysym >= XK_KP_F1) && (keysym <= XK_KP_F4)); -} - -int -xcb_is_function_key (xcb_keysym_t keysym) -{ - return ((keysym >= XK_F1) && (keysym <= XK_F35)); -} - -int -xcb_is_misc_function_key (xcb_keysym_t keysym) -{ - return ((keysym >= XK_Select) && (keysym <= XK_Break)); -} - -int -xcb_is_modifier_key (xcb_keysym_t keysym) -{ - return (((keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R)) || - ((keysym >= XK_ISO_Lock) && (keysym <= XK_ISO_Last_Group_Lock)) || - (keysym == XK_Mode_switch) || - (keysym == XK_Num_Lock)); -} - -/* private functions */ - -void -xcb_convert_case(xcb_keysym_t sym, - xcb_keysym_t *lower, - xcb_keysym_t *upper) -{ - *lower = sym; - *upper = sym; - - switch(sym >> 8) - { - case 0: /* Latin 1 */ - if ((sym >= XK_A) && (sym <= XK_Z)) - *lower += (XK_a - XK_A); - else if ((sym >= XK_a) && (sym <= XK_z)) - *upper -= (XK_a - XK_A); - else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis)) - *lower += (XK_agrave - XK_Agrave); - else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis)) - *upper -= (XK_agrave - XK_Agrave); - else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn)) - *lower += (XK_oslash - XK_Ooblique); - else if ((sym >= XK_oslash) && (sym <= XK_thorn)) - *upper -= (XK_oslash - XK_Ooblique); - break; - case 1: /* Latin 2 */ - /* Assume the KeySym is a legal value (ignore discontinuities) */ - if (sym == XK_Aogonek) - *lower = XK_aogonek; - else if (sym >= XK_Lstroke && sym <= XK_Sacute) - *lower += (XK_lstroke - XK_Lstroke); - else if (sym >= XK_Scaron && sym <= XK_Zacute) - *lower += (XK_scaron - XK_Scaron); - else if (sym >= XK_Zcaron && sym <= XK_Zabovedot) - *lower += (XK_zcaron - XK_Zcaron); - else if (sym == XK_aogonek) - *upper = XK_Aogonek; - else if (sym >= XK_lstroke && sym <= XK_sacute) - *upper -= (XK_lstroke - XK_Lstroke); - else if (sym >= XK_scaron && sym <= XK_zacute) - *upper -= (XK_scaron - XK_Scaron); - else if (sym >= XK_zcaron && sym <= XK_zabovedot) - *upper -= (XK_zcaron - XK_Zcaron); - else if (sym >= XK_Racute && sym <= XK_Tcedilla) - *lower += (XK_racute - XK_Racute); - else if (sym >= XK_racute && sym <= XK_tcedilla) - *upper -= (XK_racute - XK_Racute); - break; - case 2: /* Latin 3 */ - /* Assume the KeySym is a legal value (ignore discontinuities) */ - if (sym >= XK_Hstroke && sym <= XK_Hcircumflex) - *lower += (XK_hstroke - XK_Hstroke); - else if (sym >= XK_Gbreve && sym <= XK_Jcircumflex) - *lower += (XK_gbreve - XK_Gbreve); - else if (sym >= XK_hstroke && sym <= XK_hcircumflex) - *upper -= (XK_hstroke - XK_Hstroke); - else if (sym >= XK_gbreve && sym <= XK_jcircumflex) - *upper -= (XK_gbreve - XK_Gbreve); - else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex) - *lower += (XK_cabovedot - XK_Cabovedot); - else if (sym >= XK_cabovedot && sym <= XK_scircumflex) - *upper -= (XK_cabovedot - XK_Cabovedot); - break; - case 3: /* Latin 4 */ - /* Assume the KeySym is a legal value (ignore discontinuities) */ - if (sym >= XK_Rcedilla && sym <= XK_Tslash) - *lower += (XK_rcedilla - XK_Rcedilla); - else if (sym >= XK_rcedilla && sym <= XK_tslash) - *upper -= (XK_rcedilla - XK_Rcedilla); - else if (sym == XK_ENG) - *lower = XK_eng; - else if (sym == XK_eng) - *upper = XK_ENG; - else if (sym >= XK_Amacron && sym <= XK_Umacron) - *lower += (XK_amacron - XK_Amacron); - else if (sym >= XK_amacron && sym <= XK_umacron) - *upper -= (XK_amacron - XK_Amacron); - break; - case 6: /* Cyrillic */ - /* Assume the KeySym is a legal value (ignore discontinuities) */ - if (sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE) - *lower -= (XK_Serbian_DJE - XK_Serbian_dje); - else if (sym >= XK_Serbian_dje && sym <= XK_Serbian_dze) - *upper += (XK_Serbian_DJE - XK_Serbian_dje); - else if (sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN) - *lower -= (XK_Cyrillic_YU - XK_Cyrillic_yu); - else if (sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign) - *upper += (XK_Cyrillic_YU - XK_Cyrillic_yu); - break; - case 7: /* Greek */ - /* Assume the KeySym is a legal value (ignore discontinuities) */ - if (sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent) - *lower += (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent); - else if (sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent && - sym != XK_Greek_iotaaccentdieresis && - sym != XK_Greek_upsilonaccentdieresis) - *upper -= (XK_Greek_alphaaccent - XK_Greek_ALPHAaccent); - else if (sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA) - *lower += (XK_Greek_alpha - XK_Greek_ALPHA); - else if (sym >= XK_Greek_alpha && sym <= XK_Greek_omega && - sym != XK_Greek_finalsmallsigma) - *upper -= (XK_Greek_alpha - XK_Greek_ALPHA); - break; - case 0x14: /* Armenian */ - if (sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe) { - *lower = sym | 1; - *upper = sym & ~1; - } - break; - } -} - -void -xcb_key_symbols_get_reply (xcb_key_symbols_t *syms, - xcb_generic_error_t **e) -{ - if (!syms) - return; - - if (syms->tag == TAG_COOKIE) - { - syms->tag = TAG_VALUE; - syms->u.reply = xcb_get_keyboard_mapping_reply(syms->c, - syms->u.cookie, - e); - } -} diff --git a/keysyms/xcb-keysyms.pc.in b/keysyms/xcb-keysyms.pc.in deleted file mode 100644 index 249fdc0..0000000 --- a/keysyms/xcb-keysyms.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Keysyms library -Description: XCB Keysyms -Version: @PACKAGE_VERSION@ -Requires: xcb -Libs: -L${libdir} -lxcb-keysyms @LIBS@ -Cflags: -I${includedir} diff --git a/keysyms/xcb_keysyms.h b/keysyms/xcb_keysyms.h deleted file mode 100644 index 9d34a50..0000000 --- a/keysyms/xcb_keysyms.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef __XCB_KEYSYMS_H__ -#define __XCB_KEYSYMS_H__ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct _XCBKeySymbols xcb_key_symbols_t; - -xcb_key_symbols_t *xcb_key_symbols_alloc (xcb_connection_t *c); - -void xcb_key_symbols_free (xcb_key_symbols_t *syms); - -xcb_keysym_t xcb_key_symbols_get_keysym (xcb_key_symbols_t *syms, - xcb_keycode_t keycode, - int col); - -/** - * @brief Get the keycodes attached to a keysyms. - * There can be several value, so what is returned is an array of keycode - * terminated by XCB_NO_SYMBOL. You are responsible to free it. - * Be aware that this function can be slow. It will convert all - * combinations of all available keycodes to keysyms to find the ones that - * match. - * @param syms Key symbols. - * @param keysym The keysym to look for. - * @return A XCB_NO_SYMBOL terminated array of keycode, or NULL if nothing is found. - */ -xcb_keycode_t * xcb_key_symbols_get_keycode(xcb_key_symbols_t *syms, - xcb_keysym_t keysym); - -xcb_keysym_t xcb_key_press_lookup_keysym (xcb_key_symbols_t *syms, - xcb_key_press_event_t *event, - int col); - -xcb_keysym_t xcb_key_release_lookup_keysym (xcb_key_symbols_t *syms, - xcb_key_release_event_t *event, - int col); - -int xcb_refresh_keyboard_mapping (xcb_key_symbols_t *syms, - xcb_mapping_notify_event_t *event); - -/* TODO: need XLookupString equivalent */ - -/* Tests for classes of symbols */ - -int xcb_is_keypad_key (xcb_keysym_t keysym); - -int xcb_is_private_keypad_key (xcb_keysym_t keysym); - -int xcb_is_cursor_key (xcb_keysym_t keysym); - -int xcb_is_pf_key (xcb_keysym_t keysym); - -int xcb_is_function_key (xcb_keysym_t keysym); - -int xcb_is_misc_function_key (xcb_keysym_t keysym); - -int xcb_is_modifier_key (xcb_keysym_t keysym); - - -#ifdef __cplusplus -} -#endif - - -#endif /* __XCB_KEYSYMS_H__ */ diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4 new file mode 100644 index 0000000..e22b50f --- /dev/null +++ b/m4/ax_compare_version.m4 @@ -0,0 +1,174 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_PROG_AWK + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/m4/xcb_util_common.m4 b/m4/xcb_util_common.m4 new file mode 100644 index 0000000..f9463d3 --- /dev/null +++ b/m4/xcb_util_common.m4 @@ -0,0 +1,44 @@ +# XCB_UTIL_COMMON(xcb-required-version, xcb-proto-required-version) +# ----------------------------------------------------------------- +# +# Defines default options for xcb-util libraries. xorg/util/macros >= +# 1.6.0 is required for cross-platform compiler flags and to build +# library documentation. +# +AC_DEFUN([XCB_UTIL_COMMON], [ +m4_ifndef([AX_COMPARE_VERSION], + [m4_fatal([could not find AX_COMPARE_VERSION in macros search path])]) + +AC_REQUIRE([AC_PROG_LIBTOOL]) + +# Define header files and pkgconfig paths +xcbincludedir='${includedir}/xcb' +AC_SUBST(xcbincludedir) +pkgconfigdir='${libdir}/pkgconfig' +AC_SUBST(pkgconfigdir) + +# Check xcb version +PKG_CHECK_MODULES(XCB, xcb >= [$1]) + +# Check version of xcb-proto that xcb was compiled against +xcbproto_required=[$2] + +AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required]) +xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb` +AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes", + xcbproto_ok="no") +AC_MSG_RESULT([$xcbproto_ok]) + +if test $xcbproto_ok = no; then + AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher]) +fi + +# Call macros from Xorg util-macros +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.6.0 or later before running autoconf/autogen])]) + +XORG_MACROS_VERSION([1.6.0]) +XORG_DEFAULT_OPTIONS +XORG_ENABLE_DEVEL_DOCS +XORG_WITH_DOXYGEN +]) # XCB_UTIL_COMMON diff --git a/m4/xcb_util_m4_with_include_path.m4 b/m4/xcb_util_m4_with_include_path.m4 new file mode 100644 index 0000000..a3ddce4 --- /dev/null +++ b/m4/xcb_util_m4_with_include_path.m4 @@ -0,0 +1,24 @@ +# XCB_UTIL_M4_WITH_INCLUDE_PATH +# ------------------------------ +# +# This macro attempts to locate an m4 macro processor which supports +# -I option and is only useful for modules relying on M4 in order to +# expand macros in source code files. +# +# M4: variable holding the path to an usable m4 program. +# +# This macro requires Autoconf 2.62 or later as it is relying upon +# AC_PATH_PROGS_FEATURE_CHECK macro. NOTE: As soon as the minimum +# required version of Autoconf for Xorg is bumped to 2.62, this macro +# is supposed to be shipped with xorg/util/macros. +# +AC_DEFUN([XCB_UTIL_M4_WITH_INCLUDE_PATH], [ +AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], + [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], + [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ + ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], + [AC_MSG_ERROR([could not find m4 that supports -I option])], + [$PATH:/usr/gnu/bin])]) + +AC_SUBST([M4], [$ac_cv_path_M4]) +]) # XCB_UTIL_M4_WITH_INCLUDE_PATH diff --git a/missing b/missing deleted file mode 100755 index 28055d2..0000000 --- a/missing +++ /dev/null @@ -1,376 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/packaging/xcb-util.spec b/packaging/xcb-util.spec index 2a8050c..dd7d130 100644 --- a/packaging/xcb-util.spec +++ b/packaging/xcb-util.spec @@ -1,271 +1,20 @@ -Name: xcb-util -Summary: utility libraries for X C Binding -Version: 0.3.6 -Release: 0 -Group: System/Libraries -License: MIT -URL: http://xcb.freedesktop.org/ -Source0: http://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz - -BuildRequires: pkgconfig(xcb-render) -BuildRequires: pkgconfig(xcb-shm) -BuildRequires: pkgconfig(xcb) +Name: xcb-util +Summary: utility libraries for X C Binding +Version: 0.3.8 +Release: slp.1.2 +Group: System/Libraries +License: MIT +URL: http://xcb.freedesktop.org/ +Source: %{name}-%{version}.tar.gz + +BuildRequires: pkgconfig(xorg-macros) +BuildRequires: libxcb-devel >= 1.4, m4 BuildRequires: pkgconfig(xproto) BuildRequires: gperf - +Provides: xcb-renderutil %description Description: %{summary} - - - -%package -n libxcb-atom -Summary: utility libraries for X C Binding -- atom -Group: System/Libraries -%description -n libxcb-atom -This package contains the library files needed to run software using -libxcb-atom, providing standard core X atom constants and atom caching. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-atom-devel -Summary: utility libraries for X C Binding -- atom -Group: Development/Libraries -Requires: libxcb-atom = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-atom-devel -This package contains the header and library files needed to build software -using libxcb-atom, providing standard core X atom constants and atom caching. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-aux -Summary: utility libraries for X C Binding -- aux -Group: System/Libraries -%description -n libxcb-aux -This package contains the library files needed to run software using -libxcb-aux, providing convenient access to connection setup and some -core requests. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-aux-devel -Summary: utility libraries for X C Binding -- aux -Group: Development/Libraries -Requires: libxcb-aux = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-aux-devel -This package contains the header and library files needed to build software -using libxcb-aux, providing convenient access to connection setup and some -core requests. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-event -Summary: utility libraries for X C Binding -- event -Group: System/Libraries -%description -n libxcb-event -This package contains the library files needed to run software using -libxcb-event, providing X callback event handling. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-event-devel -Summary: utility libraries for X C Binding -- event -Group: Development/Libraries -Requires: libxcb-event = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-event-devel -This package contains the header and library files needed to build software -using libxcb-event, providing X callback event handling. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-image -Summary: utility libraries for X C Binding -- image -Group: System/Libraries -%description -n libxcb-image -This package contains the library files needed to run software using -libxcb-image, providing port of Xlib's XImage and XShmImage functions. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-image-devel -Summary: utility libraries for X C Binding -- image -Group: Development/Libraries -Requires: libxcb-image = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-image-devel -This package contains the header and library files needed to build software -using libxcb-image, providing port of Xlib's XImage and XShmImage functions. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-keysyms -Summary: utility libraries for X C Binding -- keysyms -Group: System/Libraries -%description -n libxcb-keysyms -This package contains the library files needed to run software using -libxcb-keysyms, providing standard X key constants and conversion to/from -keycodes. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-keysyms-devel -Summary: utility libraries for X C Binding -- ekysyms -Group: Development/Libraries -Requires: libxcb-keysyms = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-keysyms-devel -This package contains the header and library files needed to build software -using libxcb-keysyms, providing standard X key constants and conversion to/from -keycodes. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-property -Summary: utility libraries for X C Binding -- property -Group: System/Libraries -%description -n libxcb-property -This package contains the library files needed to run software using -libxcb-property, providing callback X property-change handling. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-property-devel -Summary: utility libraries for X C Binding -- property -Group: Development/Libraries -Requires: libxcb-property = %{version}-%{release} -Requires: libxcb-event-devel = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-property-devel -This package contains the header and library files needed to build software -using libxcb-property, providing callback X property-change handling. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-render-util -Summary: utility libraries for X C Binding -- render-util -Group: System/Libraries -%description -n libxcb-render-util -This package contains the library files needed to run software using -libxcb-render-util, providing convenience functions for the Render extension. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-render-util-devel -Summary: utility libraries for X C Binding -- render-util -Group: Development/Libraries -Requires: libxcb-render-util = %{version}-%{release} -Requires: pkgconfig(xcb) -Requires: pkgconfig(xcb-render) -%description -n libxcb-render-util-devel -This package contains the header and library files needed to build software -using libxcb-render-util, providing convenience functions for the Render -extension. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - - -%package -n libxcb-reply -Summary: utility libraries for X C Binding -- reply -Group: System/Libraries -%description -n libxcb-reply -This package contains the library files needed to run software using -libxcb-reply. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-reply-devel -Summary: utility libraries for X C Binding -- reply -Group: Development/Libraries -Requires: libxcb-reply = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-reply-devel -This package contains the header and library files needed to build software -using libxcb-reply. -. The xcb-util module provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -273,46 +22,20 @@ and interfaces which make the raw X protocol more usable. Some of the libraries also provide client-side code which is not strictly part of the X protocol but which have traditionally been provided by Xlib. +%package devel +Summary: Development and header files for xcb-util +Group: System Environment/Libraries +Requires: %{name} = %{version}-%{release}, pkgconfig -%package -n libxcb-icccm -Summary: utility libraries for X C Binding -- icccm -Group: System/Libraries -%description -n libxcb-icccm -This package contains the library files needed to run software using -libxcb-icccm, providing client and window-manager helpers for ICCCM. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - -%package -n libxcb-icccm-devel -Summary: utility libraries for X C Binding -- icccm -Group: Development/Libraries -Requires: libxcb-icccm = %{version}-%{release} -Requires: libxcb-atom-devel = %{version}-%{release} -Requires: libxcb-property-devel = %{version}-%{release} -Requires: pkgconfig(xcb) -%description -n libxcb-icccm-devel -This package contains the header and library files needed to build software -using libxcb-icccm, providing client and window-manager helpers for ICCCM. -. -The xcb-util module provides a number of libraries which sit on top of -libxcb, the core X protocol library, and some of the extension -libraries. These experimental libraries provide convenience functions -and interfaces which make the raw X protocol more usable. Some of the -libraries also provide client-side code which is not strictly part of -the X protocol but which have traditionally been provided by Xlib. - +%description devel +Development files for xcb-util. %prep -%setup -q -n %{name}-%{version} - +%setup -q %build +./autogen.sh %reconfigure --disable-static make %{?jobs:-j%jobs} @@ -321,85 +44,23 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig +%remove_docs +%clean +rm -rf %{buildroot} +%files +%defattr(-,root,root,-) +%{_libdir}/libxcb-util.so.0* -%files -n libxcb-atom -/usr/lib/libxcb-atom.so.* - -%files -n libxcb-atom-devel -/usr/include/xcb/xcb_atom.h -/usr/lib/libxcb-atom.so -/usr/lib/pkgconfig/xcb-atom.pc - - -%files -n libxcb-aux -/usr/lib/libxcb-aux.so.* - -%files -n libxcb-aux-devel -/usr/include/xcb/xcb_aux.h -/usr/lib/libxcb-aux.so -/usr/lib/pkgconfig/xcb-aux.pc - - -%files -n libxcb-event -/usr/lib/libxcb-event.so.* - -%files -n libxcb-event-devel -/usr/include/xcb/xcb_event.h -/usr/lib/libxcb-event.so -/usr/lib/pkgconfig/xcb-event.pc - - -%files -n libxcb-icccm -/usr/lib/libxcb-icccm.so.* - -%files -n libxcb-icccm-devel -/usr/include/xcb/xcb_icccm.h -/usr/lib/libxcb-icccm.so -/usr/lib/pkgconfig/xcb-icccm.pc - -%files -n libxcb-image -/usr/lib/libxcb-image.so.* - -%files -n libxcb-image-devel -/usr/include/xcb/xcb_image.h -/usr/lib/libxcb-image.so -/usr/lib/pkgconfig/xcb-image.pc - -%files -n libxcb-keysyms -/usr/lib/libxcb-keysyms.so.* - -%files -n libxcb-keysyms-devel -/usr/include/xcb/xcb_keysyms.h -/usr/lib/libxcb-keysyms.so -/usr/lib/pkgconfig/xcb-keysyms.pc - -%files -n libxcb-property -/usr/lib/libxcb-property.so.* - -%files -n libxcb-property-devel -/usr/include/xcb/xcb_property.h -/usr/lib/libxcb-property.so -/usr/lib/pkgconfig/xcb-property.pc - -%files -n libxcb-render-util -/usr/lib/libxcb-render-util.so.* - -%files -n libxcb-render-util-devel -/usr/include/xcb/xcb_renderutil.h -/usr/lib/libxcb-render-util.so -/usr/lib/pkgconfig/xcb-renderutil.pc - -%files -n libxcb-reply -/usr/lib/libxcb-reply.so.* +%files devel +%defattr(-,root,root,-) +%{_libdir}/pkgconfig/*.pc +%{_libdir}/*.so +%{_includedir}/xcb/*.h -%files -n libxcb-reply-devel -/usr/include/xcb/xcb_reply.h -/usr/lib/libxcb-reply.so -/usr/lib/pkgconfig/xcb-reply.pc -%exclude /usr/include/xcb/xcb_bitops.h -%exclude /usr/include/xcb/xcb_pixel.h diff --git a/property/Makefile.am b/property/Makefile.am deleted file mode 100644 index 3fb56de..0000000 --- a/property/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-property.la - -xcbinclude_HEADERS = xcb_property.h - -AM_CFLAGS = $(CWARNFLAGS) - -libxcb_property_la_SOURCES = property.c -libxcb_property_la_CPPFLAGS = $(XCB_CFLAGS) $(XCB_EVENT_CFLAGS) -libxcb_property_la_LIBADD = $(XCB_LIBS) $(XCB_EVENT_LIBS) -libxcb_property_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-property.pc - -EXTRA_DIST = xcb-property.pc.in diff --git a/property/property.c b/property/property.c deleted file mode 100644 index 161481e..0000000 --- a/property/property.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright © 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include - -#include "xcb_property.h" - -xcb_get_property_cookie_t -xcb_get_any_property(xcb_connection_t *c, uint8_t del, xcb_window_t window, xcb_atom_t name, uint32_t long_len) -{ - static const xcb_atom_t type = XCB_GET_PROPERTY_TYPE_ANY; - - return xcb_get_property(c, del, window, name, type, 0, long_len); -} - -xcb_get_property_cookie_t -xcb_get_any_property_unchecked(xcb_connection_t *c, - uint8_t del, - xcb_window_t window, - xcb_atom_t name, - uint32_t long_len) -{ - return xcb_get_property_unchecked(c, del, window, name, XCB_GET_PROPERTY_TYPE_ANY, 0, long_len); -} - -static int -call_handler(xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_property_handler_t *h) -{ - xcb_get_property_reply_t *propr = 0; - int ret; - - if(state != XCB_PROPERTY_DELETE) - { - xcb_get_property_cookie_t cookie = xcb_get_any_property(c, 0, window, atom, h->long_len); - propr = xcb_get_property_reply(c, cookie, 0); - } - ret = h->handler(h->data, c, state, window, atom, propr); - free(propr); - return ret; -} - -int -xcb_property_changed(xcb_property_handlers_t *prophs, uint8_t state, xcb_window_t window, xcb_atom_t atom) -{ - xcb_connection_t *c = xcb_event_get_xcb_connection(xcb_property_get_event_handlers(prophs)); - xcb_property_handler_node_t *cur; - - for(cur = prophs->head; cur; cur = cur->next) - if(cur->name == atom) - return call_handler(c, state, window, atom, &cur->h); - - if(prophs->def.handler) - return call_handler(c, state, window, atom, &prophs->def); - - return 0; -} - -static int -handle_property_notify_event(void *data, xcb_connection_t *c, xcb_property_notify_event_t *e) -{ - xcb_property_handlers_t *prophs = data; - uint8_t state = e->state; - xcb_window_t window = e->window; - xcb_atom_t atom = e->atom; - - return xcb_property_changed(prophs, state, window, atom); -} - -void -xcb_property_handlers_init(xcb_property_handlers_t *prophs, xcb_event_handlers_t *evenths) -{ - memset(prophs, 0, sizeof(prophs)); - prophs->evenths = evenths; - xcb_event_set_property_notify_handler(evenths, handle_property_notify_event, prophs); -} - -void -xcb_property_handlers_wipe(xcb_property_handlers_t *prophs) -{ - xcb_property_handler_node_t *node, *next; - - for(node = prophs->head; node; node = next) - { - next = node->next; - free(node); - } -} - -xcb_event_handlers_t * -xcb_property_get_event_handlers(xcb_property_handlers_t *prophs) -{ - return prophs->evenths; -} - -static inline void -set_prop_handler(xcb_property_handler_t *cur, uint32_t long_len, xcb_generic_property_handler_t handler, void *data) -{ - cur->long_len = long_len; - cur->handler = handler; - cur->data = data; -} - -uint8_t -xcb_property_set_handler(xcb_property_handlers_t *prophs, xcb_atom_t name, uint32_t long_len, xcb_generic_property_handler_t handler, void *data) -{ - xcb_property_handler_node_t *cur = malloc(sizeof(xcb_property_handler_node_t)); - if(!cur) - return 0; - cur->next = prophs->head; - cur->name = name; - set_prop_handler(&cur->h, long_len, handler, data); - prophs->head = cur; - return 1; -} - -uint8_t -xcb_property_set_default_handler(xcb_property_handlers_t *prophs, uint32_t long_len, xcb_generic_property_handler_t handler, void *data) -{ - set_prop_handler(&prophs->def, long_len, handler, data); - return 1; -} diff --git a/property/xcb-property.pc.in b/property/xcb-property.pc.in deleted file mode 100644 index 94cd0f7..0000000 --- a/property/xcb-property.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Property library -Description: XCB property convenience library -Version: @PACKAGE_VERSION@ -Requires: xcb xcb-event -Libs: -L${libdir} -lxcb-property @LIBS@ -Cflags: -I${includedir} diff --git a/property/xcb_property.h b/property/xcb_property.h deleted file mode 100644 index d90f5c9..0000000 --- a/property/xcb_property.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -/** - * @defgroup xcb__property_t XCB Property Functions - * - * These functions ease the handling of X propertiess received. - * - * @{ - */ - -#ifndef __XCB_PROPERTY_H__ -#define __XCB_PROPERTY_H__ - -#include "xcb_event.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct xcb_property_handlers xcb_property_handlers_t; -typedef int (*xcb_generic_property_handler_t)(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property); - -typedef struct { - uint32_t long_len; - xcb_generic_property_handler_t handler; - void *data; -} xcb_property_handler_t; - -typedef struct xcb_property_handler_node xcb_property_handler_node_t; -struct xcb_property_handler_node { - xcb_property_handler_node_t *next; - xcb_atom_t name; - xcb_property_handler_t h; -}; - -struct xcb_property_handlers { - xcb_property_handler_node_t *head; - xcb_property_handler_t def; - xcb_event_handlers_t *evenths; -}; - -/** - * @brief Get any property from a window, from any format. - * @param c The connection to the X server. - * @param del Boolean value that determines whether the property is deleted. - * @param window The window to get property from. - * @param name The property atom name. - * @param long_len The maximum length of the property. - * @return A cookie. - */ -xcb_get_property_cookie_t xcb_get_any_property(xcb_connection_t *c, - uint8_t del, - xcb_window_t window, - xcb_atom_t name, - uint32_t long_len); - -/** - * @see xcb_get_any_property - */ -xcb_get_property_cookie_t xcb_get_any_property_unchecked(xcb_connection_t *c, - uint8_t del, - xcb_window_t window, - xcb_atom_t name, - uint32_t long_len); -/** - * @brief Initialize a property handlers structure. - * @param prophs The property handlers data structure pointer. - * @param evenths The event handlers. - */ -void xcb_property_handlers_init(xcb_property_handlers_t *prophs, xcb_event_handlers_t *evenths); - -/** - * @brief Wipe a property handler structure. - * @param prophs The property handlers data structure pointer. - */ -void xcb_property_handlers_wipe(xcb_property_handlers_t *prophs); - -/** - * @brief Get a event handlers from a property handlers data structure. - * @param prophs The property handlers. - * @return The event handlers data structure which was set if any, NULL - * otherwise. - */ -xcb_event_handlers_t *xcb_property_get_event_handlers(xcb_property_handlers_t *prophs); - -/** - * @brief Set a property handler for an event. - * @param prophs The property handlers. - * @param name The property atom name. - * @param long_len The maximum length of the property value that will be - * handled. - * @param handler The handler callback function. - * @param data Optional data that will be passed as argument of the handler - * callback function. Can be NULL safely if you do not need it. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t xcb_property_set_handler(xcb_property_handlers_t *prophs, - xcb_atom_t name, - uint32_t long_len, - xcb_generic_property_handler_t handler, - void *data); - -/** - * @brief Set the default property handler. - * If a property does not have its own handler function, this one will be - * used. - * @param prophs The property handlers. - * @param name The property atom name. - * @param long_len The maximum length of the property value that will be - * handled. - * @param handler The handler callback function. - * @param data Optional data that will be passed as argument of the handler - * callback function. Can be NULL safely if you do not need it. - * @return Return 1 on success, 0 otherwise. - */ -uint8_t xcb_property_set_default_handler(xcb_property_handlers_t *prophs, uint32_t long_len, xcb_generic_property_handler_t handler, void *data); - -/** - * @brief Notify that a property has changed and call handler function callback as needed. - * @param prophs The property handlers. - * @param state The property state. - * @param window The window. - * @param atom The property atom name. - */ -int xcb_property_changed(xcb_property_handlers_t *prophs, uint8_t state, xcb_window_t window, xcb_atom_t atom); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* __XCB_PROPERTY_H__ */ diff --git a/renderutil/Makefile.am b/renderutil/Makefile.am deleted file mode 100644 index aaf0f48..0000000 --- a/renderutil/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-render-util.la - -xcbinclude_HEADERS = xcb_renderutil.h - -libxcb_render_util_la_SOURCES = cache.c util.c glyph.c -libxcb_render_util_la_CPPFLAGS = $(XCB_CFLAGS) $(XCB_RENDER_CFLAGS) -libxcb_render_util_la_LIBADD = $(XCB_LIBS) $(XCB_RENDER_LIBS) - -pkgconfig_DATA = xcb-renderutil.pc - -EXTRA_DIST=xcb-renderutil.pc.in diff --git a/renderutil/cache.c b/renderutil/cache.c deleted file mode 100644 index 96acbe8..0000000 --- a/renderutil/cache.c +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright © 2006 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "xcb_renderutil.h" -#include -#include - -typedef struct connection_cache { - struct connection_cache *next; /* keep a linked list */ - xcb_connection_t *c; /* which display this is */ - xcb_render_query_version_reply_t *version; - xcb_render_query_pict_formats_reply_t *formats; -} connection_cache; - -static struct { - pthread_mutex_t lock; - connection_cache *head; /* start of the list */ - connection_cache *cur; /* most recently used */ -} connections = { PTHREAD_MUTEX_INITIALIZER }; - -/* - * If the server is missing support for any of the required depths on - * any screen, tell the application that Render is not present. - */ - -#define DEPTH_MASK(d) (1 << ((d) - 1)) - -/* - * Render requires support for depth 1, 4, 8, 24 and 32 pixmaps - */ - -#define REQUIRED_DEPTHS (DEPTH_MASK(1) | \ - DEPTH_MASK(4) | \ - DEPTH_MASK(8) | \ - DEPTH_MASK(24) | \ - DEPTH_MASK(32)) - -/* Test each depth not explicitly advertised to see if pixmap creation - * succeeds: if it does, that depth is usable. */ -static int -pixmap_depths_usable (xcb_connection_t *c, uint32_t missing, xcb_pixmap_t pixmap, xcb_drawable_t root) -{ - xcb_void_cookie_t create_cookie[32] = { { 0 } }; - xcb_void_cookie_t free_cookie[32] = { { 0 } }; - int d; - int success = 1; - for (d = 1; d <= 32; d++) - if (missing & DEPTH_MASK(d)) - { - create_cookie[d - 1] = xcb_create_pixmap_checked (c, d, pixmap, root, 1, 1); - free_cookie[d - 1] = xcb_free_pixmap_checked (c, pixmap); - if (!create_cookie[d - 1].sequence || !free_cookie[d - 1].sequence) - { - success = 0; - break; - } - } - for (d = 0; d < 32; d++) - if (create_cookie[d].sequence || free_cookie[d].sequence) - { - xcb_generic_error_t *create_error = xcb_request_check (c, create_cookie[d]); - xcb_generic_error_t *free_error = xcb_request_check (c, free_cookie[d]); - success = success && !create_error; - free(create_error); - free(free_error); - } - return success; -} - -static int -has_required_depths (xcb_connection_t *c) -{ - xcb_screen_iterator_t screens; - xcb_pixmap_t pixmap = { -1 }; - for (screens = xcb_setup_roots_iterator(xcb_get_setup(c)); screens.rem; xcb_screen_next(&screens)) - { - xcb_depth_iterator_t depths; - uint32_t missing = REQUIRED_DEPTHS; - xcb_drawable_t root; - - for (depths = xcb_screen_allowed_depths_iterator(screens.data); depths.rem; xcb_depth_next(&depths)) - missing &= ~DEPTH_MASK(depths.data->depth); - if (!missing) - continue; - - /* - * Ok, this is ugly. It should be sufficient at this - * point to just return false, but Xinerama is broken at - * this point and only advertises depths which have an - * associated visual. Of course, the other depths still - * work, but the only way to find out is to try them. - */ - if (pixmap == -1) - pixmap = xcb_generate_id(c); - root = screens.data->root; - if (!pixmap_depths_usable (c, missing, pixmap, root)) - return 0; - } - return 1; -} - -static connection_cache * -find_or_create_display (xcb_connection_t *c) -{ - connection_cache *info; - xcb_render_query_version_cookie_t version_cookie; - xcb_render_query_pict_formats_cookie_t formats_cookie; - int present; - - /* - * look for display in list - */ - for (info = connections.head; info; info = info->next) - if (info->c == c) { - connections.cur = info; /* cache most recently used */ - return info; - } - - /* - * don't already have this display: add it. - */ - info = malloc (sizeof (connection_cache)); - if (!info) - return NULL; - info->c = c; - - version_cookie = xcb_render_query_version(c, 0, 10); - formats_cookie = xcb_render_query_pict_formats(c); - xcb_flush(c); - present = has_required_depths (c); - info->version = xcb_render_query_version_reply(c, version_cookie, 0); - info->formats = xcb_render_query_pict_formats_reply(c, formats_cookie, 0); - - if (!present || !info->version || !info->formats) - { - free(info->version); - info->version = 0; - free(info->formats); - info->formats = 0; - } - /* Check for the lack of sub-pixel data */ - else if (info->version->major_version == 0 && info->version->minor_version < 6) - info->formats->num_subpixel = 0; - - /* - * now, chain it onto the list - */ - info->next = connections.head; - connections.head = info; - connections.cur = info; - - return info; -} - -static connection_cache * -find_display (xcb_connection_t *c) -{ - connection_cache *info; - - /* - * see if this was the most recently accessed display - */ - if ((info = connections.cur) && info->c == c) - return info; - - pthread_mutex_lock(&connections.lock); - info = find_or_create_display (c); - pthread_mutex_unlock(&connections.lock); - return info; -} - -const xcb_render_query_version_reply_t * -xcb_render_util_query_version (xcb_connection_t *c) -{ - connection_cache *info = find_display (c); - if (!info) - return 0; - return info->version; -} - -const xcb_render_query_pict_formats_reply_t * -xcb_render_util_query_formats (xcb_connection_t *c) -{ - connection_cache *info = find_display (c); - if (!info) - return 0; - return info->formats; -} - -int -xcb_render_util_disconnect (xcb_connection_t *c) -{ - connection_cache **prev, *cur = NULL; - pthread_mutex_lock(&connections.lock); - for(prev = &connections.head; *prev; prev = &(*prev)->next) - if((*prev)->c == c) - { - cur = *prev; - *prev = cur->next; - if(cur == connections.cur) - connections.cur = NULL; /* flush cache */ - free(cur->version); - free(cur->formats); - free(cur); - break; - } - pthread_mutex_unlock(&connections.lock); - return cur != NULL; -} diff --git a/renderutil/glyph.c b/renderutil/glyph.c deleted file mode 100644 index 1721cad..0000000 --- a/renderutil/glyph.c +++ /dev/null @@ -1,287 +0,0 @@ -/* Copyright © 2006 Ian Osgood - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or their - * institutions shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the authors. - */ - -#include -#include - -#include "xcb_renderutil.h" - -typedef struct _glyph_header_t { - uint8_t count; - uint8_t pad0[3]; - int16_t dx, dy; -} _glyph_header_t; - -/* implementation of the opaque stream */ -struct xcb_render_util_composite_text_stream_t { - /* state info */ - uint32_t glyph_size; /* 0 for unset, 1/2/4 for 8/16/32 */ - xcb_render_glyphset_t initial_glyphset; - xcb_render_glyphset_t current_glyphset; - - /* dynamically allocated stream */ - /* contents are 32-bit aligned, network byte order */ - size_t stream_len; - uint32_t *stream; - uint32_t *current; -}; - -#define CURRENT_LEN(s) (((char *)s->current - (char *)s->stream)) - -xcb_render_util_composite_text_stream_t * -xcb_render_util_composite_text_stream ( - xcb_render_glyphset_t initial_glyphset, - uint32_t total_glyphs, - uint32_t total_glyphset_changes ) -{ - xcb_render_util_composite_text_stream_t *stream; - size_t size = 32; - - /* assume worst case: each glyph has its own dx,dy */ - if (total_glyphs || total_glyphset_changes) { - size = total_glyphs * 3 * sizeof(uint32_t) - + total_glyphset_changes * 3 * sizeof(uint32_t); - } - - stream = malloc(sizeof(xcb_render_util_composite_text_stream_t)); - - stream->glyph_size = 0; - stream->initial_glyphset = initial_glyphset; - stream->current_glyphset = initial_glyphset; - - stream->stream_len = size; - stream->stream = malloc(size); - stream->current = stream->stream; - - return stream; -} - -static void -_grow_stream( xcb_render_util_composite_text_stream_t *stream, size_t increase ) -{ - size_t current_len = CURRENT_LEN(stream); - if (current_len + increase > stream->stream_len) { - uint32_t *s = realloc(stream->stream, 2 * stream->stream_len); - if (s != NULL) { - stream->stream_len *= 2; - stream->stream = s; - stream->current = stream->stream + (current_len>>2); - } - } -} - -void -xcb_render_util_glyphs_8 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint8_t *glyphs ) -{ - _glyph_header_t header = { count, {0,0,0}, dx, dy }; - - if (count > 252) return; /* FIXME */ - - if (stream->glyph_size != sizeof(*glyphs)) { - if (stream->glyph_size != 0) - return; - stream->glyph_size = sizeof(*glyphs); - } - _grow_stream(stream, sizeof(header) + count+3); - - memcpy(stream->current, &header, sizeof(header)); - stream->current += 2; - - memcpy(stream->current, glyphs, header.count); - stream->current += ((int)header.count+3)>>2; -} - -void -xcb_render_util_glyphs_16 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint16_t *glyphs ) -{ - _glyph_header_t header = { count, {0,0,0}, dx, dy }; - - if (count > 254) return; /* FIXME */ - - if (stream->glyph_size != sizeof(*glyphs)) { - if (stream->glyph_size != 0) - return; - stream->glyph_size = sizeof(*glyphs); - } - _grow_stream(stream, sizeof(header) + count*sizeof(*glyphs)+1); - - memcpy(stream->current, &header, sizeof(header)); - stream->current += 2; - - memcpy(stream->current, glyphs, header.count*sizeof(*glyphs)); - stream->current += ((int)header.count*sizeof(*glyphs)+3)>>2; -} - -void -xcb_render_util_glyphs_32 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint32_t *glyphs ) -{ - _glyph_header_t header = { count, {0,0,0}, dx, dy }; - - if (count > 254) return; /* FIXME */ - - if (stream->glyph_size != sizeof(*glyphs)) { - if (stream->glyph_size != 0) - return; - stream->glyph_size = sizeof(*glyphs); - } - _grow_stream(stream, sizeof(header) + count*sizeof(*glyphs)+1); - - memcpy(stream->current, &header, sizeof(header)); - stream->current += 2; - - memcpy(stream->current, glyphs, header.count*sizeof(*glyphs)); - stream->current += header.count; -} - -/* note: these glyph arrays must be swapped to network byte order */ - -void -xcb_render_util_change_glyphset ( - xcb_render_util_composite_text_stream_t *stream, - xcb_render_glyphset_t glyphset ) -{ - static _glyph_header_t header = { 255, {0,0,0}, 0, 0 }; - - if (glyphset == stream->current_glyphset) - return; - - _grow_stream(stream, 3*sizeof(uint32_t)); - - memcpy(stream->current, &header, sizeof(header)); - stream->current += 2; - - *stream->current = glyphset; - stream->current++; - - stream->current_glyphset = glyphset; -} - -typedef xcb_void_cookie_t -(*xcb_render_composite_glyphs_func) (xcb_connection_t *c, - uint8_t op, - xcb_render_picture_t src, - xcb_render_picture_t dst, - xcb_render_pictformat_t mask_format, - xcb_render_glyphset_t glyphset, - int16_t src_x, - int16_t src_y, - uint32_t glyphcmds_len, - const uint8_t *glyphcmds); - - -xcb_void_cookie_t -xcb_render_util_composite_text ( - xcb_connection_t *xc, - uint8_t op, - xcb_render_picture_t src, - xcb_render_picture_t dst, - xcb_render_pictformat_t mask_format, - int16_t src_x, - int16_t src_y, - xcb_render_util_composite_text_stream_t *stream ) -{ - xcb_render_composite_glyphs_func f; - - switch (stream->glyph_size) - { - case 1: - f = xcb_render_composite_glyphs_8; - break; - case 2: - f = xcb_render_composite_glyphs_16; - break; - case 4: - f = xcb_render_composite_glyphs_32; - break; - default: /* uninitialized */ - return xcb_no_operation(xc); - } - return f( - xc, op, src, dst, mask_format, - stream->initial_glyphset, - src_x, src_y, - CURRENT_LEN(stream), - (uint8_t *)stream->stream - ); -} - -xcb_void_cookie_t -xcb_render_util_composite_text_checked ( - xcb_connection_t *xc, - uint8_t op, - xcb_render_picture_t src, - xcb_render_picture_t dst, - xcb_render_pictformat_t mask_format, - int16_t src_x, - int16_t src_y, - xcb_render_util_composite_text_stream_t *stream ) -{ - xcb_render_composite_glyphs_func f; - - switch (stream->glyph_size) - { - case 1: - f = xcb_render_composite_glyphs_8_checked; - break; - case 2: - f = xcb_render_composite_glyphs_16_checked; - break; - case 4: - f = xcb_render_composite_glyphs_32_checked; - break; - default: /* uninitialized */ - return xcb_no_operation_checked(xc); - } - return f( - xc, op, src, dst, mask_format, - stream->initial_glyphset, - src_x, src_y, - CURRENT_LEN(stream), - (uint8_t *)stream->stream - ); -} - -void -xcb_render_util_composite_text_free ( - xcb_render_util_composite_text_stream_t *stream ) -{ - free(stream->stream); - free(stream); -} diff --git a/renderutil/util.c b/renderutil/util.c deleted file mode 100644 index 2d8840d..0000000 --- a/renderutil/util.c +++ /dev/null @@ -1,251 +0,0 @@ -/* Copyright © 2000 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "xcb_renderutil.h" - -xcb_render_pictvisual_t * -xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats, - const xcb_visualid_t visual) -{ - xcb_render_pictscreen_iterator_t screens; - xcb_render_pictdepth_iterator_t depths; - xcb_render_pictvisual_iterator_t visuals; - if (!formats) - return 0; - for (screens = xcb_render_query_pict_formats_screens_iterator(formats); screens.rem; xcb_render_pictscreen_next(&screens)) - for (depths = xcb_render_pictscreen_depths_iterator(screens.data); depths.rem; xcb_render_pictdepth_next(&depths)) - for (visuals = xcb_render_pictdepth_visuals_iterator(depths.data); visuals.rem; xcb_render_pictvisual_next(&visuals)) - if (visuals.data->visual == visual) - return visuals.data; - return 0; -} - -xcb_render_pictforminfo_t * -xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, - unsigned long mask, - const xcb_render_pictforminfo_t *template, - int count) -{ - xcb_render_pictforminfo_iterator_t i; - if (!formats) - return 0; - for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i)) - { - if (mask & XCB_PICT_FORMAT_ID) - if (template->id != i.data->id) - continue; - if (mask & XCB_PICT_FORMAT_TYPE) - if (template->type != i.data->type) - continue; - if (mask & XCB_PICT_FORMAT_DEPTH) - if (template->depth != i.data->depth) - continue; - if (mask & XCB_PICT_FORMAT_RED) - if (template->direct.red_shift != i.data->direct.red_shift) - continue; - if (mask & XCB_PICT_FORMAT_RED_MASK) - if (template->direct.red_mask != i.data->direct.red_mask) - continue; - if (mask & XCB_PICT_FORMAT_GREEN) - if (template->direct.green_shift != i.data->direct.green_shift) - continue; - if (mask & XCB_PICT_FORMAT_GREEN_MASK) - if (template->direct.green_mask != i.data->direct.green_mask) - continue; - if (mask & XCB_PICT_FORMAT_BLUE) - if (template->direct.blue_shift != i.data->direct.blue_shift) - continue; - if (mask & XCB_PICT_FORMAT_BLUE_MASK) - if (template->direct.blue_mask != i.data->direct.blue_mask) - continue; - if (mask & XCB_PICT_FORMAT_ALPHA) - if (template->direct.alpha_shift != i.data->direct.alpha_shift) - continue; - if (mask & XCB_PICT_FORMAT_ALPHA_MASK) - if (template->direct.alpha_mask != i.data->direct.alpha_mask) - continue; - if (mask & XCB_PICT_FORMAT_COLORMAP) - if (template->colormap != i.data->colormap) - continue; - if (count-- == 0) - return i.data; - } - return 0; -} - -xcb_render_pictforminfo_t * -xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats, - xcb_pict_standard_t format) -{ - static const struct { - xcb_render_pictforminfo_t templ; - unsigned long mask; - } standardFormats[] = { - /* XCB_PICT_STANDARD_ARGB_32 */ - { - { - 0, /* id */ - XCB_RENDER_PICT_TYPE_DIRECT, /* type */ - 32, /* depth */ - { 0 }, /* pad */ - { /* direct */ - 16, /* direct.red */ - 0xff, /* direct.red_mask */ - 8, /* direct.green */ - 0xff, /* direct.green_mask */ - 0, /* direct.blue */ - 0xff, /* direct.blue_mask */ - 24, /* direct.alpha */ - 0xff, /* direct.alpha_mask */ - }, - 0, /* colormap */ - }, - XCB_PICT_FORMAT_TYPE | - XCB_PICT_FORMAT_DEPTH | - XCB_PICT_FORMAT_RED | - XCB_PICT_FORMAT_RED_MASK | - XCB_PICT_FORMAT_GREEN | - XCB_PICT_FORMAT_GREEN_MASK | - XCB_PICT_FORMAT_BLUE | - XCB_PICT_FORMAT_BLUE_MASK | - XCB_PICT_FORMAT_ALPHA | - XCB_PICT_FORMAT_ALPHA_MASK, - }, - /* XCB_PICT_STANDARD_RGB_24 */ - { - { - 0, /* id */ - XCB_RENDER_PICT_TYPE_DIRECT, /* type */ - 24, /* depth */ - { 0 }, /* pad */ - { /* direct */ - 16, /* direct.red */ - 0xff, /* direct.red_MASK */ - 8, /* direct.green */ - 0xff, /* direct.green_MASK */ - 0, /* direct.blue */ - 0xff, /* direct.blue_MASK */ - 0, /* direct.alpha */ - 0x00, /* direct.alpha_MASK */ - }, - 0, /* colormap */ - }, - XCB_PICT_FORMAT_TYPE | - XCB_PICT_FORMAT_DEPTH | - XCB_PICT_FORMAT_RED | - XCB_PICT_FORMAT_RED_MASK | - XCB_PICT_FORMAT_GREEN | - XCB_PICT_FORMAT_GREEN_MASK | - XCB_PICT_FORMAT_BLUE | - XCB_PICT_FORMAT_BLUE_MASK | - XCB_PICT_FORMAT_ALPHA_MASK, - }, - /* XCB_PICT_STANDARD_A_8 */ - { - { - 0, /* id */ - XCB_RENDER_PICT_TYPE_DIRECT, /* type */ - 8, /* depth */ - { 0 }, /* pad */ - { /* direct */ - 0, /* direct.red */ - 0x00, /* direct.red_MASK */ - 0, /* direct.green */ - 0x00, /* direct.green_MASK */ - 0, /* direct.blue */ - 0x00, /* direct.blue_MASK */ - 0, /* direct.alpha */ - 0xff, /* direct.alpha_MASK */ - }, - 0, /* colormap */ - }, - XCB_PICT_FORMAT_TYPE | - XCB_PICT_FORMAT_DEPTH | - XCB_PICT_FORMAT_RED_MASK | - XCB_PICT_FORMAT_GREEN_MASK | - XCB_PICT_FORMAT_BLUE_MASK | - XCB_PICT_FORMAT_ALPHA | - XCB_PICT_FORMAT_ALPHA_MASK, - }, - /* XCB_PICT_STANDARD_A_4 */ - { - { - 0, /* id */ - XCB_RENDER_PICT_TYPE_DIRECT, /* type */ - 4, /* depth */ - { 0 }, /* pad */ - { /* direct */ - 0, /* direct.red */ - 0x00, /* direct.red_MASK */ - 0, /* direct.green */ - 0x00, /* direct.green_MASK */ - 0, /* direct.blue */ - 0x00, /* direct.blue_MASK */ - 0, /* direct.alpha */ - 0x0f, /* direct.alpha_MASK */ - }, - 0, /* colormap */ - }, - XCB_PICT_FORMAT_TYPE | - XCB_PICT_FORMAT_DEPTH | - XCB_PICT_FORMAT_RED_MASK | - XCB_PICT_FORMAT_GREEN_MASK | - XCB_PICT_FORMAT_BLUE_MASK | - XCB_PICT_FORMAT_ALPHA | - XCB_PICT_FORMAT_ALPHA_MASK, - }, - /* XCB_PICT_STANDARD_A_1 */ - { - { - 0, /* id */ - XCB_RENDER_PICT_TYPE_DIRECT, /* type */ - 1, /* depth */ - { 0 }, /* pad */ - { /* direct */ - 0, /* direct.red */ - 0x00, /* direct.red_MASK */ - 0, /* direct.green */ - 0x00, /* direct.green_MASK */ - 0, /* direct.blue */ - 0x00, /* direct.blue_MASK */ - 0, /* direct.alpha */ - 0x01, /* direct.alpha_MASK */ - }, - 0, /* colormap */ - }, - XCB_PICT_FORMAT_TYPE | - XCB_PICT_FORMAT_DEPTH | - XCB_PICT_FORMAT_RED_MASK | - XCB_PICT_FORMAT_GREEN_MASK | - XCB_PICT_FORMAT_BLUE_MASK | - XCB_PICT_FORMAT_ALPHA | - XCB_PICT_FORMAT_ALPHA_MASK, - }, - }; - - if (format < 0 || format >= sizeof(standardFormats) / sizeof(*standardFormats)) - return 0; - - return xcb_render_util_find_format (formats, - standardFormats[format].mask, - &standardFormats[format].templ, - 0); -} diff --git a/renderutil/xcb-renderutil.pc.in b/renderutil/xcb-renderutil.pc.in deleted file mode 100644 index cbad815..0000000 --- a/renderutil/xcb-renderutil.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB RenderUtil library -Description: XCB RENDER-extension utilities library -Version: @PACKAGE_VERSION@ -Requires: xcb xcb-render -Libs: -L${libdir} -lxcb-render-util @LIBS@ -Cflags: -I${includedir} diff --git a/renderutil/xcb_renderutil.h b/renderutil/xcb_renderutil.h deleted file mode 100644 index 6eb5923..0000000 --- a/renderutil/xcb_renderutil.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright © 2006 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. - */ - -#ifndef XCB_RENDERUTIL -#define XCB_RENDERUTIL -#include - -typedef enum xcb_pict_format_t { - XCB_PICT_FORMAT_ID = (1 << 0), - XCB_PICT_FORMAT_TYPE = (1 << 1), - XCB_PICT_FORMAT_DEPTH = (1 << 2), - XCB_PICT_FORMAT_RED = (1 << 3), - XCB_PICT_FORMAT_RED_MASK = (1 << 4), - XCB_PICT_FORMAT_GREEN = (1 << 5), - XCB_PICT_FORMAT_GREEN_MASK = (1 << 6), - XCB_PICT_FORMAT_BLUE = (1 << 7), - XCB_PICT_FORMAT_BLUE_MASK = (1 << 8), - XCB_PICT_FORMAT_ALPHA = (1 << 9), - XCB_PICT_FORMAT_ALPHA_MASK = (1 << 10), - XCB_PICT_FORMAT_COLORMAP = (1 << 11) -} xcb_pict_format_t; - -typedef enum xcb_pict_standard_t { - XCB_PICT_STANDARD_ARGB_32, - XCB_PICT_STANDARD_RGB_24, - XCB_PICT_STANDARD_A_8, - XCB_PICT_STANDARD_A_4, - XCB_PICT_STANDARD_A_1 -} xcb_pict_standard_t; - - -xcb_render_pictvisual_t * -xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t *formats, - const xcb_visualid_t visual); - -xcb_render_pictforminfo_t * -xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, - unsigned long mask, - const xcb_render_pictforminfo_t *template, - int count); - -xcb_render_pictforminfo_t * -xcb_render_util_find_standard_format (const xcb_render_query_pict_formats_reply_t *formats, - xcb_pict_standard_t format); - -const xcb_render_query_version_reply_t * -xcb_render_util_query_version (xcb_connection_t *c); - -const xcb_render_query_pict_formats_reply_t * -xcb_render_util_query_formats (xcb_connection_t *c); - -int -xcb_render_util_disconnect (xcb_connection_t *c); - -/* wrappers for xcb_render_composite_glyphs_8/16/32 */ - -typedef struct xcb_render_util_composite_text_stream_t xcb_render_util_composite_text_stream_t; - -xcb_render_util_composite_text_stream_t * -xcb_render_util_composite_text_stream ( - xcb_render_glyphset_t initial_glyphset, - uint32_t total_glyphs, - uint32_t total_glyphset_changes ); - -void -xcb_render_util_glyphs_8 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint8_t *glyphs ); - -void -xcb_render_util_glyphs_16 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint16_t *glyphs ); - -void -xcb_render_util_glyphs_32 ( - xcb_render_util_composite_text_stream_t *stream, - int16_t dx, - int16_t dy, - uint32_t count, - const uint32_t *glyphs ); - -void -xcb_render_util_change_glyphset ( - xcb_render_util_composite_text_stream_t *stream, - xcb_render_glyphset_t glyphset ); - -xcb_void_cookie_t -xcb_render_util_composite_text ( - xcb_connection_t *xc, - uint8_t op, - xcb_render_picture_t src, - xcb_render_picture_t dst, - xcb_render_pictformat_t mask_format, - int16_t src_x, - int16_t src_y, - xcb_render_util_composite_text_stream_t *stream ); - -xcb_void_cookie_t -xcb_render_util_composite_text_checked ( - xcb_connection_t *xc, - uint8_t op, - xcb_render_picture_t src, - xcb_render_picture_t dst, - xcb_render_pictformat_t mask_format, - int16_t src_x, - int16_t src_y, - xcb_render_util_composite_text_stream_t *stream ); - -void -xcb_render_util_composite_text_free ( - xcb_render_util_composite_text_stream_t *stream ); - -#endif /* XCB_RENDERUTIL */ diff --git a/reply/Makefile.am b/reply/Makefile.am deleted file mode 100644 index aa49773..0000000 --- a/reply/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -lib_LTLIBRARIES = libxcb-reply.la - -xcbinclude_HEADERS = xcb_reply.h - -AM_CFLAGS = $(CWARNFLAGS) - -XCB_REPLY_LIBS = libxcb-reply.la - -libxcb_reply_la_SOURCES = reply.c -libxcb_reply_la_CPPFLAGS = $(XCB_CFLAGS) -libxcb_reply_la_LIBADD = $(XCB_LIBS) -lpthread -libxcb_reply_la_LDFLAGS = -version-info 1:0:0 - -pkgconfig_DATA = xcb-reply.pc - -EXTRA_DIST=xcb-reply.pc.in - -noinst_PROGRAMS = test_reply - -test_reply_CPPFLAGS = $(XCB_CFLAGS) -test_reply_LDADD = $(XCB_LIBS) $(XCB_REPLY_LIBS) -test_reply_SOURCES = test_reply.c diff --git a/reply/reply.c b/reply/reply.c deleted file mode 100644 index 0cc75c6..0000000 --- a/reply/reply.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright © 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include -#include - -#include "xcb_reply.h" - -void -xcb_reply_handlers_init(xcb_connection_t *c, xcb_reply_handlers_t *r) -{ - static const pthread_mutex_t proto_lock = PTHREAD_MUTEX_INITIALIZER; - static const pthread_cond_t proto_cond = PTHREAD_COND_INITIALIZER; - r->lock = proto_lock; - r->cond = proto_cond; - r->c = c; - r->head = NULL; -} - -xcb_connection_t * -xcb_reply_get_xcb_connection(xcb_reply_handlers_t *h) -{ - return h->c; -} - -static void -insert_handler(xcb_reply_handlers_t *h, struct xcb_reply_node *cur) -{ - struct xcb_reply_node **prev = &h->head; - while(*prev && (*prev)->request < cur->request) - prev = &(*prev)->next; - cur->next = *prev; - *prev = cur; -} - -static void -remove_handler(xcb_reply_handlers_t *h, struct xcb_reply_node *cur) -{ - struct xcb_reply_node **prev = &h->head; - while(*prev && (*prev)->request < cur->request) - prev = &(*prev)->next; - if(!(*prev) || (*prev)->request != cur->request) - return; - *prev = cur->next; - free(cur); -} - -static int -process_replies(xcb_reply_handlers_t *h, int block) -{ - int handled = 0; - pthread_mutex_lock(&h->lock); - pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &h->lock); - while(1) - { - struct xcb_reply_node *cur = h->head; - xcb_generic_error_t *error; - void *reply; - pthread_mutex_unlock(&h->lock); - pthread_cleanup_push((void (*)(void *)) pthread_mutex_lock, &h->lock); - if(block) - reply = xcb_wait_for_reply(h->c, cur->request, &error); - else if(!xcb_poll_for_reply(h->c, cur->request, &reply, &error)) - return handled; - if(reply || error) - { - cur->handler(cur->data, h->c, reply, error); - cur->handled = 1; - free(reply); - free(error); - } - handled |= cur->handled; - pthread_cleanup_pop(1); - if(!reply) - remove_handler(h, cur); - if(!h->head) - { - if(block) - pthread_cond_wait(&h->cond, &h->lock); - else - break; - } - } - pthread_cleanup_pop(1); - return handled; -} - -static void * -reply_thread(void *h) -{ - process_replies(h, 1); - return 0; -} - -void -xcb_reply_start_thread(xcb_reply_handlers_t *h) -{ - pthread_create(&h->thread, 0, reply_thread, h); -} - -void -xcb_reply_stop_thread(xcb_reply_handlers_t *h) -{ - pthread_cancel(h->thread); - pthread_join(h->thread, 0); -} - -void -xcb_reply_add_handler(xcb_reply_handlers_t *h, unsigned int request, xcb_generic_reply_handler_t handler, void *data) -{ - struct xcb_reply_node *cur = malloc(sizeof(struct xcb_reply_node)); - cur->request = request; - cur->handler = handler; - cur->data = data; - cur->handled = 0; - - pthread_mutex_lock(&h->lock); - insert_handler(h, cur); - pthread_cond_broadcast(&h->cond); - pthread_mutex_unlock(&h->lock); -} diff --git a/reply/test_reply.c b/reply/test_reply.c deleted file mode 100644 index 0805c41..0000000 --- a/reply/test_reply.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright © 2008 Ian Osgood - * Copyright © 2008 Jamey Sharp - * Copyright © 2008 Josh Triplett - * Copyright © 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -#include "xcb_reply.h" - -#include -#include -#include -#include - -pthread_cond_t cond = PTHREAD_COND_INITIALIZER; -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - -void fontinfo_handler(void *data, xcb_connection_t *c, xcb_generic_reply_t *rg, xcb_generic_error_t *eg) -{ - xcb_list_fonts_with_info_reply_t *rep = (xcb_list_fonts_with_info_reply_t *) rg; - if(rep) - { - int len = xcb_list_fonts_with_info_name_length(rep); - if(len) - printf("(+%u) Font \"%.*s\"\n", - (unsigned int) rep->replies_hint, - len, xcb_list_fonts_with_info_name(rep)); - else - { - pthread_mutex_lock(&lock); - pthread_cond_broadcast(&cond); - pthread_mutex_unlock(&lock); - printf("End of font list.\n"); - } - } - if(eg) - printf("Error from ListFontsWithInfo: %d\n", eg->error_code); -} - -int main(int argc, char **argv) -{ - int count = 10; - char *pattern = "*"; - xcb_connection_t *c = xcb_connect(NULL, NULL); - xcb_reply_handlers_t h; - xcb_reply_handlers_init(c, &h); - - if(argc > 1) - count = atoi(argv[1]); - if(argc > 2) - pattern = argv[2]; - - xcb_reply_add_handler(&h, xcb_list_fonts_with_info(c, count, strlen(pattern), pattern).sequence, fontinfo_handler, 0); - pthread_mutex_lock(&lock); - xcb_reply_start_thread(&h); - pthread_cond_wait(&cond, &lock); - xcb_reply_stop_thread(&h); - pthread_mutex_unlock(&lock); - - xcb_disconnect(c); - exit(0); -} diff --git a/reply/xcb-reply.pc.in b/reply/xcb-reply.pc.in deleted file mode 100644 index 3299a5f..0000000 --- a/reply/xcb-reply.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: XCB Reply library -Description: XCB reply convenience library -Version: @PACKAGE_VERSION@ -Requires: xcb -Libs: -L${libdir} -lxcb-reply @LIBS@ -Cflags: -I${includedir} diff --git a/reply/xcb_reply.h b/reply/xcb_reply.h deleted file mode 100644 index 71d07ac..0000000 --- a/reply/xcb_reply.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2008 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - */ - -/** - * @defgroup xcb__reply_t XCB Reply Functions - * - * These functions ease the usage of asynchronous possibility of XCB about - * the reply retrieve of sent requests. - * - * @{ - */ - -#ifndef __XCB_REPLY_H__ -#define __XCB_REPLY_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*xcb_generic_reply_handler_t)(void *data, xcb_connection_t *c, xcb_generic_reply_t *reply, xcb_generic_error_t *error); - -struct xcb_reply_node -{ - struct xcb_reply_node *next; - unsigned int request; - xcb_generic_reply_handler_t handler; - void *data; - char handled; -}; - -struct xcb_reply_handlers -{ - pthread_mutex_t lock; - pthread_cond_t cond; - struct xcb_reply_node *head; - xcb_connection_t *c; - pthread_t thread; -}; - -typedef struct xcb_reply_handlers xcb_reply_handlers_t; - -/** - * @brief Initialize a reply handlers structure. - * @param c The connection to the X server. - * @param h The reply handlers. - */ -void xcb_reply_handlers_init(xcb_connection_t *c, xcb_reply_handlers_t *h); - -/** - * @brief Get the connection to the X server used in reply handlers. - * @param h The reply handlers data structure. - * @return The connection to the X server. - */ -xcb_connection_t *xcb_reply_get_xcb_connection(xcb_reply_handlers_t *h); - -/** - * @brief Poll for reply using reply handlers. - * @param h The reply handlers data structure. - * @return The value return by the handler callback function, or 0 if no - * handler was found. - */ -int xcb_reply_poll_for_reply(xcb_reply_handlers_t *h); - -/** - * @brief Start reply handling thread. - * This thread will run forever until it is stop with xcb_reply_stop_thread. - * @param h The reply handlers. - */ -void xcb_reply_start_thread(xcb_reply_handlers_t *h); - -/** - * @brief Stop reply handling thread. - * @param h The reply handlers. - */ -void xcb_reply_stop_thread(xcb_reply_handlers_t *h); - -/** - * @brief Add a reply handler. - * @param h The reply handlers data structure to fill. - * @param request The request identifier. - * @param handler The handler to call for this request. - * @param data Optional data passed to the callback function handling request. - */ -void xcb_reply_add_handler(xcb_reply_handlers_t *h, unsigned int request, xcb_generic_reply_handler_t handler, void *data); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* __XCB_REPLY_H__ */ diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..13b5313 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,33 @@ + +lib_LTLIBRARIES = libxcb-util.la + +AM_CPPFLAGS = $(XCB_CFLAGS) +AM_CFLAGS = $(CWARNFLAGS) + +libxcb_util_la_LIBADD = $(XCB_LIBS) +libxcb_util_la_LDFLAGS = -version-info 0:0:0 -no-undefined +libxcb_util_la_SOURCES = \ + atoms.c \ + event.c \ + xcb_aux.c + +xcbinclude_HEADERS = \ + xcb_util.h \ + xcb_atom.h \ + xcb_aux.h \ + xcb_bitops.h \ + xcb_event.h + +BUILT_SOURCES = atoms.c atoms.gperf xcb_atom.h +CLEANFILES = $(BUILT_SOURCES) +EXTRA_DIST = atomlist.m4 atoms.gperf.m4 xcb_atom.h.m4 + +atoms.c: atoms.gperf + $(GPERF) --output-file $@ $< + +atoms.gperf: $(srcdir)/atoms.gperf.m4 $(srcdir)/atomlist.m4 + $(M4) -I$(srcdir) $< >$@ + +xcb_atom.h: $(srcdir)/xcb_atom.h.m4 $(srcdir)/atomlist.m4 + $(M4) -I$(srcdir) $< >$@ + diff --git a/src/atomlist.m4 b/src/atomlist.m4 new file mode 100644 index 0000000..1c84740 --- /dev/null +++ b/src/atomlist.m4 @@ -0,0 +1,71 @@ +define(`FOREACH', `ifelse(`$1', , , `DO($1) +FOREACH(shift($@))')')FOREACH( +PRIMARY, +SECONDARY, +ARC, +ATOM, +BITMAP, +CARDINAL, +COLORMAP, +CURSOR, +CUT_BUFFER0, +CUT_BUFFER1, +CUT_BUFFER2, +CUT_BUFFER3, +CUT_BUFFER4, +CUT_BUFFER5, +CUT_BUFFER6, +CUT_BUFFER7, +DRAWABLE, +FONT, +INTEGER, +PIXMAP, +POINT, +RECTANGLE, +RESOURCE_MANAGER, +RGB_COLOR_MAP, +RGB_BEST_MAP, +RGB_BLUE_MAP, +RGB_DEFAULT_MAP, +RGB_GRAY_MAP, +RGB_GREEN_MAP, +RGB_RED_MAP, +STRING, +VISUALID, +WINDOW, +WM_COMMAND, +WM_HINTS, +WM_CLIENT_MACHINE, +WM_ICON_NAME, +WM_ICON_SIZE, +WM_NAME, +WM_NORMAL_HINTS, +WM_SIZE_HINTS, +WM_ZOOM_HINTS, +MIN_SPACE, +NORM_SPACE, +MAX_SPACE, +END_SPACE, +SUPERSCRIPT_X, +SUPERSCRIPT_Y, +SUBSCRIPT_X, +SUBSCRIPT_Y, +UNDERLINE_POSITION, +UNDERLINE_THICKNESS, +STRIKEOUT_ASCENT, +STRIKEOUT_DESCENT, +ITALIC_ANGLE, +X_HEIGHT, +QUAD_WIDTH, +WEIGHT, +POINT_SIZE, +RESOLUTION, +COPYRIGHT, +NOTICE, +FONT_NAME, +FAMILY_NAME, +FULL_NAME, +CAP_HEIGHT, +WM_CLASS, +WM_TRANSIENT_FOR, +)dnl diff --git a/src/atoms.c b/src/atoms.c new file mode 100644 index 0000000..cdd8e38 --- /dev/null +++ b/src/atoms.c @@ -0,0 +1,690 @@ +/* C code produced by gperf version 3.0.3 */ +/* Command-line: gperf --output-file atoms.c atoms.gperf */ +/* Computed positions: -k'3,6,9,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "atoms.gperf" + + +/* Rely on vasprintf (GNU extension) instead of vsnprintf if + possible... */ +#ifdef HAVE_VASPRINTF +#define _GNU_SOURCE +#include +#endif + +#include +#include +#include +#include "xcb_atom.h" + +#line 25 "atoms.gperf" +struct atom_map { int name; xcb_atom_t value; }; +#include +/* maximum key range = 146, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +hash (str, len) + register const char *str; + register unsigned int len; +{ + static const unsigned char asso_values[] = + { + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 75, 70, + 65, 60, 40, 35, 20, 5, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 35, 0, 45, 15, 0, + 150, 50, 0, 5, 150, 150, 15, 35, 0, 40, + 5, 150, 10, 15, 0, 25, 150, 20, 70, 40, + 55, 150, 150, 150, 150, 15, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[8]]; + /*FALLTHROUGH*/ + case 8: + case 7: + case 6: + hval += asso_values[(unsigned char)str[5]]; + /*FALLTHROUGH*/ + case 5: + case 4: + case 3: + hval += asso_values[(unsigned char)str[2]]; + break; + } + return hval + asso_values[(unsigned char)str[len - 1]]; +} + +struct stringpool_t + { + char stringpool_str4[sizeof("FONT")]; + char stringpool_str6[sizeof("NOTICE")]; + char stringpool_str9[sizeof("FONT_NAME")]; + char stringpool_str10[sizeof("POINT")]; + char stringpool_str11[sizeof("WEIGHT")]; + char stringpool_str14[sizeof("MIN_SPACE")]; + char stringpool_str15[sizeof("CAP_HEIGHT")]; + char stringpool_str16[sizeof("BITMAP")]; + char stringpool_str17[sizeof("INTEGER")]; + char stringpool_str19[sizeof("COPYRIGHT")]; + char stringpool_str24[sizeof("FULL_NAME")]; + char stringpool_str26[sizeof("STRIKEOUT_ASCENT")]; + char stringpool_str27[sizeof("STRIKEOUT_DESCENT")]; + char stringpool_str28[sizeof("RGB_GREEN_MAP")]; + char stringpool_str29[sizeof("END_SPACE")]; + char stringpool_str32[sizeof("RGB_BEST_MAP")]; + char stringpool_str33[sizeof("CARDINAL")]; + char stringpool_str36[sizeof("CURSOR")]; + char stringpool_str37[sizeof("WM_CLIENT_MACHINE")]; + char stringpool_str38[sizeof("WM_HINTS")]; + char stringpool_str41[sizeof("CUT_BUFFER7")]; + char stringpool_str42[sizeof("RGB_GRAY_MAP")]; + char stringpool_str43[sizeof("DRAWABLE")]; + char stringpool_str45[sizeof("RGB_DEFAULT_MAP")]; + char stringpool_str46[sizeof("WINDOW")]; + char stringpool_str47[sizeof("RGB_BLUE_MAP")]; + char stringpool_str48[sizeof("UNDERLINE_POSITION")]; + char stringpool_str51[sizeof("RGB_RED_MAP")]; + char stringpool_str53[sizeof("VISUALID")]; + char stringpool_str54[sizeof("RECTANGLE")]; + char stringpool_str56[sizeof("CUT_BUFFER6")]; + char stringpool_str57[sizeof("WM_NAME")]; + char stringpool_str58[sizeof("X_HEIGHT")]; + char stringpool_str61[sizeof("SUBSCRIPT_Y")]; + char stringpool_str62[sizeof("PRIMARY")]; + char stringpool_str63[sizeof("COLORMAP")]; + char stringpool_str64[sizeof("UNDERLINE_THICKNESS")]; + char stringpool_str65[sizeof("QUAD_WIDTH")]; + char stringpool_str66[sizeof("RESOURCE_MANAGER")]; + char stringpool_str67[sizeof("WM_ICON_NAME")]; + char stringpool_str68[sizeof("RGB_COLOR_MAP")]; + char stringpool_str70[sizeof("WM_NORMAL_HINTS")]; + char stringpool_str71[sizeof("CUT_BUFFER5")]; + char stringpool_str73[sizeof("WM_CLASS")]; + char stringpool_str75[sizeof("WM_COMMAND")]; + char stringpool_str76[sizeof("CUT_BUFFER4")]; + char stringpool_str78[sizeof("SUPERSCRIPT_Y")]; + char stringpool_str79[sizeof("ATOM")]; + char stringpool_str80[sizeof("NORM_SPACE")]; + char stringpool_str81[sizeof("WM_TRANSIENT_FOR")]; + char stringpool_str82[sizeof("WM_ICON_SIZE")]; + char stringpool_str83[sizeof("WM_ZOOM_HINTS")]; + char stringpool_str84[sizeof("MAX_SPACE")]; + char stringpool_str85[sizeof("POINT_SIZE")]; + char stringpool_str86[sizeof("PIXMAP")]; + char stringpool_str90[sizeof("RESOLUTION")]; + char stringpool_str91[sizeof("SUBSCRIPT_X")]; + char stringpool_str92[sizeof("ITALIC_ANGLE")]; + char stringpool_str93[sizeof("ARC")]; + char stringpool_str96[sizeof("CUT_BUFFER3")]; + char stringpool_str98[sizeof("WM_SIZE_HINTS")]; + char stringpool_str101[sizeof("CUT_BUFFER2")]; + char stringpool_str106[sizeof("CUT_BUFFER1")]; + char stringpool_str108[sizeof("SUPERSCRIPT_X")]; + char stringpool_str111[sizeof("CUT_BUFFER0")]; + char stringpool_str116[sizeof("STRING")]; + char stringpool_str121[sizeof("FAMILY_NAME")]; + char stringpool_str149[sizeof("SECONDARY")]; + }; +static const struct stringpool_t stringpool_contents = + { + "FONT", + "NOTICE", + "FONT_NAME", + "POINT", + "WEIGHT", + "MIN_SPACE", + "CAP_HEIGHT", + "BITMAP", + "INTEGER", + "COPYRIGHT", + "FULL_NAME", + "STRIKEOUT_ASCENT", + "STRIKEOUT_DESCENT", + "RGB_GREEN_MAP", + "END_SPACE", + "RGB_BEST_MAP", + "CARDINAL", + "CURSOR", + "WM_CLIENT_MACHINE", + "WM_HINTS", + "CUT_BUFFER7", + "RGB_GRAY_MAP", + "DRAWABLE", + "RGB_DEFAULT_MAP", + "WINDOW", + "RGB_BLUE_MAP", + "UNDERLINE_POSITION", + "RGB_RED_MAP", + "VISUALID", + "RECTANGLE", + "CUT_BUFFER6", + "WM_NAME", + "X_HEIGHT", + "SUBSCRIPT_Y", + "PRIMARY", + "COLORMAP", + "UNDERLINE_THICKNESS", + "QUAD_WIDTH", + "RESOURCE_MANAGER", + "WM_ICON_NAME", + "RGB_COLOR_MAP", + "WM_NORMAL_HINTS", + "CUT_BUFFER5", + "WM_CLASS", + "WM_COMMAND", + "CUT_BUFFER4", + "SUPERSCRIPT_Y", + "ATOM", + "NORM_SPACE", + "WM_TRANSIENT_FOR", + "WM_ICON_SIZE", + "WM_ZOOM_HINTS", + "MAX_SPACE", + "POINT_SIZE", + "PIXMAP", + "RESOLUTION", + "SUBSCRIPT_X", + "ITALIC_ANGLE", + "ARC", + "CUT_BUFFER3", + "WM_SIZE_HINTS", + "CUT_BUFFER2", + "CUT_BUFFER1", + "SUPERSCRIPT_X", + "CUT_BUFFER0", + "STRING", + "FAMILY_NAME", + "SECONDARY" + }; +#define stringpool ((const char *) &stringpool_contents) +#ifdef __GNUC__ +__inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct atom_map * +in_word_set (str, len) + register const char *str; + register unsigned int len; +{ + enum + { + TOTAL_KEYWORDS = 68, + MIN_WORD_LENGTH = 3, + MAX_WORD_LENGTH = 19, + MIN_HASH_VALUE = 4, + MAX_HASH_VALUE = 149 + }; + + static const struct atom_map wordlist[] = + { + {-1}, {-1}, {-1}, {-1}, +#line 44 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str4,18}, + {-1}, +#line 88 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str6,62}, + {-1}, {-1}, +#line 89 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str9,63}, +#line 47 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str10,21}, +#line 84 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str11,58}, + {-1}, {-1}, +#line 69 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str14,43}, +#line 92 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str15,66}, +#line 31 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str16,5}, +#line 45 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str17,19}, + {-1}, +#line 87 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str19,61}, + {-1}, {-1}, {-1}, {-1}, +#line 91 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str24,65}, + {-1}, +#line 79 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str26,53}, +#line 80 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str27,54}, +#line 55 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str28,29}, +#line 72 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str29,46}, + {-1}, {-1}, +#line 51 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str32,25}, +#line 32 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str33,6}, + {-1}, {-1}, +#line 34 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str36,8}, +#line 62 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str37,36}, +#line 61 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str38,35}, + {-1}, {-1}, +#line 42 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str41,16}, +#line 54 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str42,28}, +#line 43 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str43,17}, + {-1}, +#line 53 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str45,27}, +#line 59 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str46,33}, +#line 52 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str47,26}, +#line 77 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str48,51}, + {-1}, {-1}, +#line 56 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str51,30}, + {-1}, +#line 58 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str53,32}, +#line 48 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str54,22}, + {-1}, +#line 41 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str56,15}, +#line 65 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str57,39}, +#line 82 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str58,56}, + {-1}, {-1}, +#line 76 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str61,50}, +#line 27 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str62,1}, +#line 33 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str63,7}, +#line 78 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str64,52}, +#line 83 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str65,57}, +#line 49 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str66,23}, +#line 63 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str67,37}, +#line 50 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str68,24}, + {-1}, +#line 66 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str70,40}, +#line 40 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str71,14}, + {-1}, +#line 93 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str73,67}, + {-1}, +#line 60 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str75,34}, +#line 39 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str76,13}, + {-1}, +#line 74 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str78,48}, +#line 30 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str79,4}, +#line 70 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str80,44}, +#line 94 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str81,68}, +#line 64 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str82,38}, +#line 68 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str83,42}, +#line 71 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str84,45}, +#line 85 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str85,59}, +#line 46 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str86,20}, + {-1}, {-1}, {-1}, +#line 86 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str90,60}, +#line 75 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str91,49}, +#line 81 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str92,55}, +#line 29 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str93,3}, + {-1}, {-1}, +#line 38 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str96,12}, + {-1}, +#line 67 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str98,41}, + {-1}, {-1}, +#line 37 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str101,11}, + {-1}, {-1}, {-1}, {-1}, +#line 36 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str106,10}, + {-1}, +#line 73 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str108,47}, + {-1}, {-1}, +#line 35 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str111,9}, + {-1}, {-1}, {-1}, {-1}, +#line 57 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str116,31}, + {-1}, {-1}, {-1}, {-1}, +#line 90 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str121,64}, + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, + {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, +#line 28 "atoms.gperf" + {(int)(long)&((struct stringpool_t *)0)->stringpool_str149,2} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + stringpool; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') + return &wordlist[key]; + } + } + } + return 0; +} +#line 95 "atoms.gperf" + + +static const char atom_names[] = + "PRIMARY\0" + "SECONDARY\0" + "ARC\0" + "ATOM\0" + "BITMAP\0" + "CARDINAL\0" + "COLORMAP\0" + "CURSOR\0" + "CUT_BUFFER0\0" + "CUT_BUFFER1\0" + "CUT_BUFFER2\0" + "CUT_BUFFER3\0" + "CUT_BUFFER4\0" + "CUT_BUFFER5\0" + "CUT_BUFFER6\0" + "CUT_BUFFER7\0" + "DRAWABLE\0" + "FONT\0" + "INTEGER\0" + "PIXMAP\0" + "POINT\0" + "RECTANGLE\0" + "RESOURCE_MANAGER\0" + "RGB_COLOR_MAP\0" + "RGB_BEST_MAP\0" + "RGB_BLUE_MAP\0" + "RGB_DEFAULT_MAP\0" + "RGB_GRAY_MAP\0" + "RGB_GREEN_MAP\0" + "RGB_RED_MAP\0" + "STRING\0" + "VISUALID\0" + "WINDOW\0" + "WM_COMMAND\0" + "WM_HINTS\0" + "WM_CLIENT_MACHINE\0" + "WM_ICON_NAME\0" + "WM_ICON_SIZE\0" + "WM_NAME\0" + "WM_NORMAL_HINTS\0" + "WM_SIZE_HINTS\0" + "WM_ZOOM_HINTS\0" + "MIN_SPACE\0" + "NORM_SPACE\0" + "MAX_SPACE\0" + "END_SPACE\0" + "SUPERSCRIPT_X\0" + "SUPERSCRIPT_Y\0" + "SUBSCRIPT_X\0" + "SUBSCRIPT_Y\0" + "UNDERLINE_POSITION\0" + "UNDERLINE_THICKNESS\0" + "STRIKEOUT_ASCENT\0" + "STRIKEOUT_DESCENT\0" + "ITALIC_ANGLE\0" + "X_HEIGHT\0" + "QUAD_WIDTH\0" + "WEIGHT\0" + "POINT_SIZE\0" + "RESOLUTION\0" + "COPYRIGHT\0" + "NOTICE\0" + "FONT_NAME\0" + "FAMILY_NAME\0" + "FULL_NAME\0" + "CAP_HEIGHT\0" + "WM_CLASS\0" + "WM_TRANSIENT_FOR\0" +; + +static const uint16_t atom_name_offsets[] = { + 0, + 8, + 18, + 22, + 27, + 34, + 43, + 52, + 59, + 71, + 83, + 95, + 107, + 119, + 131, + 143, + 155, + 164, + 169, + 177, + 184, + 190, + 200, + 217, + 231, + 244, + 257, + 273, + 286, + 300, + 312, + 319, + 328, + 335, + 346, + 355, + 373, + 386, + 399, + 407, + 423, + 437, + 451, + 461, + 472, + 482, + 492, + 506, + 520, + 532, + 544, + 563, + 583, + 600, + 618, + 631, + 640, + 651, + 658, + 669, + 680, + 690, + 697, + 707, + 719, + 729, + 740, + 749, +}; + +xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name) +{ + const struct atom_map *value = in_word_set(name, name_len); + xcb_atom_t ret = XCB_NONE; + if(value) + ret = value->value; + return ret; +} + +const char *xcb_atom_get_name_predefined(xcb_atom_t atom) +{ + if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_name_offsets))) + return 0; + return atom_names + atom_name_offsets[atom - 1]; +} + +static char *makename(const char *fmt, ...) +{ + char *ret; + int n; + va_list ap; + +#ifndef HAVE_VASPRINTF + char *np; + int size = 64; + + /* First allocate 'size' bytes, should be enough usually */ + if((ret = malloc(size)) == NULL) + return NULL; + + while(1) + { + va_start(ap, fmt); + n = vsnprintf(ret, size, fmt, ap); + va_end(ap); + + if(n < 0) + return NULL; + + if(n < size) + return ret; + + size = n + 1; + if((np = realloc(ret, size)) == NULL) + { + free(ret); + return NULL; + } + + ret = np; + } +#else + va_start(ap, fmt); + n = vasprintf(&ret, fmt, ap); + va_end(ap); + + if(n < 0) + return NULL; + + return ret; +#endif +} + +char *xcb_atom_name_by_screen(const char *base, uint8_t screen) +{ + return makename("%s_S%u", base, screen); +} + +char *xcb_atom_name_by_resource(const char *base, uint32_t resource) +{ + return makename("%s_R%08X", base, resource); +} + +char *xcb_atom_name_unique(const char *base, uint32_t id) +{ + if(base) + return makename("%s_U%lu", base, id); + else + return makename("U%lu", id); +} diff --git a/src/atoms.gperf.m4 b/src/atoms.gperf.m4 new file mode 100644 index 0000000..8876e26 --- /dev/null +++ b/src/atoms.gperf.m4 @@ -0,0 +1,121 @@ +%{ + +/* Rely on vasprintf (GNU extension) instead of vsnprintf if + possible... */ +#ifdef HAVE_VASPRINTF +#define _GNU_SOURCE +#include +#endif + +#include +#include +#include +#include "xcb_atom.h" + +%} + +%readonly-tables +%pic +%null-strings +%enum +%includes +%compare-strncmp + +%struct-type +struct atom_map { int name; xcb_atom_t value; }; +%% +define(`COUNT', 0)dnl +define(`DO', `$1,define(`COUNT', incr(COUNT))COUNT')dnl +include(atomlist.m4)`'dnl +%% + +static const char atom_names[] = +define(`DO', ` "$1\0"')dnl +include(atomlist.m4); + +static const uint16_t atom_name_offsets[] = { +define(`OFFSET', 0)dnl +define(`DO', ` OFFSET,define(`OFFSET', eval(OFFSET+1+len($1)))')dnl +include(atomlist.m4)`'dnl +}; + +xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name) +{ + const struct atom_map *value = in_word_set(name, name_len); + xcb_atom_t ret = XCB_NONE; + if(value) + ret = value->value; + return ret; +} + +const char *xcb_atom_get_name_predefined(xcb_atom_t atom) +{ + if(atom <= 0 || atom > (sizeof(atom_name_offsets) / sizeof(*atom_name_offsets))) + return 0; + return atom_names + atom_name_offsets[atom - 1]; +} + +static char *makename(const char *fmt, ...) +{ + char *ret; + int n; + va_list ap; + +#ifndef HAVE_VASPRINTF + char *np; + int size = 64; + + /* First allocate 'size' bytes, should be enough usually */ + if((ret = malloc(size)) == NULL) + return NULL; + + while(1) + { + va_start(ap, fmt); + n = vsnprintf(ret, size, fmt, ap); + va_end(ap); + + if(n < 0) + return NULL; + + if(n < size) + return ret; + + size = n + 1; + if((np = realloc(ret, size)) == NULL) + { + free(ret); + return NULL; + } + + ret = np; + } +#else + va_start(ap, fmt); + n = vasprintf(&ret, fmt, ap); + va_end(ap); + + if(n < 0) + return NULL; + + return ret; +#endif +} + +char *xcb_atom_name_by_screen(const char *base, uint8_t screen) +{ + return makename("%s_S%u", base, screen); +} + +char *xcb_atom_name_by_resource(const char *base, uint32_t resource) +{ + return makename("%s_R%08X", base, resource); +} + +char *xcb_atom_name_unique(const char *base, uint32_t id) +{ + if(base) + return makename("%s_U%lu", base, id); + else + return makename("U%lu", id); +} diff --git a/src/event.c b/src/event.c new file mode 100644 index 0000000..de8899a --- /dev/null +++ b/src/event.c @@ -0,0 +1,257 @@ +/* + * Copyright © 2008-2009 Julien Danjou + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or + * their institutions shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from the authors. + */ + +#include +#include +#include + +#include "xcb_event.h" + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#define ssizeof(foo) (ssize_t)sizeof(foo) +#define countof(foo) (ssizeof(foo) / ssizeof(foo[0])) + +static const char *labelError[] = +{ + "Success", + "BadRequest", + "BadValue", + "BadWindow", + "BadPixmap", + "BadAtom", + "BadCursor", + "BadFont", + "BadMatch", + "BadDrawable", + "BadAccess", + "BadAlloc", + "BadColor", + "BadGC", + "BadIDChoice", + "BadName", + "BadLength", + "BadImplementation", +}; + +static const char *labelRequest[] = +{ + "no request", + "CreateWindow", + "ChangeWindowAttributes", + "GetWindowAttributes", + "DestroyWindow", + "DestroySubwindows", + "ChangeSaveSet", + "ReparentWindow", + "MapWindow", + "MapSubwindows", + "UnmapWindow", + "UnmapSubwindows", + "ConfigureWindow", + "CirculateWindow", + "GetGeometry", + "QueryTree", + "InternAtom", + "GetAtomName", + "ChangeProperty", + "DeleteProperty", + "GetProperty", + "ListProperties", + "SetSelectionOwner", + "GetSelectionOwner", + "ConvertSelection", + "SendEvent", + "GrabPointer", + "UngrabPointer", + "GrabButton", + "UngrabButton", + "ChangeActivePointerGrab", + "GrabKeyboard", + "UngrabKeyboard", + "GrabKey", + "UngrabKey", + "AllowEvents", + "GrabServer", + "UngrabServer", + "QueryPointer", + "GetMotionEvents", + "TranslateCoords", + "WarpPointer", + "SetInputFocus", + "GetInputFocus", + "QueryKeymap", + "OpenFont", + "CloseFont", + "QueryFont", + "QueryTextExtents", + "ListFonts", + "ListFontsWithInfo", + "SetFontPath", + "GetFontPath", + "CreatePixmap", + "FreePixmap", + "CreateGC", + "ChangeGC", + "CopyGC", + "SetDashes", + "SetClipRectangles", + "FreeGC", + "ClearArea", + "CopyArea", + "CopyPlane", + "PolyPoint", + "PolyLine", + "PolySegment", + "PolyRectangle", + "PolyArc", + "FillPoly", + "PolyFillRectangle", + "PolyFillArc", + "PutImage", + "GetImage", + "PolyText", + "PolyText", + "ImageText", + "ImageText", + "CreateColormap", + "FreeColormap", + "CopyColormapAndFree", + "InstallColormap", + "UninstallColormap", + "ListInstalledColormaps", + "AllocColor", + "AllocNamedColor", + "AllocColorCells", + "AllocColorPlanes", + "FreeColors", + "StoreColors", + "StoreNamedColor", + "QueryColors", + "LookupColor", + "CreateCursor", + "CreateGlyphCursor", + "FreeCursor", + "RecolorCursor", + "QueryBestSize", + "QueryExtension", + "ListExtensions", + "ChangeKeyboardMapping", + "GetKeyboardMapping", + "ChangeKeyboardControl", + "GetKeyboardControl", + "Bell", + "ChangePointerControl", + "GetPointerControl", + "SetScreenSaver", + "GetScreenSaver", + "ChangeHosts", + "ListHosts", + "SetAccessControl", + "SetCloseDownMode", + "KillClient", + "RotateProperties", + "ForceScreenSaver", + "SetPointerMapping", + "GetPointerMapping", + "SetModifierMapping", + "GetModifierMapping", + "major 120", + "major 121", + "major 122", + "major 123", + "major 124", + "major 125", + "major 126", + "NoOperation", +}; + +static const char *labelEvent[] = +{ + "error", + "reply", + "KeyPress", + "KeyRelease", + "ButtonPress", + "ButtonRelease", + "MotionNotify", + "EnterNotify", + "LeaveNotify", + "FocusIn", + "FocusOut", + "KeymapNotify", + "Expose", + "GraphicsExpose", + "NoExpose", + "VisibilityNotify", + "CreateNotify", + "DestroyNotify", + "UnmapNotify", + "MapNotify", + "MapRequest", + "ReparentNotify", + "ConfigureNotify", + "ConfigureRequest", + "GravityNotify", + "ResizeRequest", + "CirculateNotify", + "CirculateRequest", + "PropertyNotify", + "SelectionClear", + "SelectionRequest", + "SelectionNotify", + "ColormapNotify", + "ClientMessage", + "MappingNotify", +}; + +const char * +xcb_event_get_label(uint8_t type) +{ + if(type < countof(labelEvent)) + return labelEvent[type]; + return NULL; +} + +const char * +xcb_event_get_error_label(uint8_t type) +{ + if(type < countof(labelError)) + return labelError[type]; + return NULL; +} + +const char * +xcb_event_get_request_label(uint8_t type) +{ + if(type < countof(labelRequest)) + return labelRequest[type]; + return NULL; +} diff --git a/src/xcb_atom.h b/src/xcb_atom.h new file mode 100644 index 0000000..27449bd --- /dev/null +++ b/src/xcb_atom.h @@ -0,0 +1,21 @@ +#ifndef __XCB_ATOM_H__ +#define __XCB_ATOM_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name); +const char *xcb_atom_get_name_predefined(xcb_atom_t atom); + +char *xcb_atom_name_by_screen(const char *base, uint8_t screen); +char *xcb_atom_name_by_resource(const char *base, uint32_t resource); +char *xcb_atom_name_unique(const char *base, uint32_t id); + +#ifdef __cplusplus +} +#endif + +#endif /* __XCB_ATOM_H__ */ diff --git a/src/xcb_atom.h.m4 b/src/xcb_atom.h.m4 new file mode 100644 index 0000000..27449bd --- /dev/null +++ b/src/xcb_atom.h.m4 @@ -0,0 +1,21 @@ +#ifndef __XCB_ATOM_H__ +#define __XCB_ATOM_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name); +const char *xcb_atom_get_name_predefined(xcb_atom_t atom); + +char *xcb_atom_name_by_screen(const char *base, uint8_t screen); +char *xcb_atom_name_by_resource(const char *base, uint32_t resource); +char *xcb_atom_name_unique(const char *base, uint32_t id); + +#ifdef __cplusplus +} +#endif + +#endif /* __XCB_ATOM_H__ */ diff --git a/src/xcb_aux.c b/src/xcb_aux.c new file mode 100644 index 0000000..c810398 --- /dev/null +++ b/src/xcb_aux.c @@ -0,0 +1,374 @@ +/* + * Copyright © 2008 Bart Massey + * Copyright © 2008 Ian Osgood + * Copyright © 2008 Jamey Sharp + * Copyright © 2008 Josh Triplett + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or + * their institutions shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from the authors. + */ + +#include +#include +#include + +#include +#include "xcb_aux.h" + +/* Connection related functions */ + +uint8_t +xcb_aux_get_depth (xcb_connection_t *c, + xcb_screen_t *screen) +{ + xcb_drawable_t drawable; + xcb_get_geometry_reply_t *geom; + int depth = 0; + + drawable = screen->root; + geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0); + + if (geom) { + depth = geom->depth; + free (geom); + } + + return depth; +} + +uint8_t +xcb_aux_get_depth_of_visual (xcb_screen_t *screen, + xcb_visualid_t id) +{ + xcb_depth_iterator_t i; + xcb_visualtype_iterator_t j; + for (i = xcb_screen_allowed_depths_iterator(screen); + i.rem; xcb_depth_next(&i)) + for (j = xcb_depth_visuals_iterator(i.data); + j.rem; xcb_visualtype_next(&j)) + if (j.data->visual_id == id) + return i.data->depth; + return 0; +} + +xcb_screen_t * +xcb_aux_get_screen (xcb_connection_t *c, + int screen) +{ + xcb_screen_iterator_t i = xcb_setup_roots_iterator(xcb_get_setup(c)); + for (; i.rem; --screen, xcb_screen_next(&i)) + if (screen == 0) + return i.data; + return 0; +} + +xcb_visualtype_t * +xcb_aux_get_visualtype (xcb_connection_t *c, + int scr, + xcb_visualid_t vid) +{ + xcb_screen_t *screen; + xcb_depth_t *depth; + xcb_visualtype_iterator_t iter; + int cur; + + screen = xcb_aux_get_screen (c, scr); + if (!screen) return NULL; + + depth = xcb_screen_allowed_depths_iterator(screen).data; + if (!depth) return NULL; + + iter = xcb_depth_visuals_iterator(depth); + for (cur = 0 ; cur < iter.rem ; xcb_visualtype_next(&iter), ++cur) + if (vid == iter.data->visual_id) + return iter.data; + + return NULL; +} + +xcb_visualtype_t * +xcb_aux_find_visual_by_id (xcb_screen_t *screen, + xcb_visualid_t id) +{ + xcb_depth_iterator_t i; + xcb_visualtype_iterator_t j; + for (i = xcb_screen_allowed_depths_iterator(screen); + i.rem; xcb_depth_next(&i)) + for (j = xcb_depth_visuals_iterator(i.data); + j.rem; xcb_visualtype_next(&j)) + if (j.data->visual_id == id) + return j.data; + return 0; +} + +xcb_visualtype_t * +xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, + int8_t class, + int8_t depth) +{ + xcb_depth_iterator_t i; + xcb_visualtype_iterator_t j; + for (i = xcb_screen_allowed_depths_iterator(screen); + i.rem; xcb_depth_next(&i)) { + if (depth != -1 && i.data->depth != depth) + continue; + for (j = xcb_depth_visuals_iterator(i.data); + j.rem; xcb_visualtype_next(&j)) + if (class == -1 || j.data->_class == class) + return j.data; + } + return 0; +} + +void +xcb_aux_sync (xcb_connection_t *c) +{ + free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL)); +} + +/* structs instead of value lists */ +/* TODO: generate the struct types and functions from protocol masks and descriptions */ + +/* This generic implementation of pack_list depends on: + a) structs packed to uint32_t size + b) structs consist of just uint32_t/int32_t fields in the same order as bitmask +*/ + +static void +pack_list( uint32_t mask, const uint32_t *src, uint32_t *dest ) +{ + for ( ; mask; mask >>= 1, src++) + if (mask & 1) + *dest++ = *src; +} + +xcb_void_cookie_t +xcb_aux_create_window (xcb_connection_t *c, + uint8_t depth, + xcb_window_t wid, + xcb_window_t parent, + int16_t x, + int16_t y, + uint16_t width, + uint16_t height, + uint16_t border_width, + uint16_t _class, + xcb_visualid_t visual, + uint32_t mask, + const xcb_params_cw_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_create_window(c, depth, wid, parent, + x, y, width, height, border_width, + _class, visual, mask, value_list); +} + +xcb_void_cookie_t +xcb_aux_create_window_checked (xcb_connection_t *c, + uint8_t depth, + xcb_window_t wid, + xcb_window_t parent, + int16_t x, + int16_t y, + uint16_t width, + uint16_t height, + uint16_t border_width, + uint16_t _class, + xcb_visualid_t visual, + uint32_t mask, + const xcb_params_cw_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_create_window_checked(c, depth, wid, parent, + x, y, width, height, border_width, + _class, visual, mask, value_list); +} + +xcb_void_cookie_t +xcb_aux_change_window_attributes_checked (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_window_attributes_checked( c, window, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_change_window_attributes (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_window_attributes( c, window, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_configure_window (xcb_connection_t *c, + xcb_window_t window, + uint16_t mask, + const xcb_params_configure_window_t *params) +{ + uint32_t value_list[8]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_configure_window( c, window, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_create_gc (xcb_connection_t *c, + xcb_gcontext_t gid, + xcb_drawable_t drawable, + uint32_t mask, + const xcb_params_gc_t *params) +{ + uint32_t value_list[32]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_create_gc( c, gid, drawable, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_create_gc_checked (xcb_connection_t *c, + xcb_gcontext_t gid, + xcb_drawable_t drawable, + uint32_t mask, + const xcb_params_gc_t *params) +{ + uint32_t value_list[32]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_create_gc_checked( c, gid, drawable, mask, value_list); +} + +xcb_void_cookie_t +xcb_aux_change_gc (xcb_connection_t *c, + xcb_gcontext_t gc, + uint32_t mask, + const xcb_params_gc_t *params) +{ + uint32_t value_list[32]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_gc( c, gc, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_change_gc_checked (xcb_connection_t *c, + xcb_gcontext_t gc, + uint32_t mask, + const xcb_params_gc_t *params) +{ + uint32_t value_list[32]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_gc_checked( c, gc, mask, value_list ); +} + +xcb_void_cookie_t +xcb_aux_change_keyboard_control (xcb_connection_t *c, + uint32_t mask, + const xcb_params_keyboard_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_keyboard_control( c, mask, value_list ); +} + +/* Color related functions */ + +/* Return true if the given color name can be translated locally, + in which case load the components. Otherwise, a lookup_color request + will be needed, so return false. */ +int +xcb_aux_parse_color(char *color_name, + uint16_t *red, uint16_t *green, uint16_t *blue) +{ + int n, r, g, b, i; + if (!color_name || *color_name != '#') + return 0; + /* + * Excitingly weird RGB parsing code from Xlib. + */ + n = strlen (color_name); + color_name++; + n--; + if (n != 3 && n != 6 && n != 9 && n != 12) + return 0; + n /= 3; + g = b = 0; + do { + r = g; + g = b; + b = 0; + for (i = n; --i >= 0; ) { + char c = *color_name++; + b <<= 4; + if (c >= '0' && c <= '9') + b |= c - '0'; + else if (c >= 'A' && c <= 'F') + b |= c - ('A' - 10); + else if (c >= 'a' && c <= 'f') + b |= c - ('a' - 10); + else return 0; + } + } while (*color_name != '\0'); + n <<= 2; + n = 16 - n; + *red = r << n; + *green = g << n; + *blue = b << n; + return 1; +} + +/* Drawing related functions */ + +/* Adapted from Xlib */ +xcb_void_cookie_t +xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, + xcb_gcontext_t gc, + uint16_t linewidth, + int32_t linestyle, + int32_t capstyle, + int32_t joinstyle) +{ + uint32_t mask = 0; + xcb_params_gc_t gv; + + XCB_AUX_ADD_PARAM(&mask, &gv, line_width, linewidth); + XCB_AUX_ADD_PARAM(&mask, &gv, line_style, linestyle); + XCB_AUX_ADD_PARAM(&mask, &gv, cap_style, capstyle); + XCB_AUX_ADD_PARAM(&mask, &gv, join_style, joinstyle); + return xcb_aux_change_gc_checked(dpy, gc, mask, &gv); +} + +/* Adapted from Xlib */ +/* XXX It would be wiser for apps just to call + clear_area() directly. */ +xcb_void_cookie_t +xcb_aux_clear_window(xcb_connection_t * dpy, + xcb_window_t w) +{ + return xcb_clear_area(dpy, 0, w, 0, 0, 0, 0); +} diff --git a/src/xcb_aux.h b/src/xcb_aux.h new file mode 100644 index 0000000..d49d438 --- /dev/null +++ b/src/xcb_aux.h @@ -0,0 +1,214 @@ +#ifndef __XCB_AUX_H__ +#define __XCB_AUX_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + + +uint8_t xcb_aux_get_depth (xcb_connection_t *c, + xcb_screen_t *screen); + +uint8_t xcb_aux_get_depth_of_visual (xcb_screen_t *screen, + xcb_visualid_t id); + +xcb_screen_t *xcb_aux_get_screen (xcb_connection_t *c, + int screen); + +xcb_visualtype_t *xcb_aux_get_visualtype (xcb_connection_t *c, + int screen, + xcb_visualid_t vid); + +xcb_visualtype_t * +xcb_aux_find_visual_by_id (xcb_screen_t *screen, + xcb_visualid_t id); + +xcb_visualtype_t * +xcb_aux_find_visual_by_attrs (xcb_screen_t *screen, + int8_t class_, + int8_t depth); + +void xcb_aux_sync (xcb_connection_t *c); + +/* internal helper macro for XCB_AUX_ADD_PARAM +It gives the offset of the field 'param' in the structure pointed to by +'paramsp' in multiples of an uint32_t's size. */ +#define XCB_AUX_INTERNAL_OFFSETOF(paramsp, param) \ + ((uint32_t const*)(&((paramsp)->param))-(uint32_t const*)(paramsp)) + +/* add an optional parameter to an xcb_params_* structure +parameters: + maskp: pointer to bitmask whos bits mark used parameters + paramsp: pointer to structure with parameters + param: parameter to set + value: value to set the parameter to +*/ +#define XCB_AUX_ADD_PARAM(maskp, paramsp, param, value) \ + ((*(maskp)|=1<param=(value))) + +typedef struct { + uint32_t back_pixmap; + uint32_t back_pixel; + uint32_t border_pixmap; + uint32_t border_pixel; + uint32_t bit_gravity; + uint32_t win_gravity; + uint32_t backing_store; + uint32_t backing_planes; + uint32_t backing_pixel; + uint32_t override_redirect; + uint32_t save_under; + uint32_t event_mask; + uint32_t dont_propagate; + uint32_t colormap; + uint32_t cursor; +} xcb_params_cw_t; + +xcb_void_cookie_t +xcb_aux_create_window (xcb_connection_t *c, + uint8_t depth, + xcb_window_t wid, + xcb_window_t parent, + int16_t x, + int16_t y, + uint16_t width, + uint16_t height, + uint16_t border_width, + uint16_t class_, + xcb_visualid_t visual, + uint32_t mask, + const xcb_params_cw_t *params); + +xcb_void_cookie_t +xcb_aux_create_window_checked (xcb_connection_t *c, + uint8_t depth, + xcb_window_t wid, + xcb_window_t parent, + int16_t x, + int16_t y, + uint16_t width, + uint16_t height, + uint16_t border_width, + uint16_t class_, + xcb_visualid_t visual, + uint32_t mask, + const xcb_params_cw_t *params); + +xcb_void_cookie_t +xcb_aux_change_window_attributes (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params); + +xcb_void_cookie_t +xcb_aux_change_window_attributes_checked (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params); + +typedef struct { + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + uint32_t border_width; + uint32_t sibling; + uint32_t stack_mode; +} xcb_params_configure_window_t; + +xcb_void_cookie_t +xcb_aux_configure_window (xcb_connection_t *c, + xcb_window_t window, + uint16_t mask, + const xcb_params_configure_window_t *params); + +typedef struct { + uint32_t function; + uint32_t plane_mask; + uint32_t foreground; + uint32_t background; + uint32_t line_width; + uint32_t line_style; + uint32_t cap_style; + uint32_t join_style; + uint32_t fill_style; + uint32_t fill_rule; + uint32_t tile; + uint32_t stipple; + uint32_t tile_stipple_origin_x; + uint32_t tile_stipple_origin_y; + uint32_t font; + uint32_t subwindow_mode; + uint32_t graphics_exposures; + uint32_t clip_originX; + uint32_t clip_originY; + uint32_t mask; + uint32_t dash_offset; + uint32_t dash_list; + uint32_t arc_mode; +} xcb_params_gc_t; + +xcb_void_cookie_t +xcb_aux_create_gc (xcb_connection_t *c, + xcb_gcontext_t cid, + xcb_drawable_t drawable, + uint32_t mask, + const xcb_params_gc_t *params); + +xcb_void_cookie_t +xcb_aux_create_gc_checked (xcb_connection_t *c, + xcb_gcontext_t gid, + xcb_drawable_t drawable, + uint32_t mask, + const xcb_params_gc_t *params); +xcb_void_cookie_t +xcb_aux_change_gc (xcb_connection_t *c, + xcb_gcontext_t gc, + uint32_t mask, + const xcb_params_gc_t *params); + +xcb_void_cookie_t +xcb_aux_change_gc_checked (xcb_connection_t *c, + xcb_gcontext_t gc, + uint32_t mask, + const xcb_params_gc_t *params); +typedef struct { + uint32_t key_click_percent; + uint32_t bell_percent; + uint32_t bell_pitch; + uint32_t bell_duration; + uint32_t led; + uint32_t led_mode; + uint32_t key; + uint32_t auto_repeat_mode; +} xcb_params_keyboard_t; + +xcb_void_cookie_t +xcb_aux_change_keyboard_control (xcb_connection_t *c, + uint32_t mask, + const xcb_params_keyboard_t *params); + +int +xcb_aux_parse_color(char *color_name, + uint16_t *red, uint16_t *green, uint16_t *blue); + +xcb_void_cookie_t +xcb_aux_set_line_attributes_checked (xcb_connection_t *dpy, + xcb_gcontext_t gc, + uint16_t linewidth, + int32_t linestyle, + int32_t capstyle, + int32_t joinstyle); + +xcb_void_cookie_t +xcb_aux_clear_window(xcb_connection_t * dpy, + xcb_window_t w); + +#ifdef __cplusplus +} +#endif + + +#endif /* __XCB_AUX_H__ */ diff --git a/src/xcb_bitops.h b/src/xcb_bitops.h new file mode 100644 index 0000000..a6872a1 --- /dev/null +++ b/src/xcb_bitops.h @@ -0,0 +1,212 @@ +#ifndef __XCB_BITOPS_H__ +#define __XCB_BITOPS_H__ + +/* Copyright (C) 2007 Bart Massey + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or their + * institutions shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the authors. + */ + +#include +#include +#include + +/** + * @defgroup xcb__bitops XCB Bit Operations + * + * Inline functions for common bit ops used in XCB and elsewhere. + * + * @{ + */ + + +/** + * Create a low-order bitmask. + * @param n Mask size. + * @return Mask. + * + * Create a bitmask with the lower @p n bits set and the + * rest of the word clear. + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_mask(uint32_t n) +{ + return n == 32 ? ~0 : (1 << n) - 1; +} + + +/** + * Population count. + * @param n Integer representing a bitset. + * @return Number of 1 bits in the bitset. + * + * This is a reasonably fast algorithm for counting the bits + * in a 32-bit word. Currently a classic binary + * divide-and-conquer popcount: popcount_2() from + * http://en.wikipedia.org/wiki/Hamming_weight. + * @ingroup xcb__bitops + */ + + +/* 15 ops, 3 long immediates, 14 stages, 9 alu ops, 9 alu stages */ +_X_INLINE static uint32_t +xcb_popcount(uint32_t x) +{ + uint32_t m1 = 0x55555555; + uint32_t m2 = 0x33333333; + uint32_t m4 = 0x0f0f0f0f; + x -= (x >> 1) & m1; + x = (x & m2) + ((x >> 2) & m2); + x = (x + (x >> 4)) & m4; + x += x >> 8; + return (x + (x >> 16)) & 0x3f; +} + + +/** + * Round up to the next power-of-two unit size. + * @param base Number to be rounded up. + * @param pad Multiple to be rounded to; must be a power of two. + * @return Rounded-up number. + * + * Rounds @p base up to a multiple of @p pad, where @p pad + * is a power of two. The more general case is handled by + * xcb_roundup(). + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_roundup_2 (uint32_t base, uint32_t pad) +{ + return (base + pad - 1) & -pad; +} + +/** + * Round down to the next power-of-two unit size. + * @param base Number to be rounded down. + * @param pad Multiple to be rounded to; must be a power of two. + * @return Rounded-down number. + * + * Rounds @p base down to a multiple of @p pad, where @p pad + * is a power of two. The more general case is handled by + * xcb_rounddown(). + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_rounddown_2 (uint32_t base, uint32_t pad) +{ + return base & -pad; +} + +/** + * Round up to the next unit size. + * @param base Number to be rounded up. + * @param pad Multiple to be rounded to. + * @return Rounded-up number. + * + * This is a general routine for rounding @p base up + * to a multiple of @p pad. If you know that @p pad + * is a power of two, you should probably call xcb_roundup_2() + * instead. + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_roundup (uint32_t base, uint32_t pad) +{ + uint32_t b = base + pad - 1; + /* faster if pad is a power of two */ + if (((pad - 1) & pad) == 0) + return b & -pad; + return b - b % pad; +} + + +/** + * Round down to the next unit size. + * @param base Number to be rounded down. + * @param pad Multiple to be rounded to. + * @return Rounded-down number. + * + * This is a general routine for rounding @p base down + * to a multiple of @p pad. If you know that @p pad + * is a power of two, you should probably call xcb_rounddown_2() + * instead. + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_rounddown (uint32_t base, uint32_t pad) +{ + /* faster if pad is a power of two */ + if (((pad - 1) & pad) == 0) + return base & -pad; + return base - base % pad; +} + + +/** + * Reverse bits of word. + * @param x Target word. + * @param n Number of low-order bits to reverse. + * @return Word with low @p n bits reversed, all others 0. + * + * Reverses the bottom @p n bits of @p x. + * @ingroup xcb__bitops + */ +_X_INLINE static uint32_t +xcb_bit_reverse(uint32_t x, uint8_t n) { + uint32_t m1 = 0x00ff00ff; + uint32_t m2 = 0x0f0f0f0f; + uint32_t m3 = 0x33333333; + uint32_t m4 = 0x55555555; + x = ((x << 16) | (x >> 16)); + x = ((x & m1) << 8) | ((x >> 8) & m1); + x = ((x & m2) << 4) | ((x >> 4) & m2); + x = ((x & m3) << 2) | ((x >> 2) & m3); + x = ((x & m4) << 1) | ((x >> 1) & m4); + x >>= 32 - n; + return x; +} + + +/** + * Host byte order. + * @return The byte order of the host. + * + * Tests the host's byte order and returns either + * XCB_IMAGE_ORDER_MSB_FIRST or XCB_IMAGE_ORDER_LSB_FIRST + * as appropriate. + * @ingroup xcb__bitops + */ +_X_INLINE static xcb_image_order_t +xcb_host_byte_order(void) { + uint32_t endian_test = 0x01020304; + + switch (*(char *)&endian_test) { + case 0x01: + return XCB_IMAGE_ORDER_MSB_FIRST; + case 0x04: + return XCB_IMAGE_ORDER_LSB_FIRST; + } + assert(0); +} + +#endif /* __XCB_BITOPS_H__ */ diff --git a/src/xcb_event.h b/src/xcb_event.h new file mode 100644 index 0000000..ee911fc --- /dev/null +++ b/src/xcb_event.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008-2009 Julien Danjou + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or + * their institutions shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from the authors. + */ + +/** + * @defgroup xcb__event_t XCB Event Functions + * + * These functions ease the handling of X events received. + * + * @{ + */ + +#ifndef __XCB_EVENT_H__ +#define __XCB_EVENT_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Bit mask to find event type regardless of event source. + * + * Each event in the X11 protocol contains an 8-bit type code. + * The most-significant bit in this code is set if the event was + * generated from a SendEvent request. This mask can be used to + * determine the type of event regardless of how the event was + * generated. See the X11R6 protocol specification for details. + */ +#define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) +#define XCB_EVENT_RESPONSE_TYPE(e) (e->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) +#define XCB_EVENT_SENT(e) (e->response_type & ~XCB_EVENT_RESPONSE_TYPE_MASK) + +/** + * @brief Convert an event response type to a label. + * @param type The event type. + * @return A string with the event name, or NULL if unknown. + */ +const char * xcb_event_get_label(uint8_t type); + +/** + * @brief Convert an event error type to a label. + * @param type The error type. + * @return A string with the event name, or NULL if unknown or if the event is + * not an error. + */ +const char * xcb_event_get_error_label(uint8_t type); + +/** + * @brief Convert an event request type to a label. + * @param type The request type. + * @return A string with the event name, or NULL if unknown or if the event is + * not an error. + */ +const char * xcb_event_get_request_label(uint8_t type); + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* __XCB_EVENT_H__ */ diff --git a/src/xcb_util.h b/src/xcb_util.h new file mode 100644 index 0000000..0f06f1b --- /dev/null +++ b/src/xcb_util.h @@ -0,0 +1,8 @@ +#ifndef __XCB_UTIL_H__ +#define __XCB_UTIL_H__ + +#include +#include +#include + +#endif /* __XCB_UTIL_H__ */ diff --git a/xcb-atom.pc.in b/xcb-atom.pc.in new file mode 100644 index 0000000..fcc39e8 --- /dev/null +++ b/xcb-atom.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XCB Atom library +Description: XCB atom cache +Version: @PACKAGE_VERSION@ +Requires: xcb +Libs: -L${libdir} -lxcb-util +Cflags: -I${includedir} diff --git a/xcb-aux.pc.in b/xcb-aux.pc.in new file mode 100644 index 0000000..d049081 --- /dev/null +++ b/xcb-aux.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XCB Aux library +Description: XCB convenient functions +Version: @PACKAGE_VERSION@ +Requires: xcb +Libs: -L${libdir} -lxcb-util +Cflags: -I${includedir} diff --git a/xcb-event.pc.in b/xcb-event.pc.in new file mode 100644 index 0000000..4a7d618 --- /dev/null +++ b/xcb-event.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XCB Event library +Description: XCB event callback interface +Version: @PACKAGE_VERSION@ +Requires: xcb +Libs: -L${libdir} -lxcb-util +Cflags: -I${includedir} diff --git a/xcb-renderutil.pc.in b/xcb-renderutil.pc.in new file mode 100644 index 0000000..9875d90 --- /dev/null +++ b/xcb-renderutil.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XCB Util Core library +Description: XCB util core interface +Version: @PACKAGE_VERSION@ +Requires: xcb +Libs: -L${libdir} -lxcb-util +Cflags: -I${includedir} diff --git a/xcb-util-common.h b/xcb-util-common.h deleted file mode 100644 index a76fbb3..0000000 --- a/xcb-util-common.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Common useful header for xcb-util - * - * Copyright © 2009 Julien Danjou - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the names of the authors or - * their institutions shall not be used in advertising or otherwise to - * promote the sale, use or other dealings in this Software without - * prior written authorization from the authors. - * - */ - -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#define ssizeof(foo) (ssize_t)sizeof(foo) -#define countof(foo) (ssizeof(foo) / ssizeof(foo[0])) diff --git a/xcb-util.pc.in b/xcb-util.pc.in new file mode 100644 index 0000000..9875d90 --- /dev/null +++ b/xcb-util.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XCB Util Core library +Description: XCB util core interface +Version: @PACKAGE_VERSION@ +Requires: xcb +Libs: -L${libdir} -lxcb-util +Cflags: -I${includedir} -- cgit v1.2.3