[Xcb] bind from XML

Josh Triplett josh at freedesktop.org
Sun May 14 04:34:36 PDT 2006


Florent Monnier wrote:
>> I think in general fields must be described by two attributes:
>>
>> 1) size in bytes (1, 2, 4) [possibly optional except for enumerations]
> 
> Do you really mean bytes?
> What happens if the client is made for 8bits bytes, and the host X server 
> works with 16bits bytes ?

"16bits bytes"? :)  I do really mean "bytes", but apparently we don't
mean the same things by "bytes".  "byte" == "octet" == "8 bits".
Historically some systems thought differently, usually in the range 6-12
bits, but nowadays byte always means 8 bits.  However, I will try to
make sure to define "byte" specifically as 8 bits in any specification
of the format, to avoid any potential issues. :)

>> Currently, there are lots of protocol descriptions that could use
>> information about the
>> enumerations or exceptions that are allowed for their fields.

Agreed.  As soon as we have explicitly sized enumerations, we can use
the enumerated types for fields.  (This assumes that a given enumeration
always has the same size in all fields; if this proves false, then we
need to add the ability to specify an enumeration for a field type but
override the size.)

We may also want to specify flags better before doing this, since
otherwise this:
<enum name="E">
  <item name="flag0"><bit>0</bit></item>
  <item name="flag1"><bit>1</bit></item>
</enum>
<struct name="S">
  <field type="E" name="e" />
</struct>
could imply that S.e could only take on the values 1 and 2, when it can
actually take on 0, 1, 2, and (1|2)==3.

>> The other type hole is in value lists.  They consist of CARD/INT32s,
>> but the
>> meaning of each item in the list is dependent on the bits set in the
>> mask.  Xlib hides
>> value lists behind structures, so the individual fields are typed,
>> but the raw lists
>> are exposed in XCB.
> 
> Just like the type WINDOWorNONE, why not a CARDorINT32 ?

More general than that; the items could actually represent enumerated
values, flags, or anything else you might stuff in.

- Josh Triplett


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060514/8bb5fe56/signature.pgp


More information about the Xcb mailing list