[Xcb] put description of valueparams in xml files
Barton C Massey
bart at cs.pdx.edu
Mon Jun 11 16:17:44 PDT 2007
I'm not sure what to think, and I've been sitting on this
for a while, so I should hit send. Seaborn's "bitfield"
thing seems like a good idea. I'm not sure I quite
understand your thing.
Anybody else have any opinions?
Bart
In message <200706070016.42662.hto at arcor.de> you wrote:
> Hello,
>
> Mark Seaborn wrote a protocol-tracer, see:
> http://lists.freedesktop.org/archives/xcb/2007-May/002790.html
>
> To allow for readable output of the valueparam argument he introduced
> an additional attribute "bitfield" in the valueparam:
>
> <valueparam value-mask-type="CARD32"
> value-mask-name="value_mask"
> value-list-name="value_list"
> bitfield="window_attributes" />
>
> "bitfield" references another xml-list like this:
>
> <bitfield name="window_attributes">
> <bit number="0"
> type="PIXMAP / 0=None 1=ParentRelative" name="back_pixmap" />
> <bit number="1" type="CARD32" name="back_pixel" />
> <bit number="2"
> type="PIXMAP / 0=CopyFromParent" name="border_pixmap" />
> ....
> </bitfield>
>
> This can be useful for other things besides tracers: validation or
> languages with named parameters (e.g. Python). It also serves as
> documentation.
>
> It has some overlap with the enumeration which describes the bits for
> the value-mask (in this case the enum CW) though.
>
> I have the following two-part idea: An extra tag for valueparam-enums.
> E.g. replace:
>
> <enum name="CW">
> <item name="BackPixmap"> <bit>0</bit></item>
>
> with
>
> <valueparam_enum name="CW">
> <item name="BackPixmap" type="PIXMAP"> <bit>0</bit></item>
>
> In addition to that we allow fields which have enum values to
> reference these values. E.g.:
>
> <valueparam enum_ref="CW" ...>
> <item type="CARD32" name="WinGravity" enum_ref="Gravity"/>
> <field type="CARD8" name="image_byte_order" enum_ref="ImageOrder"/>
> ...
>
> What do you think?
>
> Tom
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
More information about the Xcb
mailing list