[Xcb] Python generator / cairo problems

Eamon Walsh ewalsh at tycho.nsa.gov
Mon Apr 21 14:41:44 PDT 2008

Jeremy A. Kolb wrote:
> We'll need to be able to handle the documention tags in the XML.  Where do 
> I stick those (see my previous email a few days ago that shows an example 
> of the tags)?

The documentation tags/attributes must be incorporated into the xcb.xsd 
schema document.

After that you can edit types.py, expr.py and state.py and have the 
constructors of the various classes parse out the documentation strings 
and store them in their state (tentative example below).  Then make the 
code in c-client.py use those state fields to generate the doxygen or 

diff --git a/xcbgen/types.py b/xcbgen/types.py
index a84420f..83a0e53 100644
--- a/xcbgen/types.py
+++ b/xcbgen/types.py
@@ -117,6 +117,12 @@ class Enum(SimpleType):
         SimpleType.__init__(self, name, 4)
         self.values = []
         for item in list(elt):
+            # Handle documentation subelement
+            if item.tag == 'doc':
+                self.doc_brief = item.findtext('brief')
+                self.doc_detailed = item.findtext('detailed')
+                continue
             # First check if we're using a default value
             if len(list(item)) == 0:
                 self.values.append((item.get('name'), ''))

Eamon Walsh <ewalsh at tycho.nsa.gov>
National Security Agency

More information about the Xcb mailing list