[Xcb] Experiences with XCB
Vincent Torri
vtorri at univ-evry.fr
Tue Sep 19 23:10:35 PDT 2006
On Wed, 20 Sep 2006, Ori Bernstein wrote:
>
> My experience with XCB was mixed. My first thought was "Where are the
> docs?!?".
For the api of xcb itself, on the web page or, as you found out yourself,
in xcb.h
> What I found myself doing for documentation was grepping the headers in
> include/X11/XCB/* for the sort of things I was looking for, and then trying to
> figure out the equivalent Xlib function to look up it's manpage. Ick.
> Please, please write man pages with code snippets.
In the tutorial (xcb/doc/tutorial), there are a lot of doc about
translating common Xlib functions to XCB.
Usually, when I don't find enough doc on how to translate an Xlib function
in the tutorial, I look at the Xlib code. It's usually easy, then to get
the XCB code.
In gneral, you are right, there is a lack of doc about xcb. Once the
naming convention will be out, I think that I'll make a patch so that doc
is generated by doxygen if it is found.
> The "strong typing by structs" was another annoyance, although I guess my use
> case is nontypical, since I had to interact with the X server's DIX, which uses
> scalars. Lots of conversions were going on.
>
> I still believe the biggest deficiency in the XCB API is that there is no way
> to peek the next event in the queue. An example use case: I want to collect all
> expose events in one function. In my mind, the natural way to do this is
> peeking the next event (or at least it's type) to decide if I'm done gathering
> exposures. XCB has no way of doing this, as far as I can see, and it makes some
> code awkward.
I also have dealt with that in ecore. But I modified a bit my code and,
finally, that peek function was not necessary for me. In case it might
help you, I get the next event and store it in a global variable, and I
use that variable later to check of there's an event or not in the queue.
Vincent
More information about the Xcb
mailing list