Merge branch 'master' into debian
This commit is contained in:
commit
5d7d548d05
|
@ -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 \
|
||||
|
|
|
@ -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.
|
|
@ -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
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([libxcb],
|
||||
0.9,
|
||||
0.9.92,
|
||||
[xcb@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,
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
188
src/Makefile.am
188
src/Makefile.am
|
@ -1,4 +1,5 @@
|
|||
lib_LTLIBRARIES = libxcb.la \
|
||||
libxcb-xlib.la \
|
||||
libxcb-composite.la \
|
||||
libxcb-damage.la \
|
||||
libxcb-dpms.la \
|
||||
|
@ -20,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
|
||||
|
@ -105,7 +106,7 @@ AM_CFLAGS = $(COPTFLAGS) $(CWARNFLAGS) $(CDEBUGFLAGS) $(XCBPROTO_CFLAGS) $(XAU_C
|
|||
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:
|
||||
|
@ -115,90 +116,94 @@ 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)
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
|
@ -208,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 ; \
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
@ -270,8 +267,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,18 +400,10 @@ authorization from the authors.
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="xidtype" mode="pass1">
|
||||
<struct name="{xcb:xcb-prefix(@name)}_t">
|
||||
<field type="uint32_t" name="xid" />
|
||||
</struct>
|
||||
<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)}" />
|
||||
<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">
|
||||
|
@ -1085,6 +1074,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">
|
||||
|
@ -1105,7 +1096,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>,
|
||||
|
|
21
src/xcb.h
21
src/xcb.h
|
@ -224,12 +224,10 @@ xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
|
|||
* 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.
|
||||
|
@ -410,6 +408,19 @@ xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
|
|||
xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
|
||||
|
||||
|
||||
/* xcb_xid.c */
|
||||
|
||||
/**
|
||||
* @brief Allocates an XID for a new object.
|
||||
* @param c: The connection.
|
||||
* @return A newly allocated XID.
|
||||
*
|
||||
* Allocates an XID for a new object. Typically used just prior to
|
||||
* various object creation functions, such as xcb_create_window.
|
||||
*/
|
||||
uint32_t xcb_generate_id(xcb_connection_t *c);
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -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];
|
||||
|
@ -97,12 +109,12 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -215,6 +227,7 @@ xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info)
|
|||
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);
|
||||
|
||||
|
@ -255,6 +269,22 @@ void _xcb_conn_shutdown(xcb_connection_t *c)
|
|||
c->has_error = 1;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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 +308,7 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vec
|
|||
++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 +317,7 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vec
|
|||
_xcb_conn_shutdown(c);
|
||||
ret = 0;
|
||||
}
|
||||
pthread_mutex_lock(&c->iolock);
|
||||
_xcb_lock_io(c);
|
||||
|
||||
if(ret)
|
||||
{
|
||||
|
|
44
src/xcb_in.c
44
src/xcb_in.c
|
@ -108,8 +108,6 @@ static int read_packet(xcb_connection_t *c)
|
|||
}
|
||||
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)
|
|||
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)
|
||||
|
@ -318,7 +319,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_
|
|||
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 +359,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_
|
|||
}
|
||||
|
||||
wake_up_next_reader(c);
|
||||
pthread_mutex_unlock(&c->iolock);
|
||||
_xcb_unlock_io(c);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -373,9 +374,9 @@ int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply,
|
|||
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,44 +385,29 @@ xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c)
|
|||
xcb_generic_event_t *ret;
|
||||
if(c->has_error)
|
||||
return 0;
|
||||
pthread_mutex_lock(&c->iolock);
|
||||
_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;
|
||||
}
|
||||
|
||||
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;
|
||||
pthread_mutex_lock(&c->iolock);
|
||||
_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);
|
||||
pthread_mutex_unlock(&c->iolock);
|
||||
if(success)
|
||||
{
|
||||
if(error)
|
||||
*error = 0;
|
||||
return ret;
|
||||
}
|
||||
_xcb_unlock_io(c);
|
||||
}
|
||||
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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect
|
|||
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_connection_t *c, int flags, struct iovec *vect
|
|||
_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;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "xcb.h"
|
||||
#include "xcbext.h"
|
||||
#include "xcbint.h"
|
||||
#include "extensions/xc_misc.h"
|
||||
#include "xc_misc.h"
|
||||
|
||||
/* Public interface */
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
@ -33,9 +35,21 @@ unsigned int xcb_get_request_sent(xcb_connection_t *c)
|
|||
return c->out.request;
|
||||
}
|
||||
|
||||
pthread_mutex_t *xcb_get_io_lock(xcb_connection_t *c)
|
||||
void xcb_xlib_lock(xcb_connection_t *c)
|
||||
{
|
||||
if(c->has_error)
|
||||
return 0;
|
||||
return &c->iolock;
|
||||
_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);
|
||||
}
|
||||
|
|
|
@ -66,11 +66,6 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_
|
|||
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);
|
||||
|
|
16
src/xcbint.h
16
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;
|
||||
|
||||
|
@ -170,4 +180,10 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info);
|
|||
#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
|
||||
|
|
|
@ -31,9 +31,11 @@
|
|||
#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);
|
||||
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -93,4 +93,6 @@ 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;
|
||||
s/xcb_[a-z0-9_]*_new/xcb_generate_id/g;
|
||||
|
|
|
@ -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}
|
Loading…
Reference in New Issue