[Xcb] XCB naming conventions technical problems

Thomas Hunger hto at arcor.de
Thu Sep 14 12:57:51 PDT 2006


I did some hacking on the Stylesheet "c-client.xsl" and 
the "xproto.xml" to implement the new naming scheme. First 
the questions:

What do import.py, size.py  and type.py do? They do not seem 
to be called before the xsl processor gets called?

Now the problems:

* Within the stylesheet there are a lot snippets like 


If I transform them to 


and $ext is empty because it is an unqualified type the 
result will be 


meaning two underscores in a row. I see two ways to solve 
1) declare ext with an underscore included (this seems to 
break other things)
2) do an xsl:if to check if $ext is empty and insert text 
accordingly. This would mean a lot of checking (~20 

* Renaming types e.g. from WINDOW to window_t can be done in 
two places: In xproto.xml or by appending "_t" in various 
places in c-clients.xsl.
When doing the former, the created functions for requests 
would e.g. look like "xcb_create_window_t_checked" which is 
not wanted. The other way, appending "_t" in the stylesheet 
is quite complicated because many places need to be 
adjusted. I tried for an hour but it still does not compile 
correctly (But maybe Josh could do it).

After giving up (there were more problems), I did a small 
xml->c converter for a subset in python which seems to me 
simpler and better readable (although less error checking 
presently). This raises the question: would a move from xsl 
to python be viable or is python too much of a dependency?

Thanks for reading

More information about the Xcb mailing list