[Xcb] XKEYBOARD protocol definition
Josh Triplett
josh at joshtriplett.org
Wed Nov 11 15:10:37 PST 2009
On Wed, Nov 11, 2009 at 04:41:06PM -0500, Peter Harris wrote:
> Eamon Walsh wrote:
> > +<sumof ref="identifier" />
> > +
> > + This element represents sumation of elements of referenced list.
> > +
> > +<popcount>expression</popcount>
> > +
> > + This element represents number of bits set.
> >
> >
> > Going off on a tangent here: if popcount goes in, then we don't need the
> > <valueparam> element in the schema anymore. The reason is that the
> > following two snippets are identical:
> >
> > <valueparam value-mask-type="CARD32"
> > value-mask-name="value-mask"
> > value-list-name="value-list" />
> >
> > <field type="CARD32" name="value-mask" />
> > <list name="value-list" type="CARD32">
> > <popcount><fieldref>value-mask</fieldref></popcount>
> > </list>
Yes, *please*. I'd love to see valueparam die in favor of something
simpler and more general.
> All true. Even better would be to use
> <switch>(<bitcase></bitcase)+</switch> to replace valueparam, to allow
> generation of code that replaces xcb/util/aux.
Both seem useful, I think, depending on the situation. If you truly
just have a set of identical values and a bitmask indicating which ones
you've supplied, a list with length given by a <popcount> seems perfect.
If you want to supply slightly different values for different cases, or
otherwise do anything out of the ordinary, <bitcase> seems preferable.
Can you give an example of replacing a standard <valueparam> with
<bitcase>?
- Josh Triplett
More information about the Xcb
mailing list