[Xcb] put description of valueparams in xml files
iano at quirkster.com
Mon Jun 11 16:30:03 PDT 2007
It sounds like Mark and Tom are trying to patch one of the biggest
type-safety holes in the protocol. I heartily approve!
One thing to note: in some requests, the valueparam data items may be
unions of types (i.e. None or a Window; some enum or a Pixmap; two
different enums). This is true for parameters in general, not just
We should also try implementing XKB and the other remaining
unimplemented extensions before settling on a mechanism like this.
On Jun 11, 2007, at 4:17 PM, Barton C Massey wrote:
> 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?
> In message <200706070016.42662.hto at arcor.de> you wrote:
>> Mark Seaborn wrote a protocol-tracer, see:
>> To allow for readable output of the valueparam argument he introduced
>> an additional attribute "bitfield" in the valueparam:
>> <valueparam value-mask-type="CARD32"
>> 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" />
>> This can be useful for other things besides tracers: validation or
>> languages with named parameters (e.g. Python). It also serves as
>> 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-
>> E.g. replace:
>> <enum name="CW">
>> <item name="BackPixmap"> <bit>0</bit></item>
>> <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?
>> Xcb mailing list
>> Xcb at lists.freedesktop.org
> Xcb mailing list
> Xcb at lists.freedesktop.org
More information about the Xcb