[Xcb] Proposal: Link fields to enums in the protocol XML files

Antoine Latter aslatter at gmail.com
Sun Jan 4 19:18:18 PST 2009


While working on Haskell bindings similar to XCB, I thought about how
nice it would be if the XML protocol descriptions provided some sort
of link between a field in a request and the enum which described its
allowed values.

This wouldn't be too useful in the C bindings (I think?), but as
Haskell supports first-class enumeration types I wanted to use that
language feature.

So here's a patch which does so for xproto.xml.

It adds two optional attributes to field elements:

  enum - which names the enum which describes this field
  mask - which does the same, but indicates that this field may assume
multiple values in said enum

Someone may want to look over my changes to xcb.xsd that knows more
about XML than I do.

Does this look like a good idea?  Can the added attributes be useful
in other ways?

On a related topic, has anyone given thought on how to encode more
information about the various value-params in the spec into the XML


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Associate-fields-with-the-enum-which-describes-their.patch
Type: text/x-diff
Size: 18794 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xcb/attachments/20090104/f7196581/attachment.patch 

More information about the Xcb mailing list