[Xcb] xproto.xml QueryTextExtents question

Jamey Sharp jamey at minilop.net
Sun Apr 22 15:55:49 PDT 2007

On Mon, Apr 23, 2007 at 12:26:37AM +0200, Thomas Hunger wrote:
> usually for each list type there is a field like "string_len" when the 
> list is named "string".
> QueryTextExtents has no such field. It could of course be inferred 
> that it needs to be there because there is a list. But then why not 
> always infer the name of the length-field (when it is not an 
> expression)?

It's because the list length doesn't always appear on the wire in the
protocol. Often the request's standard length field is enough for the
server to infer the length of the list. However, our generated C code
always includes a length argument for each list so that the client can
compute the right standard length field. If the XML doesn't explicitly
include a field for the length, an extra C-binding function argument is
generated automatically.

In the case of QueryTextExtents, the elements of the list are two bytes
long. The standard length field says how many four-byte chunks there are
in the request. So the "odd_length" field indicates whether the last two
bytes are padding or contain an actual character. No other length field
is needed.

> (See e.g. request InternAtom vs. PolyPoint where the points_len is
> implicit again)

PolyPoint's POINT list elements are four bytes long; InternAtom's
characters are one byte. An explicit 'points_len' would be redundant,
but 'name_len' isn't.

I hope that helped,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20070422/4fa1ce7a/attachment.pgp

More information about the Xcb mailing list