[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xcb
Subject:    Re: [Xcb] XKEYBOARD protocol definition
From:       Antoine Latter <aslatter () gmail ! com>
Date:       2009-11-12 1:29:07
Message-ID: 694519c50911111729u18b89192k37d6526f6b659598 () mail ! gmail ! com
[Download RAW message or body]

On Wed, Nov 11, 2009 at 5:45 PM, Peter Harris <pharris@opentext.com> wrote:
> By using <bitcase>, you can vary the type of the data used. In a
> hypothetical future server-side XCB, you could auto-generate boilerplate
> that checks to make sure that CreateWindow/BorderPixmap is, in fact, a
> valid Pixmap XID. This may also be useful for type-checking bindings
> (perhaps Haskell - Antoine?).
>
> For a slightly less hypothetical example, you can link the appropriate
> enums to individual fields. This will let the Wireshark dissector
> pretty-print RENDER/ChangePicture/repeat as "RepeatReflect" instead of
> "3". Once I update the wireshark dissector generator, that is. (RENDER
> example used instead of CreateWindow, since core X11 is still dissected
> by the legacy X11 dissector in Wireshark.)

If I could link the allowed fields in a value-param to their type at
compile-time that would be pretty special, and that sounds like what
you're aiming for. I'm still not sure what that would look like with
the new bitcase syntax - I haven't been following too closely.

At minimum, the list+popcount approach lets us get away from the
value-mask bitwidth hack.

Antoine
_______________________________________________
Xcb mailing list
Xcb@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xcb
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic