[Xcb] Funky casts

Josh Triplett josh at freedesktop.org
Sun Mar 12 19:04:13 PST 2006


Jamey Sharp wrote:
> Bart and I discussed the problem and decided that glx.xml needs a
> declaration something like this (except that my grasp of the XML
> protocol descriptions is fairly shaky):
> 
> <union name="DRAWABLE">
>   <field type="WINDOW" name="window" />
>   <field type="DRAWABLE" name="core" />
> </union>
> 
> It was never correct to declare the glx DRAWABLE as an <xidtype>: it
> isn't something you can allocate, only a union of several other
> <xidtype>s.
> 
> Anyway, this remains a bit of a pain to use in C. You'll need to declare
> an XCBGlxDRAWABLE somewhere, then assign your XCBWINDOW into the
> core.window member, and finally pass that into your function. An
> optimizing compiler will hopefully generate no code for that process:
> it's just a hint (or a blow to the head) for the type-checker.

That looks correct, except that if some of those types are intended to
reference core types rather than GLX extension types or vice versa, you
need to qualify them with the appropriate scope, such as glx:WINDOW or
xcb_types:WINDOW.  Given that the core and GLX both have WINDOW and
DRAWABLE types, be careful as to which types are allowed where.

- Josh Triplett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060312/d95eac34/signature.pgp


More information about the Xcb mailing list