[Xcb] Server-side XCB

Tomas Carnecky tom at dbservice.com
Mon Aug 9 09:15:32 PDT 2010


I started looking into using xcb to generate the server-side protocol
bindings. The first attempt is already available for preliminary review
at http://lists.x.org/archives/xorg-devel/2010-August/011774.html.
Unlike libxcb, which generates the source files in pure python, I've
chosen to use a template language. I find it much easier to read,
understand and edit.

To generate the source files, I first parse the xml file and store it as
python objects (lists, dictionaries, classes etc). Then I pass all those
to the template which generates the source files. The template language
I use is from http://www.makotemplates.org, but any other template
language would work equally well. Speed is not the issue here,
readability and portability is much more important.

I will need to extend the python code and move some of the logic out of
the templates into the python script (xcb-gen.py), things like
('_').join(field.type.name) should not be in the template files. Maybe
some of that code could go into xcbgen.

tom



More information about the Xcb mailing list