[Xcb] Bug 6254: remove XCB's xproto/X11 dependency

Josh Triplett josh at freedesktop.org
Wed Mar 15 01:48:11 PST 2006


Ian Osgood wrote:
> On Mar 14, 2006, at 12:08 AM, Jamey Sharp wrote:
>>> On Mon, Mar 13, 2006 at 09:30:29PM -0500, Jeremy Kolb wrote:
>>>>> The <enum> construct generates very wordy symbols. (Example: enum  {
>>>>> XCBWindowClassInputOutput = 1 } XCBWindowClass; where previously   one
>>>>> only had to deal with InputOutput). You could argue that this is  a
>>>>> feature, though perhaps not for masks. Maybe an option to prefix   the
>>>>> members just with "XCB" and not the full name of the enumeration?
>>>>
>>>> I really think we need a better way of handling enums.  The names are
>>>> way too unwieldly.  Vincent and I have talked about this but we 
>>>> couldn't
>>>> come up with a good solution.  I really think it needs to be changed
>>>> though, not developer friendly at all.
>>>
>>> I like "developer-friendly" where possible, but one response to  this is
>>> that I don't expect many people to program directly to XCB. Usually  some
>>> toolkit is preferable; only the authors of toolkits, and some  libraries
>>> like Cairo and libGL, should care much about XCB's API. My preference
>>> would be an API that closely reflects the protocol documentation. A  bit
>>> of typing won't kill anyone.
> 
> The problem is the documentation for the constants uses their short  names,
> and many of the constants are used in multiple requests.  What would you
> name the enum that contains XCBNone?  Does the XSLT have a function
> to define an arbitrary XCB namespace constant as an alternative?

It doesn't, and as a result some of the enums are really just sets of
constants.  The best way to write that would probably be something like:
<constant name="None" type="CARDnn"><value>n</value></constant>

The internal second pass already does something like that, so it
wouldn't be too hard to add.

> Personally, I am easily persuaded that XCBWindowClassInputOutput is
> a good thing: self-documenting and avoids name conflicts. Code should
> be written to aid the reader, not the writer.  Those who want shorter or
> more traditional names know where to find X.h.

I agree.

- 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/20060315/0edc42e1/signature.pgp


More information about the Xcb mailing list