[Xcb-commit] Branch 'debian' - 24 commits - Makefile.am NEWS README
configure.ac debian doc src tools xcb-xlib.pc.in
Jamey Sharp
jamey at kemper.freedesktop.org
Sun Oct 8 03:46:52 PDT 2006
Makefile.am | 2
NEWS | 209 ++
README | 36
configure.ac | 8
debian/changelog | 26
debian/control | 315 ++--
debian/copyright.debian | 2
debian/libxcb-composite0-dev.install | 4
debian/libxcb-damage0-dev.install | 4
debian/libxcb-dpms0-dev.install | 4
debian/libxcb-glx0-dev.install | 4
debian/libxcb-randr0-dev.install | 4
debian/libxcb-record0-dev.install | 4
debian/libxcb-render0-dev.install | 4
debian/libxcb-res0-dev.install | 4
debian/libxcb-screensaver0-dev.install | 4
debian/libxcb-shape0-dev.install | 4
debian/libxcb-shm0-dev.install | 4
debian/libxcb-sync0-dev.install | 4
debian/libxcb-xevie0-dev.install | 4
debian/libxcb-xf86dri0-dev.install | 4
debian/libxcb-xfixes0-dev.install | 4
debian/libxcb-xlib0-dev.install | 4
debian/libxcb-xlib0.install | 1
debian/libxcb-xprint0-dev.install | 4
debian/libxcb-xtest0-dev.install | 4
debian/libxcb-xv0-dev.install | 4
debian/libxcb-xvmc0-dev.install | 4
debian/libxcb0-dev.install | 9
debian/libxcb1-dev.install | 8
debian/libxcbcomposite0-dev.install | 4
debian/libxcbdamage0-dev.install | 4
debian/libxcbdpms0-dev.install | 4
debian/libxcbglx0-dev.install | 4
debian/libxcbrandr0-dev.install | 4
debian/libxcbrecord0-dev.install | 4
debian/libxcbrender0-dev.install | 4
debian/libxcbres0-dev.install | 4
debian/libxcbscreensaver0-dev.install | 4
debian/libxcbshape0-dev.install | 4
debian/libxcbshm0-dev.install | 4
debian/libxcbsync0-dev.install | 4
debian/libxcbxevie0-dev.install | 4
debian/libxcbxf86dri0-dev.install | 4
debian/libxcbxfixes0-dev.install | 4
debian/libxcbxprint0-dev.install | 4
debian/libxcbxtest0-dev.install | 4
debian/libxcbxv0-dev.install | 4
debian/libxcbxvmc0-dev.install | 4
debian/rules | 22
debian/watch | 2
doc/tutorial/index.html | 2448 ++++++++++++++++-----------------
doc/tutorial/xcb.css | 20
src/.gitignore | 26
src/Makefile.am | 188 +-
src/c-client.xsl | 25
src/xcb.h | 21
src/xcb_conn.c | 38
src/xcb_in.c | 44
src/xcb_out.c | 10
src/xcb_xid.c | 2
src/xcb_xlib.c | 22
src/xcbext.h | 5
src/xcbint.h | 16
src/xcbxlib.h | 6
tools/api_conv.pl | 4
xcb-xlib.pc.in | 11
67 files changed, 2080 insertions(+), 1602 deletions(-)
New commits:
diff-tree 2184891ca53f6c14cd0545a8ed3f6baaa6539a3f (from 5d7d548d05c28594fecb53894e5c386ed771eb89)
Author: Jamey Sharp <jamey at minilop.net>
Date: Sun Oct 8 03:29:47 2006 -0700
Update Debian packaging for 1.0 RC2 release.
* New upstream version.
[ Josh Triplett ]
* No longer installs files to /usr/include/X11, so remove Pre-Depends on
x11-common.
* Update to Standards-Version 3.7.2 (no changes required).
* Point specifically to http://xcb.freedesktop.org/dist in copyright file,
rather than http://xcb.freedesktop.org .
* Add debian/watch file.
* Install pkgconfig files to /usr/share/pkgconfig.
* Version Build-Depends on xcb-proto as (>= 0.9.92)
* Change libxcb0{,-dev,-dbg} to libxcb1{,-dev,-dbg} to match soname bump, and
update Depends of other library -dev packages.
* Add debian/control stanzas and debhelper install files for new library
libxcb-xlib0.
* Change libxcb${ext}0{,-dev,-dbg} to libxcb-${ext}0{,-dev,-dbg}, to match
the sonames of the libraries.
* cdbs >= 0.4.40 now builds -dbg packages for each library package, without
requiring DEB_DBG_PACKAGE_libxcb* for each one. Remove assignments to
these variables in debian/rules, and version cdbs Build-Depends accordingly.
* Change -dbg package priorities from optional to extra.
Authors: Josh Triplett <josh at freedesktop.org>, Jamey Sharp <jamey at minilop.net>
diff --git a/debian/changelog b/debian/changelog
index ffad141..709e8ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,29 @@
+libxcb (0.9.92-1) experimental; urgency=low
+
+ * New upstream version.
+
+ [ Josh Triplett ]
+ * No longer installs files to /usr/include/X11, so remove Pre-Depends on
+ x11-common.
+ * Update to Standards-Version 3.7.2 (no changes required).
+ * Point specifically to http://xcb.freedesktop.org/dist in copyright file,
+ rather than http://xcb.freedesktop.org .
+ * Add debian/watch file.
+ * Install pkgconfig files to /usr/share/pkgconfig.
+ * Version Build-Depends on xcb-proto as (>= 0.9.92)
+ * Change libxcb0{,-dev,-dbg} to libxcb1{,-dev,-dbg} to match soname bump, and
+ update Depends of other library -dev packages.
+ * Add debian/control stanzas and debhelper install files for new library
+ libxcb-xlib0.
+ * Change libxcb${ext}0{,-dev,-dbg} to libxcb-${ext}0{,-dev,-dbg}, to match
+ the sonames of the libraries.
+ * cdbs >= 0.4.40 now builds -dbg packages for each library package, without
+ requiring DEB_DBG_PACKAGE_libxcb* for each one. Remove assignments to
+ these variables in debian/rules, and version cdbs Build-Depends accordingly.
+ * Change -dbg package priorities from optional to extra.
+
+ -- Jamey Sharp <sharpone at debian.org> Sun, 08 Oct 2006 01:19:28 -0700
+
libxcb (0.9-3) experimental; urgency=low
* Stop running autoreconf in debian/rules, and remove Build-Depends for
diff --git a/debian/control b/debian/control
index b22ceef..05b451d 100644
--- a/debian/control
+++ b/debian/control
@@ -3,10 +3,10 @@ Priority: optional
Section: libdevel
Maintainer: XCB Developers <xcb at lists.freedesktop.org>
Uploaders: Jamey Sharp <sharpone at debian.org>, Josh Triplett <josh at freedesktop.org>
-Build-Depends: libxau-dev, libxdmcp-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9)
-Standards-Version: 3.6.1
+Build-Depends: libxau-dev, libxdmcp-dev, xcb-proto (>= 0.9.92), cdbs (>= 0.4.40), debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9)
+Standards-Version: 3.7.2
-Package: libxcb0
+Package: libxcb1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -27,11 +27,10 @@ Description: X C Binding
.
Homepage: http://xcb.freedesktop.org
-Package: libxcb0-dev
+Package: libxcb1-dev
Section: libdevel
Architecture: any
-Depends: libxcb0 (= ${Source-Version})
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb1 (= ${Source-Version})
Description: X C Binding, development files
This package contains the header and library files needed to build software
using libxcb, the X C Binding.
@@ -49,10 +48,11 @@ Description: X C Binding, development fi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcb0-dbg
+Package: libxcb1-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcb0 (= ${Source-Version})
+Depends: libxcb1 (= ${Source-Version})
Description: X C Binding, debugging symbols
This package contains the debugging symbols associated with libxcb, the X C
Binding. gdb will automatically use these symbols when debugging libxcb.
@@ -70,7 +70,78 @@ Description: X C Binding, debugging symb
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbcomposite0
+Package: libxcb-xlib0
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: X C Binding, Xlib/XCB interface library
+ This package contains the library files needed to run software using
+ libxcb-xlib, the Xlib/XCB interface for the X C Binding. libxcb-xlib contains
+ portions of XCB used only by the Xlib/XCB compatibility layer; nothing other
+ than Xlib should ever link to it.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+ .
+ Homepage: http://xcb.freedesktop.org
+
+Package: libxcb-xlib0-dev
+Section: libdevel
+Architecture: any
+Depends: libxcb-xlib0 (= ${Source-Version}), libxcb1-dev
+Description: X C Binding, Xlib/XCB interface library, development files
+ This package contains the header and library files needed to build software
+ using libxcb-xlib, the Xlib/XCB interface for the X C Binding. libxcb-xlib
+ contains portions of XCB used only by the Xlib/XCB compatibility layer;
+ nothing other than Xlib should ever link to it.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+ .
+ Homepage: http://xcb.freedesktop.org
+
+Package: libxcb-xlib0-dbg
+Priority: extra
+Section: libdevel
+Architecture: any
+Depends: libxcb-xlib0 (= ${Source-Version})
+Description: X C Binding, Xlib/XCB interface library, debugging symbols
+ This package contains the debugging symbols associated with libxcb-xlib, the
+ Xlib/XCB interface for the X C Binding. gdb will automatically use these
+ symbols when debugging libxcb-xlib. libxcb-xlib contains portions of XCB used
+ only by the Xlib/XCB compatibility layer; nothing other than Xlib should ever
+ link to it.
+ .
+ The XCB library provides an interface to the X Window System protocol,
+ designed to replace the Xlib interface. XCB provides several advantages over
+ Xlib:
+ .
+ * Size: small library and lower memory footprint
+ * Latency hiding: batch several requests and wait for the replies later
+ * Direct protocol access: one-to-one mapping between interface and protocol
+ * Thread support: access XCB from multiple threads, with no explicit locking
+ * Easy creation of new extensions: automatically generates interface from
+ machine-parsable protocol descriptions
+ .
+ Homepage: http://xcb.freedesktop.org
+
+Package: libxcb-composite0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -91,11 +162,10 @@ Description: X C Binding, composite exte
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbcomposite0-dev
+Package: libxcb-composite0-dev
Section: libdevel
Architecture: any
-Depends: libxcbcomposite0 (= ${Source-Version}), libxcb0-dev, libxcbxfixes0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-composite0 (= ${Source-Version}), libxcb1-dev, libxcb-xfixes0-dev
Description: X C Binding, composite extension, development files
This package contains the header and library files needed to build software
using libxcb-composite, the composite extension for the X C Binding.
@@ -113,10 +183,11 @@ Description: X C Binding, composite exte
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbcomposite0-dbg
+Package: libxcb-composite0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbcomposite0 (= ${Source-Version})
+Depends: libxcb-composite0 (= ${Source-Version})
Description: X C Binding, composite extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-composite, the composite extension for the X C Binding. gdb will
@@ -135,7 +206,7 @@ Description: X C Binding, composite exte
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdamage0
+Package: libxcb-damage0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -156,11 +227,10 @@ Description: X C Binding, damage extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdamage0-dev
+Package: libxcb-damage0-dev
Section: libdevel
Architecture: any
-Depends: libxcbdamage0 (= ${Source-Version}), libxcb0-dev, libxcbxfixes0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-damage0 (= ${Source-Version}), libxcb1-dev, libxcb-xfixes0-dev
Description: X C Binding, damage extension, development files
This package contains the header and library files needed to build software
using libxcb-damage, the damage extension for the X C Binding.
@@ -178,10 +248,11 @@ Description: X C Binding, damage extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdamage0-dbg
+Package: libxcb-damage0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbdamage0 (= ${Source-Version})
+Depends: libxcb-damage0 (= ${Source-Version})
Description: X C Binding, damage extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-damage, the damage extension for the X C Binding. gdb will
@@ -200,7 +271,7 @@ Description: X C Binding, damage extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdpms0
+Package: libxcb-dpms0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -221,11 +292,10 @@ Description: X C Binding, dpms extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdpms0-dev
+Package: libxcb-dpms0-dev
Section: libdevel
Architecture: any
-Depends: libxcbdpms0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-dpms0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, dpms extension, development files
This package contains the header and library files needed to build software
using libxcb-dpms, the dpms extension for the X C Binding.
@@ -243,10 +313,11 @@ Description: X C Binding, dpms extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbdpms0-dbg
+Package: libxcb-dpms0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbdpms0 (= ${Source-Version})
+Depends: libxcb-dpms0 (= ${Source-Version})
Description: X C Binding, dpms extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-dpms, the dpms extension for the X C Binding. gdb will
@@ -265,7 +336,7 @@ Description: X C Binding, dpms extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbglx0
+Package: libxcb-glx0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -286,11 +357,10 @@ Description: X C Binding, glx extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbglx0-dev
+Package: libxcb-glx0-dev
Section: libdevel
Architecture: any
-Depends: libxcbglx0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-glx0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, glx extension, development files
This package contains the header and library files needed to build software
using libxcb-glx, the glx extension for the X C Binding.
@@ -308,10 +378,11 @@ Description: X C Binding, glx extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbglx0-dbg
+Package: libxcb-glx0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbglx0 (= ${Source-Version})
+Depends: libxcb-glx0 (= ${Source-Version})
Description: X C Binding, glx extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-glx, the glx extension for the X C Binding. gdb will
@@ -330,7 +401,7 @@ Description: X C Binding, glx extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrandr0
+Package: libxcb-randr0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -351,11 +422,10 @@ Description: X C Binding, randr extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrandr0-dev
+Package: libxcb-randr0-dev
Section: libdevel
Architecture: any
-Depends: libxcbrandr0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-randr0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, randr extension, development files
This package contains the header and library files needed to build software
using libxcb-randr, the randr extension for the X C Binding.
@@ -373,10 +443,11 @@ Description: X C Binding, randr extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrandr0-dbg
+Package: libxcb-randr0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbrandr0 (= ${Source-Version})
+Depends: libxcb-randr0 (= ${Source-Version})
Description: X C Binding, randr extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-randr, the randr extension for the X C Binding. gdb will
@@ -395,7 +466,7 @@ Description: X C Binding, randr extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrecord0
+Package: libxcb-record0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -416,11 +487,10 @@ Description: X C Binding, record extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrecord0-dev
+Package: libxcb-record0-dev
Section: libdevel
Architecture: any
-Depends: libxcbrecord0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-record0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, record extension, development files
This package contains the header and library files needed to build software
using libxcb-record, the record extension for the X C Binding.
@@ -438,10 +508,11 @@ Description: X C Binding, record extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrecord0-dbg
+Package: libxcb-record0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbrecord0 (= ${Source-Version})
+Depends: libxcb-record0 (= ${Source-Version})
Description: X C Binding, record extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-record, the record extension for the X C Binding. gdb will
@@ -460,7 +531,7 @@ Description: X C Binding, record extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrender0
+Package: libxcb-render0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -481,11 +552,10 @@ Description: X C Binding, render extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrender0-dev
+Package: libxcb-render0-dev
Section: libdevel
Architecture: any
-Depends: libxcbrender0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-render0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, render extension, development files
This package contains the header and library files needed to build software
using libxcb-render, the render extension for the X C Binding.
@@ -503,10 +573,11 @@ Description: X C Binding, render extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbrender0-dbg
+Package: libxcb-render0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbrender0 (= ${Source-Version})
+Depends: libxcb-render0 (= ${Source-Version})
Description: X C Binding, render extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-render, the render extension for the X C Binding. gdb will
@@ -525,7 +596,7 @@ Description: X C Binding, render extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbres0
+Package: libxcb-res0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -546,11 +617,10 @@ Description: X C Binding, res extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbres0-dev
+Package: libxcb-res0-dev
Section: libdevel
Architecture: any
-Depends: libxcbres0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-res0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, res extension, development files
This package contains the header and library files needed to build software
using libxcb-res, the res extension for the X C Binding.
@@ -568,10 +638,11 @@ Description: X C Binding, res extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbres0-dbg
+Package: libxcb-res0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbres0 (= ${Source-Version})
+Depends: libxcb-res0 (= ${Source-Version})
Description: X C Binding, res extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-res, the res extension for the X C Binding. gdb will
@@ -590,7 +661,7 @@ Description: X C Binding, res extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbscreensaver0
+Package: libxcb-screensaver0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -611,11 +682,10 @@ Description: X C Binding, screensaver ex
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbscreensaver0-dev
+Package: libxcb-screensaver0-dev
Section: libdevel
Architecture: any
-Depends: libxcbscreensaver0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-screensaver0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, screensaver extension, development files
This package contains the header and library files needed to build software
using libxcb-screensaver, the screensaver extension for the X C Binding.
@@ -633,10 +703,11 @@ Description: X C Binding, screensaver ex
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbscreensaver0-dbg
+Package: libxcb-screensaver0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbscreensaver0 (= ${Source-Version})
+Depends: libxcb-screensaver0 (= ${Source-Version})
Description: X C Binding, screensaver extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-screensaver, the screensaver extension for the X C Binding. gdb will
@@ -655,7 +726,7 @@ Description: X C Binding, screensaver ex
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshape0
+Package: libxcb-shape0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -676,11 +747,10 @@ Description: X C Binding, shape extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshape0-dev
+Package: libxcb-shape0-dev
Section: libdevel
Architecture: any
-Depends: libxcbshape0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-shape0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, shape extension, development files
This package contains the header and library files needed to build software
using libxcb-shape, the shape extension for the X C Binding.
@@ -698,10 +768,11 @@ Description: X C Binding, shape extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshape0-dbg
+Package: libxcb-shape0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbshape0 (= ${Source-Version})
+Depends: libxcb-shape0 (= ${Source-Version})
Description: X C Binding, shape extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-shape, the shape extension for the X C Binding. gdb will
@@ -720,7 +791,7 @@ Description: X C Binding, shape extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshm0
+Package: libxcb-shm0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -741,11 +812,10 @@ Description: X C Binding, shm extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshm0-dev
+Package: libxcb-shm0-dev
Section: libdevel
Architecture: any
-Depends: libxcbshm0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-shm0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, shm extension, development files
This package contains the header and library files needed to build software
using libxcb-shm, the shm extension for the X C Binding.
@@ -763,10 +833,11 @@ Description: X C Binding, shm extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbshm0-dbg
+Package: libxcb-shm0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbshm0 (= ${Source-Version})
+Depends: libxcb-shm0 (= ${Source-Version})
Description: X C Binding, shm extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-shm, the shm extension for the X C Binding. gdb will
@@ -785,7 +856,7 @@ Description: X C Binding, shm extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbsync0
+Package: libxcb-sync0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -806,11 +877,10 @@ Description: X C Binding, sync extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbsync0-dev
+Package: libxcb-sync0-dev
Section: libdevel
Architecture: any
-Depends: libxcbsync0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-sync0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, sync extension, development files
This package contains the header and library files needed to build software
using libxcb-sync, the sync extension for the X C Binding.
@@ -828,10 +898,11 @@ Description: X C Binding, sync extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbsync0-dbg
+Package: libxcb-sync0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbsync0 (= ${Source-Version})
+Depends: libxcb-sync0 (= ${Source-Version})
Description: X C Binding, sync extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-sync, the sync extension for the X C Binding. gdb will
@@ -850,7 +921,7 @@ Description: X C Binding, sync extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxevie0
+Package: libxcb-xevie0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -871,11 +942,10 @@ Description: X C Binding, xevie extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxevie0-dev
+Package: libxcb-xevie0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxevie0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xevie0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, xevie extension, development files
This package contains the header and library files needed to build software
using libxcb-xevie, the xevie extension for the X C Binding.
@@ -893,10 +963,11 @@ Description: X C Binding, xevie extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxevie0-dbg
+Package: libxcb-xevie0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxevie0 (= ${Source-Version})
+Depends: libxcb-xevie0 (= ${Source-Version})
Description: X C Binding, xevie extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xevie, the xevie extension for the X C Binding. gdb will
@@ -915,7 +986,7 @@ Description: X C Binding, xevie extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxf86dri0
+Package: libxcb-xf86dri0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -936,11 +1007,10 @@ Description: X C Binding, xf86dri extens
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxf86dri0-dev
+Package: libxcb-xf86dri0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxf86dri0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xf86dri0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, xf86dri extension, development files
This package contains the header and library files needed to build software
using libxcb-xf86dri, the xf86dri extension for the X C Binding.
@@ -958,10 +1028,11 @@ Description: X C Binding, xf86dri extens
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxf86dri0-dbg
+Package: libxcb-xf86dri0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxf86dri0 (= ${Source-Version})
+Depends: libxcb-xf86dri0 (= ${Source-Version})
Description: X C Binding, xf86dri extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xf86dri, the xf86dri extension for the X C Binding. gdb will
@@ -980,7 +1051,7 @@ Description: X C Binding, xf86dri extens
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxfixes0
+Package: libxcb-xfixes0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -1001,11 +1072,10 @@ Description: X C Binding, xfixes extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxfixes0-dev
+Package: libxcb-xfixes0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxfixes0 (= ${Source-Version}), libxcb0-dev, libxcbrender0-dev, libxcbshape0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xfixes0 (= ${Source-Version}), libxcb1-dev, libxcb-render0-dev, libxcb-shape0-dev
Description: X C Binding, xfixes extension, development files
This package contains the header and library files needed to build software
using libxcb-xfixes, the xfixes extension for the X C Binding.
@@ -1023,10 +1093,11 @@ Description: X C Binding, xfixes extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxfixes0-dbg
+Package: libxcb-xfixes0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxfixes0 (= ${Source-Version})
+Depends: libxcb-xfixes0 (= ${Source-Version})
Description: X C Binding, xfixes extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xfixes, the xfixes extension for the X C Binding. gdb will
@@ -1045,7 +1116,7 @@ Description: X C Binding, xfixes extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxprint0
+Package: libxcb-xprint0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -1066,11 +1137,10 @@ Description: X C Binding, xprint extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxprint0-dev
+Package: libxcb-xprint0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxprint0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xprint0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, xprint extension, development files
This package contains the header and library files needed to build software
using libxcb-xprint, the xprint extension for the X C Binding.
@@ -1088,10 +1158,11 @@ Description: X C Binding, xprint extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxprint0-dbg
+Package: libxcb-xprint0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxprint0 (= ${Source-Version})
+Depends: libxcb-xprint0 (= ${Source-Version})
Description: X C Binding, xprint extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xprint, the xprint extension for the X C Binding. gdb will
@@ -1110,7 +1181,7 @@ Description: X C Binding, xprint extensi
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxtest0
+Package: libxcb-xtest0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -1131,11 +1202,10 @@ Description: X C Binding, xtest extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxtest0-dev
+Package: libxcb-xtest0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxtest0 (= ${Source-Version}), libxcb0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xtest0 (= ${Source-Version}), libxcb1-dev
Description: X C Binding, xtest extension, development files
This package contains the header and library files needed to build software
using libxcb-xtest, the xtest extension for the X C Binding.
@@ -1153,10 +1223,11 @@ Description: X C Binding, xtest extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxtest0-dbg
+Package: libxcb-xtest0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxtest0 (= ${Source-Version})
+Depends: libxcb-xtest0 (= ${Source-Version})
Description: X C Binding, xtest extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xtest, the xtest extension for the X C Binding. gdb will
@@ -1175,7 +1246,7 @@ Description: X C Binding, xtest extensio
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxv0
+Package: libxcb-xv0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -1196,11 +1267,10 @@ Description: X C Binding, xv extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxv0-dev
+Package: libxcb-xv0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxv0 (= ${Source-Version}), libxcb0-dev, libxcbshm0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xv0 (= ${Source-Version}), libxcb1-dev, libxcb-shm0-dev
Description: X C Binding, xv extension, development files
This package contains the header and library files needed to build software
using libxcb-xv, the xv extension for the X C Binding.
@@ -1218,10 +1288,11 @@ Description: X C Binding, xv extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxv0-dbg
+Package: libxcb-xv0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxv0 (= ${Source-Version})
+Depends: libxcb-xv0 (= ${Source-Version})
Description: X C Binding, xv extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xv, the xv extension for the X C Binding. gdb will
@@ -1240,7 +1311,7 @@ Description: X C Binding, xv extension,
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxvmc0
+Package: libxcb-xvmc0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -1261,11 +1332,10 @@ Description: X C Binding, xvmc extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxvmc0-dev
+Package: libxcb-xvmc0-dev
Section: libdevel
Architecture: any
-Depends: libxcbxvmc0 (= ${Source-Version}), libxcb0-dev, libxcbxv0-dev
-Pre-Depends: x11-common (>= 1:1.09)
+Depends: libxcb-xvmc0 (= ${Source-Version}), libxcb1-dev, libxcb-xv0-dev
Description: X C Binding, xvmc extension, development files
This package contains the header and library files needed to build software
using libxcb-xvmc, the xvmc extension for the X C Binding.
@@ -1283,10 +1353,11 @@ Description: X C Binding, xvmc extension
.
Homepage: http://xcb.freedesktop.org
-Package: libxcbxvmc0-dbg
+Package: libxcb-xvmc0-dbg
+Priority: extra
Section: libdevel
Architecture: any
-Depends: libxcbxvmc0 (= ${Source-Version})
+Depends: libxcb-xvmc0 (= ${Source-Version})
Description: X C Binding, xvmc extension, debugging symbols
This package contains the debugging symbols associated with
libxcb-xvmc, the xvmc extension for the X C Binding. gdb will
diff --git a/debian/copyright.debian b/debian/copyright.debian
index 7cd330a..fa33d3c 100644
--- a/debian/copyright.debian
+++ b/debian/copyright.debian
@@ -3,7 +3,7 @@ Thu, 18 Mar 2004 00:48:42 -0800, and lat
<josh at freedesktop.org>. The package is co-maintained by the XCB developers
via the XCB mailing list <xcb at lists.freedesktop.org>.
-It was downloaded from http://xcb.freedesktop.org.
+It was downloaded from http://xcb.freedesktop.org/dist
Upstream Authors: Jamey Sharp <sharpone at debian.org>
Josh Triplett <josh at freedesktop.org>
diff --git a/debian/libxcb-composite0-dev.install b/debian/libxcb-composite0-dev.install
new file mode 100644
index 0000000..5e9782f
--- /dev/null
+++ b/debian/libxcb-composite0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/composite.h
+usr/lib/libxcb-composite.a
+usr/lib/libxcb-composite.so
+usr/lib/pkgconfig/xcb-composite.pc usr/share/pkgconfig
diff --git a/debian/libxcb-composite0.install b/debian/libxcb-composite0.install
new file mode 100644
index 0000000..7943ef0
--- /dev/null
+++ b/debian/libxcb-composite0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-composite.so.*
diff --git a/debian/libxcb-damage0-dev.install b/debian/libxcb-damage0-dev.install
new file mode 100644
index 0000000..b3d7ab6
--- /dev/null
+++ b/debian/libxcb-damage0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/damage.h
+usr/lib/libxcb-damage.a
+usr/lib/libxcb-damage.so
+usr/lib/pkgconfig/xcb-damage.pc usr/share/pkgconfig
diff --git a/debian/libxcb-damage0.install b/debian/libxcb-damage0.install
new file mode 100644
index 0000000..e33a41e
--- /dev/null
+++ b/debian/libxcb-damage0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-damage.so.*
diff --git a/debian/libxcb-dpms0-dev.install b/debian/libxcb-dpms0-dev.install
new file mode 100644
index 0000000..25e0952
--- /dev/null
+++ b/debian/libxcb-dpms0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/dpms.h
+usr/lib/libxcb-dpms.a
+usr/lib/libxcb-dpms.so
+usr/lib/pkgconfig/xcb-dpms.pc usr/share/pkgconfig
diff --git a/debian/libxcb-dpms0.install b/debian/libxcb-dpms0.install
new file mode 100644
index 0000000..c78e4e8
--- /dev/null
+++ b/debian/libxcb-dpms0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-dpms.so.*
diff --git a/debian/libxcb-glx0-dev.install b/debian/libxcb-glx0-dev.install
new file mode 100644
index 0000000..d9c8f6c
--- /dev/null
+++ b/debian/libxcb-glx0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/glx.h
+usr/lib/libxcb-glx.a
+usr/lib/libxcb-glx.so
+usr/lib/pkgconfig/xcb-glx.pc usr/share/pkgconfig
diff --git a/debian/libxcb-glx0.install b/debian/libxcb-glx0.install
new file mode 100644
index 0000000..2434177
--- /dev/null
+++ b/debian/libxcb-glx0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-glx.so.*
diff --git a/debian/libxcb-randr0-dev.install b/debian/libxcb-randr0-dev.install
new file mode 100644
index 0000000..674dffa
--- /dev/null
+++ b/debian/libxcb-randr0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/randr.h
+usr/lib/libxcb-randr.a
+usr/lib/libxcb-randr.so
+usr/lib/pkgconfig/xcb-randr.pc usr/share/pkgconfig
diff --git a/debian/libxcb-randr0.install b/debian/libxcb-randr0.install
new file mode 100644
index 0000000..42d89d3
--- /dev/null
+++ b/debian/libxcb-randr0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-randr.so.*
diff --git a/debian/libxcb-record0-dev.install b/debian/libxcb-record0-dev.install
new file mode 100644
index 0000000..680cece
--- /dev/null
+++ b/debian/libxcb-record0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/record.h
+usr/lib/libxcb-record.a
+usr/lib/libxcb-record.so
+usr/lib/pkgconfig/xcb-record.pc usr/share/pkgconfig
diff --git a/debian/libxcb-record0.install b/debian/libxcb-record0.install
new file mode 100644
index 0000000..3071c28
--- /dev/null
+++ b/debian/libxcb-record0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-record.so.*
diff --git a/debian/libxcb-render0-dev.install b/debian/libxcb-render0-dev.install
new file mode 100644
index 0000000..27c0d84
--- /dev/null
+++ b/debian/libxcb-render0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/render.h
+usr/lib/libxcb-render.a
+usr/lib/libxcb-render.so
+usr/lib/pkgconfig/xcb-render.pc usr/share/pkgconfig
diff --git a/debian/libxcb-render0.install b/debian/libxcb-render0.install
new file mode 100644
index 0000000..ae85806
--- /dev/null
+++ b/debian/libxcb-render0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-render.so.*
diff --git a/debian/libxcb-res0-dev.install b/debian/libxcb-res0-dev.install
new file mode 100644
index 0000000..494568d
--- /dev/null
+++ b/debian/libxcb-res0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/res.h
+usr/lib/libxcb-res.a
+usr/lib/libxcb-res.so
+usr/lib/pkgconfig/xcb-res.pc usr/share/pkgconfig
diff --git a/debian/libxcb-res0.install b/debian/libxcb-res0.install
new file mode 100644
index 0000000..d4afa71
--- /dev/null
+++ b/debian/libxcb-res0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-res.so.*
diff --git a/debian/libxcb-screensaver0-dev.install b/debian/libxcb-screensaver0-dev.install
new file mode 100644
index 0000000..8cc12d7
--- /dev/null
+++ b/debian/libxcb-screensaver0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/screensaver.h
+usr/lib/libxcb-screensaver.a
+usr/lib/libxcb-screensaver.so
+usr/lib/pkgconfig/xcb-screensaver.pc usr/share/pkgconfig
diff --git a/debian/libxcb-screensaver0.install b/debian/libxcb-screensaver0.install
new file mode 100644
index 0000000..d4b7442
--- /dev/null
+++ b/debian/libxcb-screensaver0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-screensaver.so.*
diff --git a/debian/libxcb-shape0-dev.install b/debian/libxcb-shape0-dev.install
new file mode 100644
index 0000000..3cee345
--- /dev/null
+++ b/debian/libxcb-shape0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/shape.h
+usr/lib/libxcb-shape.a
+usr/lib/libxcb-shape.so
+usr/lib/pkgconfig/xcb-shape.pc usr/share/pkgconfig
diff --git a/debian/libxcb-shape0.install b/debian/libxcb-shape0.install
new file mode 100644
index 0000000..ea87b38
--- /dev/null
+++ b/debian/libxcb-shape0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-shape.so.*
diff --git a/debian/libxcb-shm0-dev.install b/debian/libxcb-shm0-dev.install
new file mode 100644
index 0000000..e168595
--- /dev/null
+++ b/debian/libxcb-shm0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/shm.h
+usr/lib/libxcb-shm.a
+usr/lib/libxcb-shm.so
+usr/lib/pkgconfig/xcb-shm.pc usr/share/pkgconfig
diff --git a/debian/libxcb-shm0.install b/debian/libxcb-shm0.install
new file mode 100644
index 0000000..1339c72
--- /dev/null
+++ b/debian/libxcb-shm0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-shm.so.*
diff --git a/debian/libxcb-sync0-dev.install b/debian/libxcb-sync0-dev.install
new file mode 100644
index 0000000..cc998e5
--- /dev/null
+++ b/debian/libxcb-sync0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/sync.h
+usr/lib/libxcb-sync.a
+usr/lib/libxcb-sync.so
+usr/lib/pkgconfig/xcb-sync.pc usr/share/pkgconfig
diff --git a/debian/libxcb-sync0.install b/debian/libxcb-sync0.install
new file mode 100644
index 0000000..937a4d8
--- /dev/null
+++ b/debian/libxcb-sync0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-sync.so.*
diff --git a/debian/libxcb-xevie0-dev.install b/debian/libxcb-xevie0-dev.install
new file mode 100644
index 0000000..c3640c4
--- /dev/null
+++ b/debian/libxcb-xevie0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xevie.h
+usr/lib/libxcb-xevie.a
+usr/lib/libxcb-xevie.so
+usr/lib/pkgconfig/xcb-xevie.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xevie0.install b/debian/libxcb-xevie0.install
new file mode 100644
index 0000000..9ffcbcd
--- /dev/null
+++ b/debian/libxcb-xevie0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xevie.so.*
diff --git a/debian/libxcb-xf86dri0-dev.install b/debian/libxcb-xf86dri0-dev.install
new file mode 100644
index 0000000..66d6f30
--- /dev/null
+++ b/debian/libxcb-xf86dri0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xf86dri.h
+usr/lib/libxcb-xf86dri.a
+usr/lib/libxcb-xf86dri.so
+usr/lib/pkgconfig/xcb-xf86dri.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xf86dri0.install b/debian/libxcb-xf86dri0.install
new file mode 100644
index 0000000..72e3797
--- /dev/null
+++ b/debian/libxcb-xf86dri0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xf86dri.so.*
diff --git a/debian/libxcb-xfixes0-dev.install b/debian/libxcb-xfixes0-dev.install
new file mode 100644
index 0000000..4f29d33
--- /dev/null
+++ b/debian/libxcb-xfixes0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xfixes.h
+usr/lib/libxcb-xfixes.a
+usr/lib/libxcb-xfixes.so
+usr/lib/pkgconfig/xcb-xfixes.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xfixes0.install b/debian/libxcb-xfixes0.install
new file mode 100644
index 0000000..6b11b1d
--- /dev/null
+++ b/debian/libxcb-xfixes0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xfixes.so.*
diff --git a/debian/libxcb-xlib0-dev.install b/debian/libxcb-xlib0-dev.install
new file mode 100644
index 0000000..7084a10
--- /dev/null
+++ b/debian/libxcb-xlib0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xcbxlib.h
+usr/lib/libxcb-xlib.a
+usr/lib/libxcb-xlib.so
+usr/lib/pkgconfig/xcb-xlib.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xlib0.install b/debian/libxcb-xlib0.install
new file mode 100644
index 0000000..c79ea03
--- /dev/null
+++ b/debian/libxcb-xlib0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xlib.so.*
diff --git a/debian/libxcb-xprint0-dev.install b/debian/libxcb-xprint0-dev.install
new file mode 100644
index 0000000..0303cb8
--- /dev/null
+++ b/debian/libxcb-xprint0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xprint.h
+usr/lib/libxcb-xprint.a
+usr/lib/libxcb-xprint.so
+usr/lib/pkgconfig/xcb-xprint.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xprint0.install b/debian/libxcb-xprint0.install
new file mode 100644
index 0000000..ca3062e
--- /dev/null
+++ b/debian/libxcb-xprint0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xprint.so.*
diff --git a/debian/libxcb-xtest0-dev.install b/debian/libxcb-xtest0-dev.install
new file mode 100644
index 0000000..8038d3e
--- /dev/null
+++ b/debian/libxcb-xtest0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xtest.h
+usr/lib/libxcb-xtest.a
+usr/lib/libxcb-xtest.so
+usr/lib/pkgconfig/xcb-xtest.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xtest0.install b/debian/libxcb-xtest0.install
new file mode 100644
index 0000000..f2de6c1
--- /dev/null
+++ b/debian/libxcb-xtest0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xtest.so.*
diff --git a/debian/libxcb-xv0-dev.install b/debian/libxcb-xv0-dev.install
new file mode 100644
index 0000000..6af4700
--- /dev/null
+++ b/debian/libxcb-xv0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xv.h
+usr/lib/libxcb-xv.a
+usr/lib/libxcb-xv.so
+usr/lib/pkgconfig/xcb-xv.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xv0.install b/debian/libxcb-xv0.install
new file mode 100644
index 0000000..3a159a9
--- /dev/null
+++ b/debian/libxcb-xv0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xv.so.*
diff --git a/debian/libxcb-xvmc0-dev.install b/debian/libxcb-xvmc0-dev.install
new file mode 100644
index 0000000..9a9bcd4
--- /dev/null
+++ b/debian/libxcb-xvmc0-dev.install
@@ -0,0 +1,4 @@
+usr/include/xcb/xvmc.h
+usr/lib/libxcb-xvmc.a
+usr/lib/libxcb-xvmc.so
+usr/lib/pkgconfig/xcb-xvmc.pc usr/share/pkgconfig
diff --git a/debian/libxcb-xvmc0.install b/debian/libxcb-xvmc0.install
new file mode 100644
index 0000000..a21ec6a
--- /dev/null
+++ b/debian/libxcb-xvmc0.install
@@ -0,0 +1 @@
+usr/lib/libxcb-xvmc.so.*
diff --git a/debian/libxcb0-dev.install b/debian/libxcb0-dev.install
deleted file mode 100644
index 61d4a73..0000000
--- a/debian/libxcb0-dev.install
+++ /dev/null
@@ -1,9 +0,0 @@
-usr/include/X11/XCB/bigreq.h
-usr/include/X11/XCB/xc_misc.h
-usr/include/X11/XCB/xcb.h
-usr/include/X11/XCB/xcbext.h
-usr/include/X11/XCB/xcbxlib.h
-usr/include/X11/XCB/xproto.h
-usr/lib/libxcb.a
-usr/lib/libxcb.so
-usr/lib/pkgconfig/xcb.pc
diff --git a/debian/libxcb0.install b/debian/libxcb0.install
deleted file mode 100644
index 4460d67..0000000
--- a/debian/libxcb0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb.so.*
diff --git a/debian/libxcb1-dev.install b/debian/libxcb1-dev.install
new file mode 100644
index 0000000..475c517
--- /dev/null
+++ b/debian/libxcb1-dev.install
@@ -0,0 +1,8 @@
+usr/include/xcb/bigreq.h
+usr/include/xcb/xc_misc.h
+usr/include/xcb/xcb.h
+usr/include/xcb/xcbext.h
+usr/include/xcb/xproto.h
+usr/lib/libxcb.a
+usr/lib/libxcb.so
+usr/lib/pkgconfig/xcb.pc usr/share/pkgconfig
diff --git a/debian/libxcb1.install b/debian/libxcb1.install
new file mode 100644
index 0000000..4460d67
--- /dev/null
+++ b/debian/libxcb1.install
@@ -0,0 +1 @@
+usr/lib/libxcb.so.*
diff --git a/debian/libxcbcomposite0-dev.install b/debian/libxcbcomposite0-dev.install
deleted file mode 100644
index aa85813..0000000
--- a/debian/libxcbcomposite0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/composite.h
-usr/lib/libxcb-composite.a
-usr/lib/libxcb-composite.so
-usr/lib/pkgconfig/xcb-composite.pc
diff --git a/debian/libxcbcomposite0.install b/debian/libxcbcomposite0.install
deleted file mode 100644
index 7943ef0..0000000
--- a/debian/libxcbcomposite0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-composite.so.*
diff --git a/debian/libxcbdamage0-dev.install b/debian/libxcbdamage0-dev.install
deleted file mode 100644
index 38ae588..0000000
--- a/debian/libxcbdamage0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/damage.h
-usr/lib/libxcb-damage.a
-usr/lib/libxcb-damage.so
-usr/lib/pkgconfig/xcb-damage.pc
diff --git a/debian/libxcbdamage0.install b/debian/libxcbdamage0.install
deleted file mode 100644
index e33a41e..0000000
--- a/debian/libxcbdamage0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-damage.so.*
diff --git a/debian/libxcbdpms0-dev.install b/debian/libxcbdpms0-dev.install
deleted file mode 100644
index 307e55b..0000000
--- a/debian/libxcbdpms0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/dpms.h
-usr/lib/libxcb-dpms.a
-usr/lib/libxcb-dpms.so
-usr/lib/pkgconfig/xcb-dpms.pc
diff --git a/debian/libxcbdpms0.install b/debian/libxcbdpms0.install
deleted file mode 100644
index c78e4e8..0000000
--- a/debian/libxcbdpms0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-dpms.so.*
diff --git a/debian/libxcbglx0-dev.install b/debian/libxcbglx0-dev.install
deleted file mode 100644
index 75d3a80..0000000
--- a/debian/libxcbglx0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/glx.h
-usr/lib/libxcb-glx.a
-usr/lib/libxcb-glx.so
-usr/lib/pkgconfig/xcb-glx.pc
diff --git a/debian/libxcbglx0.install b/debian/libxcbglx0.install
deleted file mode 100644
index 2434177..0000000
--- a/debian/libxcbglx0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-glx.so.*
diff --git a/debian/libxcbrandr0-dev.install b/debian/libxcbrandr0-dev.install
deleted file mode 100644
index 1fb84df..0000000
--- a/debian/libxcbrandr0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/randr.h
-usr/lib/libxcb-randr.a
-usr/lib/libxcb-randr.so
-usr/lib/pkgconfig/xcb-randr.pc
diff --git a/debian/libxcbrandr0.install b/debian/libxcbrandr0.install
deleted file mode 100644
index 42d89d3..0000000
--- a/debian/libxcbrandr0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-randr.so.*
diff --git a/debian/libxcbrecord0-dev.install b/debian/libxcbrecord0-dev.install
deleted file mode 100644
index 9e05a99..0000000
--- a/debian/libxcbrecord0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/record.h
-usr/lib/libxcb-record.a
-usr/lib/libxcb-record.so
-usr/lib/pkgconfig/xcb-record.pc
diff --git a/debian/libxcbrecord0.install b/debian/libxcbrecord0.install
deleted file mode 100644
index 3071c28..0000000
--- a/debian/libxcbrecord0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-record.so.*
diff --git a/debian/libxcbrender0-dev.install b/debian/libxcbrender0-dev.install
deleted file mode 100644
index 95b11a7..0000000
--- a/debian/libxcbrender0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/render.h
-usr/lib/libxcb-render.a
-usr/lib/libxcb-render.so
-usr/lib/pkgconfig/xcb-render.pc
diff --git a/debian/libxcbrender0.install b/debian/libxcbrender0.install
deleted file mode 100644
index ae85806..0000000
--- a/debian/libxcbrender0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-render.so.*
diff --git a/debian/libxcbres0-dev.install b/debian/libxcbres0-dev.install
deleted file mode 100644
index 30c7fb6..0000000
--- a/debian/libxcbres0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/res.h
-usr/lib/libxcb-res.a
-usr/lib/libxcb-res.so
-usr/lib/pkgconfig/xcb-res.pc
diff --git a/debian/libxcbres0.install b/debian/libxcbres0.install
deleted file mode 100644
index d4afa71..0000000
--- a/debian/libxcbres0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-res.so.*
diff --git a/debian/libxcbscreensaver0-dev.install b/debian/libxcbscreensaver0-dev.install
deleted file mode 100644
index 7a57732..0000000
--- a/debian/libxcbscreensaver0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/screensaver.h
-usr/lib/libxcb-screensaver.a
-usr/lib/libxcb-screensaver.so
-usr/lib/pkgconfig/xcb-screensaver.pc
diff --git a/debian/libxcbscreensaver0.install b/debian/libxcbscreensaver0.install
deleted file mode 100644
index d4b7442..0000000
--- a/debian/libxcbscreensaver0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-screensaver.so.*
diff --git a/debian/libxcbshape0-dev.install b/debian/libxcbshape0-dev.install
deleted file mode 100644
index 744d12b..0000000
--- a/debian/libxcbshape0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/shape.h
-usr/lib/libxcb-shape.a
-usr/lib/libxcb-shape.so
-usr/lib/pkgconfig/xcb-shape.pc
diff --git a/debian/libxcbshape0.install b/debian/libxcbshape0.install
deleted file mode 100644
index ea87b38..0000000
--- a/debian/libxcbshape0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-shape.so.*
diff --git a/debian/libxcbshm0-dev.install b/debian/libxcbshm0-dev.install
deleted file mode 100644
index 74d306a..0000000
--- a/debian/libxcbshm0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/shm.h
-usr/lib/libxcb-shm.a
-usr/lib/libxcb-shm.so
-usr/lib/pkgconfig/xcb-shm.pc
diff --git a/debian/libxcbshm0.install b/debian/libxcbshm0.install
deleted file mode 100644
index 1339c72..0000000
--- a/debian/libxcbshm0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-shm.so.*
diff --git a/debian/libxcbsync0-dev.install b/debian/libxcbsync0-dev.install
deleted file mode 100644
index a1ba73c..0000000
--- a/debian/libxcbsync0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/sync.h
-usr/lib/libxcb-sync.a
-usr/lib/libxcb-sync.so
-usr/lib/pkgconfig/xcb-sync.pc
diff --git a/debian/libxcbsync0.install b/debian/libxcbsync0.install
deleted file mode 100644
index 937a4d8..0000000
--- a/debian/libxcbsync0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-sync.so.*
diff --git a/debian/libxcbxevie0-dev.install b/debian/libxcbxevie0-dev.install
deleted file mode 100644
index 4215629..0000000
--- a/debian/libxcbxevie0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xevie.h
-usr/lib/libxcb-xevie.a
-usr/lib/libxcb-xevie.so
-usr/lib/pkgconfig/xcb-xevie.pc
diff --git a/debian/libxcbxevie0.install b/debian/libxcbxevie0.install
deleted file mode 100644
index 9ffcbcd..0000000
--- a/debian/libxcbxevie0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xevie.so.*
diff --git a/debian/libxcbxf86dri0-dev.install b/debian/libxcbxf86dri0-dev.install
deleted file mode 100644
index 1b698af..0000000
--- a/debian/libxcbxf86dri0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xf86dri.h
-usr/lib/libxcb-xf86dri.a
-usr/lib/libxcb-xf86dri.so
-usr/lib/pkgconfig/xcb-xf86dri.pc
diff --git a/debian/libxcbxf86dri0.install b/debian/libxcbxf86dri0.install
deleted file mode 100644
index 72e3797..0000000
--- a/debian/libxcbxf86dri0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xf86dri.so.*
diff --git a/debian/libxcbxfixes0-dev.install b/debian/libxcbxfixes0-dev.install
deleted file mode 100644
index 0b719ae..0000000
--- a/debian/libxcbxfixes0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xfixes.h
-usr/lib/libxcb-xfixes.a
-usr/lib/libxcb-xfixes.so
-usr/lib/pkgconfig/xcb-xfixes.pc
diff --git a/debian/libxcbxfixes0.install b/debian/libxcbxfixes0.install
deleted file mode 100644
index 6b11b1d..0000000
--- a/debian/libxcbxfixes0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xfixes.so.*
diff --git a/debian/libxcbxprint0-dev.install b/debian/libxcbxprint0-dev.install
deleted file mode 100644
index 5ca7b5b..0000000
--- a/debian/libxcbxprint0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xprint.h
-usr/lib/libxcb-xprint.a
-usr/lib/libxcb-xprint.so
-usr/lib/pkgconfig/xcb-xprint.pc
diff --git a/debian/libxcbxprint0.install b/debian/libxcbxprint0.install
deleted file mode 100644
index ca3062e..0000000
--- a/debian/libxcbxprint0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xprint.so.*
diff --git a/debian/libxcbxtest0-dev.install b/debian/libxcbxtest0-dev.install
deleted file mode 100644
index 6045fee..0000000
--- a/debian/libxcbxtest0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xtest.h
-usr/lib/libxcb-xtest.a
-usr/lib/libxcb-xtest.so
-usr/lib/pkgconfig/xcb-xtest.pc
diff --git a/debian/libxcbxtest0.install b/debian/libxcbxtest0.install
deleted file mode 100644
index f2de6c1..0000000
--- a/debian/libxcbxtest0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xtest.so.*
diff --git a/debian/libxcbxv0-dev.install b/debian/libxcbxv0-dev.install
deleted file mode 100644
index 9171e7a..0000000
--- a/debian/libxcbxv0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xv.h
-usr/lib/libxcb-xv.a
-usr/lib/libxcb-xv.so
-usr/lib/pkgconfig/xcb-xv.pc
diff --git a/debian/libxcbxv0.install b/debian/libxcbxv0.install
deleted file mode 100644
index 3a159a9..0000000
--- a/debian/libxcbxv0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xv.so.*
diff --git a/debian/libxcbxvmc0-dev.install b/debian/libxcbxvmc0-dev.install
deleted file mode 100644
index 6548706..0000000
--- a/debian/libxcbxvmc0-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/X11/XCB/xvmc.h
-usr/lib/libxcb-xvmc.a
-usr/lib/libxcb-xvmc.so
-usr/lib/pkgconfig/xcb-xvmc.pc
diff --git a/debian/libxcbxvmc0.install b/debian/libxcbxvmc0.install
deleted file mode 100644
index a21ec6a..0000000
--- a/debian/libxcbxvmc0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libxcb-xvmc.so.*
diff --git a/debian/rules b/debian/rules
index 931c6d9..e3cc188 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,28 +2,6 @@
DEB_DH_INSTALL_SOURCEDIR=debian/tmp
-# FIXME: cdbs shouldn't require this
-DEB_DBG_PACKAGE_libxcb0=libxcb0-dbg
-DEB_DBG_PACKAGE_libxcbcomposite0=libxcbcomposite0-dbg
-DEB_DBG_PACKAGE_libxcbdamage0=libxcbdamage0-dbg
-DEB_DBG_PACKAGE_libxcbdpms0=libxcbdpms0-dbg
-DEB_DBG_PACKAGE_libxcbglx0=libxcbglx0-dbg
-DEB_DBG_PACKAGE_libxcbrandr0=libxcbrandr0-dbg
-DEB_DBG_PACKAGE_libxcbrecord0=libxcbrecord0-dbg
-DEB_DBG_PACKAGE_libxcbrender0=libxcbrender0-dbg
-DEB_DBG_PACKAGE_libxcbres0=libxcbres0-dbg
-DEB_DBG_PACKAGE_libxcbscreensaver0=libxcbscreensaver0-dbg
-DEB_DBG_PACKAGE_libxcbshape0=libxcbshape0-dbg
-DEB_DBG_PACKAGE_libxcbshm0=libxcbshm0-dbg
-DEB_DBG_PACKAGE_libxcbsync0=libxcbsync0-dbg
-DEB_DBG_PACKAGE_libxcbxevie0=libxcbxevie0-dbg
-DEB_DBG_PACKAGE_libxcbxf86dri0=libxcbxf86dri0-dbg
-DEB_DBG_PACKAGE_libxcbxfixes0=libxcbxfixes0-dbg
-DEB_DBG_PACKAGE_libxcbxprint0=libxcbxprint0-dbg
-DEB_DBG_PACKAGE_libxcbxtest0=libxcbxtest0-dbg
-DEB_DBG_PACKAGE_libxcbxv0=libxcbxv0-dbg
-DEB_DBG_PACKAGE_libxcbxvmc0=libxcbxvmc0-dbg
-
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..174db34
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://xcb.freedesktop.org/dist/libxcb-([0-9].*)\.tar\.gz
diff-tree 5d7d548d05c28594fecb53894e5c386ed771eb89 (from parents)
Merge: e37875573dad21e2a6d844184d58ea6a587a65f2 431f210bbb20e39a24ac879af5f2a8a7744e6a6c
Author: Jamey Sharp <jamey at minilop.net>
Date: Sun Oct 8 01:17:01 2006 -0700
Merge branch 'master' into debian
diff-tree 431f210bbb20e39a24ac879af5f2a8a7744e6a6c (from e0fac22caaf27b3e461807f8c563d0457938baa6)
Author: Jamey Sharp <jamey at minilop.net>
Date: Sat Oct 7 19:50:55 2006 -0700
Release libxcb 1.0 RC2 (0.9.92).
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..6a53911
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,209 @@
+Release 1.0 RC2 (2006-10-07)
+============================
+
+API changes
+-----------
+
+In our announcement of XCB 1.0 RC1, we proposed two API changes for
+community feedback:
+
+ We would greatly appreciate API review in this final release
+ candidate period. We've had some limited feedback that our attempts
+ to impose static type safety on XIDs in C pose more a hindrance than
+ a help, so we would appreciate discussion over whether this
+ constitutes a "serious issue with the API". Some question also
+ remains of whether xcb_poll_for_event should have the out-parameter
+ 'error', now that XCB has a more uniform mechanism for reporting
+ connection errors. Speak now on these points or leave us alone. ;-)
+
+Since we've received feedback agreeing with our proposed changes, and no
+objections or requests to keep the existing API, we made both changes
+and bumped the soname to libxcb.so.1.0.0 in preparation for the release
+of XCB 1.0.
+
+* Remove XID wrapper structures and replace them with uint32_t typedefs.
+ XID union types like xcb_drawable_t and xcb_fontable_t also become
+ uint32_t typedefs. The API conversion script now replaces xcb_*_new
+ with calls directly to xcb_generate_id. This change makes
+ xcb_generate_id part of the client API rather than the extension API,
+ so move xcb_generate_id from xcbext.h to xcb.h.
+
+* Remove the 'int *error' out-parameter for xcb_poll_for_event.
+ xcb_poll_for_event now shuts down the xcb_connection_t on fatal
+ errors; use xcb_connection_has_error to check.
+
+The Xlib-specific API in libxcb-xlib also changed:
+
+* Stop exposing the XCB IO lock for Xlib's benefit, by removing
+ xcb_get_io_lock from the Xlib-specific XCB API; instead, libxcb-xlib
+ now provides xcb_xlib_lock and xcb_xlib_unlock.
+
+Code generation changes
+-----------------------
+
+* The code generator no longer implicitly imports xproto for extensions.
+ xcb-proto 1.0 RC2 includes the corresponding change to explicitly
+ import xproto in extensions that need it
+
+* The generated protocol headers now declare "struct foo", "union foo"
+ or "enum foo", not just the typedef "foo" of an unnamed
+ struct/union/enum type.
+
+Bug Fixes
+---------
+
+* Make Plan 7 'checked' requests work correctly.
+
+Documentation improvements
+--------------------------
+
+* Document xcb_generate_id.
+
+* Tutorial enhancements.
+
+
+Release 1.0 RC1 (2006-09-25)
+============================
+
+The Great XCB Renaming
+----------------------
+
+Rename API to follow a new naming convention:
+
+* XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES
+* xcb_functions_lowercase_with_underscores
+* xcb_types_lowercase_with_underscores_and_suffix_t
+* expand all abbreviations like "req", "rep", and "iter"
+
+Word boundaries for the names in the protocol descriptions fall:
+
+* Wherever the protocol descriptions already have an underscore
+* Between a lowercase letter and a subsequent uppercase letter
+* Before the last uppercase letter in a string of uppercase letters
+ followed by a lowercase letter (such as in LSBFirst between LSB and
+ First)
+* Before and after a string of digits (with exceptions for sized types
+ like xcb_char2b_t and xcb_glx_float32_t to match the stdint.h
+ convention)
+
+Also fix up some particular naming issues:
+
+* Rename shape_op and shape_kind to drop the "shape_" prefix, since
+ otherwise these types end up as xcb_shape_shape_{op,kind}_t.
+* Remove leading underscores from enums in the GLX protocol description,
+ previously needed to ensure a word separator, but now redundant.
+
+This renaming breaks code written for the previous API naming
+convention. The scripts in XCB's tools directory will convert code
+written for the old API to use the new API; they work well enough that
+we used them to convert the non-program-generated code in XCB, and when
+run on the old program-generated code, they almost exactly reproduce the
+new program-generated code (modulo whitespace and bugs in the old code
+generator).
+
+Authors: Vincent Torri, Thomas Hunger, Josh Triplett
+
+In addition to the API renaming, the library SONAMEs have changed to
+libxcb.so and libxcb-extname.so. The library major version remains at 0,
+to become version 1 before 1.0 is released; the SONAME lowercasing means
+that this will not conflict with XCB 0.9 libraries.
+
+The header files have moved from /usr/include/X11/XCB/ to
+/usr/include/xcb/. The XML-XCB protocol descriptions have moved to
+/usr/share/xcb, with extension descriptions no longer relegated to an
+extensions/ subdirectory. The API conversion script api_conv.pl will fix
+references to the header files, and packages using pkg-config will
+automatically use the new library names.
+
+Error handling Plan 7
+---------------------
+
+All request functions now come in an "unchecked" and "checked" variant.
+The checked variant allows callers to handle errors inline where they
+obtain the reply, or by calling xcb_request_check for requests with no
+reply. The unchecked variant uses the event queue for errors. Requests
+with replies default to checked, because the caller must already make a
+function call to retrieve the reply and can see the error at that time;
+the unchecked variant uses the suffix _unchecked. Requests without
+replies default to unchecked, because the caller will not necessarily
+expect to handle a response, and the checked variant uses the suffix
+_checked.
+
+Connection error handling
+-------------------------
+
+Fatal connection errors now put the xcb_connection_t object into an
+error state, at which point all further operations on that connection
+will fail. Callers can use the new xcb_connection_has_error function to
+check for this state in a connection. Functions that return a
+connection, such as the xcb_connect function, may instead return an
+xcb_connection_t already in an error state.
+
+In the future we expect to add additional API for getting more
+information about the error condition that caused the connection to get
+into an error state.
+
+Smaller API changes
+-------------------
+
+All functions that have been marked 'deprecated' up to now have been
+removed for this release. After XCB 1.0 is released, functions marked
+'deprecated' will be preserved until the end of time to maintain
+compatibility.
+
+XCB no longer provides a sync function. Most callers of this function
+should use xcb_flush instead, which usually provides the intended
+functionality and does not require a round-trip to the server. If you
+really need this functionality, either use xcb_get_input_focus like sync
+used to do, or use the xcb_aux_sync function from the xcb-aux library in
+xcb-util. However, note that we do not consider the libraries in
+xcb-util remotely stable yet.
+
+XCB no longer provides xcb_[extension_name]_init functions for each
+extension. These functions previously caused XCB to issue and process a
+QueryExtension request. Callers should now directly call
+xcb_get_extension_data on the xcb_[extension_name]_id, or use
+xcb_prefetch_extension_data if they do not need to force a round-trip
+immediately.
+
+The compatibility functions in xcbxlib.h, provided solely for use by
+Xlib/XCB, now exist in a separate library libxcb-xlib. We don't want to
+have to change the libxcb soname if we later change or remove the Xlib
+compatibility functions, and nothing except Xlib/XCB should ever use
+them. (Applications which use Xlib/XCB do not need this library either;
+Xlib/XCB only uses it internally.)
+
+The descriptions of several extensions have been updated to match the
+latest versions implemented in the X.org X server.
+
+GIT Repository split
+--------------------
+
+Previously, several XCB-related projects all existed under the umbrella
+of a single monolithic GIT repository with per-project subdirectories.
+We have split this repository into individual per-project repositories.
+
+Josh Triplett and Jamey Sharp wrote a tool called git-split to
+accomplish this repository split. git-split reconstructs the history of
+a sub-project previously stored in a subdirectory of a larger
+repository. It constructs new commit objects based on the existing tree
+objects for the subtree in each commit, and discards commits which do
+not affect the history of the sub-project, as well as merges made
+unnecessary due to these discarded commits.
+
+We would like to acknowledge the work of the gobby team in creating a
+collaborative editor which greatly aided the development of git-split
+(as well as these release notes).
+
+Build and implementation fixes
+------------------------------
+
+XCB no longer needs proto/x11 from X.org; the XCB header xproto.h
+provides the definitions from X.h, named according to XCB conventions.
+
+XCB should now build with non-GNU implementations of Make.
+
+XCB properly handles 32-bit wrap of sequence numbers, and thus now
+supports issuing more than 2**32 requests in one connection.
+
+Fixed bugs #7001, #7261.
diff --git a/README b/README
new file mode 100644
index 0000000..1a7a657
--- /dev/null
+++ b/README
@@ -0,0 +1,36 @@
+About libxcb
+============
+
+libxcb provides an interface to the X Window System protocol, slated to
+replace the current Xlib interface. It has several advantages over
+Xlib, including:
+- size: small library and lower memory footprint
+- latency hiding: batch several requests and wait for the replies later
+- direct protocol access: one-to-one mapping between interface and protocol
+- proven thread support: transparently access XCB from multiple threads
+- easy extension implementation: interfaces auto-generated from XML-XCB
+
+Xlib can also use XCB as a transport layer, allowing software to make
+requests and receive responses with both, which eases porting to XCB.
+However, client programs, libraries, and toolkits will gain the most
+benefit from a native XCB port.
+
+
+Please report any issues you find to the freedesktop.org bug tracker,
+at:
+
+ <https://bugs.freedesktop.org/enter_bug.cgi?product=XCB>
+
+Discussion about XCB occurs on the XCB mailing list:
+
+ <mailto:xcb at lists.freedesktop.org>
+ <http://lists.freedesktop.org/mailman/listinfo/xcb>
+
+You can obtain the latest development versions of XCB using GIT.
+For anonymous checkouts, use:
+
+ git clone git://anongit.freedesktop.org/git/xcb/libxcb
+
+For developers, use:
+
+ git clone git+ssh://git.freedesktop.org/git/xcb/libxcb
diff --git a/configure.ac b/configure.ac
index b097759..d975468 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
AC_PREREQ(2.57)
AC_INIT([libxcb],
- 0.9.91,
+ 0.9.92,
[xcb at lists.freedesktop.org])
AC_CONFIG_SRCDIR([xcb.pc.in])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -34,7 +34,7 @@ fi
AC_SUBST(HTML_CHECK_RESULT)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 0.9)
+PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 0.9.92)
PKG_CHECK_MODULES(XAU, xau)
PKG_CHECK_MODULES(XDMCP, xdmcp,
diff --git a/src/Makefile.am b/src/Makefile.am
index 15fda4a..0d4770b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -116,7 +116,7 @@ libxcb_la_SOURCES = \
# * If you add an interface, increment current and age and set revision to 0.
# * If you change or remove an interface, increment current and set revision
# and age to 0.
-libxcb_la_LDFLAGS = -version-info 0:0:0
+libxcb_la_LDFLAGS = -version-info 1:0:0
BUILT_SOURCES = $(COREPROTO) $(EXTENSIONS)
CLEANFILES = $(COREPROTO) $(EXTENSIONS)
diff-tree e0fac22caaf27b3e461807f8c563d0457938baa6 (from 7b84d8b650a611d4d76083340e50cb7ea815014d)
Author: Jamey Sharp <jamey at minilop.net>
Date: Sat Oct 7 18:35:53 2006 -0700
Bugfix: make Plan 7 'checked' requests work correctly.
The initial implementation of Plan 7 dumped all X errors into the event
queue, because the record of a pending reply was pruned too early if an
error occurred in place of the expected reply.
diff --git a/src/xcb_in.c b/src/xcb_in.c
index b252ffc..1cb6b69 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -108,8 +108,6 @@ static int read_packet(xcb_connection_t
}
c->in.request_completed = c->in.request_read - 1;
}
- if(genrep.response_type == XCB_ERROR)
- c->in.request_completed = c->in.request_read;
while(c->in.pending_replies &&
XCB_SEQUENCE_COMPARE (c->in.pending_replies->request, <=, c->in.request_completed))
@@ -120,6 +118,9 @@ static int read_packet(xcb_connection_t
c->in.pending_replies_tail = &c->in.pending_replies;
free(oldpend);
}
+
+ if(genrep.response_type == XCB_ERROR)
+ c->in.request_completed = c->in.request_read;
}
if(genrep.response_type == XCB_ERROR || genrep.response_type == XCB_REPLY)
diff-tree 7b84d8b650a611d4d76083340e50cb7ea815014d (from 9e10819a678970928c9f9a1fffb4ba00f5ac7c57)
Author: Ian Osgood <iano at quirkster.com>
Date: Sat Oct 7 14:09:29 2006 -0700
Document xcb_generate_id.
diff --git a/src/xcb.h b/src/xcb.h
index eaab47f..751bf70 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -410,6 +410,14 @@ xcb_connection_t *xcb_connect_to_display
/* xcb_xid.c */
+/**
+ * @brief Allocates an XID for a new object.
+ * @param c: The connection.
+ * @return A newly allocated XID.
+ *
+ * Allocates an XID for a new object. Typically used just prior to
+ * various object creation functions, such as xcb_create_window.
+ */
uint32_t xcb_generate_id(xcb_connection_t *c);
diff-tree 9e10819a678970928c9f9a1fffb4ba00f5ac7c57 (from b9e49b2a47e7388e20f8a5c009cdaf0b369e117c)
Author: Josh Triplett <josh at freedesktop.org>
Date: Sat Oct 7 13:16:43 2006 -0700
Move xcb_generate_id from xcbext.h to xcb.h
Since extensions no longer provide type-specific XID-generation functions,
xcb_generate_id now forms part of the xcb client API, rather than the
extension API; move it from xcbext.h to xcb.h accordingly.
diff --git a/src/xcb.h b/src/xcb.h
index 4b5b349..eaab47f 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -408,6 +408,11 @@ xcb_connection_t *xcb_connect(const char
xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
+/* xcb_xid.c */
+
+uint32_t xcb_generate_id(xcb_connection_t *c);
+
+
/**
* @}
*/
diff --git a/src/xcbext.h b/src/xcbext.h
index 4824660..01dd590 100644
--- a/src/xcbext.h
+++ b/src/xcbext.h
@@ -66,11 +66,6 @@ void *xcb_wait_for_reply(xcb_connection_
int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error);
-/* xcb_xid.c */
-
-uint32_t xcb_generate_id(xcb_connection_t *c);
-
-
/* xcb_util.c */
int xcb_popcount(uint32_t mask);
diff-tree b9e49b2a47e7388e20f8a5c009cdaf0b369e117c (from dd5ece606587d3e41058df803ab1804654195bbb)
Author: Josh Triplett <josh at freedesktop.org>
Date: Sat Oct 7 01:27:26 2006 -0700
Stop implicitly importing xproto; goes with proto change to explicitly import it
diff --git a/src/c-client.xsl b/src/c-client.xsl
index 406e9b6..f9897f7 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -68,9 +68,6 @@ authorization from the authors.
<xsl:for-each select="/xcb/import">
<path><xsl:value-of select="concat($extension-path, ., '.xml')" /></path>
</xsl:for-each>
- <xsl:if test="not($header='xproto')">
- <path><xsl:value-of select="concat($base-path, 'xproto.xml')" /></path>
- </xsl:if>
</xsl:variable>
<xsl:variable name="search-path" select="e:node-set($search-path-rtf)/path"/>
diff-tree dd5ece606587d3e41058df803ab1804654195bbb (from 16ec51397e0711526457709605cf6b5ebf00b5e2)
Author: Jamey Sharp <jamey at minilop.net>
Date: Sat Oct 7 01:27:03 2006 -0700
Declare "struct foo" or "enum foo" as well as the typedef'd name "foo".
diff --git a/src/c-client.xsl b/src/c-client.xsl
index 9fd9ccc..406e9b6 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -1077,6 +1077,8 @@ authorization from the authors.
</xsl:variable>
<xsl:text>typedef </xsl:text>
<xsl:if test="not(@kind)">struct</xsl:if><xsl:value-of select="@kind" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name" />
<xsl:text> {
</xsl:text>
<xsl:for-each select="exprfield|field|list[@fixed]|pad">
@@ -1097,7 +1099,9 @@ authorization from the authors.
<xsl:template match="enum" mode="output">
<xsl:if test="$h">
- <xsl:text>typedef enum {
+ <xsl:text>typedef enum </xsl:text>
+ <xsl:value-of select="@name" />
+ <xsl:text> {
</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separator"><xsl:text>,
diff-tree 16ec51397e0711526457709605cf6b5ebf00b5e2 (from 7b786bd8f34e67617beda4f952a5a636a370396a)
Author: Josh Triplett <josh at freedesktop.org>
Date: Sat Oct 7 00:14:50 2006 -0700
Handle "xidunion" instead of "union" for XID unions like DRAWABLE and FONTABLE
diff --git a/src/c-client.xsl b/src/c-client.xsl
index 4a7b50e..9fd9ccc 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -270,8 +270,8 @@ authorization from the authors.
<xsl:variable name="type-definitions"
select="(/xcb|document($search-path)/xcb
)[$is-unqualified or @header=$namespace]
- /*[((self::struct or self::union
- or self::xidtype or self::enum
+ /*[((self::struct or self::union or self::enum
+ or self::xidtype or self::xidunion
or self::event or self::eventcopy
or self::error or self::errorcopy)
and @name=$unqualified-type)
@@ -403,7 +403,7 @@ authorization from the authors.
</xsl:if>
</xsl:template>
- <xsl:template match="xidtype" mode="pass1">
+ <xsl:template match="xidtype|xidunion" mode="pass1">
<typedef oldname="uint32_t" newname="{xcb:xcb-prefix(@name)}_t" />
<iterator ref="{xcb:xcb-prefix(@name)}" />
<iterator-functions ref="{xcb:xcb-prefix(@name)}" />
diff-tree 7b786bd8f34e67617beda4f952a5a636a370396a (from c73ff37b907c8af6d03ab69cca27bc837c1cc189)
Author: Jamey Sharp <jamey at minilop.net>
Date: Fri Oct 6 23:32:18 2006 -0700
api_conv.pl: replace xcb_*_new with calls directly to xcb_generate_id, now that we have no type-safety XID wrappers.
diff --git a/tools/api_conv.pl b/tools/api_conv.pl
index 003a893..83fd82d 100755
--- a/tools/api_conv.pl
+++ b/tools/api_conv.pl
@@ -95,3 +95,4 @@ sub convert($$)
s/^(\s*#\s*include\s*<)X11\/XCB\//$1xcb\//;
s/([_A-Za-z][_A-Za-z0-9]*)([ \t]*\()?/convert($1, defined $2) . ($2 or "")/eg;
+s/xcb_[a-z0-9_]*_new/xcb_generate_id/g;
diff-tree c73ff37b907c8af6d03ab69cca27bc837c1cc189 (from 90eeb461be4975ff35d187ba64fedbb16ff13d15)
Author: Josh Triplett <josh at freedesktop.org>
Date: Fri Oct 6 20:11:19 2006 -0700
Refer to the "xlib lock" rather than the "IOLock" in xcbxlib.h
diff --git a/src/xcbxlib.h b/src/xcbxlib.h
index 628d71d..00c76fc 100644
--- a/src/xcbxlib.h
+++ b/src/xcbxlib.h
@@ -31,7 +31,8 @@
#include <pthread.h>
#include "xcb.h"
-/* This function must be called with the IOLock held. */
+/* The caller of this function must hold the xlib lock, using the lock
+ * functions below. */
unsigned int xcb_get_request_sent(xcb_connection_t *c);
void xcb_xlib_lock(xcb_connection_t *c);
diff-tree 90eeb461be4975ff35d187ba64fedbb16ff13d15 (from 9bd2c0c58fbe4c994e76619c2d67e46ed8b43030)
Author: Josh Triplett <josh at freedesktop.org>
Date: Fri Oct 6 17:44:53 2006 -0700
Remove XID wrapper structures and replace them with uint32_t typedefs
After positive feedback from several people, we have decided to remove the XID
wrapper structures that attempted to provide C type safety, and replace them
with uint32_t typedefs. Feedback has indicated that these type-safety hacks
generated more trouble than help.
We will bump the libxcb soname at the next release.
diff --git a/src/c-client.xsl b/src/c-client.xsl
index 982ec02..4a7b50e 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -404,17 +404,9 @@ authorization from the authors.
</xsl:template>
<xsl:template match="xidtype" mode="pass1">
- <struct name="{xcb:xcb-prefix(@name)}_t">
- <field type="uint32_t" name="xid" />
- </struct>
+ <typedef oldname="uint32_t" newname="{xcb:xcb-prefix(@name)}_t" />
<iterator ref="{xcb:xcb-prefix(@name)}" />
<iterator-functions ref="{xcb:xcb-prefix(@name)}" />
- <function type="{xcb:xcb-prefix(@name)}_t" name="{xcb:xcb-prefix(@name)}_new">
- <field type="xcb_connection_t *" name="c" />
- <l><xsl:value-of select="concat(xcb:xcb-prefix(@name), '_t')" /> ret;</l>
- <l>ret.xid = xcb_generate_id(c);</l>
- <l>return ret;</l>
- </function>
</xsl:template>
<xsl:template match="struct|union" mode="pass1">
diff-tree 9bd2c0c58fbe4c994e76619c2d67e46ed8b43030 (from 34168ab549fdf7c6c8a6fbe39824116698d01b12)
Author: Jamey Sharp <jamey at minilop.net>
Date: Fri Oct 6 16:47:50 2006 -0700
Remove xcb_get_io_lock from the Xlib-specific API: it is no longer used.
diff --git a/src/xcb_xlib.c b/src/xcb_xlib.c
index f352ca2..59f972c 100644
--- a/src/xcb_xlib.c
+++ b/src/xcb_xlib.c
@@ -35,13 +35,6 @@ unsigned int xcb_get_request_sent(xcb_co
return c->out.request;
}
-pthread_mutex_t *xcb_get_io_lock(xcb_connection_t *c)
-{
- if(c->has_error)
- return 0;
- return &c->iolock;
-}
-
void xcb_xlib_lock(xcb_connection_t *c)
{
_xcb_lock_io(c);
diff --git a/src/xcbxlib.h b/src/xcbxlib.h
index da4a044..628d71d 100644
--- a/src/xcbxlib.h
+++ b/src/xcbxlib.h
@@ -34,8 +34,6 @@
/* This function must be called with the IOLock held. */
unsigned int xcb_get_request_sent(xcb_connection_t *c);
-pthread_mutex_t *xcb_get_io_lock(xcb_connection_t *c);
-
void xcb_xlib_lock(xcb_connection_t *c);
void xcb_xlib_unlock(xcb_connection_t *c);
diff-tree 34168ab549fdf7c6c8a6fbe39824116698d01b12 (from 40589db8124b8c72894deb86a825c6117b0a2cd2)
Author: Jamey Sharp <jamey at minilop.net>
Date: Fri Oct 6 16:12:04 2006 -0700
Remove the 'int *error' out-parameter for xcb_poll_for_event.
diff --git a/src/xcb.h b/src/xcb.h
index 15c5768..4b5b349 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -224,12 +224,10 @@ xcb_generic_event_t *xcb_wait_for_event(
* Returns the next event or error from the server, if one is
* available, or returns @c NULL otherwise. If no event is available, that
* might be because an I/O error like connection close occurred while
- * attempting to read the next event. The @p error parameter is a
- * pointer to an int to be filled in with the I/O error status of the
- * operation. If @p error is @c NULL, terminates the application when an
- * I/O error occurs.
+ * attempting to read the next event, in which case the connection is
+ * shut down when this function returns.
*/
-xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c, int *error);
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
/**
* @brief Return the error for a request, or NULL if none can ever arrive.
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 41764df..b252ffc 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -395,33 +395,18 @@ xcb_generic_event_t *xcb_wait_for_event(
return ret;
}
-xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c, int *error)
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c)
{
+ xcb_generic_event_t *ret = 0;
if(!c->has_error)
{
- xcb_generic_event_t *ret = 0;
- int success;
_xcb_lock_io(c);
/* FIXME: follow X meets Z architecture changes. */
- success = _xcb_in_read(c);
- if(success)
+ if(_xcb_in_read(c)) /* _xcb_in_read shuts down the connection on error */
ret = get_event(c);
_xcb_unlock_io(c);
- if(success)
- {
- if(error)
- *error = 0;
- return ret;
- }
}
- if(error)
- *error = -1;
- else
- {
- fprintf(stderr, "xcb_poll_for_event: I/O error occured, but no handler provided.\n");
- abort();
- }
- return 0;
+ return ret;
}
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie)
diff-tree 40589db8124b8c72894deb86a825c6117b0a2cd2 (from 57b0cd8fea498a32ff2322583c7278d5e86aa4e8)
Author: Jamey Sharp <jamey at minilop.net>
Date: Wed Oct 4 15:01:00 2006 -0700
Add xcb_xlib_lock and xcb_xlib_unlock, a special-purpose two-level recursive lock just for libX11.
diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 3d18369..239d71b 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -59,6 +59,18 @@ static int set_fd_flags(const int fd)
return 1;
}
+static int _xcb_xlib_init(_xcb_xlib *xlib)
+{
+ xlib->lock = 0;
+ pthread_cond_init(&xlib->cond, 0);
+ return 1;
+}
+
+static void _xcb_xlib_destroy(_xcb_xlib *xlib)
+{
+ pthread_cond_destroy(&xlib->cond);
+}
+
static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
{
static const char pad[3];
@@ -215,6 +227,7 @@ xcb_connection_t *xcb_connect_to_fd(int
if(!(
set_fd_flags(fd) &&
pthread_mutex_init(&c->iolock, 0) == 0 &&
+ _xcb_xlib_init(&c->xlib) &&
_xcb_in_init(&c->in) &&
_xcb_out_init(&c->out) &&
write_setup(c, auth_info) &&
@@ -239,6 +252,7 @@ void xcb_disconnect(xcb_connection_t *c)
close(c->fd);
pthread_mutex_destroy(&c->iolock);
+ _xcb_xlib_destroy(&c->xlib);
_xcb_in_destroy(&c->in);
_xcb_out_destroy(&c->out);
@@ -258,6 +272,12 @@ void _xcb_conn_shutdown(xcb_connection_t
void _xcb_lock_io(xcb_connection_t *c)
{
pthread_mutex_lock(&c->iolock);
+ while(c->xlib.lock)
+ {
+ if(pthread_equal(c->xlib.thread, pthread_self()))
+ break;
+ pthread_cond_wait(&c->xlib.cond, &c->iolock);
+ }
}
void _xcb_unlock_io(xcb_connection_t *c)
diff --git a/src/xcb_xlib.c b/src/xcb_xlib.c
index 5e56426..f352ca2 100644
--- a/src/xcb_xlib.c
+++ b/src/xcb_xlib.c
@@ -26,6 +26,8 @@
#include "xcbxlib.h"
#include "xcbint.h"
+#include <assert.h>
+
unsigned int xcb_get_request_sent(xcb_connection_t *c)
{
if(c->has_error)
@@ -39,3 +41,22 @@ pthread_mutex_t *xcb_get_io_lock(xcb_con
return 0;
return &c->iolock;
}
+
+void xcb_xlib_lock(xcb_connection_t *c)
+{
+ _xcb_lock_io(c);
+ assert(!c->xlib.lock);
+ c->xlib.lock = 1;
+ c->xlib.thread = pthread_self();
+ _xcb_unlock_io(c);
+}
+
+void xcb_xlib_unlock(xcb_connection_t *c)
+{
+ _xcb_lock_io(c);
+ assert(c->xlib.lock);
+ assert(pthread_equal(c->xlib.thread, pthread_self()));
+ c->xlib.lock = 0;
+ pthread_cond_broadcast(&c->xlib.cond);
+ _xcb_unlock_io(c);
+}
diff --git a/src/xcbint.h b/src/xcbint.h
index 1dc6f93..d81e787 100644
--- a/src/xcbint.h
+++ b/src/xcbint.h
@@ -113,6 +113,15 @@ int _xcb_in_read(xcb_connection_t *c);
int _xcb_in_read_block(xcb_connection_t *c, void *buf, int nread);
+/* xcb_xlib.c */
+
+typedef struct _xcb_xlib {
+ int lock;
+ pthread_t thread;
+ pthread_cond_t cond;
+} _xcb_xlib;
+
+
/* xcb_xid.c */
typedef struct _xcb_xid {
@@ -150,6 +159,7 @@ struct xcb_connection_t {
/* I/O data */
pthread_mutex_t iolock;
+ _xcb_xlib xlib;
_xcb_in in;
_xcb_out out;
@@ -159,8 +169,6 @@ struct xcb_connection_t {
};
void _xcb_conn_shutdown(xcb_connection_t *c);
-void _xcb_lock_io(xcb_connection_t *c);
-void _xcb_unlock_io(xcb_connection_t *c);
int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count);
@@ -172,4 +180,10 @@ int _xcb_get_auth_info(int fd, xcb_auth_
#pragma GCC visibility pop
#endif
+
+/* xcb_conn.c symbols visible to xcb-xlib */
+
+void _xcb_lock_io(xcb_connection_t *c);
+void _xcb_unlock_io(xcb_connection_t *c);
+
#endif
diff --git a/src/xcbxlib.h b/src/xcbxlib.h
index 7e050c2..da4a044 100644
--- a/src/xcbxlib.h
+++ b/src/xcbxlib.h
@@ -36,4 +36,7 @@ unsigned int xcb_get_request_sent(xcb_co
pthread_mutex_t *xcb_get_io_lock(xcb_connection_t *c);
+void xcb_xlib_lock(xcb_connection_t *c);
+void xcb_xlib_unlock(xcb_connection_t *c);
+
#endif
diff-tree 57b0cd8fea498a32ff2322583c7278d5e86aa4e8 (from e7f473afbd02c87cc6b1fc9c7c240d6c5cc26763)
Author: Jamey Sharp <jamey at minilop.net>
Date: Wed Oct 4 12:23:45 2006 -0700
Factor out pthread_mutex_lock and unlock calls for the iolock.
diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 9aa7cdf..3d18369 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -97,12 +97,12 @@ static int write_setup(xcb_connection_t
}
assert(count <= sizeof(parts) / sizeof(*parts));
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
{
struct iovec *parts_ptr = parts;
ret = _xcb_out_send(c, &parts_ptr, &count);
}
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return ret;
}
@@ -255,6 +255,16 @@ void _xcb_conn_shutdown(xcb_connection_t
c->has_error = 1;
}
+void _xcb_lock_io(xcb_connection_t *c)
+{
+ pthread_mutex_lock(&c->iolock);
+}
+
+void _xcb_unlock_io(xcb_connection_t *c)
+{
+ pthread_mutex_unlock(&c->iolock);
+}
+
int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count)
{
int ret;
@@ -278,7 +288,7 @@ int _xcb_conn_wait(xcb_connection_t *c,
++c->out.writing;
}
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
do {
ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
} while (ret == -1 && errno == EINTR);
@@ -287,7 +297,7 @@ int _xcb_conn_wait(xcb_connection_t *c,
_xcb_conn_shutdown(c);
ret = 0;
}
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
if(ret)
{
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 604faab..41764df 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -318,7 +318,7 @@ void *xcb_wait_for_reply(xcb_connection_
if(c->has_error)
return 0;
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
/* If this request has not been written yet, write it. */
if(_xcb_out_flush_to(c, request))
@@ -358,7 +358,7 @@ void *xcb_wait_for_reply(xcb_connection_
}
wake_up_next_reader(c);
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return ret;
}
@@ -373,9 +373,9 @@ int xcb_poll_for_reply(xcb_connection_t
return 1; /* would not block */
}
assert(reply != 0);
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
ret = poll_for_reply(c, request, reply, error);
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return ret;
}
@@ -384,14 +384,14 @@ xcb_generic_event_t *xcb_wait_for_event(
xcb_generic_event_t *ret;
if(c->has_error)
return 0;
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
/* get_event returns 0 on empty list. */
while(!(ret = get_event(c)))
if(!_xcb_conn_wait(c, &c->in.event_cond, 0, 0))
break;
wake_up_next_reader(c);
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return ret;
}
@@ -401,12 +401,12 @@ xcb_generic_event_t *xcb_poll_for_event(
{
xcb_generic_event_t *ret = 0;
int success;
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
/* FIXME: follow X meets Z architecture changes. */
success = _xcb_in_read(c);
if(success)
ret = get_event(c);
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
if(success)
{
if(error)
diff --git a/src/xcb_out.c b/src/xcb_out.c
index 162abd4..74787e3 100644
--- a/src/xcb_out.c
+++ b/src/xcb_out.c
@@ -163,7 +163,7 @@ unsigned int xcb_send_request(xcb_connec
workaround = WORKAROUND_GLX_GET_FB_CONFIGS_BUG;
/* get a sequence number and arrange for delivery. */
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
/* wait for other writing threads to get out of my way. */
while(c->out.writing)
pthread_cond_wait(&c->out.cond, &c->iolock);
@@ -207,7 +207,7 @@ unsigned int xcb_send_request(xcb_connec
_xcb_conn_shutdown(c);
request = 0;
}
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return request;
}
@@ -216,9 +216,9 @@ int xcb_flush(xcb_connection_t *c)
int ret;
if(c->has_error)
return 0;
- pthread_mutex_lock(&c->iolock);
+ _xcb_lock_io(c);
ret = _xcb_out_flush_to(c, c->out.request);
- pthread_mutex_unlock(&c->iolock);
+ _xcb_unlock_io(c);
return ret;
}
diff --git a/src/xcbint.h b/src/xcbint.h
index 1a71696..1dc6f93 100644
--- a/src/xcbint.h
+++ b/src/xcbint.h
@@ -159,6 +159,8 @@ struct xcb_connection_t {
};
void _xcb_conn_shutdown(xcb_connection_t *c);
+void _xcb_lock_io(xcb_connection_t *c);
+void _xcb_unlock_io(xcb_connection_t *c);
int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count);
diff-tree e7f473afbd02c87cc6b1fc9c7c240d6c5cc26763 (from 408e74538676230e289d79c6b0195b464bfc6606)
Author: TORRI Vincent <torri at alf94-3-82-66-248-160.fbx.proxad.net>
Date: Sat Sep 30 13:06:58 2006 +0200
fix some indentation, remove args of the main function (not needed), xcb_sync -> xcb_aux_sync. Jamey, it seems that your script transforms XCBGetSetup into a type, instead of a function. Same for XCBSetupVendor. Maybe there are other fuctions that have the same problem.
diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html
index 64f36a4..ea53305 100644
--- a/doc/tutorial/index.html
+++ b/doc/tutorial/index.html
@@ -687,7 +687,7 @@ xcb_screen_iterator_t xcb_setup_roots_it
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -747,7 +747,7 @@ xcb_void_cookie_t xcb_create_window (xcb
uint16_t height, /* Height of the window (in pixels) */
uint16_t border_width, /* Width of the window's border (in pixels) */
uint16_t _class,
- xcb_visualid_t visual,
+ xcb_visualid_t visual,
uint32_t value_mask,
const uint32_t *value_list);
</pre>
@@ -772,7 +772,7 @@ xcb_void_cookie_t xcb_map_window (xcb_co
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -823,7 +823,7 @@ int xcb_flush (xcb_connection_t *c);
This function flushes all pending requests to the X server (much
like the <span class="code">fflush()</span> function is used to
flush standard output). The second function is
- <span class="code">xcb_sync()</span>:
+ <span class="code">xcb_aux_sync()</span>:
</p>
<pre class="code">
int xcb_aux_sync (xcb_connection_t *c);
@@ -917,7 +917,7 @@ xcb_void_cookie_t xcb_create_gc (xcb_con
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -1249,7 +1249,7 @@ xcb_void_cookie_t xcb_poly_fill_arc (xcb
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -1912,11 +1912,11 @@ print_modifiers (uint32_t mask)
}
int
-main (int argc, char *argv[])
+main ()
{
- xcb_connection_t *c;
- xcb_screen_t *screen;
- xcb_drawable_t win;
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
xcb_generic_event_t *e;
uint32_t mask = 0;
uint32_t values[2];
@@ -2146,7 +2146,7 @@ xcb_void_cookie_t xcb_change_property (x
#include <X11/XCB/xcb_atom.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -2676,7 +2676,7 @@ typedef struct {
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -2721,7 +2721,7 @@ xcb_void_cookie_t xcb_create_colormap (x
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -2822,7 +2822,7 @@ xcb_alloc_color_reply_t *xcb_alloc_color
#include <X11/XCB/xcb.h>
int
-main (int argc, char *argv[])
+main ()
{
xcb_connection_t *c;
xcb_screen_t *screen;
@@ -2973,12 +2973,12 @@ xcb_void_cookie_t xcb_copy_area (xcb_con
xcb_drawable_t src_drawable, /* The Drawable we want to paste */
xcb_drawable_t dst_drawable, /* The Drawable on which we copy the previous Drawable */
xcb_gcontext_t gc, /* A Graphic Context */
- int16_t src_x, /* Top left x coordinate of the region we want to copy */
- int16_t src_y, /* Top left y coordinate of the region we want to copy */
- int16_t dst_x, /* Top left x coordinate of the region where we want to copy */
- int16_t dst_y, /* Top left y coordinate of the region where we want to copy */
- uint16_t width, /* Width of the region we want to copy */
- uint16_t height); /* Height of the region we want to copy */
+ int16_t src_x, /* Top left x coordinate of the region we want to copy */
+ int16_t src_y, /* Top left y coordinate of the region we want to copy */
+ int16_t dst_x, /* Top left x coordinate of the region where we want to copy */
+ int16_t dst_y, /* Top left y coordinate of the region where we want to copy */
+ uint16_t width, /* Width of the region we want to copy */
+ uint16_t height); /* Height of the region we want to copy */
</pre>
<p>
As you can see, we could copy the whole pixmap, as well as
@@ -3143,7 +3143,7 @@ xcb_change_window_attributes (conn, wind
structure. They are obtained by using a function that requires a
<span class="code">xcb_connection_t *</span> or a member of the
<span class="code">xcb_setup_t</span> structure
- (via the function <span class="code">xcb_get_setup_t</span>), or
+ (via the function <span class="code">xcb_get_setup</span>), or
a function that requires that structure.
</p>
<ol>
@@ -3192,9 +3192,9 @@ c = xcb_connect (display_name, &scre
<li class="subtitle"><a name="ScreenCount"></a>ScreenCount
<p>
You get the count of screens with the functions
- <span class="code">xcb_get_setup_t</span>
+ <span class="code">xcb_get_setup</span>
and
- <span class="code">xcb_setup_roots_iterator_t</span>
+ <span class="code">xcb_setup_roots_iterator</span>
(if you need to iterate):
</p>
<pre class="code">
@@ -3225,10 +3225,10 @@ screen_count = xcb_setup_roots_length (x
<li class="subtitle"><a name="ServerVendor"></a>ServerVendor
<p>
You get the name of the vendor of the server hardware with
- the functions <span class="code">xcb_get_setup_t</span>
+ the functions <span class="code">xcb_get_setup</span>
and
<span
- class="code">xcb_setup_vendor_t</span>. Beware
+ class="code">xcb_setup_vendor</span>. Beware
that, unlike Xlib, the string returned by XCB is not
necessarily null-terminaled:
</p>
@@ -3250,7 +3250,7 @@ vendor[length] = '\0';
<p>
You get the major version of the protocol in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3266,7 +3266,7 @@ protocol_major_version = xcb_get_setup (
<p>
You get the minor version of the protocol in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3282,7 +3282,7 @@ protocol_minor_version = xcb_get_setup (
<p>
You get the number of the release of the server hardware in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3303,7 +3303,7 @@ release_number = xcb_get_setup (c)->r
<p>
You get the bitmap scanline unit in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3319,7 +3319,7 @@ bitmap_format_scanline_unit = xcb_get_se
<p>
You get the bitmap bit order in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3335,7 +3335,7 @@ bitmap_format_bit_order = xcb_get_setup
<p>
You get the bitmap scanline pad in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
@@ -3351,7 +3351,7 @@ bitmap_format_scanline_pad = xcb_get_set
<p>
You get the image byte order in the
<span class="code">xcb_setup_t</span>
- structure, with the function <span class="code">xcb_get_setup_t</span>:
+ structure, with the function <span class="code">xcb_get_setup</span>:
</p>
<pre class="code">
xcb_connection_t *c;
diff-tree 408e74538676230e289d79c6b0195b464bfc6606 (from 15993fccd0b0cba870b793345fb5c5ec13ece0c8)
Author: TORRI Vincent <torri at alf94-3-82-66-248-160.fbx.proxad.net>
Date: Sat Sep 30 12:45:12 2006 +0200
update tutorial to the new api. Add some doc about cursors. Add some colors to section 6 (Opening and closing the connection to an X server). Tell me if you want to keep colors or not (colors can be modified in xcb.css)
diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html
index b24c4ba..64f36a4 100644
--- a/doc/tutorial/index.html
+++ b/doc/tutorial/index.html
@@ -103,10 +103,11 @@
<li><a class="subsection" href="#pixmapsdraw">Drawing a pixmap in a window</a>
<li><a class="subsection" href="#pixmapsfree">Freeing a pixmap</a>
</ol>
- <li>Messing with the mouse cursor
+ <li><a class="subsection" href="#mousecursor">Messing with the mouse cursor</a>
<ol>
- <li>Creating and destroying a mouse cursor
- <li>Setting a window's mouse cursor
+ <li><a class="subsection" href="#mousecursorcreate">Creating and destroying a mouse cursor</a>
+ <li><a class="subsection" href="#mousecursorset">Setting a window's mouse cursor</a>
+ <li><a class="subsection" href="#mousecursorexample">Complete example</a>
</ol>
<li><a class="subsection" href="#translation">Translation of basic Xlib functions and macros</a>
<ol>
@@ -162,7 +163,7 @@
<p>
This tutorial is based on the
<a href="http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html">Xlib Tutorial</a>
- written by <a href="mailto:choor at atcom.co.il">Guy Keren</a>. The
+ written by <a href="mailto:choor at atcom dot co dot il">Guy Keren</a>. The
author allowed me to take some parts of his text, mainly the text which
deals with the X Windows generality.
</p>
@@ -300,7 +301,7 @@
requests to the X server.
<li>If the event was a quit message, exit the loop.
</ol>
- <li>Close down the connection to the X server.
+ <li>Close down the connection to the X server.
<li>Perform cleanup operations.
</ol>
<br>
@@ -322,7 +323,7 @@
given X server. It hides a queue of messages coming from the
server, and a queue of pending requests that our client
intends to send to the server. In XCB, this structure is named
- 'XCBConnection'. It is analogous to the Xlib Display.
+ 'xcb_connection_t'. It is analogous to the Xlib Display.
When we open a connection to an X server, the
library returns a pointer to such a structure. Later, we
supply this pointer to any XCB function that should send
@@ -393,7 +394,7 @@ double
get_time(void)
{
struct timeval timev;
-
+
gettimeofday(&timev, NULL);
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
@@ -402,46 +403,45 @@ get_time(void)
int
main ()
{
- XCBConnection *c;
- XCBATOM *atoms;
- XCBInternAtomCookie *cs;
- char **names;
- int count;
- int i;
- double start;
- double end;
- double diff;
+ xcb_connection_t *c;
+ xcb_atom_t *atoms;
+ xcb_intern_atom_cookie_t *cs;
+ char **names;
+ int count;
+ int i;
+ double start;
+ double end;
+ double diff;
/* Xlib */
Display *disp;
Atom *atoms_x;
double diff_x;
- c = XCBConnect (NULL, NULL);
+ c = xcb_connect (NULL, NULL);
count = 500;
- atoms = (XCBATOM *)malloc (count * sizeof (atoms));
+ atoms = (xcb_atom_t *)malloc (count * sizeof (atoms));
names = (char **)malloc (count * sizeof (char *));
/* init names */
- for (i = 0; i < count; ++i)
- {
- char buf[100];
+ for (i = 0; i < count; ++i) {
+ char buf[100];
- sprintf (buf, "NAME%d", i);
- names[i] = strdup (buf);
- }
+ sprintf (buf, "NAME%d", i);
+ names[i] = strdup (buf);
+ }
/* bad use */
start = get_time ();
for (i = 0; i < count; ++i)
- atoms[i] = XCBInternAtomReply (c,
- XCBInternAtom (c,
- 0,
- strlen(names[i]),
- names[i]),
- NULL)->atom;
+ atoms[i] = xcb_intern_atom_reply (c,
+ xcb_intern_atom (c,
+ 0,
+ strlen(names[i]),
+ names[i]),
+ NULL)->atom;
end = get_time ();
diff = end - start;
@@ -450,19 +450,18 @@ main ()
/* good use */
start = get_time ();
- cs = (XCBInternAtomCookie *) malloc (count * sizeof(XCBInternAtomCookie));
+ cs = (xcb_intern_atom_cookie_t *) malloc (count * sizeof(xcb_intern_atom_cookie_t));
for(i = 0; i < count; ++i)
- cs[i] = XCBInternAtom (c, 0, strlen(names[i]), names[i]);
+ cs[i] = xcb_intern_atom (c, 0, strlen(names[i]), names[i]);
- for(i = 0; i < count; ++i)
- {
- XCBInternAtomRep *r;
+ for(i = 0; i < count; ++i) {
+ xcb_intern_atom_reply_t *r;
- r = XCBInternAtomReply(c, cs[i], 0);
- if(r)
- atoms[i] = r->atom;
- free(r);
- }
+ r = xcb_intern_atom_reply(c, cs[i], 0);
+ if(r)
+ atoms[i] = r->atom;
+ free(r);
+ }
end = get_time ();
printf ("good use time : %f\n", end - start);
@@ -471,13 +470,11 @@ main ()
/* free var */
for (i = 0; i < count; ++i)
- {
- free (names[i]);
- }
+ free (names[i]);
free (atoms);
free (cs);
- XCBDisconnect (c);
+ xcb_disconnect (c);
/* Xlib */
disp = XOpenDisplay (getenv("DISPLAY"));
@@ -498,8 +495,8 @@ main ()
free (names);
XCloseDisplay (disp);
-
- return 1;
+
+ return 0;
}
</pre>
<li class="subtitle"><a name="gc">The Graphic Context</a>
@@ -554,22 +551,22 @@ main ()
</p>
<ul>
<li>pkgconfig 0.15.0
- <li>automake 1.7
- <li>autoconf 2.50
+ <li><a href="http://www.gnu.org/software/automake/">automake 1.7</a>
+ <li><a href="http://www.gnu.org/software/autoconf/">autoconf 2.50</a>
<li><a href="http://www.check.org">check</a>
<li><a href="http://xmlsoft.org/XSLT/">xsltproc</a>
+ <li><a href="http://www.gnu.org/software/gperf/">gperf 3.0.1</a>
</ul>
<p>
- You have to checkout in CVS the following modules:
+ You have to checkout in the git repository the following modules:
</p>
<ul>
- <li>Xproto from xlibs
<li>Xau from xlibs
<li>xcb-proto
<li>xcb
</ul>
<p>
- Note that Xproto and xcb-proto exist only to install header
+ Note that xcb-proto exists only to install header
files, so typing 'make' or 'make all' will produce the message
"Nothing to be done for 'all'". That's normal.
</p>
@@ -590,8 +587,8 @@ gcc -Wall prog.c -o prog `pkg-config --c
will be the one in the environment variable DISPLAY.
</p>
<pre class="code">
-XCBConnection *XCBConnect (const char *displayname,
- int *screenp);
+<type>xcb_connection_t</type> *xcb_connect (<keyword>const</keyword> <type>char</type> *displayname,
+ <type>int</type> *screenp);
</pre>
<p>
The second parameter returns the screen number used for the
@@ -599,24 +596,24 @@ XCBConnection *XCBConnect (const char *d
and is opaque. Here is how the connection can be opened:
</p>
<pre class="code">
-#include <X11/XCB/xcb.h>
+#<include>include</include> <string><X11/XCB/xcb.h></string>
-int
-main (int argc, char *argv[])
+<type>int</type>
+<function>main</function> ()
{
- XCBConnection *c;
-
+ <type>xcb_connection_t</type> *c;
+
/* Open the connection to the X server. Use the DISPLAY environment variable as the default display name */
- c = XCBConnect (NULL, NULL);
+ c = xcb_connect (NULL, NULL);
- return 1;
+ <keyword>return</keyword> 0;
}
</pre>
<p>
To close a connection, it suffices to use:
</p>
<pre class="code">
-void XCBDisconnect (XCBConnection *c);
+<type>void</type> xcb_disconnect (<type>xcb_connection_t</type> *c);
</pre>
<div class="comp">
<div class="title">
@@ -629,7 +626,7 @@ void XCBDisconnect (XCBConnection *c);
</div>
<div class="xcb">
<ul>
- <li>XCBConnect ()
+ <li>xcb_connect ()
</ul>
</div>
<div class="xlib">
@@ -639,7 +636,7 @@ void XCBDisconnect (XCBConnection *c);
</div>
<div class="xcb">
<ul>
- <li>XCBDisconnect ()
+ <li>xcb_disconnect ()
</ul>
</div>
</div>
@@ -651,35 +648,35 @@ void XCBDisconnect (XCBConnection *c);
basic information about it: what screens it has, what is the
size (width and height) of the screen, how many colors it
supports (black and white ? grey scale ?, 256 colors ? more ?),
- and so on. We get such information from the XCBSCREEN
+ and so on. We get such information from the xcb_screen_t
structure:
</p>
<pre class="code">
typedef struct {
- XCBWINDOW root;
- XCBCOLORMAP default_colormap;
- CARD32 white_pixel;
- CARD32 black_pixel;
- CARD32 current_input_masks;
- CARD16 width_in_pixels;
- CARD16 height_in_pixels;
- CARD16 width_in_millimeters;
- CARD16 height_in_millimeters;
- CARD16 min_installed_maps;
- CARD16 max_installed_maps;
- XCBVISUALID root_visual;
- BYTE backing_stores;
- BOOL save_unders;
- CARD8 root_depth;
- CARD8 allowed_depths_len;
-} XCBSCREEN;
+ xcb_window_t root;
+ xcb_colormap_t default_colormap;
+ uint32_t white_pixel;
+ uint32_t black_pixel;
+ uint32_t current_input_masks;
+ uint16_t width_in_pixels;
+ uint16_t height_in_pixels;
+ uint16_t width_in_millimeters;
+ uint16_t height_in_millimeters;
+ uint16_t min_installed_maps;
+ uint16_t max_installed_maps;
+ xcb_visualid_t root_visual;
+ uint8_t backing_stores;
+ uint8_t save_unders;
+ uint8_t root_depth;
+ uint8_t allowed_depths_len;
+} xcb_screen_t;
</pre>
<p>
We could retrieve the first screen of the connection by using the
following function:
</p>
<pre class="code">
-XCBSCREENIter XCBSetupRootsIter (XCBSetup *R);
+xcb_screen_iterator_t xcb_setup_roots_iterator (xcb_setup_t *R);
</pre>
<p>
Here is a small program that shows how to use this function:
@@ -692,22 +689,21 @@ XCBSCREENIter XCBSetupRootsIter (XCBSetu
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- int screen_nbr;
- XCBSCREENIter iter;
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ int screen_nbr;
+ xcb_screen_iterator_t iter;
+
/* Open the connection to the X server. Use the DISPLAY environment variable */
- c = XCBConnect (NULL, &screen_nbr);
-
+ c = xcb_connect (NULL, &screen_nbr);
+
/* Get the screen #screen_nbr */
- iter = XCBSetupRootsIter (XCBGetSetup (c));
- for (; iter.rem; --screen_nbr, XCBSCREENNext (&iter))
- if (screen_nbr == 0)
- {
- screen = iter.data;
- break;
- }
+ iter = xcb_setup_roots_iterator (xcb_get_setup (c));
+ for (; iter.rem; --screen_nbr, xcb_screen_next (&iter))
+ if (screen_nbr == 0) {
+ screen = iter.data;
+ break;
+ }
printf ("\n");
printf ("Informations of screen %ld:\n", screen->root.xid);
@@ -717,7 +713,7 @@ main (int argc, char *argv[])
printf (" black pixel...: %ld\n", screen->black_pixel);
printf ("\n");
- return 1;
+ return 0;
}
</pre>
<li class="title"><a name="helloworld">Creating a basic window - the "hello world" program</a>
@@ -728,42 +724,43 @@ main (int argc, char *argv[])
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBWINDOW;
+ uint32_t xid;
+} xcb_window_t;
</pre>
<p>
We first ask for a new Id for our window, with this function:
</p>
<pre class="code">
-XCBWINDOW XCBWINDOWNew(XCBConnection *c);
+xcb_window_t xcb_window_new(xcb_connection_t *c);
</pre>
<p>
Then, XCB supplies the following function to create new windows:
</p>
<pre class="code">
-XCBVoidCookie XCBCreateWindow (XCBConnection *c, /* Pointer to the XCBConnection structure */
- CARD8 depth, /* Depth of the screen */
- XCBWINDOW wid, /* Id of the window */
- XCBWINDOW parent, /* Id of an existing window that should be the parent of the new window */
- INT16 x, /* X position of the top-left corner of the window (in pixels) */
- INT16 y, /* Y position of the top-left corner of the window (in pixels) */
- CARD16 width, /* Width of the window (in pixels) */
- CARD16 height, /* Height of the window (in pixels) */
- CARD16 border_width, /* Width of the window's border (in pixels) */
- CARD16 _class,
- XCBVISUALID visual,
- CARD32 value_mask,
- const CARD32 *value_list);
+xcb_void_cookie_t xcb_create_window (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t depth, /* Depth of the screen */
+ xcb_window_t wid, /* Id of the window */
+ xcb_window_t parent, /* Id of an existing window that should be the parent of the new window */
+ int16_t x, /* X position of the top-left corner of the window (in pixels) */
+ int16_t y, /* Y position of the top-left corner of the window (in pixels) */
+ uint16_t width, /* Width of the window (in pixels) */
+ uint16_t height, /* Height of the window (in pixels) */
+ uint16_t border_width, /* Width of the window's border (in pixels) */
+ uint16_t _class,
+ xcb_visualid_t visual,
+ uint32_t value_mask,
+ const uint32_t *value_list);
</pre>
<p>
The fact that we created the window does not mean that it will
be drawn on screen. By default, newly created windows are not
mapped on the screen (they are invisible). In order to make our
- window visible, we use the function <span class="code">XCBMapWindow()</span>, whose
+ window visible, we use the function <span class="code">xcb_map_window()</span>, whose
prototype is
</p>
<pre class="code">
-XCBVoidCookie XCBMapWindow (XCBConnection *c, XCBWINDOW window);
+xcb_void_cookie_t xcb_map_window (xcb_connection_t *c,
+ xcb_window_t window);
</pre>
<p>
Finally, here is a small program to create a window of size
@@ -777,72 +774,72 @@ XCBVoidCookie XCBMapWindow (XCBConnectio
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBDRAWABLE win;
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+
/* Open the connection to the X server */
- c = XCBConnect (NULL, NULL);
-
+ c = xcb_connect (NULL, NULL);
+
/* Get the first screen */
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* Ask for our window's Id */
- win.window = XCBWINDOWNew(c);
+ win.window = xcb_window_new(c);
/* Create the window */
- XCBCreateWindow (c, /* Connection */
- XCBCopyFromParent, /* depth (same as root)*/
- win.window, /* window Id */
- screen->root, /* parent window */
- 0, 0, /* x, y */
- 150, 150, /* width, height */
- 10, /* border_width */
- XCBWindowClassInputOutput,/* class */
- screen->root_visual, /* visual */
- 0, NULL); /* masks, not used yet */
+ xcb_create_window (c, /* Connection */
+ XCB_COPY_FROM_PARENT, /* depth (same as root)*/
+ win.window, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ 0, NULL); /* masks, not used yet */
/* Map the window on the screen */
- XCBMapWindow (c, win.window);
+ xcb_map_window (c, win.window);
/* Make sure commands are sent before we pause, so window is shown */
- XCBFlush (c);
-
+ xcb_flush (c);
+
pause (); /* hold client until Ctrl-C */
- return 1;
+ return 0;
}
</pre>
<p>
- In this code, you see one more function - <span class="code">XCBFlush()</span>, not explained
+ In this code, you see one more function - <span class="code">xcb_flush()</span>, not explained
yet. It is used to flush all the pending requests. More
precisely, there are 2 functions that do such things. The first
- one is <span class="code">XCBFlush()</span>:
+ one is <span class="code">xcb_flush()</span>:
</p>
<pre class="code">
-int XCBFlush (XCBConnection *c);
+int xcb_flush (xcb_connection_t *c);
</pre>
<p>
This function flushes all pending requests to the X server (much
like the <span class="code">fflush()</span> function is used to
- flush standard output). The second function is
- <span class="code">XCBSync()</span>:
+ flush standard output). The second function is
+ <span class="code">xcb_sync()</span>:
</p>
<pre class="code">
-int XCBSync(XCBConnection *c, XCBGenericError **e);
+int xcb_aux_sync (xcb_connection_t *c);
</pre>
<p>
This functions also flushes all pending requests to the X
server, and then waits until the X server finishing processing
these requests. In a normal program, this will not be necessary
(we'll see why when we get to write a normal X program), but for
- now, we put it there.
+ now, we put it there.
</p>
<p>
The window that is created by the above code has a default
background (gray). This one can be set to a specific color,
thanks to the two last parameters of
- <span class="code">XCBCreateWindow()</span>, which are not
+ <span class="code">xcb_create_window()</span>, which are not
described yet. See the subsections
<a href="#winconf">Configuring a window</a> or
<a href="#winconf">Registering for event types using event masks</a>
@@ -865,8 +862,8 @@ int XCBSync(XCBConnection *c, XCBGeneric
</div>
<div class="xcb">
<ul>
- <li>XCBWINDOWNew ()
- <li>XCBCreateWindow ()
+ <li>xcb_window_new ()
+ <li>xcb_create_window ()
</ul>
</div>
</div>
@@ -891,64 +888,64 @@ int XCBSync(XCBConnection *c, XCBGeneric
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBGCONTEXT;
+ uint32_t xid;
+} xcb_gcontext_t;
</pre>
<p>
We first ask the X server to attribute an Id to our graphic
context with this function:
</p>
<pre class="code">
-XCBGCONTEXT XCBGCONTEXTNew (XCBConnection *c);
+xcb_gcontext_t xcb_gcontext_new (xcb_connection_t *c);
</pre>
<p>
Then, we set the attributes of the graphic context with this function:
</p>
<pre class="code">
-XCBVoidCookie XCBCreateGC (XCBConnection *c,
- XCBGCONTEXT cid,
- XCBDRAWABLE drawable,
- CARD32 value_mask,
- const CARD32 *value_list);
+xcb_void_cookie_t xcb_create_gc (xcb_connection_t *c,
+ xcb_gcontext_t cid,
+ xcb_drawable_t drawable,
+ uint32_t value_mask,
+ const uint32_t *value_list);
</pre>
<p>
We give now an example on how to allocate a graphic context
that specifies that each drawing function that uses it will
draw in foreground with a black color.
- </p>
+ </p>
<pre class="code">
#include <X11/XCB/xcb.h>
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBDRAWABLE win;
- XCBGCONTEXT black;
- CARD32 mask;
- CARD32 value[1];
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+ xcb_gcontext_t black;
+ uint32_t mask;
+ uint32_t value[1];
+
/* Open the connection to the X server and get the first screen */
- c = XCBConnect (NULL, NULL);
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* Create a black graphic context for drawing in the foreground */
win.window = screen->root;
- black = XCBGCONTEXTNew (c);
- mask = XCBGCForeground;
+ black = xcb_gcontext_new (c);
+ mask = XCB_GC_FOREGROUND;
value[0] = screen->black_pixel;
- XCBCreateGC (c, black, win, mask, value);
+ xcb_create_gc (c, black, win, mask, value);
- return 1;
+ return 0;
}
</pre>
<p>
Note should be taken regarding the role of "value_mask" and
- "value_list" in the prototype of <span class="code">XCBCreateGC()</span>. Since a
+ "value_list" in the prototype of <span class="code">xcb_create_gc()</span>. Since a
graphic context has many attributes, and since we often just
want to define a few of them, we need to be able to tell the
- <span class="code">XCBCreateGC()</span> which attributes we
+ <span class="code">xcb_create_gc()</span> which attributes we
want to set. This is what the "value_mask" parameter is
for. We then use the "value_list" parameter to specify actual
values for the attribute we defined in "value_mask". Thus, for
@@ -973,8 +970,8 @@ main (int argc, char *argv[])
</div>
<div class="xcb">
<ul>
- <li>XCBGCONTEXTNew ()
- <li>XCBCreateGC ()
+ <li>xcb_gcontext_new ()
+ <li>xcb_create_gc ()
</ul>
</div>
</div>
@@ -989,39 +986,39 @@ main (int argc, char *argv[])
by using this function:
</p>
<pre class="code">
-XCBVoidCookie XCBChangeGC (XCBConnection *c, /* The XCB Connection */
- XCBGCONTEXT gc, /* The Graphic Context */
- CARD32 value_mask, /* Components of the Graphic Context that have to be set */
- const CARD32 *value_list); /* Value as specified by value_mask */
+xcb_void_cookie_t xcb_change_gc (xcb_connection_t *c, /* The XCB Connection */
+ xcb_gcontext_t gc, /* The Graphic Context */
+ uint32_t value_mask, /* Components of the Graphic Context that have to be set */
+ const uint32_t *value_list); /* Value as specified by value_mask */
</pre>
<p>
The <span class="code">value_mask</span> parameter could take
- any combination of these masks from the XCBGC enumeration:
+ any combination of these masks from the xcb_gc_t enumeration:
</p>
<ul>
- <li>XCBGCFunction
- <li>XCBGCPlaneMask
- <li>XCBGCForeground
- <li>XCBGCBackground
- <li>XCBGCLineWidth
- <li>XCBGCLineStyle
- <li>XCBGCCapStyle
- <li>XCBGCJoinStyle
- <li>XCBGCFillStyle
- <li>XCBGCFillRule
- <li>XCBGCTile
- <li>XCBGCStipple
- <li>XCBGCTileStippleOriginX
- <li>XCBGCTileStippleOriginY
- <li>XCBGCFont
- <li>XCBGCSubwindowMode
- <li>XCBGCGraphicsExposures
- <li>XCBGCClipOriginX
- <li>XCBGCClipOriginY
- <li>XCBGCClipMask
- <li>XCBGCDashOffset
- <li>XCBGCDashList
- <li>XCBGCArcMode
+ <li>XCB_GC_FUNCTION
+ <li>XCB_GC_PLANE_MASK
+ <li>XCB_GC_FOREGROUND
+ <li>XCB_GC_BACKGROUND
+ <li>XCB_GC_LINE_WIDTH
+ <li>XCB_GC_LINE_STYLE
+ <li>XCB_GC_CAP_STYLE
+ <li>XCB_GC_JOIN_STYLE
+ <li>XCB_GC_FILL_STYLE
+ <li>XCB_GC_FILL_RULE
+ <li>XCB_GC_TILE
+ <li>XCB_GC_STIPPLE
+ <li>XCB_GC_TILE_STIPPLE_ORIGIN_X
+ <li>XCB_GC_TILE_STIPPLE_ORIGIN_Y
+ <li>XCB_GC_FONT
+ <li>XCB_GC_SUBWINDOW_MODE
+ <li>XCB_GC_GRAPHICS_EXPOSURES
+ <li>XCB_GC_CLIP_ORIGIN_X
+ <li>XCB_GC_CLIP_ORIGIN_Y
+ <li>XCB_GC_CLIP_MASK
+ <li>XCB_GC_DASH_OFFSET
+ <li>XCB_GC_DASH_LIST
+ <li>XCB_GC_ARC_MODE
</ul>
<p>
It is possible to set several attributes at the same
@@ -1051,34 +1048,34 @@ XCBVoidCookie XCBChangeGC (XCBConnection
To draw a point, or several points, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyPoint (XCBConnection *c, /* The connection to the X server */
- BYTE coordinate_mode, /* Coordinate mode, usually set to XCBCoordModeOrigin */
- XCBDRAWABLE drawable, /* The drawable on which we want to draw the point(s) */
- XCBGCONTEXT gc, /* The Graphic Context we use to draw the point(s) */
- CARD32 points_len, /* The number of points */
- const XCBPOINT *points); /* An array of points */
+xcb_void_cookie_t xcb_poly_point (xcb_connection_t *c, /* The connection to the X server */
+ uint8_t coordinate_mode, /* Coordinate mode, usually set to XCB_COORD_MODE_ORIGIN */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the point(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the point(s) */
+ uint32_t points_len, /* The number of points */
+ const xcb_point_t *points); /* An array of points */
</pre>
<p>
The <span class="code">coordinate_mode</span> parameter
specifies the coordinate mode. Available values are
</p>
<ul>
- <li><span class="code">XCBCoordModeOrigin</span>
- <li><span class="code">XCBCoordModePrevious</span>
+ <li><span class="code">XCB_COORD_MODE_ORIGIN</span>
+ <li><span class="code">XCB_COORD_MODE_PREVIOUS</span>
</ul>
<p>
- If XCBCoordModePrevious is used, then all points but the first one
+ If XCB_COORD_MODE_PREVIOUS is used, then all points but the first one
are relative to the immediately previous point.
</p>
<p>
- The <span class="code">XCBPOINT</span> type is just a
+ The <span class="code">xcb_point_t</span> type is just a
structure with two fields (the coordinates of the point):
</p>
<pre class="code">
typedef struct {
- INT16 x;
- INT16 y;
-} XCBPOINT;
+ int16_t x;
+ int16_t y;
+} xcb_point_t;
</pre>
<p>
You could see an example in xpoints.c. <b>TODO</b> Set the link.
@@ -1087,12 +1084,12 @@ typedef struct {
To draw a line, or a polygonal line, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyLine (XCBConnection *c, /* The connection to the X server */
- BYTE coordinate_mode, /* Coordinate mode, usually set to XCBCoordModeOrigin */
- XCBDRAWABLE drawable, /* The drawable on which we want to draw the line(s) */
- XCBGCONTEXT gc, /* The Graphic Context we use to draw the line(s) */
- CARD32 points_len, /* The number of points in the polygonal line */
- const XCBPOINT *points); /* An array of points */
+xcb_void_cookie_t xcb_poly_line (xcb_connection_t *c, /* The connection to the X server */
+ uint8_t coordinate_mode, /* Coordinate mode, usually set to XCB_COORD_MODE_ORIGIN */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the line(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the line(s) */
+ uint32_t points_len, /* The number of points in the polygonal line */
+ const xcb_point_t *points); /* An array of points */
</pre>
<p>
This function will draw the line between the first and the
@@ -1103,47 +1100,47 @@ XCBVoidCookie XCBPolyLine (XCBConnection
To draw a segment, or several segments, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolySegment (XCBConnection *c, /* The connection to the X server */
- XCBDRAWABLE drawable, /* The drawable on which we want to draw the segment(s) */
- XCBGCONTEXT gc, /* The Graphic Context we use to draw the segment(s) */
- CARD32 segments_len, /* The number of segments */
- const XCBSEGMENT *segments); /* An array of segments */
+xcb_void_cookie_t xcb_poly_segment (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the segment(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the segment(s) */
+ uint32_t segments_len, /* The number of segments */
+ const xcb_segment_t *segments); /* An array of segments */
</pre>
<p>
- The <span class="code">XCBSEGMENT</span> type is just a
+ The <span class="code">xcb_segment_t</span> type is just a
structure with four fields (the coordinates of the two points
that define the segment):
</p>
<pre class="code">
typedef struct {
- INT16 x1;
- INT16 y1;
- INT16 x2;
- INT16 y2;
-} XCBSEGMENT;
+ int16_t x1;
+ int16_t y1;
+ int16_t x2;
+ int16_t y2;
+} xcb_segment_t;
</pre>
<p>
To draw a rectangle, or several rectangles, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyRectangle (XCBConnection *c, /* The connection to the X server */
- XCBDRAWABLE drawable, /* The drawable on which we want to draw the rectangle(s) */
- XCBGCONTEXT gc, /* The Graphic Context we use to draw the rectangle(s) */
- CARD32 rectangles_len, /* The number of rectangles */
- const XCBRECTANGLE *rectangles); /* An array of rectangles */
+xcb_void_cookie_t xcb_poly_rectangle (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the rectangle(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the rectangle(s) */
+ uint32_t rectangles_len, /* The number of rectangles */
+ const xcb_rectangle_t *rectangles); /* An array of rectangles */
</pre>
<p>
- The <span class="code">XCBRECTANGLE</span> type is just a
+ The <span class="code">xcb_rectangle_t</span> type is just a
structure with four fields (the coordinates of the top-left
corner of the rectangle, and its width and height):
</p>
<pre class="code">
typedef struct {
- INT16 x;
- INT16 y;
- CARD16 width;
- CARD16 height;
-} XCBRECTANGLE;
+ int16_t x;
+ int16_t y;
+ uint16_t width;
+ uint16_t height;
+} xcb_rectangle_t;
</pre>
<!-- There's no coordinate_mode. Is it normal? -->
<!-- [iano] Yes, it's not in the protocol. -->
@@ -1151,25 +1148,25 @@ typedef struct {
To draw an elliptical arc, or several elliptical arcs, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyArc (XCBConnection *c, /* The connection to the X server */
- XCBDRAWABLE drawable, /* The drawable on which we want to draw the arc(s) */
- XCBGCONTEXT gc, /* The Graphic Context we use to draw the arc(s) */
- CARD32 arcs_len, /* The number of arcs */
- const XCBARC *arcs); /* An array of arcs */
+xcb_void_cookie_t xcb_poly_arc (xcb_connection_t *c, /* The connection to the X server */
+ xcb_drawable_t drawable, /* The drawable on which we want to draw the arc(s) */
+ xcb_gcontext_t gc, /* The Graphic Context we use to draw the arc(s) */
+ uint32_t arcs_len, /* The number of arcs */
+ const xcb_arc_t *arcs); /* An array of arcs */
</pre>
<p>
- The <span class="code">XCBARC</span> type is a structure with
+ The <span class="code">xcb_arc_t</span> type is a structure with
six fields:
</p>
<pre class="code">
typedef struct {
- INT16 x; /* Top left x coordinate of the rectangle surrounding the ellipse */
- INT16 y; /* Top left y coordinate of the rectangle surrounding the ellipse */
- CARD16 width; /* Width of the rectangle surrounding the ellipse */
- CARD16 height; /* Height of the rectangle surrounding the ellipse */
- INT16 angle1; /* Angle at which the arc begins */
- INT16 angle2; /* Angle at which the arc ends */
-} XCBARC;
+ int16_t x; /* Top left x coordinate of the rectangle surrounding the ellipse */
+ int16_t y; /* Top left y coordinate of the rectangle surrounding the ellipse */
+ uint16_t width; /* Width of the rectangle surrounding the ellipse */
+ uint16_t height; /* Height of the rectangle surrounding the ellipse */
+ int16_t angle1; /* Angle at which the arc begins */
+ int16_t angle2; /* Angle at which the arc ends */
+} xcb_arc_t;
</pre>
<div class="emph">
<p>
@@ -1196,13 +1193,13 @@ typedef struct {
we use
</p>
<pre class="code">
-XCBVoidCookie XCBFillPoly (XCBConnection *c,
- XCBDRAWABLE drawable,
- XCBGCONTEXT gc,
- CARD8 shape,
- CARD8 coordinate_mode,
- CARD32 points_len,
- const XCBPOINT *points);
+xcb_void_cookie_t xcb_fill_poly (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint8_t shape,
+ uint8_t coordinate_mode,
+ uint32_t points_len,
+ const xcb_point_t *points);
</pre>
<p>
The <span class="code">shape</span> parameter specifies a
@@ -1210,29 +1207,29 @@ XCBVoidCookie XCBFillPoly (XCBConnection
values are
</p>
<ul>
- <li><span class="code">XCBPolyShapeComplex</span>
- <li><span class="code">XCBPolyShapeNonconvex</span>
- <li><span class="code">XCBPolyShapeConvex</span>
+ <li><span class="code">XCB_POLY_SHAPE_COMPLEX</span>
+ <li><span class="code">XCB_POLY_SHAPE_NONCONVEX</span>
+ <li><span class="code">XCB_POLY_SHAPE_CONVEX</span>
</ul>
<p>
To fill one or several rectangles, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyFillRectangle (XCBConnection *c,
- XCBDRAWABLE drawable,
- XCBGCONTEXT gc,
- CARD32 rectangles_len,
- const XCBRECTANGLE *rectangles);
+xcb_void_cookie_t xcb_poly_fill_rectangle (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint32_t rectangles_len,
+ const xcb_rectangle_t *rectangles);
</pre>
<p>
To fill one or several arcs, we use
</p>
<pre class="code">
-XCBVoidCookie XCBPolyFillArc (XCBConnection *c,
- XCBDRAWABLE drawable,
- XCBGCONTEXT gc,
- CARD32 arcs_len,
- const XCBARC *arcs);
+xcb_void_cookie_t xcb_poly_fill_arc (xcb_connection_t *c,
+ xcb_drawable_t drawable,
+ xcb_gcontext_t gc,
+ uint32_t arcs_len,
+ const xcb_arc_t *arcs);
</pre>
<br>
<a name="points.c"></a>
@@ -1245,152 +1242,121 @@ XCBVoidCookie XCBPolyFillArc (XCBConnect
<p>
<b>TODO:</b> Use screen->root_depth for depth parameter.
</p>
- <p>
- <b>TODO:</b> Remove get_depth(). It isn't used!
- </p>
<pre class="code">
#include <stdlib.h>
#include <stdio.h>
#include <X11/XCB/xcb.h>
-/* Get the depth of the screen. Needed in order to draw something */
-int
-get_depth(XCBConnection *c,
- XCBSCREEN *root)
-{
- XCBDRAWABLE drawable;
- XCBGetGeometryRep *geom;
- int depth;
-
- drawable.window = root->root;
- geom = XCBGetGeometryReply (c, XCBGetGeometry(c, drawable), 0);
-
- if(!geom)
- {
- perror ("GetGeometry(root) failed");
- exit (0);
- }
-
- depth = geom->depth;
- free (geom);
-
- return depth;
-}
-
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBDRAWABLE win;
- XCBGCONTEXT foreground;
- XCBGenericEvent *e;
- CARD32 mask = 0;
- CARD32 values[2];
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+ xcb_gcontext_t foreground;
+ xcb_generic_event_t *e;
+ uint32_t mask = 0;
+ uint32_t values[2];
/* geometric objects */
- XCBPOINT points[] = {
+ xcb_point_t points[] = {
{10, 10},
{10, 20},
{20, 10},
{20, 20}};
- XCBPOINT polyline[] = {
+ xcb_point_t polyline[] = {
{50, 10},
{ 5, 20}, /* rest of points are relative */
{25,-20},
{10, 10}};
- XCBSEGMENT segments[] = {
+ xcb_segment_t segments[] = {
{100, 10, 140, 30},
{110, 25, 130, 60}};
- XCBRECTANGLE rectangles[] = {
+ xcb_rectangle_t rectangles[] = {
{ 10, 50, 40, 20},
{ 80, 50, 10, 40}};
- XCBARC arcs[] = {
+ xcb_arc_t arcs[] = {
{10, 100, 60, 40, 0, 90 << 6},
{90, 100, 55, 40, 0, 270 << 6}};
-
+
/* Open the connection to the X server */
- c = XCBConnect (NULL, NULL);
-
+ c = xcb_connect (NULL, NULL);
+
/* Get the first screen */
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* Create black (foreground) graphic context */
win.window = screen->root;
- foreground = XCBGCONTEXTNew (c);
- mask = XCBGCForeground | XCBGCGraphicsExposures;
+ foreground = xcb_gcontext_new (c);
+ mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
values[0] = screen->black_pixel;
values[1] = 0;
- XCBCreateGC (c, foreground, win, mask, values);
+ xcb_create_gc (c, foreground, win, mask, values);
/* Ask for our window's Id */
- win.window = XCBWINDOWNew(c);
+ win.window = xcb_window_new(c);
/* Create the window */
- mask = XCBCWBackPixel | XCBCWEventMask;
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
values[0] = screen->white_pixel;
- values[1] = XCBEventMaskExposure;
- XCBCreateWindow (c, /* Connection */
- XCBCopyFromParent, /* depth */
- win.window, /* window Id */
- screen->root, /* parent window */
- 0, 0, /* x, y */
- 150, 150, /* width, height */
- 10, /* border_width */
- XCBWindowClassInputOutput,/* class */
- screen->root_visual, /* visual */
- mask, values); /* masks */
+ values[1] = XCB_EVENT_MASK_EXPOSURE;
+ xcb_create_window (c, /* Connection */
+ XCB_COPY_FROM_PARENT, /* depth */
+ win.window, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ mask, values); /* masks */
/* Map the window on the screen */
- XCBMapWindow (c, win.window);
+ xcb_map_window (c, win.window);
/* We flush the request */
- XCBFlush (c);
+ xcb_flush (c);
+
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ /* We draw the points */
+ xcb_poly_point (c, XCB_COORD_MODE_ORIGIN, win, foreground, 4, points);
- while ((e = XCBWaitForEvent (c)))
- {
- switch (e->response_type & ~0x80)
- {
- case XCBExpose:
- {
- /* We draw the points */
- XCBPolyPoint (c, XCBCoordModeOrigin, win, foreground, 4, points);
-
- /* We draw the polygonal line */
- XCBPolyLine (c, XCBCoordModePrevious, win, foreground, 4, polyline);
-
- /* We draw the segements */
- XCBPolySegment (c, win, foreground, 2, segments);
-
- /* We draw the rectangles */
- XCBPolyRectangle (c, win, foreground, 2, rectangles);
-
- /* We draw the arcs */
- XCBPolyArc (c, win, foreground, 2, arcs);
-
- /* We flush the request */
- XCBFlush (c);
-
- break;
- }
- default:
- {
- /* Unknown event type, ignore it */
- break;
- }
- }
- /* Free the Generic Event */
- free (e);
+ /* We draw the polygonal line */
+ xcb_poly_line (c, XCB_COORD_MODE_PREVIOUS, win, foreground, 4, polyline);
+
+ /* We draw the segements */
+ xcb_poly_segment (c, win, foreground, 2, segments);
+
+ /* We draw the rectangles */
+ xcb_poly_rectangle (c, win, foreground, 2, rectangles);
+
+ /* We draw the arcs */
+ xcb_poly_arc (c, win, foreground, 2, arcs);
+
+ /* We flush the request */
+ xcb_flush (c);
+
+ break;
}
+ default: {
+ /* Unknown event type, ignore it */
+ break;
+ }
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
- return 1;
+ return 0;
}
</pre>
</ol>
@@ -1418,32 +1384,32 @@ main (int argc, char *argv[])
</p>
<p>
In XCB, you use the "value_mask" and "value_list" data in the
- <span class="code">XCBCreateWindow()</span> function to
+ <span class="code">xcb_create_window()</span> function to
register for events. Here is how we register for
<span class="code">Expose</span> event when creating a window:
</p>
<pre class="code">
- mask = XCBCWEventMask;
- valwin[0] = XCBEventMaskExposure;
- win.window = XCBWINDOWNew (c);
- XCBCreateWindow (c, depth, win.window, root->root,
- 0, 0, 150, 150, 10,
- XCBWindowClassInputOutput, root->root_visual,
- mask, valwin);
+ mask = XCB_CW_EVENT_MASK;
+ valwin[0] = XCB_EVENT_MASK_EXPOSURE;
+ win.window = xcb_window_new (c);
+ xcb_create_window (c, depth, win.window, root->root,
+ 0, 0, 150, 150, 10,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual,
+ mask, valwin);
</pre>
<p>
- <span class="code">XCBEventMaskExposure</span> is a constant defined
- in the XCBEventMask enumeration in the "xproto.h" header file. If we wanted to register for several
+ <span class="code">XCB_EVENT_MASK_EXPOSURE</span> is a constant defined
+ in the xcb_event_mask_t enumeration in the "xproto.h" header file. If we wanted to register for several
event types, we can logically "or" them, as follows:
</p>
<pre class="code">
- mask = XCBCWEventMask;
- valwin[0] = XCBEventMaskExposure | XCBEventMaskButtonPress;
- win.window = XCBWINDOWNew (c);
- XCBCreateWindow (c, depth, win.window, root->root,
- 0, 0, 150, 150, 10,
- XCBWindowClassInputOutput, root->root_visual,
- mask, valwin);
+ mask = XCB_CW_EVENT_MASK;
+ valwin[0] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS;
+ win.window = xcb_window_new (c);
+ xcb_create_window (c, depth, win.window, root->root,
+ 0, 0, 150, 150, 10,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, root->root_visual,
+ mask, valwin);
</pre>
<p>
This registers for <span class="code">Expose</span> events as
@@ -1453,43 +1419,43 @@ main (int argc, char *argv[])
</p>
<p>
The values that a mask could take are given
- by the <span class="code">XCBCW</span> enumeration:
+ by the <span class="code">xcb_cw_t</span> enumeration:
</p>
<pre class="code">
typedef enum {
- XCBCWBackPixmap = 1L<<0,
- XCBCWBackPixel = 1L<<1,
- XCBCWBorderPixmap = 1L<<2,
- XCBCWBorderPixel = 1L<<3,
- XCBCWBitGravity = 1L<<4,
- XCBCWWinGravity = 1L<<5,
- XCBCWBackingStore = 1L<<6,
- XCBCWBackingPlanes = 1L<<7,
- XCBCWBackingPixel = 1L<<8,
- XCBCWOverrideRedirect = 1L<<9,
- XCBCWSaveUnder = 1L<<10,
- XCBCWEventMask = 1L<<11,
- XCBCWDontPropagate = 1L<<12,
- XCBCWColormap = 1L<<13,
- XCBCWCursor = 1L<<14
-} XCBCW;
+ XCB_CW_BACK_PIXMAP = 1L<<0,
+ XCB_CW_BACK_PIXEL = 1L<<1,
+ XCB_CW_BORDER_PIXMAP = 1L<<2,
+ XCB_CW_BORDER_PIXEL = 1L<<3,
+ XCB_CW_BIT_GRAVITY = 1L<<4,
+ XCB_CW_WIN_GRAVITY = 1L<<5,
+ XCB_CW_BACKING_STORE = 1L<<6,
+ XCB_CW_BACKING_PLANES = 1L<<7,
+ XCB_CW_BACKING_PIXEL = 1L<<8,
+ XCB_CW_OVERRIDE_REDIRECT = 1L<<9,
+ XCB_CW_SAVE_UNDER = 1L<<10,
+ XCB_CW_EVENT_MASK = 1L<<11,
+ XCB_CW_DONT_PROPAGATE = 1L<<12,
+ XCB_CW_COLORMAP = 1L<<13,
+ XCB_CW_CURSOR = 1L<<14
+} xcb_cw_t;
</pre>
<div class="emph">
<p>Note: we must be careful when setting the values of the valwin
parameter, as they have to follow the order the
- <span class="code">XCBCW</span> enumeration. Here is an
+ <span class="code">xcb_cw_t</span> enumeration. Here is an
example:
</p>
</div>
<pre class="code">
- mask = XCBCWEventMask | XCBCWBackPixmap;
- valwin[0] = XCBNone; /* for XCBCWBackPixmap (whose value is 1) */
- valwin[1] = XCBEventMaskExposure | XCBEventMaskButtonPress; /* for XCBCWEventMask, whose value (2048) */
- /* is greater than the one of XCBCWBackPixmap */
+ mask = XCB_CW_EVENT_MASK | XCB_CW_BACK_PIXMAP;
+ valwin[0] = XCB_NONE; /* for XCB_CW_BACK_PIXMAP (whose value is 1) */
+ valwin[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS; /* for XCB_CW_EVENT_MASK, whose value (2048) */
+ /* is greater than the one of XCB_CW_BACK_PIXMAP */
</pre>
<p>
If the window has already been created, we can use the
- <span class="code">XCBConfigureWindow()</span> function to set
+ <span class="code">xcb_configure_window()</span> function to set
the events that the window will receive. The subsection
<a href="#winconf">Configuring a window</a> shows its
prototype. As an example, here is a piece of code that
@@ -1498,11 +1464,11 @@ typedef enum {
<span class="code">ButtonPress</span> events:
</p>
<pre class="code">
-const static CARD32 values[] = { XCBEventMaskExposure | XCBEventMaskButtonPress };
+const static uint32_t values[] = { XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS };
/* The connection c and the window win are supposed to be defined */
-XCBConfigureWindow (c, win, XCBCWEventMask, values);
+xcb_configure_window (c, win, XCB_CW_EVENT_MASK, values);
</pre>
<div class="emph">
<p>
@@ -1524,16 +1490,16 @@ XCBConfigureWindow (c, win, XCBCWEventMa
</p>
<ul>
<li>
- <span class="code">XCBWaitForEvent (XCBConnection *c)</span>
+ <span class="code">xcb_wait_for_event (xcb_connection_t *c)</span>
is the blocking way. It waits (so blocks...) until an event is
queued in the X server. Then it retrieves it into a newly
allocated structure (it dequeues it from the queue) and returns
it. This structure has to be freed. The function returns
<span class="code">NULL</span> if an error occurs.
-
+
<br>
<li>
- <span class="code">XCBPollForEvent (XCBConnection *c, int
+ <span class="code">xcb_poll_for_event (xcb_connection_t *c, int
*error)</span> is the non-blocking way. It looks at the event
queue and returns (and dequeues too) an existing event into
a newly allocated structure. This structure has to be
@@ -1545,76 +1511,69 @@ XCBConfigureWindow (c, win, XCBCWEventMa
<p>
There are various ways to write such a loop. We present two
ways to write such a loop, with the two functions above. The
- first one uses <span class="code">XCBWaitForEvent</span>, which
+ first one uses <span class="code">xcb_wait_for_event_t</span>, which
is similar to an event Xlib loop using only <span
class="code">XNextEvent</span>:
</p>
<pre class="code">
- XCBGenericEvent *e;
+ xcb_generic_event_t *e;
- while ((e = XCBWaitForEvent (c)))
- {
- switch (e->response_type & ~0x80)
- {
- case XCBExpose:
- {
- /* Handle the Expose event type */
- XCBExposeEvent *ev = (XCBExposeEvent *)e;
-
- /* ... */
-
- break;
- }
- case XCBButtonPress:
- {
- /* Handle the ButtonPress event type */
- XCBButtonPressEvent *ev = (XCBButtonPressEvent *)e;
-
- /* ... */
-
- break;
- }
- default:
- {
- /* Unknown event type, ignore it */
- break;
- }
- }
- /* Free the Generic Event */
- free (e);
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ /* Handle the Expose event type */
+ xcb_expose_event_t *ev = (xcb_expose_event_t *)e;
+
+ /* ... */
+
+ break;
+ }
+ case XCB_BUTTON_PRESS: {
+ /* Handle the ButtonPress event type */
+ xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
+
+ /* ... */
+
+ break;
+ }
+ default: {
+ /* Unknown event type, ignore it */
+ break;
}
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
</pre>
<p>
You will certainly want to use <span
- class="code">XCBPollForEvent(XCBConnection *c, int
+ class="code">xcb_poll_for_event(xcb_connection_t *c, int
*error)</span> if, in Xlib, you use <span
class="code">XPending</span> or
<span class="code">XCheckMaskEvent</span>:
</p>
<pre class="code">
- while (XPending (display))
- {
- XEvent ev;
-
- XNextEvent(d, &ev);
-
- /* Manage your event */
- }
+ while (XPending (display)) {
+ XEvent ev;
+
+ XNextEvent(d, &ev);
+
+ /* Manage your event */
+ }
</pre>
<p>
Such a loop in XCB looks like:
</p>
<pre class="code">
- XCBGenericEvent *ev;
+ xcb_generic_event_t *ev;
- while ((ev = XCBPollForEvent (conn, 0)))
- {
- /* Manage your event */
- }
+ while ((ev = xcb_poll_for_event (conn, 0))) {
+ /* Manage your event */
+ }
</pre>
<p>
The events are managed in the same way as with <span
- class="code">XCBWaitForEvent</span>.
+ class="code">xcb_wait_for_event_t</span>.
Obviously, we will need to give the user some way of
terminating the program. This is usually done by handling a
special "quit" event, as we will soon see.
@@ -1630,18 +1589,18 @@ XCBConfigureWindow (c, win, XCBCWEventMa
</div>
<div class="xcb">
<ul>
- <li>XCBWaitForEvent ()
+ <li>xcb_wait_for_event ()
</ul>
</div>
<div class="xlib">
<ul>
- <li>XPending ()</li>
- <li>XCheckMaskEvent ()</li>
+ <li>XPending ()
+ <li>XCheckMaskEvent ()
</ul>
</div>
<div class="xcb">
<ul>
- <li>XCBPollForEvent ()
+ <li>xcb_poll_for_event ()
</ul>
</div>
</div>
@@ -1677,17 +1636,17 @@ XCBConfigureWindow (c, win, XCBCWEventMa
</p>
<pre class="code">
typedef struct {
- BYTE response_type; /* The type of the event, here it is XCBExpose */
- CARD8 pad0;
- CARD16 sequence;
- XCBWINDOW window; /* The Id of the window that receives the event (in case */
- /* our application registered for events on several windows */
- CARD16 x; /* The x coordinate of the top-left part of the window that needs to be redrawn */
- CARD16 y; /* The y coordinate of the top-left part of the window that needs to be redrawn */
- CARD16 width; /* The width of the part of the window that needs to be redrawn */
- CARD16 height; /* The height of the part of the window that needs to be redrawn */
- CARD16 count;
-} XCBExposeEvent;
+ uint8_t response_type; /* The type of the event, here it is XCB_EXPOSE */
+ uint8_t pad0;
+ uint16_t sequence;
+ xcb_window_t window; /* The Id of the window that receives the event (in case */
+ /* our application registered for events on several windows */
+ uint16_t x; /* The x coordinate of the top-left part of the window that needs to be redrawn */
+ uint16_t y; /* The y coordinate of the top-left part of the window that needs to be redrawn */
+ uint16_t width; /* The width of the part of the window that needs to be redrawn */
+ uint16_t height; /* The height of the part of the window that needs to be redrawn */
+ uint16_t count;
+} xcb_expose_event_t;
</pre>
<li class="subtitle"><a name="userinput">Getting user input</a>
<p>
@@ -1706,9 +1665,9 @@ typedef struct {
(or more) of the following masks when we create our window:
</p>
<ul>
- <li><span class="code">XCBEventMaskButtonPress</span>: notify us
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_PRESS</span>: notify us
of any button that was pressed in one of our windows.
- <li><span class="code">XCBEventMaskButtonRelease</span>: notify us
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_RELEASE</span>: notify us
of any button that was released in one of our windows.
</ul>
<p>
@@ -1717,22 +1676,22 @@ typedef struct {
</p>
<pre class="code">
typedef struct {
- BYTE response_type; /* The type of the event, here it is XCBButtonPressEvent or XCBButtonReleaseEvent */
- XCBBUTTON detail;
- CARD16 sequence;
- XCBTIMESTAMP time; /* Time, in milliseconds the event took place in */
- XCBWINDOW root;
- XCBWINDOW event;
- XCBWINDOW child;
- INT16 root_x;
- INT16 root_y;
- INT16 event_x; /* The x coordinate where the mouse has been pressed in the window */
- INT16 event_y; /* The y coordinate where the mouse has been pressed in the window */
- CARD16 state; /* A mask of the buttons (or keys) during the event */
- BOOL same_screen;
-} XCBButtonPressEvent;
+ uint8_t response_type; /* The type of the event, here it is xcb_button_press_event_t or xcb_button_release_event_t */
+ xcb_button_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate where the mouse has been pressed in the window */
+ int16_t event_y; /* The y coordinate where the mouse has been pressed in the window */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t same_screen;
+} xcb_button_press_event_t;
-typedef XCBButtonPressEvent XCBButtonReleaseEvent;
+typedef xcb_button_press_event_t xcb_button_release_event_t;
</pre>
<p>
The <span class="code">time</span> field may be used to calculate "double-click"
@@ -1742,23 +1701,23 @@ typedef XCBButtonPressEvent XCBButtonRel
</p>
<p>
The <span class="code">state</span> field is a mask of the buttons held down during
- the event. It is a bitwise OR of any of the following (from the XCBButtonMask and
- XCBModMask enumerations):
+ the event. It is a bitwise OR of any of the following (from the xcb_button_mask_t and
+ xcb_mod_mask_t enumerations):
</p>
<ul>
- <li><span class="code">XCBButtonMask1</span>
- <li><span class="code">XCBButtonMask2</span>
- <li><span class="code">XCBButtonMask3</span>
- <li><span class="code">XCBButtonMask4</span>
- <li><span class="code">XCBButtonMask5</span>
- <li><span class="code">XCBModMaskShift</span>
- <li><span class="code">XCBModMaskLock</span>
- <li><span class="code">XCBModMaskControl</span>
- <li><span class="code">XCBModMask1</span>
- <li><span class="code">XCBModMask2</span>
- <li><span class="code">XCBModMask3</span>
- <li><span class="code">XCBModMask4</span>
- <li><span class="code">XCBModMask5</span>
+ <li><span class="code">XCB_BUTTON_MASK_1</span>
+ <li><span class="code">XCB_BUTTON_MASK_2</span>
+ <li><span class="code">XCB_BUTTON_MASK_3</span>
+ <li><span class="code">XCB_BUTTON_MASK_4</span>
+ <li><span class="code">XCB_BUTTON_MASK_5</span>
+ <li><span class="code">XCB_MOD_MASK_SHIFT</span>
+ <li><span class="code">XCB_MOD_MASK_LOCK</span>
+ <li><span class="code">XCB_MOD_MASK_CONTROL</span>
+ <li><span class="code">XCB_MOD_MASK_1</span>
+ <li><span class="code">XCB_MOD_MASK_2</span>
+ <li><span class="code">XCB_MOD_MASK_3</span>
+ <li><span class="code">XCB_MOD_MASK_4</span>
+ <li><span class="code">XCB_MOD_MASK_5</span>
</ul>
<p>
Their names are self explanatory, where the first 5 refer to
@@ -1771,7 +1730,7 @@ typedef XCBButtonPressEvent XCBButtonRel
change when clicking with various buttons.
</p>
<li class="subsubtitle"><a name="mousemvnt">Mouse movement events</a>
- <p>
+ <p>
Similar to mouse button press and release events, we also
can be notified of various mouse movement events. These can
be split into two families. One is of mouse pointer
@@ -1782,20 +1741,20 @@ typedef XCBButtonPressEvent XCBButtonRel
during the creation of our window:
</p>
<ul>
- <li><span class="code">XCBEventMaskPointerMotion</span>: events of
+ <li><span class="code">XCB_EVENT_MASK_POINTER_MOTION</span>: events of
the pointer moving in one of the windows controlled by our
application, while no mouse button is held pressed.
- <li><span class="code">XCBEventMaskButtonMotion</span>: Events of
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_MOTION</span>: Events of
the pointer moving while one or more of the mouse buttons
is held pressed.
- <li><span class="code">XCBEventMaskButton1Motion</span>: same as
- <span class="code">XCBEventMaskButtonMotion</span>, but only when
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_1_MOTION</span>: same as
+ <span class="code">XCB_EVENT_MASK_BUTTON_MOTION</span>, but only when
the 1st mouse button is held pressed.
- <li><span class="code">XCBEventMaskButton2Motion</span>,
- <span class="code">XCBEventMaskButton3Motion</span>,
- <span class="code">XCBEventMaskButton4Motion</span>,
- <span class="code">XCBEventMaskButton5Motion</span>: same as
- <span class="code">XCBEventMaskButton1Motion</span>, but
+ <li><span class="code">XCB_EVENT_MASK_BUTTON_2_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_3_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_4_MOTION</span>,
+ <span class="code">XCB_EVENT_MASK_BUTTON_5_MOTION</span>: same as
+ <span class="code">XCB_EVENT_MASK_BUTTON_1_MOTION</span>, but
respectively for 2nd, 3rd, 4th and 5th mouse button.
</ul>
<p>
@@ -1804,20 +1763,20 @@ typedef XCBButtonPressEvent XCBButtonRel
</p>
<pre class="code">
typedef struct {
- BYTE response_type; /* The type of the event */
- BYTE detail;
- CARD16 sequence;
- XCBTIMESTAMP time; /* Time, in milliseconds the event took place in */
- XCBWINDOW root;
- XCBWINDOW event;
- XCBWINDOW child;
- INT16 root_x;
- INT16 root_y;
- INT16 event_x; /* The x coordinate of the mouse when the event was generated */
- INT16 event_y; /* The y coordinate of the mouse when the event was generated */
- CARD16 state; /* A mask of the buttons (or keys) during the event */
- BOOL same_screen;
-} XCBMotionNotifyEvent;
+ uint8_t response_type; /* The type of the event */
+ uint8_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate of the mouse when the event was generated */
+ int16_t event_y; /* The y coordinate of the mouse when the event was generated */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t same_screen;
+} xcb_motion_notify_event_t;
</pre>
<li class="subsubtitle"><a name="mouseenter">Mouse pointer enter and leave events</a>
<p>
@@ -1830,10 +1789,10 @@ typedef struct {
create our window:
</p>
<ul>
- <li><span class="code">XCBEventEnterWindow</span>: notify us
+ <li><span class="code">xcb_event_enter_window_t</span>: notify us
when the mouse pointer enters any of our controlled
windows.
- <li><span class="code">XCBEventLeaveWindow</span>: notify us
+ <li><span class="code">xcb_event_leave_window_t</span>: notify us
when the mouse pointer leaves any of our controlled
windows.
</ul>
@@ -1843,23 +1802,23 @@ typedef struct {
</p>
<pre class="code">
typedef struct {
- BYTE response_type; /* The type of the event */
- BYTE detail;
- CARD16 sequence;
- XCBTIMESTAMP time; /* Time, in milliseconds the event took place in */
- XCBWINDOW root;
- XCBWINDOW event;
- XCBWINDOW child;
- INT16 root_x;
- INT16 root_y;
- INT16 event_x; /* The x coordinate of the mouse when the event was generated */
- INT16 event_y; /* The y coordinate of the mouse when the event was generated */
- CARD16 state; /* A mask of the buttons (or keys) during the event */
- BYTE mode; /* The number of mouse button that was clicked */
- BYTE same_screen_focus;
-} XCBEnterNotifyEvent;
+ uint8_t response_type; /* The type of the event */
+ uint8_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x; /* The x coordinate of the mouse when the event was generated */
+ int16_t event_y; /* The y coordinate of the mouse when the event was generated */
+ uint16_t state; /* A mask of the buttons (or keys) during the event */
+ uint8_t mode; /* The number of mouse button that was clicked */
+ uint8_t same_screen_focus;
+} xcb_enter_notify_event_t;
-typedef XCBEnterNotifyEvent XCBLeaveNotifyEvent;
+typedef xcb_enter_notify_event_t xcb_leave_notify_event_t;
</pre>
<li class="subsubtitle"><a name="focus">The keyboard focus</a>
<p>
@@ -1884,10 +1843,10 @@ typedef XCBEnterNotifyEvent XCBLeaveNoti
masks when we create our window:
</p>
<ul>
- <li><span class="code">XCBEventMaskKeyPress</span>: notify us when
+ <li><span class="code">XCB_EVENT_MASK_KEY_PRESS</span>: notify us when
a key was pressed while any of our controlled windows had
the keyboard focus.
- <li><span class="code">XCBEventMaskKeyRelease</span>: notify us
+ <li><span class="code">XCB_EVENT_MASK_KEY_RELEASE</span>: notify us
when a key was released while any of our controlled
windows had the keyboard focus.
</ul>
@@ -1897,22 +1856,22 @@ typedef XCBEnterNotifyEvent XCBLeaveNoti
</p>
<pre class="code">
typedef struct {
- BYTE response_type; /* The type of the event */
- XCBKEYCODE detail;
- CARD16 sequence;
- XCBTIMESTAMP time; /* Time, in milliseconds the event took place in */
- XCBWINDOW root;
- XCBWINDOW event;
- XCBWINDOW child;
- INT16 root_x;
- INT16 root_y;
- INT16 event_x;
- INT16 event_y;
- CARD16 state;
- BOOL same_screen;
-} XCBKeyPressEvent;
+ uint8_t response_type; /* The type of the event */
+ xcb_keycode_t detail;
+ uint16_t sequence;
+ xcb_timestamp_t time; /* Time, in milliseconds the event took place in */
+ xcb_window_t root;
+ xcb_window_t event;
+ xcb_window_t child;
+ int16_t root_x;
+ int16_t root_y;
+ int16_t event_x;
+ int16_t event_y;
+ uint16_t state;
+ uint8_t same_screen;
+} xcb_key_press_event_t;
-typedef XCBKeyPressEvent XCBKeyReleaseEvent;
+typedef xcb_key_press_event_t xcb_key_release_event_t;
</pre>
<p>
The <span class="code">detail</span> field refers to the
@@ -1938,162 +1897,145 @@ typedef XCBKeyPressEvent XCBKeyReleaseEv
#include <X11/XCB/xcb.h>
void
-print_modifiers(CARD32 mask)
+print_modifiers (uint32_t mask)
{
const char **mod, *mods[] = {
"Shift", "Lock", "Ctrl", "Alt",
"Mod2", "Mod3", "Mod4", "Mod5",
"Button1", "Button2", "Button3", "Button4", "Button5"
};
- printf("Modifier mask: ");
+ printf ("Modifier mask: ");
for (mod = mods ; mask; mask >>= 1, mod++)
if (mask & 1)
printf(*mod);
- putchar('\n');
+ putchar ('\n');
}
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBDRAWABLE win;
- XCBGenericEvent *e;
- CARD32 mask = 0;
- CARD32 values[2];
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_drawable_t win;
+ xcb_generic_event_t *e;
+ uint32_t mask = 0;
+ uint32_t values[2];
+
/* Open the connection to the X server */
- c = XCBConnect (NULL, NULL);
-
+ c = xcb_connect (NULL, NULL);
+
/* Get the first screen */
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* Ask for our window's Id */
- win.window = XCBWINDOWNew(c);
+ win.window = xcb_window_new (c);
/* Create the window */
- mask = XCBCWBackPixel | XCBCWEventMask;
+ mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
values[0] = screen->white_pixel;
- values[1] = XCBEventMaskExposure | XCBEventMaskButtonPress
- | XCBEventMaskButtonRelease | XCBEventMaskPointerMotion
- | XCBEventMaskEnterWindow | XCBEventMaskLeaveWindow
- | XCBEventMaskKeyPress | XCBEventMaskKeyRelease;
- XCBCreateWindow (c, /* Connection */
- 0, /* depth */
- win.window, /* window Id */
- screen->root, /* parent window */
- 0, 0, /* x, y */
- 150, 150, /* width, height */
- 10, /* border_width */
- XCBWindowClassInputOutput,/* class */
- screen->root_visual, /* visual */
- mask, values); /* masks */
+ values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS |
+ XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION |
+ XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW |
+ XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE;
+ xcb_create_window (c, /* Connection */
+ 0, /* depth */
+ win.window, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 150, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ mask, values); /* masks */
/* Map the window on the screen */
- XCBMapWindow (c, win.window);
+ xcb_map_window (c, win.window);
- XCBFlush (c);
+ xcb_flush (c);
- while ((e = XCBWaitForEvent (c)))
- {
- switch (e->response_type & ~0x80)
- {
- case XCBExpose:
- {
- XCBExposeEvent *ev = (XCBExposeEvent *)e;
-
- printf ("Window %ld exposed. Region to be redrawn at location (%d,%d), with dimension (%d,%d)\n",
- ev->window.xid, ev->x, ev->y, ev->width, ev->height);
- break;
- }
- case XCBButtonPress:
- {
- XCBButtonPressEvent *ev = (XCBButtonPressEvent *)e;
- print_modifiers(ev->state);
-
- switch (ev->detail.id)
- {
- case 4:
- {
- printf ("Wheel Button up in window %ld, at coordinates (%d,%d)\n",
- ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- case 5:
- {
- printf ("Wheel Button down in window %ld, at coordinates (%d,%d)\n",
- ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- default:
- printf ("Button %d pressed in window %ld, at coordinates (%d,%d)\n",
- ev->detail.id, ev->event.xid, ev->event_x, ev->event_y);
- }
- break;
- }
- case XCBButtonRelease:
- {
- XCBButtonReleaseEvent *ev = (XCBButtonReleaseEvent *)e;
- print_modifiers(ev->state);
-
- printf ("Button %d released in window %ld, at coordinates (%d,%d)\n",
- ev->detail.id, ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- case XCBMotionNotify:
- {
- XCBMotionNotifyEvent *ev = (XCBMotionNotifyEvent *)e;
-
- printf ("Mouse moved in window %ld, at coordinates (%d,%d)\n",
- ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- case XCBEnterNotify:
- {
- XCBEnterNotifyEvent *ev = (XCBEnterNotifyEvent *)e;
-
- printf ("Mouse entered window %ld, at coordinates (%d,%d)\n",
- ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- case XCBLeaveNotify:
- {
- XCBLeaveNotifyEvent *ev = (XCBLeaveNotifyEvent *)e;
-
- printf ("Mouse left window %ld, at coordinates (%d,%d)\n",
- ev->event.xid, ev->event_x, ev->event_y);
- break;
- }
- case XCBKeyPress:
- {
- XCBKeyPressEvent *ev = (XCBKeyPressEvent *)e;
- print_modifiers(ev->state);
-
- printf ("Key pressed in window %ld\n",
- ev->event.xid);
- break;
- }
- case XCBKeyRelease:
- {
- XCBKeyReleaseEvent *ev = (XCBKeyReleaseEvent *)e;
- print_modifiers(ev->state);
-
- printf ("Key released in window %ld\n",
- ev->event.xid);
- break;
- }
- default:
- {
- /* Unknown event type, ignore it */
- printf("Unknown event: %d\n", e->response_type);
- break;
- }
- }
- /* Free the Generic Event */
- free (e);
+ while ((e = xcb_wait_for_event (c))) {
+ switch (e->response_type & ~0x80) {
+ case XCB_EXPOSE: {
+ xcb_expose_event_t *ev = (xcb_expose_event_t *)e;
+
+ printf ("Window %ld exposed. Region to be redrawn at location (%d,%d), with dimension (%d,%d)\n",
+ ev->window.xid, ev->x, ev->y, ev->width, ev->height);
+ break;
}
+ case XCB_BUTTON_PRESS: {
+ xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
+ print_modifiers(ev->state);
+
+ switch (ev->detail.id) {
+ case 4:
+ printf ("Wheel Button up in window %ld, at coordinates (%d,%d)\n",
+ ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ case 5:
+ printf ("Wheel Button down in window %ld, at coordinates (%d,%d)\n",
+ ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ default:
+ printf ("Button %d pressed in window %ld, at coordinates (%d,%d)\n",
+ ev->detail.id, ev->event.xid, ev->event_x, ev->event_y);
+ }
+ break;
+ }
+ case XCB_BUTTON_RELEASE: {
+ xcb_button_release_event_t *ev = (xcb_button_release_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Button %d released in window %ld, at coordinates (%d,%d)\n",
+ ev->detail.id, ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_MOTION_NOTIFY: {
+ xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)e;
+
+ printf ("Mouse moved in window %ld, at coordinates (%d,%d)\n",
+ ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_ENTER_NOTIFY: {
+ xcb_enter_notify_event_t *ev = (xcb_enter_notify_event_t *)e;
- return 1;
+ printf ("Mouse entered window %ld, at coordinates (%d,%d)\n",
+ ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_LEAVE_NOTIFY: {
+ xcb_leave_notify_event_t *ev = (xcb_leave_notify_event_t *)e;
+
+ printf ("Mouse left window %ld, at coordinates (%d,%d)\n",
+ ev->event.xid, ev->event_x, ev->event_y);
+ break;
+ }
+ case XCB_KEY_PRESS: {
+ xcb_key_press_event_t *ev = (xcb_key_press_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Key pressed in window %ld\n",
+ ev->event.xid);
+ break;
+ }
+ case XCB_KEY_RELEASE: {
+ xcb_key_release_event_t *ev = (xcb_key_release_event_t *)e;
+ print_modifiers(ev->state);
+
+ printf ("Key released in window %ld\n",
+ ev->event.xid);
+ break;
+ }
+ default:
+ /* Unknown event type, ignore it */
+ printf("Unknown event: %d\n", e->response_type);
+ break;
+ }
+ /* Free the Generic Event */
+ free (e);
+ }
+
+ return 0;
}
</pre>
</ol>
@@ -2114,8 +2056,8 @@ main (int argc, char *argv[])
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBFONT;
+ uint32_t xid;
+} xcb_font_t;
</pre>
<p>
It is used to contain information about a font, and is passed
@@ -2152,43 +2094,43 @@ typedef struct {
</p>
<p>
The property and its type (a string, an integer, etc) are
- Id. Their type are <span class="code">XCBATOM</span>:
+ Id. Their type are <span class="code">xcb_atom_t</span>:
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBATOM;
+ uint32_t xid;
+} xcb_atom_t;
</pre>
<p>
To change the property of a window, we use the following
function:
</p>
<pre class="code">
-XCBVoidCookie XCBChangeProperty (XCBConnection *c, /* Connection to the X server */
- CARD8 mode, /* Property mode */
- XCBWINDOW window, /* Window */
- XCBATOM property, /* Property to change */
- XCBATOM type, /* Type of the property */
- CARD8 format, /* Format of the property (8, 16, 32) */
- CARD32 data_len, /* Length of the data parameter */
- const void *data); /* Data */
+xcb_void_cookie_t xcb_change_property (xcb_connection_t *c, /* Connection to the X server */
+ uint8_t mode, /* Property mode */
+ xcb_window_t window, /* Window */
+ xcb_atom_t property, /* Property to change */
+ xcb_atom_t type, /* Type of the property */
+ uint8_t format, /* Format of the property (8, 16, 32) */
+ uint32_t data_len, /* Length of the data parameter */
+ const void *data); /* Data */
</pre>
<p>
The <span class="code">mode</span> parameter coud be one of
- the following values (defined in enumeration XCBPropMode in
+ the following values (defined in enumeration xcb_prop_mode_t in
the xproto.h header file):
</p>
<ul>
- <li>XCBPropModeReplace
- <li>XCBPropModePrepend
- <li>XCBPropModeAppend
+ <li>XCB_PROP_MODE_REPLACE
+ <li>XCB_PROP_MODE_PREPEND
+ <li>XCB_PROP_MODE_APPEND
</ul>
<br>
<li class="subtitle"><a name="wmname">Setting the window name and icon name</a>
<p>
The first thing we want to do would be to set the name for our
window. This is done using the
- <span class="code">XCBChangeProperty()</span> function. This
+ <span class="code">xcb_change_property()</span> function. This
name may be used by the window manager as the title of the
window (in the title bar), in a task list, etc. The property
atom to use to set the name of a window is
@@ -2206,53 +2148,53 @@ XCBVoidCookie XCBChangeProperty (XCBConn
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBDRAWABLE win;
- char *title = "Hello World !";
- char *title_icon = "Hello World ! (iconified)";
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ char *title = "Hello World !";
+ char *title_icon = "Hello World ! (iconified)";
+
-
/* Open the connection to the X server */
- c = XCBConnect (NULL, NULL);
-
+ c = xcb_connect (NULL, NULL);
+
/* Get the first screen */
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* Ask for our window's Id */
- win.window = XCBWINDOWNew(c);
+ win = xcb_window_new (c);
/* Create the window */
- XCBCreateWindow (c, /* Connection */
- 0, /* depth */
- win.window, /* window Id */
- screen->root, /* parent window */
- 0, 0, /* x, y */
- 250, 150, /* width, height */
- 10, /* border_width */
- XCBWindowClassInputOutput,/* class */
- screen->root_visual, /* visual */
- 0, NULL); /* masks, not used */
+ xcb_create_window (c, /* Connection */
+ 0, /* depth */
+ win, /* window Id */
+ screen->root, /* parent window */
+ 0, 0, /* x, y */
+ 250, 150, /* width, height */
+ 10, /* border_width */
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class */
+ screen->root_visual, /* visual */
+ 0, NULL); /* masks, not used */
/* Set the title of the window */
- XCBChangeProperty(c, XCBPropModeReplace, win.window,
- WM_NAME, STRING, 8,
- strlen(title), title);
+ xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
+ WM_NAME, STRING, 8,
+ strlen (title), title);
/* Set the title of the window icon */
- XCBChangeProperty(c, XCBPropModeReplace, win.window,
- WM_ICON_NAME, STRING, 8,
- strlen(title_icon), title_icon);
+ xcb_change_property (c, XCB_PROP_MODE_REPLACE, win,
+ WM_ICON_NAME, STRING, 8,
+ strlen(title_icon), title_icon);
/* Map the window on the screen */
- XCBMapWindow (c, win.window);
+ xcb_map_window (c, win);
+
+ xcb_flush (c);
- XCBFlush (c);
-
while (1) {}
- return 1;
+ return 0;
}
</pre>
<div class="emph">
@@ -2299,7 +2241,8 @@ gcc prog.c -o prog `pkg-config --cflags
To map a window, you use the following function:
</p>
<pre class="code">
-XCBVoidCookie XCBMapWindow(XCBConnection *c, XCBWINDOW window);
+xcb_void_cookie_t xcb_map_window (xcb_connection_t *c,
+ xcb_window_t window);
</pre>
<p>
To have a simple example, see the <a href="#helloworld">example</a>
@@ -2312,11 +2255,12 @@ XCBVoidCookie XCBMapWindow(XCBConnection
Un-mapping a window is also simple. You use the function
</p>
<pre class="code">
-XCBVoidCookie XCBUnmapWindow(XCBConnection *c, XCBWINDOW window);
+xcb_void_cookie_t xcb_unmap_window (xcb_connection_t *c,
+ xcb_window_t window);
</pre>
<p>
The utilization of this function is the same as
- <span class="code">XCBMapWindow()</span>.
+ <span class="code">xcb_map_window()</span>.
</p>
<li class="subtitle"><a name="winconf">Configuring a window</a>
<p>
@@ -2328,28 +2272,28 @@ XCBVoidCookie XCBUnmapWindow(XCBConnecti
function:
</p>
<pre class="code">
-XCBVoidCookie XCBConfigureWindow (XCBConnection *c, /* The connection to the X server*/
- XCBWINDOW window, /* The window to configure */
- CARD16 value_mask, /* The mask */
- const CARD32 *value_list); /* The values to set */
+xcb_void_cookie_t xcb_configure_window (xcb_connection_t *c, /* The connection to the X server*/
+ xcb_window_t window, /* The window to configure */
+ uint16_t value_mask, /* The mask */
+ const uint32_t *value_list); /* The values to set */
</pre>
<p>
We set the <span class="code">value_mask</span> to one or
- several mask values that are in the XCBConfigWindow enumeration in the xproto.h header:
+ several mask values that are in the xcb_config_window_t enumeration in the xproto.h header:
</p>
<ul>
- <li><span class="code">XCBConfigWindowX</span>: new x coordinate of the window's top left corner
- <li><span class="code">XCBConfigWindowY</span>: new y coordinate of the window's top left corner
- <li><span class="code">XCBConfigWindowWidth</span>: new width of the window
- <li><span class="code">XCBConfigWindowHeight</span>: new height of the window
- <li><span class="code">XCBConfigWindowBorderWidth</span>: new width of the border of the window
- <li><span class="code">XCBConfigWindowSibling</span>
- <li><span class="code">XCBConfigWindowStackMode</span>: the new stacking order
+ <li><span class="code">XCB_CONFIG_WINDOW_X</span>: new x coordinate of the window's top left corner
+ <li><span class="code">XCB_CONFIG_WINDOW_Y</span>: new y coordinate of the window's top left corner
+ <li><span class="code">XCB_CONFIG_WINDOW_WIDTH</span>: new width of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_HEIGHT</span>: new height of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_BORDER_WIDTH</span>: new width of the border of the window
+ <li><span class="code">XCB_CONFIG_WINDOW_SIBLING</span>
+ <li><span class="code">XCB_CONFIG_WINDOW_STACK_MODE</span>: the new stacking order
</ul>
<p>
We then give to <span class="code">value_mask</span> the new
value. We now describe how to use
- <span class="code">XCBConfigureWindow</span> in some useful
+ <span class="code">xcb_configure_window_t</span> in some useful
situations.
</p>
<li class="subtitle"><a name="winmove">Moving a window around the screen</a>
@@ -2358,12 +2302,12 @@ XCBVoidCookie XCBConfigureWindow (XCBCon
to a different location. This can be done like this:
</p>
<pre class="code">
-const static CARD32 values[] = { 10, 20 };
+const static uint32_t values[] = { 10, 20 };
/* The connection c and the window win are supposed to be defined */
/* Move the window to coordinates x = 10 and y = 20 */
-XCBConfigureWindow (c, win, XCBConfigWindowX | XCBConfigWindowY, values);
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, values);
</pre>
<p>
Note that when the window is moved, it might get partially
@@ -2377,25 +2321,25 @@ XCBConfigureWindow (c, win, XCBConfigWin
window. This is done using the following code:
</p>
<pre class="code">
-const static CARD32 values[] = { 200, 300 };
+const static uint32_t values[] = { 200, 300 };
/* The connection c and the window win are supposed to be defined */
/* Resize the window to width = 10 and height = 20 */
-XCBConfigureWindow (c, win, XCBConfigWindowWidth | XCBConfigWindowHeight, values);
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
</pre>
<p>
We can also combine the move and resize operations using one
- single call to <span class="code">XCBConfigureWindow</span>:
+ single call to <span class="code">xcb_configure_window_t</span>:
</p>
<pre class="code">
-const static CARD32 values[] = { 10, 20, 200, 300 };
+const static uint32_t values[] = { 10, 20, 200, 300 };
/* The connection c and the window win are supposed to be defined */
/* Move the window to coordinates x = 10 and y = 20 */
/* and resize the window to width = 10 and height = 20 */
-XCBConfigureWindow (c, win, XCBConfigWindowX | XCBConfigWindowY | XCBConfigWindowWidth | XCBConfigWindowHeight, values);
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
</pre>
<li class="subtitle"><a name="winstack">Changing windows stacking order: raise and lower</a>
<p>
@@ -2408,20 +2352,20 @@ XCBConfigureWindow (c, win, XCBConfigWin
how to manipulate our windows stack order:
</p>
<pre class="code">
-const static CARD32 values[] = { XCBStackModeAbove };
+const static uint32_t values[] = { XCB_STACK_MODE_ABOVE };
/* The connection c and the window win are supposed to be defined */
/* Move the window on the top of the stack */
-XCBConfigureWindow (c, win, XCBConfigWindowStackMode, values);
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
</pre>
<pre class="code">
-const static CARD32 values[] = { XCBStackModeBelow };
+const static uint32_t values[] = { XCB_STACK_MODE_BELOW };
/* The connection c and the window win are supposed to be defined */
/* Move the window on the bottom of the stack */
-XCBConfigureWindow (c, win, XCBConfigWindowStackMode, values);
+xcb_configure_window (c, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
</pre>
<li class="subtitle"><a name="wingetinfo">Getting information about a window</a>
<p>
@@ -2434,47 +2378,47 @@ XCBConfigureWindow (c, win, XCBConfigWin
</p>
<pre class="code">
typedef struct {
- BYTE response_type;
- CARD8 depth; /* depth of the window */
- CARD16 sequence;
- CARD32 length;
- XCBWINDOW root; /* Id of the root window *>
- INT16 x; /* X coordinate of the window's location */
- INT16 y; /* Y coordinate of the window's location */
- CARD16 width; /* Width of the window */
- CARD16 height; /* Height of the window */
- CARD16 border_width; /* Width of the window's border */
-} XCBGetGeometryRep;
+ uint8_t response_type;
+ uint8_t depth; /* depth of the window */
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t root; /* Id of the root window *>
+ int16_t x; /* X coordinate of the window's location */
+ int16_t y; /* Y coordinate of the window's location */
+ uint16_t width; /* Width of the window */
+ uint16_t height; /* Height of the window */
+ uint16_t border_width; /* Width of the window's border */
+} xcb_get_geometry_reply_t;
</pre>
<p>
XCB fill this structure with two functions:
</p>
<pre class="code">
-XCBGetGeometryCookie XCBGetGeometry (XCBConnection *c,
- XCBDRAWABLE drawable);
-XCBGetGeometryRep *XCBGetGeometryReply (XCBConnection *c,
- XCBGetGeometryCookie cookie,
- XCBGenericError **e);
+xcb_get_geometry_cookie_t xcb_get_geometry (xcb_connection_t *c,
+ xcb_drawable_t drawable);
+xcb_get_geometry_reply_t *xcb_get_geometry_reply (xcb_connection_t *c,
+ xcb_get_geometry_cookie_t cookie,
+ xcb_generic_error_t **e);
</pre>
<p>
You use them as follows:
</p>
<pre class="code">
- XCBConnection *c;
- XCBDRAWABLE win;
- XCBGetGeometryRep *geom;
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_geometry_reply_t *geom;
/* You initialize c and win */
- geom = XCBGetGeometryReply (c, XCBGetGeometry (c, win), 0);
+ geom = xcb_get_geometry_reply (c, xcb_get_geometry (c, win), NULL);
/* Do something with the fields of geom */
-
+
free (geom);
</pre>
<p>
Remark that you have to free the structure, as
- <span class="code">XCBGetGeometryReply</span> allocates a
+ <span class="code">xcb_get_geometry_reply_t</span> allocates a
newly one.
</p>
<p>
@@ -2491,79 +2435,79 @@ XCBGetGeometryRep *XCBGetGeometryRepl
</p>
<pre class="code">
typedef struct {
- BYTE response_type;
- CARD8 pad0;
- CARD16 sequence;
- CARD32 length;
- XCBWINDOW root;
- XCBWINDOW parent; /* Id of the parent window */
- CARD16 children_len;
- CARD8 pad1[14];
-} XCBQueryTreeRep;
+ uint8_t response_type;
+ uint8_t pad0;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t root;
+ xcb_window_t parent; /* Id of the parent window */
+ uint16_t children_len;
+ uint8_t pad1[14];
+} xcb_query_tree_reply_t;
</pre>
<p>
To fill this structure, we use these two functions:
</p>
<pre class="code">
-XCBQueryTreeCookie XCBQueryTree (XCBConnection *c,
- XCBWINDOW window);
-XCBQueryTreeRep *XCBQueryTreeReply (XCBConnection *c,
- XCBQueryTreeCookie cookie,
- XCBGenericError **e);
+xcb_query_tree_cookie_t xcb_query_tree (xcb_connection_t *c,
+ xcb_window_t window);
+xcb_query_tree_reply_t *xcb_query_tree_reply (xcb_connection_t *c,
+ xcb_query_tree_cookie_t cookie,
+ xcb_generic_error_t **e);
</pre>
<p>
The translated coordinates will be found in this structure:
</p>
<pre class="code">
typedef struct {
- BYTE response_type;
- BOOL same_screen;
- CARD16 sequence;
- CARD32 length;
- XCBWINDOW child;
- CARD16 dst_x; /* Translated x coordinate */
- CARD16 dst_y; /* Translated y coordinate */
-} XCBTranslateCoordinatesRep;
+ uint8_t response_type;
+ uint8_t same_screen;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_window_t child;
+ uint16_t dst_x; /* Translated x coordinate */
+ uint16_t dst_y; /* Translated y coordinate */
+} xcb_translate_coordinates_reply_t;
</pre>
<p>
As usual, we need two functions to fill this structure:
</p>
<pre class="code">
-XCBTranslateCoordinatesCookie XCBTranslateCoordinates (XCBConnection *c,
- XCBWINDOW src_window,
- XCBWINDOW dst_window,
- INT16 src_x,
- INT16 src_y);
-XCBTranslateCoordinatesRep *XCBTranslateCoordinatesReply (XCBConnection *c,
- XCBTranslateCoordinatesCookie cookie,
- XCBGenericError **e);
+xcb_translate_coordinates_cookie_t xcb_translate_coordinates (xcb_connection_t *c,
+ xcb_window_t src_window,
+ xcb_window_t dst_window,
+ int16_t src_x,
+ int16_t src_y);
+xcb_translate_coordinates_reply_t *xcb_translate_coordinates_reply (xcb_connection_t *c,
+ xcb_translate_coordinates_cookie_t cookie,
+ xcb_generic_error_t **e);
</pre>
<p>
We use them as follows:
</p>
<pre class="code">
- XCBConnection *c;
- XCBDRAWABLE win;
- XCBGetGeometryRep *geom;
- XCBQueryTreeRep *tree;
- XCBTranslateCoordinatesRep *trans;
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_geometry_reply_t *geom;
+ xcb_query_tree_reply_t *tree;
+ xcb_translate_coordinates_reply_t *trans;
/* You initialize c and win */
- geom = XCBGetGeometryReply (c, XCBGetGeometry (c, win), 0);
+ geom = xcb_get_geometry_reply (c, xcb_get_geometry (c, win), NULL);
if (!geom)
return 0;
- tree = XCBQueryTreeReply (c, XCBQueryTree (c, win), 0);
+ tree = xcb_query_tree_reply (c, xcb_query_tree (c, win), NULL);
if (!tree)
return 0;
- trans = XCBTranslateCoordinatesReply (c,
- XCBTranslateCoordinates (c,
- win,
- tree->parent,
- geom->x, geom->y),
- 0);
+ trans = xcb_translate_coordinates_reply (c,
+ xcb_translate_coordinates (c,
+ win,
+ tree->parent,
+ geom->x, geom->y),
+ NULL);
if (!trans)
return 0;
@@ -2590,53 +2534,53 @@ XCBTranslateCoordinatesRep *XCBTransla
</p>
<pre class="code">
typedef struct {
- BYTE response_type;
- CARD8 backing_store;
- CARD16 sequence;
- CARD32 length;
- XCBVISUALID visual; /* Visual of the window */
- CARD16 _class;
- CARD8 bit_gravity;
- CARD8 win_gravity;
- CARD32 backing_planes;
- CARD32 backing_pixel;
- BOOL save_under;
- BOOL map_is_installed;
- CARD8 map_state; /* Map state of the window */
- BOOL override_redirect;
- XCBCOLORMAP colormap; /* Colormap of the window */
- CARD32 all_event_masks;
- CARD32 your_event_mask;
- CARD16 do_not_propagate_mask;
-} XCBGetWindowAttributesRep;
+ uint8_t response_type;
+ uint8_t backing_store;
+ uint16_t sequence;
+ uint32_t length;
+ xcb_visualid_t visual; /* Visual of the window */
+ uint16_t _class;
+ uint8_t bit_gravity;
+ uint8_t win_gravity;
+ uint32_t backing_planes;
+ uint32_t backing_pixel;
+ uint8_t save_under;
+ uint8_t map_is_installed;
+ uint8_t map_state; /* Map state of the window */
+ uint8_t override_redirect;
+ xcb_colormap_t colormap; /* Colormap of the window */
+ uint32_t all_event_masks;
+ uint32_t your_event_mask;
+ uint16_t do_not_propagate_mask;
+} xcb_get_window_attributes_reply_t;
</pre>
<p>
XCB supplies these two functions to fill it:
</p>
<pre class="code">
-XCBGetWindowAttributesCookie XCBGetWindowAttributes (XCBConnection *c,
- XCBWINDOW window);
-XCBGetWindowAttributesRep *XCBGetWindowAttributesReply (XCBConnection *c,
- XCBGetWindowAttributesCookie cookie,
- XCBGenericError **e);
+xcb_get_window_attributes_cookie_t xcb_get_window_attributes (xcb_connection_t *c,
+ xcb_window_t window);
+xcb_get_window_attributes_reply_t *xcb_get_window_attributes_reply (xcb_connection_t *c,
+ xcb_get_window_attributes_cookie_t cookie,
+ xcb_generic_error_t **e);
</pre>
<p>
You use them as follows:
</p>
<pre class="code">
- XCBConnection *c;
- XCBDRAWABLE win;
- XCBGetWindowAttributesRep *attr;
+ xcb_connection_t *c;
+ xcb_drawable_t win;
+ xcb_get_window_attributes_reply_t *attr;
/* You initialize c and win */
- attr = XCBGetWindowAttributesReply (c, XCBGetWindowAttributes (c, win), 0);
+ attr = xcb_get_window_attributes_reply (c, xcb_get_window_attributes (c, win), NULL);
if (!attr)
return 0;
/* Do something with the fields of attr */
-
+
free (attr);
</pre>
<p>
@@ -2660,7 +2604,7 @@ XCBGetWindowAttributesRep *XCBGetWindo
application allocated the colors it needed, and when all the
color entries (4, 16, 256 colors) were in use, the next color
allocation would fail.
- </p>
+ </p>
<p>
Thus, the notion of "a color map" was introduced. A color map
is a table whose size is the same as the number of
@@ -2716,13 +2660,13 @@ XCBGetWindowAttributesRep *XCBGetWindo
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBCOLORMAP;
+ uint32_t xid;
+} xcb_colormap_t;
</pre>
<p>
In order to access the screen's default color map, you just
- have to retrieve the <span class="code">default_colormap</span>
- field of the <span class="code">XCBSCREEN</span> structure
+ have to retrieve the <span class="code">default_colormap</span>
+ field of the <span class="code">xcb_screen_t</span> structure
(see Section
<a href="#screen">Checking basic information about a connection</a>):
</p>
@@ -2734,17 +2678,17 @@ typedef struct {
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBCOLORMAP colormap;
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_colormap_t colormap;
+
/* Open the connection to the X server and get the first screen */
- c = XCBConnect (NULL, NULL);
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
colormap = screen->default_colormap;
- return 1;
+ return 0;
}
</pre>
<p>
@@ -2758,17 +2702,17 @@ main (int argc, char *argv[])
map, with this function:
</p>
<pre class="code">
-XCBCOLORMAP XCBCOLORMAPNew (XCBConnection *c);
+xcb_colormap_t xcb_colormap_new (xcb_connection_t *c);
</pre>
<p>
Then, we create the color map with
</p>
<pre class="code">
-XCBVoidCookie XCBCreateColormap (XCBConnection *c, /* Pointer to the XCBConnection structure */
- BYTE alloc, /* Colormap entries to be allocated (AllocNone or AllocAll) */
- XCBCOLORMAP mid, /* Id of the color map */
- XCBWINDOW window, /* Window on whose screen the colormap will be created */
- XCBVISUALID visual); /* Id of the visual supported by the screen */
+xcb_void_cookie_t xcb_create_colormap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t alloc, /* Colormap entries to be allocated (AllocNone or AllocAll) */
+ xcb_colormap_t mid, /* Id of the color map */
+ xcb_window_t window, /* Window on whose screen the colormap will be created */
+ xcb_visualid_t visual); /* Id of the visual supported by the screen */
</pre>
<p>
Here is an example of creation of a new color map:
@@ -2779,21 +2723,21 @@ XCBVoidCookie XCBCreateColormap (XCBConn
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBWINDOW win;
- XCBCOLORMAP cmap
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ xcb_colormap_t cmap
+
/* Open the connection to the X server and get the first screen */
- c = XCBConnect (NULL, NULL);
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* We create the window win here*/
- cmap = XCBCOLORMAPNew (c);
- XCBCreateColormap (c, XCBColormapAllocNone, cmap, win, screen->root_visual);
+ cmap = xcb_colormap_new (c);
+ xcb_create_colormap (c, XCB_COLORMAP_ALLOC_NONE, cmap, win, screen->root_visual);
- return 1;
+ return 0;
}
</pre>
<p>
@@ -2805,8 +2749,8 @@ main (int argc, char *argv[])
To free a color map, it suffices to use this function:
</p>
<pre class="code">
-XCBVoidCookie XCBFreeColormap (XCBConnection *c, /* The connection */
- XCBCOLORMAP cmap); /* The color map */
+xcb_void_cookie_t xcb_free_colormap (xcb_connection_t *c, /* The connection */
+ xcb_colormap_t cmap); /* The color map */
</pre>
<div class="comp">
<div class="title">
@@ -2819,8 +2763,8 @@ XCBVoidCookie XCBFreeColormap (XCBConnec
</div>
<div class="xcb">
<ul>
- <li>XCBCOLORMAPNew ()
- <li>XCBCreateColormap ()
+ <li>xcb_colormap_new ()
+ <li>xcb_create_colormap ()
</ul>
</div>
<div class="xlib">
@@ -2830,7 +2774,7 @@ XCBVoidCookie XCBFreeColormap (XCBConnec
</div>
<div class="xcb">
<ul>
- <li>XCBFreeColormap ()
+ <li>xcb_free_colormap ()
</ul>
</div>
</div>
@@ -2843,32 +2787,32 @@ XCBVoidCookie XCBFreeColormap (XCBConnec
</p>
<pre class="code">
typedef struct {
- BYTE response_type;
- CARD8 pad0;
- CARD16 sequence;
- CARD32 length;
- CARD16 red; /* The red component */
- CARD16 green; /* The green component */
- CARD16 blue; /* The blue component */
- CARD8 pad1[2];
- CARD32 pixel; /* The entry in the color map, supplied by the X server */
-} XCBAllocColorRep;
+ uint8_t response_type;
+ uint8_t pad0;
+ uint16_t sequence;
+ uint32_t length;
+ uint16_t red; /* The red component */
+ uint16_t green; /* The green component */
+ uint16_t blue; /* The blue component */
+ uint8_t pad1[2];
+ uint32_t pixel; /* The entry in the color map, supplied by the X server */
+} xcb_alloc_color_reply_t;
</pre>
<p>
XCB supplies these two functions to fill it:
</p>
<pre class="code">
-XCBAllocColorCookie XCBAllocColor (XCBConnection *c,
- XCBCOLORMAP cmap,
- CARD16 red,
- CARD16 green,
- CARD16 blue);
-XCBAllocColorRep *XCBAllocColorReply (XCBConnection *c,
- XCBAllocColorCookie cookie,
- XCBGenericError **e);
+xcb_alloc_color_cookie_t xcb_alloc_color (xcb_connection_t *c,
+ xcb_colormap_t cmap,
+ uint16_t red,
+ uint16_t green,
+ uint16_t blue);
+xcb_alloc_color_reply_t *xcb_alloc_color_reply (xcb_connection_t *c,
+ xcb_alloc_color_cookie_t cookie,
+ xcb_generic_error_t **e);
</pre>
<p>
- The fuction <span class="code">XCBAllocColor()</span> takes the
+ The fuction <span class="code">xcb_alloc_color()</span> takes the
3 RGB components as parameters (red, green and blue). Here is an
example of using these functions:
</p>
@@ -2880,23 +2824,23 @@ XCBAllocColorRep *XCBAllocColorReply (
int
main (int argc, char *argv[])
{
- XCBConnection *c;
- XCBSCREEN *screen;
- XCBWINDOW win;
- XCBCOLORMAP cmap;
- XCBAllocColorRep *rep;
-
+ xcb_connection_t *c;
+ xcb_screen_t *screen;
+ xcb_window_t win;
+ xcb_colormap_t cmap;
+ xcb_alloc_color_reply_t *rep;
+
/* Open the connection to the X server and get the first screen */
- c = XCBConnect (NULL, NULL);
- screen = XCBSetupRootsIter (XCBGetSetup (c)).data;
+ c = xcb_connect (NULL, NULL);
+ screen = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
/* We create the window win here*/
- cmap = XCBCOLORMAPNew (c);
- XCBCreateColormap (c, XCBColormapAllocNone, cmap, win, screen->root_visual);
+ cmap = xcb_colormap_new (c);
+ xcb_create_colormap (c, XCB_COLORMAP_ALLOC_NONE, cmap, win, screen->root_visual);
+
+ rep = xcb_alloc_color_reply (c, xcb_alloc_color (c, cmap, 65535, 0, 0), NULL);
- rep = XCBAllocColorReply (c, XCBAllocColor (c, cmap, 65535, 0, 0), 0);
-
if (!rep)
return 0;
@@ -2904,11 +2848,11 @@ main (int argc, char *argv[])
free (rep);
- return 1;
+ return 0;
}
</pre>
<p>
- As <span class="code">XCBAllocColorReply()</span> allocates
+ As <span class="code">xcb_alloc_color_reply()</span> allocates
memory, you have to free <span class="code">rep</span>.
</p>
<p>
@@ -2940,7 +2884,7 @@ main (int argc, char *argv[])
looks like a C source file. It contains variables defining the
width and the height of the bitmap, an array containing the
bit values of the bitmap (the size of the array is
- (width+7)/8*height and the bit and byte order are LSB), and
+ (width+7)/8*height and the bit and byte order are LSB), and
an optional hot-spot location (that will
be explained later, when discussing mouse cursors).
</p>
@@ -2959,8 +2903,8 @@ main (int argc, char *argv[])
</p>
<pre class="code">
typedef struct {
- CARD32 xid;
-} XCBPIXMAP;
+ uint32_t xid;
+} xcb_pixmap_t;
</pre>
<p>
In order to make the difference between a window and a pixmap,
@@ -2968,14 +2912,14 @@ typedef struct {
</p>
<pre class="code">
typedef union {
- XCBWINDOW window;
- XCBPIXMAP pixmap;
-} XCBDRAWABLE;
+ xcb_window_t window;
+ xcb_pixmap_t pixmap;
+} xcb_drawable_t;
</pre>
<p>
in order to avoid confusion between a window and a pixmap. The
operations that will work the same on a window or a pixmap
- will require a <span class="code">XCBDRAWABLE</span>
+ will require a <span class="code">xcb_drawable_t</span>
</p>
<div class="emph">
<p>
@@ -2999,21 +2943,21 @@ typedef union {
</p>
<p>
To create a new pixmap, we first ask the X server to give an
- Id to our pixmap, with this function:
+ Id to our pixmap, with this function:
</p>
<pre class="code">
-XCBPIXMAP XCBPIXMAPNew (XCBConnection *c);
+xcb_pixmap_t xcb_pixmap_new (xcb_connection_t *c);
</pre>
<p>
Then, XCB supplies the following function to create new pixmaps:
</p>
<pre class="code">
-XCBVoidCookie XCBCreatePixmap (XCBConnection *c, /* Pointer to the XCBConnection structure */
- CARD8 depth, /* Depth of the screen */
- XCBPIXMAP pid, /* Id of the pixmap */
- XCBDRAWABLE drawable,
- CARD16 width, /* Width of the window (in pixels) */
- CARD16 height); /* Height of the window (in pixels) */
+xcb_void_cookie_t xcb_create_pixmap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ uint8_t depth, /* Depth of the screen */
+ xcb_pixmap_t pid, /* Id of the pixmap */
+ xcb_drawable_t drawable,
+ uint16_t width, /* Width of the window (in pixels) */
+ uint16_t height); /* Height of the window (in pixels) */
</pre>
<p>
<b>TODO</b>: Explain the drawable parameter, and give an
@@ -3025,16 +2969,16 @@ XCBVoidCookie XCBCreatePixmap (XCBConnec
window, using the following function:
</p>
<pre class="code">
-XCBVoidCookie XCBCopyArea (XCBConnection *c, /* Pointer to the XCBConnection structure */
- XCBDRAWABLE src_drawable, /* The Drawable we want to paste */
- XCBDRAWABLE dst_drawable, /* The Drawable on which we copy the previous Drawable */
- XCBGCONTEXT gc, /* A Graphic Context */
- INT16 src_x, /* Top left x coordinate of the region we want to copy */
- INT16 src_y, /* Top left y coordinate of the region we want to copy */
- INT16 dst_x, /* Top left x coordinate of the region where we want to copy */
- INT16 dst_y, /* Top left y coordinate of the region where we want to copy */
- CARD16 width, /* Width of the region we want to copy */
- CARD16 height); /* Height of the region we want to copy */
+xcb_void_cookie_t xcb_copy_area (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ xcb_drawable_t src_drawable, /* The Drawable we want to paste */
+ xcb_drawable_t dst_drawable, /* The Drawable on which we copy the previous Drawable */
+ xcb_gcontext_t gc, /* A Graphic Context */
+ int16_t src_x, /* Top left x coordinate of the region we want to copy */
+ int16_t src_y, /* Top left y coordinate of the region we want to copy */
+ int16_t dst_x, /* Top left x coordinate of the region where we want to copy */
+ int16_t dst_y, /* Top left y coordinate of the region where we want to copy */
+ uint16_t width, /* Width of the region we want to copy */
+ uint16_t height); /* Height of the region we want to copy */
</pre>
<p>
As you can see, we could copy the whole pixmap, as well as
@@ -3050,7 +2994,7 @@ XCBVoidCookie XCBCopyArea (XCBConnection
depth. If they have a different depth, the operation would
fail. The exception to this is if we copy a specific bit plane
of the source pixmap using the
- <span class="code">XCBCopyPlane</span> function. In such an
+ <span class="code">xcb_copy_plane_t</span> function. In such an
event, we can copy a specific plane to the target window (in
actuality, setting a specific bit in the color of each pixel
copied). This can be used to generate strange graphic effects
@@ -3063,8 +3007,8 @@ XCBVoidCookie XCBCopyArea (XCBConnection
using this function:
</p>
<pre class="code">
-XCBVoidCookie XCBFreePixmap (XCBConnection *c, /* Pointer to the XCBConnection structure */
- XCBPIXMAP pixmap); /* A given pixmap */
+xcb_void_cookie_t xcb_free_pixmap (xcb_connection_t *c, /* Pointer to the xcb_connection_t structure */
+ xcb_pixmap_t pixmap); /* A given pixmap */
</pre>
<p>
Of course, after having freed it, we must not try accessing
@@ -3074,6 +3018,115 @@ XCBVoidCookie XCBFreePixmap (XCBConnecti
<b>TODO</b>: Give an example, or a link to xpoints.c
</p>
</ol>
+ <li class="title"><a name="mousecursor">Messing with the mouse cursor</a>
+ <p>
+ It it possible to modify the shape of the mouse pointer (also
+ called the X pointer) when in certain states, as we otfen see in
+ programs. For example, a busy application would often display
+ the sand clock over its main window, to give the user a visual
+ hint that he should wait. Let's see how we can change the mouse
+ cursor of our windows.
+ </p>
+ <ol>
+ <li class="subtitle"><a name="mousecursorcreate">Creating and destroying a mouse cursor</a>
+ <p>
+ There are two methods for creating cursors. One of them is by
+ using a set of predefined cursors, that are supplied by the X
+ server, the other is by using a user-supplied bitmap.
+ </p>
+ <p>
+ In the first method, we use a special font named "cursor", and
+ the function <span class="code">xcb_create_glyph_cursor</span>:
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_create_glyph_cursor_checked (xcb_connection_t *c,
+ xcb_cursor_t cid,
+ xcb_font_t source_font, /* font for the source glyph */
+ xcb_font_t mask_font, /* font for the mask glyph or XCB_NONE */
+ uint16_t source_char, /* character glyph for the source */
+ uint16_t mask_char, /* character glyph for the mask */
+ uint16_t fore_red, /* red value for the foreground of the source */
+ uint16_t fore_green, /* green value for the foreground of the source */
+ uint16_t fore_blue, /* blue value for the foreground of the source */
+ uint16_t back_red, /* red value for the background of the source */
+ uint16_t back_green, /* green value for the background of the source */
+ uint16_t back_blue) /* blue value for the background of the source */
+</pre>
+ <p>
+ <b>TODO</b>: Describe <span class="code">source_char</span>
+ and <span class="code">mask_char</span>, for example by giving
+ an example on how to get the values. There is a list there:
+ <a href="http://tronche.com/gui/x/xlib/appendix/b/">X Font Cursors</a>
+ </p>
+ <p>
+ So we first open that font (see <a href="#loadfont">Loading a Font</a>)
+ and create the new cursor. As for every X ressource, we have to
+ ask for an X id with <span class="code">xcb_cursor_new</span>
+ first:
+ </p>
+ <pre class="code">
+xcb_font_t font;
+xcb_cursor_t cursor;
+
+/* The connection is set */
+
+font = xcb_font_new (conn);
+xcb_open_font (conn, font, strlen ("cursor"), "cursor");
+
+cursor = xcb_cursor_new (conn);
+xcb_create_glyph_cursor (conn, cursor, font, font,
+ 58, 58 + 1,
+ 0, 0, 0,
+ 0, 0, 0);
+</pre>
+ <p>
+ We have created the cursor "right hand" by specifying 58 to
+ the <span class="code">source_fon</span>t argument and 58 + 1
+ to the <span class="code">mask_font</span>.
+ </p>
+ <p>
+ The cursor is destroyed by using the function
+ </p>
+ <pre class="code">
+xcb_void_cookie_t xcb_free_cursor (xcb_connection_t *c,
+ xcb_cursor_t cursor);
+</pre>
+ <p>
+ In the second method, we create a new cursor by using a pair
+ of pixmaps, with depth of one (that is, two colors
+ pixmaps). One pixmap defines the shape of the cursor, while
+ the other works as a mask, specifying which pixels of the
+ cursor will be actually drawn. The rest of the pixels will be
+ transparent.
+ </p>
+ <p>
+ <b>TODO</b>: give an example.
+ </p>
+ <li class="subtitle"><a name="mousecursorset">Setting a window's mouse cursor</a>
+ <p>
+ Once the cursor is created, we can modify the cursor of our
+ window by using <span class="code">xcb_change_window_attributes</span>
+ and using the <span class="code">XCB_CWCURSOR</span> attribute:
+ </p>
+ <pre class="code">
+uint32_t mask;
+uint32_t value_list;
+
+/* The connection and window are set */
+/* The cursor is already created */
+
+mask = XCB_CWCURSOR;
+value_list = cursor.xid;
+xcb_change_window_attributes (conn, window, mask, &value_list);
+</pre>
+ <p>
+ Of course, the cursor and the font must be freed.
+ </p>
+ <li class="subtitle"><a name="mousecursorexample">Complete example</a>
+ <p>
+ <b>TODO</b>: to do...
+ </p>
+ </ol>
<li class="title"><a name="translation">Translation of basic Xlib functions and macros</a>
<p>
The problem when you want to port an Xlib program to XCB is that
@@ -3084,13 +3137,15 @@ XCBVoidCookie XCBFreePixmap (XCBConnecti
</p>
<ol>
<li class="subtitle"><a name="displaystructure">Members of the Display structure</a>
+ <p>
In this section, we look at how to translate the macros that
return some members of the <span class="code">Display</span>
structure. They are obtained by using a function that requires a
- <span class="code">XCBConnection *</span> or a member of the
- <span class="code">XCBSetup</span> structure
- (via the function <span class="code">XCBGetSetup</span>), or
+ <span class="code">xcb_connection_t *</span> or a member of the
+ <span class="code">xcb_setup_t</span> structure
+ (via the function <span class="code">xcb_get_setup_t</span>), or
a function that requires that structure.
+ </p>
<ol>
<li class="subtitle"><a name="ConnectionNumber">ConnectionNumber</a>
<p>
@@ -3098,28 +3153,28 @@ XCBVoidCookie XCBFreePixmap (XCBConnecti
to the server. You just have to use that function:
</p>
<pre class="code">
-int XCBGetFileDescriptor(XCBConnection *c);
+int xcb_get_file_descriptor (xcb_connection_t *c);
</pre>
<li class="subtitle"><a name="DefaultScreen"></a>DefaultScreen
<p>
That number is not stored by XCB. It is returned in the
- second parameter of the function <span class="code"><a href="#openconn">XCBConnect</a></span>.
+ second parameter of the function <span class="code"><a href="#openconn">xcb_connect</a></span>.
Hence, you have to store it yourself if you want to use
- it. Then, to get the <span class="code">XCBSCREEN</span>
+ it. Then, to get the <span class="code">xcb_screen_t</span>
structure, you have to iterate on the screens.
The equivalent function of the Xlib's
<span class="code">ScreenOfDisplay</span> function can be
found <a href="#ScreenOfDisplay">below</a>. This is also provided in the
- XCBAux library as <span class="code">XCBAuxGetScreen()</span>. OK, here is the
+ xcb_aux_t library as <span class="code">xcb_aux_get_screen()</span>. OK, here is the
small piece of code to get that number:
</p>
<pre class="code">
-XCBConnection *c;
-int screen_default_nbr;
+xcb_connection_t *c;
+int screen_default_nbr;
-/* you pass the name of the display you want to XCBConnect */
+/* you pass the name of the display you want to xcb_connect_t */
-c = XCBConnect (display_name, &screen_default_nbr);
+c = xcb_connect (display_name, &screen_default_nbr);
/* screen_default_nbr contains now the number of the default screen */
</pre>
@@ -3137,56 +3192,56 @@ c = XCBConnect (display_name, &scree
<li class="subtitle"><a name="ScreenCount"></a>ScreenCount
<p>
You get the count of screens with the functions
- <span class="code">XCBGetSetup</span>
+ <span class="code">xcb_get_setup_t</span>
and
- <span class="code">XCBSetupRootsIter</span>
+ <span class="code">xcb_setup_roots_iterator_t</span>
(if you need to iterate):
</p>
<pre class="code">
-XCBConnection *c;
-int screen_count;
+xcb_connection_t *c;
+int screen_count;
/* you init the connection */
-screen_count = XCBSetupRootsIter (XCBGetSetup (c)).rem;
+screen_count = xcb_setup_roots_iterator (xcb_get_setup (c)).rem;
/* screen_count contains now the count of screens */
</pre>
<p>
If you don't want to iterate over the screens, a better way
to get that number is to use
- <span class="code">XCBSetupRootsLength</span>:
+ <span class="code">xcb_setup_roots_length_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-int screen_count;
+xcb_connection_t *c;
+int screen_count;
/* you init the connection */
-screen_count = XCBSetupRootsLength (XCBGetSetup (c));
+screen_count = xcb_setup_roots_length (xcb_get_setup (c));
/* screen_count contains now the count of screens */
</pre>
<li class="subtitle"><a name="ServerVendor"></a>ServerVendor
<p>
You get the name of the vendor of the server hardware with
- the functions <span class="code">XCBGetSetup</span>
+ the functions <span class="code">xcb_get_setup_t</span>
and
<span
- class="code">XCBSetupVendor</span>. Beware
+ class="code">xcb_setup_vendor_t</span>. Beware
that, unlike Xlib, the string returned by XCB is not
necessarily null-terminaled:
</p>
<pre class="code">
-XCBConnection *c;
-char *vendor = NULL;
-int length;
+xcb_connection_t *c;
+char *vendor = NULL;
+int length;
/* you init the connection */
-length = XCBSetupVendorLength (XCBGetSetup (c));
+length = xcb_setup_vendor_length (xcb_get_setup (c));
vendor = (char *)malloc (length + 1);
if (vendor)
-memcpy (vendor, XCBSetupVendor (XCBGetSetup (c)), length);
+memcpy (vendor, xcb_setup_vendor (xcb_get_setup (c)), length);
vendor[length] = '\0';
/* vendor contains now the name of the vendor. Must be freed when not used anymore */
@@ -3194,48 +3249,48 @@ vendor[length] = '\0';
<li class="subtitle"><a name="ProtocolVersion"></a>ProtocolVersion
<p>
You get the major version of the protocol in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD16 protocol_major_version;
+xcb_connection_t *c;
+uint16_t protocol_major_version;
/* you init the connection */
-protocol_major_version = XCBGetSetup (c)->protocol_major_version;
+protocol_major_version = xcb_get_setup (c)->protocol_major_version;
/* protocol_major_version contains now the major version of the protocol */
</pre>
<li class="subtitle"><a name="ProtocolRevision"></a>ProtocolRevision
<p>
You get the minor version of the protocol in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD16 protocol_minor_version;
+xcb_connection_t *c;
+uint16_t protocol_minor_version;
/* you init the connection */
-protocol_minor_version = XCBGetSetup (c)->protocol_minor_version;
+protocol_minor_version = xcb_get_setup (c)->protocol_minor_version;
/* protocol_minor_version contains now the minor version of the protocol */
</pre>
<li class="subtitle"><a name="VendorRelease"></a>VendorRelease
<p>
You get the number of the release of the server hardware in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD32 release_number;
+xcb_connection_t *c;
+uint32_t release_number;
/* you init the connection */
-release_number = XCBGetSetup (c)->release_number;
+release_number = xcb_get_setup (c)->release_number;
/* release_number contains now the number of the release of the server hardware */
</pre>
@@ -3247,64 +3302,64 @@ release_number = XCBGetSetup (c)->rel
<li class="subtitle"><a name="BitmapUnit"></a>BitmapUnit
<p>
You get the bitmap scanline unit in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD8 bitmap_format_scanline_unit;
+xcb_connection_t *c;
+uint8_t bitmap_format_scanline_unit;
/* you init the connection */
-bitmap_format_scanline_unit = XCBGetSetup (c)->bitmap_format_scanline_unit;
+bitmap_format_scanline_unit = xcb_get_setup (c)->bitmap_format_scanline_unit;
/* bitmap_format_scanline_unit contains now the bitmap scanline unit */
</pre>
<li class="subtitle"><a name="BitmapBitOrder"></a>BitmapBitOrder
<p>
You get the bitmap bit order in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD8 bitmap_format_bit_order;
+xcb_connection_t *c;
+uint8_t bitmap_format_bit_order;
/* you init the connection */
-bitmap_format_bit_order = XCBGetSetup (c)->bitmap_format_bit_order;
+bitmap_format_bit_order = xcb_get_setup (c)->bitmap_format_bit_order;
/* bitmap_format_bit_order contains now the bitmap bit order */
</pre>
<li class="subtitle"><a name="BitmapPad"></a>BitmapPad
<p>
You get the bitmap scanline pad in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD8 bitmap_format_scanline_pad;
+xcb_connection_t *c;
+uint8_t bitmap_format_scanline_pad;
/* you init the connection */
-bitmap_format_scanline_pad = XCBGetSetup (c)->bitmap_format_scanline_pad;
+bitmap_format_scanline_pad = xcb_get_setup (c)->bitmap_format_scanline_pad;
/* bitmap_format_scanline_pad contains now the bitmap scanline pad */
</pre>
<li class="subtitle"><a name="ImageByteOrder"></a>ImageByteOrder
<p>
You get the image byte order in the
- <span class="code">XCBSetup</span>
- structure, with the function <span class="code">XCBGetSetup</span>:
+ <span class="code">xcb_setup_t</span>
+ structure, with the function <span class="code">xcb_get_setup_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-CARD8 image_byte_order;
+xcb_connection_t *c;
+uint8_t image_byte_order;
/* you init the connection */
-image_byte_order = XCBGetSetup (c)->image_byte_order;
+image_byte_order = xcb_get_setup (c)->image_byte_order;
/* image_byte_order contains now the image byte order */
</pre>
@@ -3314,13 +3369,13 @@ image_byte_order = XCBGetSetup (c)->i
in Xlib, <span class="code">ScreenOfDisplay</span> returns a
<span class="code">Screen</span> structure that contains
several characteristics of your screen. XCB has a similar
- structure (<span class="code">XCBSCREEN</span>),
+ structure (<span class="code">xcb_screen_t</span>),
but the way to obtain it is a bit different. With
Xlib, you just provide the number of the screen and you grab it
from an array. With XCB, you iterate over all the screens to
obtain the one you want. The complexity of this operation is
O(n). So the best is to store this structure if you use
- it often. See <a href="#ScreenOfDisplay">ScreenOfDisplay</a> just below.
+ it often. See <a href="#ScreenOfDisplay">screen_of_display</a> just below.
</p>
<p>
Xlib provides generally two functions to obtain the characteristics
@@ -3328,7 +3383,7 @@ image_byte_order = XCBGetSetup (c)->i
the screen, which calls <span class="code">ScreenOfDisplay</span>,
and the other that uses the <span class="code">Screen</span> structure.
This might be a bit confusing. As mentioned above, with XCB, it
- is better to store the <span class="code">XCBSCREEN</span>
+ is better to store the <span class="code">xcb_screen_t</span>
structure. Then, you have to read the members of this
structure. That's why the Xlib functions are put by pairs (or
more) as, with XCB, you will use the same code.
@@ -3341,13 +3396,13 @@ image_byte_order = XCBGetSetup (c)->i
once you get the one you want, you return it:
</p>
<pre class="code"><a name="ScreenOfDisplay"></a>
-XCBSCREEN *ScreenOfDisplay (XCBConnection *c,
- int screen)
+xcb_screen_t *screen_of_display (xcb_connection_t *c,
+ int screen)
{
- XCBSCREENIter iter;
+ xcb_screen_iterator_t iter;
- iter = XCBSetupRootsIter (XCBGetSetup (c));
- for (; iter.rem; --screen, XCBSCREENNext (&iter))
+ iter = xcb_setup_roots_iterator (xcb_get_setup (c));
+ for (; iter.rem; --screen, xcb_screen_next (&iter))
if (screen == 0)
return iter.data;
@@ -3361,24 +3416,24 @@ XCBSCREEN *ScreenOfDisplay (XCBConnectio
<p>
All the functions below will use the result of that
function, as they just grab a specific member of the
- <span class="code">XCBSCREEN</span> structure.
+ <span class="code">xcb_screen_t</span> structure.
</p>
<li class="subtitle"><a name="DefaultScreenOfDisplay"></a>DefaultScreenOfDisplay
<p>
It is the default screen that you obtain when you connect to
- the X server. It suffices to call the <a href="#ScreenOfDisplay">ScreenOfDisplay</a>
+ the X server. It suffices to call the <a href="#ScreenOfDisplay">screen_of_display</a>
function above with the connection and the number of the
default screen.
</p>
<pre class="code">
-XCBConnection *c;
-int screen_default_nbr;
-XCBSCREEN *default_screen; /* the returned default screen */
+xcb_connection_t *c;
+int screen_default_nbr;
+xcb_screen_t *default_screen; /* the returned default screen */
-/* you pass the name of the display you want to XCBConnect */
+/* you pass the name of the display you want to xcb_connect_t */
-c = XCBConnect (display_name, &screen_default_nbr);
-default_screen = ScreenOfDisplay (c, screen_default_nbr);
+c = xcb_connect (display_name, &screen_default_nbr);
+default_screen = screen_of_display (c, screen_default_nbr);
/* default_screen contains now the default root window, or a NULL window if no screen is found */
</pre>
@@ -3386,14 +3441,14 @@ default_screen = ScreenOfDisplay (c, scr
<p>
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-XCBWINDOW root_window = { 0 }; /* the returned window */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_window_t root_window = { 0 }; /* the returned window */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
root_window = screen->root;
@@ -3407,15 +3462,15 @@ if (screen)
<a href="#RootWindow">root window</a> as above:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_default_nbr;
-XCBWINDOW root_window = { 0 }; /* the returned root window */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_default_nbr;
+xcb_window_t root_window = { 0 }; /* the returned root window */
-/* you pass the name of the display you want to XCBConnect */
+/* you pass the name of the display you want to xcb_connect_t */
-c = XCBConnect (display_name, &screen_default_nbr);
-screen = ScreenOfDisplay (c, screen_default_nbr);
+c = xcb_connect (display_name, &screen_default_nbr);
+screen = screen_of_display (c, screen_default_nbr);
if (screen)
root_window = screen->root;
@@ -3424,67 +3479,63 @@ if (screen)
<li class="subtitle"><a name="DefaultVisual">DefaultVisual / DefaultVisualOfScreen</a>
<p>
While a Visual is, in Xlib, a structure, in XCB, there are
- two types: <span class="code">XCBVISUALID</span>, which is
- the Id of the visual, and <span class="code">XCBVISUALTYPE</span>,
+ two types: <span class="code">xcb_visualid_t</span>, which is
+ the Id of the visual, and <span class="code">xcb_visualtype_t</span>,
which corresponds to the Xlib Visual. To get the Id of the
visual of a screen, just get the
<span class="code">root_visual</span>
- member of a <span class="code">XCBSCREEN</span>:
+ member of a <span class="code">xcb_screen_t</span>:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-XCBVISUALID root_visual = { 0 }; /* the returned visual Id */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_visualid_t root_visual = { 0 }; /* the returned visual Id */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
root_visual = screen->root_visual;
/* root_visual contains now the value of the Id of the visual, or a NULL visual if no screen is found */
</pre>
<p>
- To get the <span class="code">XCBVISUALTYPE</span>
+ To get the <span class="code">xcb_visualtype_t</span>
structure, it's a bit less easy. You have to get the
- <span class="code">XCBSCREEN</span> structure that you want,
+ <span class="code">xcb_screen_t</span> structure that you want,
get its <span class="code">root_visual</span> member,
- then iterate over the <span class="code">XCBDEPTH</span>s
- and the <span class="code">XCBVISUALTYPE</span>s, and compare
- the <span class="code">XCBVISUALID</span> of these <span class="code">XCBVISUALTYPE</span>s:
+ then iterate over the <span class="code">xcb_depth_t</span>s
+ and the <span class="code">xcb_visualtype_t</span>s, and compare
+ the <span class="code">xcb_visualid_t</span> of these <span class="code">xcb_visualtype_t</span>s:
with <span class="code">root_visual</span>:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-XCBVISUALID root_visual = { 0 };
-XCBVISUALTYPE *visual_type = NULL; /* the returned visual type */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_visualid_t root_visual = { 0 };
+xcb_visualtype_t *visual_type = NULL; /* the returned visual type */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
-if (screen)
- {
- XCBDEPTHIter depth_iter;
-
- depth_iter = XCBSCREENAllowedDepthsIter (screen);
- for (; depth_iter.rem; XCBDEPTHNext (&depth_iter))
- {
- XCBVISUALTYPEIter visual_iter;
-
- visual_iter = XCBDEPTHVisualsIter (depth_iter.data);
- for (; visual_iter.rem; XCBVISUALTYPENext (&visual_iter))
- {
- if (screen->root_visual.id == visual_iter.data->visual_id.id)
- {
- visual_type = visual_iter.data;
- break;
- }
- }
+screen = screen_of_display (c, screen_nbr);
+if (screen) {
+ xcb_depth_iterator_t depth_iter;
+
+ depth_iter = xcb_screen_allowed_depths_iterator (screen);
+ for (; depth_iter.rem; xcb_depth_next (&depth_iter)) {
+ xcb_visualtype_iterator_t visual_iter;
+
+ visual_iter = xcb_depth_visuals_iterator (depth_iter.data);
+ for (; visual_iter.rem; xcb_visualtype_next (&visual_iter)) {
+ if (screen->root_visual.id == visual_iter.data->visual_id.id) {
+ visual_type = visual_iter.data;
+ break;
}
+ }
}
+}
/* visual_type contains now the visual structure, or a NULL visual structure if no screen is found */
</pre>
@@ -3492,48 +3543,47 @@ if (screen)
<p>
This default Graphic Context is just a newly created Graphic
Context, associated to the root window of a
- <span class="code">XCBSCREEN</span>,
+ <span class="code">xcb_screen_t</span>,
using the black white pixels of that screen:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-XCBGCONTEXT gc = { 0 }; /* the returned default graphic context */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_gcontext_t gc = { 0 }; /* the returned default graphic context */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
-if (screen)
- {
- XCBDRAWABLE draw;
- CARD32 mask;
- CARD32 values[2];
-
- gc = XCBGCONTEXTNew (c);
- draw.window = screen->root;
- mask = XCBGCForeground | XCBGCBackground;
- values[0] = screen->black_pixel;
- values[1] = screen->white_pixel;
- XCBCreateGC (c, gc, draw, mask, values);
- }
+screen = screen_of_display (c, screen_nbr);
+if (screen) {
+ xcb_drawable_t draw;
+ uint32_t mask;
+ uint32_t values[2];
+
+ gc = xcb_gcontext_new (c);
+ draw.window = screen->root;
+ mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND;
+ values[0] = screen->black_pixel;
+ values[1] = screen->white_pixel;
+ xcb_create_gc (c, gc, draw, mask, values);
+}
/* gc contains now the default graphic context */
</pre>
<li class="subtitle"><a name="BlackPixel">BlackPixel / BlackPixelOfScreen</a>
<p>
It is the Id of the black pixel, which is in the structure
- of an <span class="code">XCBSCREEN</span>.
+ of an <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 black_pixel = 0; /* the returned black pixel */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t black_pixel = 0; /* the returned black pixel */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
black_pixel = screen->black_pixel;
@@ -3542,17 +3592,17 @@ if (screen)
<li class="subtitle"><a name="WhitePixel">WhitePixel / WhitePixelOfScreen</a>
<p>
It is the Id of the white pixel, which is in the structure
- of an <span class="code">XCBSCREEN</span>.
+ of an <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 white_pixel = 0; /* the returned white pixel */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t white_pixel = 0; /* the returned white pixel */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
white_pixel = screen->white_pixel;
@@ -3562,17 +3612,17 @@ if (screen)
<p>
It is the width in pixels of the screen that you want, and
which is in the structure of the corresponding
- <span class="code">XCBSCREEN</span>.
+ <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 width_in_pixels = 0; /* the returned width in pixels */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t width_in_pixels = 0; /* the returned width in pixels */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
width_in_pixels = screen->width_in_pixels;
@@ -3582,17 +3632,17 @@ if (screen)
<p>
It is the height in pixels of the screen that you want, and
which is in the structure of the corresponding
- <span class="code">XCBSCREEN</span>.
+ <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 height_in_pixels = 0; /* the returned height in pixels */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t height_in_pixels = 0; /* the returned height in pixels */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
height_in_pixels = screen->height_in_pixels;
@@ -3602,17 +3652,17 @@ if (screen)
<p>
It is the width in millimeters of the screen that you want, and
which is in the structure of the corresponding
- <span class="code">XCBSCREEN</span>.
+ <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 width_in_millimeters = 0; /* the returned width in millimeters */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t width_in_millimeters = 0; /* the returned width in millimeters */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
width_in_millimeters = screen->width_in_millimeters;
@@ -3622,17 +3672,17 @@ if (screen)
<p>
It is the height in millimeters of the screen that you want, and
which is in the structure of the corresponding
- <span class="code">XCBSCREEN</span>.
+ <span class="code">xcb_screen_t</span>.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 height_in_millimeters = 0; /* the returned height in millimeters */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t height_in_millimeters = 0; /* the returned height in millimeters */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
height_in_millimeters = screen->height_in_millimeters;
@@ -3641,17 +3691,17 @@ if (screen)
<li class="subtitle"><a name="DisplayPlanes">DisplayPlanes / DefaultDepth / DefaultDepthOfScreen / PlanesOfScreen</a>
<p>
It is the depth (in bits) of the root window of the
- screen. You get it from the <span class="code">XCBSCREEN</span> structure.
+ screen. You get it from the <span class="code">xcb_screen_t</span> structure.
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD8 root_depth = 0; /* the returned depth of the root window */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t root_depth = 0; /* the returned depth of the root window */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
root_depth = screen->root_depth;
@@ -3661,17 +3711,17 @@ if (screen)
<p>
This is the default colormap of the screen (and not the
(default) colormap of the default screen !). As usual, you
- get it from the <span class="code">XCBSCREEN</span> structure:
+ get it from the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-XCBCOLORMAP default_colormap = { 0 }; /* the returned default colormap */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+xcb_colormap_t default_colormap = { 0 }; /* the returned default colormap */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
default_colormap = screen->default_colormap;
@@ -3679,17 +3729,17 @@ if (screen)
</pre>
<li class="subtitle"><a name="MinCmapsOfScreen"></a>MinCmapsOfScreen
<p>
- You get the minimum installed colormaps in the <span class="code">XCBSCREEN</span> structure:
+ You get the minimum installed colormaps in the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD16 min_installed_maps = 0; /* the returned minimum installed colormaps */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint16_t min_installed_maps = 0; /* the returned minimum installed colormaps */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
min_installed_maps = screen->min_installed_maps;
@@ -3697,17 +3747,17 @@ if (screen)
</pre>
<li class="subtitle"><a name="MaxCmapsOfScreen"></a>MaxCmapsOfScreen
<p>
- You get the maximum installed colormaps in the <span class="code">XCBSCREEN</span> structure:
+ You get the maximum installed colormaps in the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD16 max_installed_maps = 0; /* the returned maximum installed colormaps */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint16_t max_installed_maps = 0; /* the returned maximum installed colormaps */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
max_installed_maps = screen->max_installed_maps;
@@ -3716,17 +3766,17 @@ if (screen)
<li class="subtitle"><a name="DoesSaveUnders"></a>DoesSaveUnders
<p>
You know if <span class="code">save_unders</span> is set,
- by looking in the <span class="code">XCBSCREEN</span> structure:
+ by looking in the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-BOOL save_unders = 0; /* the returned value of save_unders */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t save_unders = 0; /* the returned value of save_unders */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
save_unders = screen->save_unders;
@@ -3735,17 +3785,17 @@ if (screen)
<li class="subtitle"><a name="DoesBackingStore"></a>DoesBackingStore
<p>
You know the value of <span class="code">backing_stores</span>,
- by looking in the <span class="code">XCBSCREEN</span> structure:
+ by looking in the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-BYTE backing_stores = 0; /* the returned value of backing_stores */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint8_t backing_stores = 0; /* the returned value of backing_stores */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
backing_stores = screen->backing_stores;
@@ -3754,17 +3804,17 @@ if (screen)
<li class="subtitle"><a name="EventMaskOfScreen"></a>EventMaskOfScreen
<p>
To get the current input masks,
- you look in the <span class="code">XCBSCREEN</span> structure:
+ you look in the <span class="code">xcb_screen_t</span> structure:
</p>
<pre class="code">
-XCBConnection *c;
-XCBSCREEN *screen;
-int screen_nbr;
-CARD32 current_input_masks = 0; /* the returned value of current input masks */
+xcb_connection_t *c;
+xcb_screen_t *screen;
+int screen_nbr;
+uint32_t current_input_masks = 0; /* the returned value of current input masks */
/* you init the connection and screen_nbr */
-screen = ScreenOfDisplay (c, screen_nbr);
+screen = screen_of_display (c, screen_nbr);
if (screen)
current_input_masks = screen->current_input_masks;
@@ -3774,7 +3824,7 @@ if (screen)
<li class="subtitle"><a name="misc">Miscellaneous macros</a>
<ol>
<li class="subtitle"><a name="DisplayOfScreen"></a>DisplayOfScreen
- <p>
+ <p>
in Xlib, the <span class="code">Screen</span> structure
stores its associated <span class="code">Display</span>
structure. This is not the case in the X Window protocol,
@@ -3784,13 +3834,13 @@ if (screen)
<li class="subtitle"><a name="DisplayCells"></a>DisplayCells / CellsOfScreen
<p>
To get the colormap entries,
- you look in the <span class="code">XCBVISUALTYPE</span>
+ you look in the <span class="code">xcb_visualtype_t</span>
structure, that you grab like <a class="subsection" href="#DefaultVisual">here</a>:
</p>
<pre class="code">
-XCBConnection *c;
-XCBVISUALTYPE *visual_type;
-CARD16 colormap_entries = 0; /* the returned value of the colormap entries */
+xcb_connection_t *c;
+xcb_visualtype_t *visual_type;
+uint16_t colormap_entries = 0; /* the returned value of the colormap entries */
/* you init the connection and visual_type */
diff --git a/doc/tutorial/xcb.css b/doc/tutorial/xcb.css
index dd07232..d2ab886 100644
--- a/doc/tutorial/xcb.css
+++ b/doc/tutorial/xcb.css
@@ -101,3 +101,23 @@ span.code
font-family: monospace;
font-size: 12px;
}
+pre.code type
+{
+ color: #44bb44;
+}
+pre.code function
+{
+ color: #449fb7;
+}
+pre.code include
+{
+ color: #7d93ae;
+}
+pre.code string
+{
+ color: #ef6e4b;
+}
+pre.code keyword
+{
+ color: #00bbbb;
+}
diff-tree 15993fccd0b0cba870b793345fb5c5ec13ece0c8 (from f7cd80142fa83d531850df2c2a3b4a514129170b)
Author: Jamey Sharp <jamey at minilop.net>
Date: Mon Sep 25 05:12:07 2006 -0700
Release libxcb 1.0 RC1 (0.9.91).
diff --git a/configure.ac b/configure.ac
index afcdc8c..b097759 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
AC_PREREQ(2.57)
AC_INIT([libxcb],
- 0.9,
+ 0.9.91,
[xcb at lists.freedesktop.org])
AC_CONFIG_SRCDIR([xcb.pc.in])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
diff-tree f7cd80142fa83d531850df2c2a3b4a514129170b (from 0d7beff580232d4b7adfc840bcd1cae894b57682)
Author: Josh Triplett <josh at freedesktop.org>
Date: Mon Sep 25 05:10:37 2006 -0700
Stop installing the protocol descriptions for extensions to an extensions/
subdirectory
diff --git a/src/.gitignore b/src/.gitignore
index bcb45d0..b63a8e0 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,6 +1,24 @@
-xproto.xml
-xproto.c
-xproto.h
+bigreq.*
+composite.*
+damage.*
+dpms.*
+glx.*
+randr.*
+record.*
+render.*
+res.*
+screensaver.*
+shape.*
+shm.*
+sync.*
+xc_misc.*
+xevie.*
+xf86dri.*
+xfixes.*
+xprint.*
+xtest.*
+xv.*
+xvmc.*
+xproto.*
xcb_des.c
-extensions
X11
diff --git a/src/Makefile.am b/src/Makefile.am
index 274a884..15fda4a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,79 +21,79 @@ lib_LTLIBRARIES = libxcb.la \
libxcb-xvmc.la
EXTHEADERS = \
- extensions/bigreq.h \
- extensions/composite.h \
- extensions/damage.h \
- extensions/dpms.h \
- extensions/glx.h \
- extensions/randr.h \
- extensions/record.h \
- extensions/render.h \
- extensions/res.h \
- extensions/screensaver.h \
- extensions/shape.h \
- extensions/shm.h \
- extensions/sync.h \
- extensions/xc_misc.h \
- extensions/xevie.h \
- extensions/xf86dri.h \
- extensions/xfixes.h \
- extensions/xprint.h \
- extensions/xtest.h \
- extensions/xv.h \
- extensions/xvmc.h
+ bigreq.h \
+ composite.h \
+ damage.h \
+ dpms.h \
+ glx.h \
+ randr.h \
+ record.h \
+ render.h \
+ res.h \
+ screensaver.h \
+ shape.h \
+ shm.h \
+ sync.h \
+ xc_misc.h \
+ xevie.h \
+ xf86dri.h \
+ xfixes.h \
+ xprint.h \
+ xtest.h \
+ xv.h \
+ xvmc.h
EXTSOURCES = \
- extensions/bigreq.c \
- extensions/composite.c \
- extensions/damage.c \
- extensions/dpms.c \
- extensions/glx.c \
- extensions/randr.c \
- extensions/record.c \
- extensions/render.c \
- extensions/res.c \
- extensions/screensaver.c \
- extensions/shape.c \
- extensions/shm.c \
- extensions/sync.c \
- extensions/xc_misc.c \
- extensions/xevie.c \
- extensions/xf86dri.c \
- extensions/xfixes.c \
- extensions/xprint.c \
- extensions/xtest.c \
- extensions/xv.c \
- extensions/xvmc.c
+ bigreq.c \
+ composite.c \
+ damage.c \
+ dpms.c \
+ glx.c \
+ randr.c \
+ record.c \
+ render.c \
+ res.c \
+ screensaver.c \
+ shape.c \
+ shm.c \
+ sync.c \
+ xc_misc.c \
+ xevie.c \
+ xf86dri.c \
+ xfixes.c \
+ xprint.c \
+ xtest.c \
+ xv.c \
+ xvmc.c
EXTENSIONS = $(EXTSOURCES) $(EXTHEADERS)
ESSENTIAL_EXTENSIONS = \
- extensions/bigreq.h \
- extensions/bigreq.c \
- extensions/xc_misc.h \
- extensions/xc_misc.c
+ bigreq.h \
+ bigreq.c \
+ xc_misc.h \
+ xc_misc.c
EXTENSION_XML = \
- extensions/bigreq.xml \
- extensions/composite.xml \
- extensions/damage.xml \
- extensions/dpms.xml \
- extensions/glx.xml \
- extensions/randr.xml \
- extensions/record.xml \
- extensions/render.xml \
- extensions/res.xml \
- extensions/screensaver.xml \
- extensions/shape.xml \
- extensions/shm.xml \
- extensions/sync.xml \
- extensions/xc_misc.xml \
- extensions/xevie.xml \
- extensions/xf86dri.xml \
- extensions/xfixes.xml \
- extensions/xprint.xml \
- extensions/xtest.xml \
- extensions/xvmc.xml \
- extensions/xv.xml
+ bigreq.xml \
+ composite.xml \
+ damage.xml \
+ dpms.xml \
+ glx.xml \
+ randr.xml \
+ record.xml \
+ render.xml \
+ res.xml \
+ screensaver.xml \
+ shape.xml \
+ shm.xml \
+ sync.xml \
+ xc_misc.xml \
+ xevie.xml \
+ xf86dri.xml \
+ xfixes.xml \
+ xprint.xml \
+ xtest.xml \
+ xvmc.xml \
+ xv.xml
COREHEADERS = xproto.h
CORESOURCES = xproto.c
@@ -131,79 +131,79 @@ libxcb_xlib_la_SOURCES = xcb_xlib.c
libxcb_composite_la_LDFLAGS = -version-info 0:0:0
libxcb_composite_la_LIBADD = $(XCB_LIBS)
-libxcb_composite_la_SOURCES = extensions/composite.c extensions/composite.h
+libxcb_composite_la_SOURCES = composite.c composite.h
libxcb_damage_la_LDFLAGS = -version-info 0:0:0
libxcb_damage_la_LIBADD = $(XCB_LIBS)
-libxcb_damage_la_SOURCES = extensions/damage.c extensions/damage.h
+libxcb_damage_la_SOURCES = damage.c damage.h
libxcb_dpms_la_LDFLAGS = -version-info 0:0:0
libxcb_dpms_la_LIBADD = $(XCB_LIBS)
-libxcb_dpms_la_SOURCES = extensions/dpms.c extensions/dpms.h
+libxcb_dpms_la_SOURCES = dpms.c dpms.h
libxcb_glx_la_LDFLAGS = -version-info 0:0:0
libxcb_glx_la_LIBADD = $(XCB_LIBS)
-libxcb_glx_la_SOURCES = extensions/glx.c extensions/glx.h
+libxcb_glx_la_SOURCES = glx.c glx.h
libxcb_randr_la_LDFLAGS = -version-info 0:0:0
libxcb_randr_la_LIBADD = $(XCB_LIBS)
-libxcb_randr_la_SOURCES = extensions/randr.c extensions/randr.h
+libxcb_randr_la_SOURCES = randr.c randr.h
libxcb_record_la_LDFLAGS = -version-info 0:0:0
libxcb_record_la_LIBADD = $(XCB_LIBS)
-libxcb_record_la_SOURCES = extensions/record.c extensions/record.h
+libxcb_record_la_SOURCES = record.c record.h
libxcb_render_la_LDFLAGS = -version-info 0:0:0
libxcb_render_la_LIBADD = $(XCB_LIBS)
-libxcb_render_la_SOURCES = extensions/render.c extensions/render.h
+libxcb_render_la_SOURCES = render.c render.h
libxcb_res_la_LDFLAGS = -version-info 0:0:0
libxcb_res_la_LIBADD = $(XCB_LIBS)
-libxcb_res_la_SOURCES = extensions/res.c extensions/res.h
+libxcb_res_la_SOURCES = res.c res.h
libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0
libxcb_screensaver_la_LIBADD = $(XCB_LIBS)
-libxcb_screensaver_la_SOURCES = extensions/screensaver.c extensions/screensaver.h
+libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h
libxcb_shape_la_LDFLAGS = -version-info 0:0:0
libxcb_shape_la_LIBADD = $(XCB_LIBS)
-libxcb_shape_la_SOURCES = extensions/shape.c extensions/shape.h
+libxcb_shape_la_SOURCES = shape.c shape.h
libxcb_shm_la_LDFLAGS = -version-info 0:0:0
libxcb_shm_la_LIBADD = $(XCB_LIBS)
-libxcb_shm_la_SOURCES = extensions/shm.c extensions/shm.h
+libxcb_shm_la_SOURCES = shm.c shm.h
libxcb_sync_la_LDFLAGS = -version-info 0:0:0
libxcb_sync_la_LIBADD = $(XCB_LIBS)
-libxcb_sync_la_SOURCES = extensions/sync.c extensions/sync.h
+libxcb_sync_la_SOURCES = sync.c sync.h
libxcb_xevie_la_LDFLAGS = -version-info 0:0:0
libxcb_xevie_la_LIBADD = $(XCB_LIBS)
-libxcb_xevie_la_SOURCES = extensions/xevie.c extensions/xevie.h
+libxcb_xevie_la_SOURCES = xevie.c xevie.h
libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0
libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)
-libxcb_xf86dri_la_SOURCES = extensions/xf86dri.c extensions/xf86dri.h
+libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h
libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0
libxcb_xfixes_la_LIBADD = $(XCB_LIBS)
-libxcb_xfixes_la_SOURCES = extensions/xfixes.c extensions/xfixes.h
+libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h
libxcb_xprint_la_LDFLAGS = -version-info 0:0:0
libxcb_xprint_la_LIBADD = $(XCB_LIBS)
-libxcb_xprint_la_SOURCES = extensions/xprint.c extensions/xprint.h
+libxcb_xprint_la_SOURCES = xprint.c xprint.h
libxcb_xtest_la_LDFLAGS = -version-info 0:0:0
libxcb_xtest_la_LIBADD = $(XCB_LIBS)
-libxcb_xtest_la_SOURCES = extensions/xtest.c extensions/xtest.h
+libxcb_xtest_la_SOURCES = xtest.c xtest.h
libxcb_xv_la_LDFLAGS = -version-info 0:0:0
libxcb_xv_la_LIBADD = $(XCB_LIBS)
-libxcb_xv_la_SOURCES = extensions/xv.c extensions/xv.h
+libxcb_xv_la_SOURCES = xv.c xv.h
libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0
libxcb_xvmc_la_LIBADD = $(XCB_LIBS)
-libxcb_xvmc_la_SOURCES = extensions/xvmc.c extensions/xvmc.h
+libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h
$(EXTHEADERS) $(EXTSOURCES): c-client.xsl
@@ -213,23 +213,20 @@ SUFFIXES = .xml
@n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n)
$(XSLTPROC) --stringparam mode header \
--stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \
- --stringparam extension-path \
- $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
+ --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \
-o $@ $(srcdir)/c-client.xsl $<
.xml.c:
@n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n)
$(XSLTPROC) --stringparam mode source \
--stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \
- --stringparam extension-path \
- $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
+ --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \
-o $@ $(srcdir)/c-client.xsl $<
xproto.xml: $(XCBPROTO_XCBINCLUDEDIR)/xproto.xml
$(LN_S) $(XCBPROTO_XCBINCLUDEDIR)/xproto.xml $@
$(EXTENSION_XML):
- [ -d extensions ] || mkdir extensions
for i in $(EXTENSION_XML) ; do \
rm -f $$i ; \
$(LN_S) $(XCBPROTO_XCBINCLUDEDIR)/$$i $$i ; \
diff --git a/src/xcb_out.c b/src/xcb_out.c
index edb0aa9..162abd4 100644
--- a/src/xcb_out.c
+++ b/src/xcb_out.c
@@ -33,7 +33,7 @@
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
-#include "extensions/bigreq.h"
+#include "bigreq.h"
static int write_block(xcb_connection_t *c, struct iovec *vector, int count)
{
diff --git a/src/xcb_xid.c b/src/xcb_xid.c
index 6ca6bd9..7ff0c5f 100644
--- a/src/xcb_xid.c
+++ b/src/xcb_xid.c
@@ -29,7 +29,7 @@
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
-#include "extensions/xc_misc.h"
+#include "xc_misc.h"
/* Public interface */
diff-tree 0d7beff580232d4b7adfc840bcd1cae894b57682 (from d04e7777d3547de2cece0734c0b9be49d3ddb88c)
Author: Josh Triplett <josh at freedesktop.org>
Date: Mon Sep 25 04:43:04 2006 -0700
Actually install xcb-xlib.pc, and ship xcb-xlib.pc.in in distribution tarballs
diff --git a/Makefile.am b/Makefile.am
index 205691b..7f89fba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
xcb.pc \
+xcb-xlib.pc \
xcb-composite.pc \
xcb-damage.pc \
xcb-dpms.pc \
@@ -26,6 +27,7 @@ xcb-xvmc.pc
EXTRA_DIST = \
xcb.pc.in \
+xcb-xlib.pc.in \
xcb-composite.pc.in \
xcb-damage.pc.in \
xcb-dpms.pc.in \
diff-tree d04e7777d3547de2cece0734c0b9be49d3ddb88c (from 0bccf7d2eed45ba15a012d090b9b950075e75803)
Author: Jamey Sharp <jamey at minilop.net>
Date: Mon Sep 25 04:14:26 2006 -0700
Ensure api_conv.pl is idempotent on names of constants: XCB_[A-Z0-9_]+.
diff --git a/tools/api_conv.pl b/tools/api_conv.pl
index 7e26145..003a893 100755
--- a/tools/api_conv.pl
+++ b/tools/api_conv.pl
@@ -62,7 +62,7 @@ sub convert($$)
return "uint$1_t" if /^CARD(8|16|32)$/;
return "int$1_t" if /^INT(8|16|32)$/;
return "uint8_t" if $_ eq 'BOOL' or $_ eq 'BYTE';
- return $_ if /^[A-Z]*_[A-Z_]*$/ or !/^XCB(.+)/;
+ return $_ if /^[A-Z0-9]*_[A-Z0-9_]*$/ or !/^XCB(.+)/;
my $const = defined $::const{$_};
$_ = $1;
diff-tree 0bccf7d2eed45ba15a012d090b9b950075e75803 (from 9100981d359f6366ab92b456e6069bac89afeb15)
Author: Jamey Sharp <jamey at minilop.net>
Date: Mon Sep 25 04:03:01 2006 -0700
Move header files to $includedir/xcb (generally $prefix/include/xcb).
diff --git a/configure.ac b/configure.ac
index ff91834..afcdc8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ AC_HEADER_STDC
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
-xcbincludedir='${includedir}/X11/XCB'
+xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
AC_ARG_WITH(opt,
diff --git a/tools/api_conv.pl b/tools/api_conv.pl
index 2b0fa9f..7e26145 100755
--- a/tools/api_conv.pl
+++ b/tools/api_conv.pl
@@ -93,4 +93,5 @@ sub convert($$)
return "xcb" . $_;
}
+s/^(\s*#\s*include\s*<)X11\/XCB\//$1xcb\//;
s/([_A-Za-z][_A-Za-z0-9]*)([ \t]*\()?/convert($1, defined $2) . ($2 or "")/eg;
diff-tree 9100981d359f6366ab92b456e6069bac89afeb15 (from 810dfb886247dc4484886aff2e2e7d80ea945de4)
Author: Josh Triplett <josh at freedesktop.org>
Date: Mon Sep 25 02:02:16 2006 -0700
Split the Xlib compatibility functions into a separate library libxcb-xlib
We don't want to have to change the libxcb soname if we later manage to remove
the Xlib compatibility functions, and nothing except Xlib should ever use
them, so split them into a separate library.
diff --git a/configure.ac b/configure.ac
index d72677c..ff91834 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,6 @@ AC_SUBST(CWARNFLAGS)
GCC_CHECK_VISIBILITY()
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
-AC_CONFIG_FILES([xcb.pc xcb-composite.pc xcb-damage.pc xcb-dpms.pc xcb-glx.pc xcb-randr.pc xcb-record.pc xcb-render.pc xcb-res.pc xcb-screensaver.pc xcb-shape.pc xcb-shm.pc xcb-sync.pc xcb-xevie.pc xcb-xf86dri.pc xcb-xfixes.pc xcb-xprint.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc])
+AC_CONFIG_FILES([xcb.pc xcb-xlib.pc xcb-composite.pc xcb-damage.pc xcb-dpms.pc xcb-glx.pc xcb-randr.pc xcb-record.pc xcb-render.pc xcb-res.pc xcb-screensaver.pc xcb-shape.pc xcb-shm.pc xcb-sync.pc xcb-xevie.pc xcb-xf86dri.pc xcb-xfixes.pc xcb-xprint.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index f49cc38..274a884 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,5 @@
lib_LTLIBRARIES = libxcb.la \
+ libxcb-xlib.la \
libxcb-composite.la \
libxcb-damage.la \
libxcb-dpms.la \
@@ -105,7 +106,7 @@ AM_CFLAGS = $(COPTFLAGS) $(CWARNFLAGS) $
libxcb_la_LIBADD = $(XCBPROTO_LIBS) $(XAU_LIBS) $(XDMCP_LIBS)
libxcb_la_SOURCES = \
xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \
- xcb_list.c xcb_util.c xcb_xlib.c xcb_auth.c \
+ xcb_list.c xcb_util.c xcb_auth.c \
$(COREPROTO) $(ESSENTIAL_EXTENSIONS) c-client.xsl
# Explanation for -version-info:
@@ -122,6 +123,10 @@ CLEANFILES = $(COREPROTO) $(EXTENSIONS)
XCB_LIBS = libxcb.la
+libxcb_xlib_la_LDFLAGS = -version-info 0:0:0
+libxcb_xlib_la_LIBADD = $(XCB_LIBS)
+libxcb_xlib_la_SOURCES = xcb_xlib.c
+
# FIXME: find a way to autogenerate this from the XML files.
libxcb_composite_la_LDFLAGS = -version-info 0:0:0
diff --git a/xcb-xlib.pc.in b/xcb-xlib.pc.in
new file mode 100644
index 0000000..f28b529
--- /dev/null
+++ b/xcb-xlib.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB Xlib
+Description: XCB Xlib support functions
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-xlib
+Cflags: -I${includedir}
More information about the xcb-commit
mailing list