[Xcb] Question about XCB-XML

Barton C Massey bart at cs.pdx.edu
Thu May 27 14:14:11 PDT 2010


In message <87mxvnyria.fsf at keller.adm.naquadah.org> you wrote:
> On Wed, May 26 2010, Marcos Roriz wrote:
> > One of the thing that I didn't understand is why does
> > XCB/Xlib needs to generate Xml for the protocol isn't
> > the protocol fixed (at least at core), i.e., "imutable",
> > ins't better/easier to just create a implementation or
> > does it really needs the power of dynamic generation the
> > C bindings?
> 
> The protocol, and its extension, are fixed. The XML files are
> hand-written to describe this protocol. Then this XML files are used to
> generate various bindings for various languages.
> 
> This mean you do not have to write a full implementation for each
> language, just a binding generator.

Originally, we took this approach to get rid of a lot of
repetitive, error-prone hand-generated boilerplate C code.
The ability to automatically produce X11 bindings for other
languages, and to easily add understanding of X11 to tools
such as Wireshark, has been a nice bonus.  The XML also
serves as reasonably nice documentation of the protocol; at
some point we may consider canonicalizing it as the
definition of some X11 extension protocols.

If nothing else, it has been good to test the X server
against a client library that was developed independently of
Xlib: we've found a few server bugs that were masked by
corresponding Xlib bugs that way.

    Bart


More information about the Xcb mailing list