[Xcb] how to use the record extension in xcb...

Uli Schlachter psychon at znc.in
Sat Dec 17 13:52:15 UTC 2016

On 15.12.2016 09:51, zmqdev wrote:
> Hello,
> I'm currently writing a new version of a (working) program that uses the
> record extension, so I want to use xcb instead of Xlib.

I'm sorry to hear that.

> However, I am unclear on how to separate the multiple items contained in
> a single reply from the record extension.
> The only working example I found was this answer on stackoverflow
>     https://stackoverflow.com/questions/20823894/xcb-record-x11-extension-example
> It works, but does 'magic' to access the several data items that are
> contained in a single xcb_record_enable_context_reply_t (as per protocol
> specification of record extension).

It does the same magic that libXtst uses to parse the reply.

> I thought of iterator functions, but for some reason, the header file
> <xcb/record.h> has only the one function

The XCB header functions are auto-generated from the protocol
description and the RECORD extension does not really fit into this. Its
replies can contain almost arbitrary data. I think the XML used to
express protocol extension is not powerful enough to express RECORD's
magic and even if it were, the generated result would not be all that

I think that all that I can tell you is to stick with Xlib instead of
XCB when using the RECORD extension.

(who also wrote the above-linked stackoverflow answer)
A normal person is just someone you don't know well enough yet.
 - Nettie Wiebe

More information about the Xcb mailing list