[Xcb] Re: very first attempt of the keybinding

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Fri May 6 12:09:41 PDT 2005

> To allow future optimizations, I'd be inclined to use a single opaque
> XCBKeySymbols structure to track all per-display state. The simple
> version of that struct would hold a pointer to the XCBConnection that
> it's associated with, plus a tagged union of a GetKeyboardMapping cookie
> and reply. On initialization of this structure the cookie would be
> filled in with a query for the whole mapping; whenever a lookup is
> needed the cookie would be converted to a reply; and on MappingNotify
> events the reply would be discarded and the cookie reinitialized with a
> new query.

A question :

I create a tagged XCBKeySymbolsCookie structure
XCBKeySymbols is a function that returns it. It calls
XCBGetKeyboardMapping and init the structure.

but what would return XCBKeySymbolsReply ? the XCBKeySymbolsCookie ? this
one appears in the prototype and should not be passed as a reference
(like a standard reply prototype).
So, returning it is the only way that i have to get the reply. But then,
the "cookie" would appear twice (in the prototype and as the returned
value). In addition, the name is not good for the reply function.

What do you think of that ? I'm not sure that's the good design.


More information about the xcb mailing list