[Xcb] RFC: Altenum updates for xcb/proto

Eyal Alaluf eyala at mainsoft.com
Wed Feb 25 06:52:52 PST 2009

About using a specific flag - XML marks nullable types using nullable="true" so a nullable flag would make sense here.
As for the other cases - as long as they are not too numerous they are normally not bothersome.

-----Original Message-----
From: xcb-bounces at lists.freedesktop.org [mailto:xcb-bounces at lists.freedesktop.org] On Behalf Of Peter Harris
Sent: Wednesday, February 25, 2009 4:34 PM
To: Barton C Massey
Cc: Julien Danjou; xcb at lists.freedesktop.org; Peter Harris
Subject: Re: [Xcb] RFC: Altenum updates for xcb/proto

On Wed, Feb 25, 2009 at 3:54 AM, Barton C Massey wrote:
> I'm confused what we're trying to name?
> The only constraint I have on generated names, that I'm
> pretty religious about, is that any generated name should be
> inferrable from the protocol specification without reference
> to other documentation or source code.  In this case, does
> this mean something like XCB_WINDOW_NONE?

The core of the problem is that, while xcb.h has "XCB_NONE", there is
no way to reference this hard-coded #define from within the XML.

I'd like to avoid creating a whole plethora of new single-entry enums
XCB_ATOM_NONE, XCB_FONT_NONE, and maybe even a few

All of those xidtypes have instances where they are 'None-able'. I'm
not sure if that would be spelt "Nonable" or "Noneable"; I like the
"Nullable" suggestion by Eyal elsethread. It has the advantage of not
making up a new word (as it is already in use for the same concept

Just brainstorming: Perhaps a special case in the code generator, to
drop the new enum? I see that generated
XCB_WINDOW_CLASS_COPY_FROM_PARENT already (partially?) duplicates the
hard-coded XCB_COPY_FROM_PARENT (and has since 2006).

Just brainstorming: Maybe a new flag in the xsd to mark none-able
<field>s? Seems messy.

While we're on the subject: The same issue crops up with CurrentTime.
In my private branch, generated XCB_TIME_CURRENT_TIME duplicates the
hard-coded XCB_CURRENT_TIME. Is this acceptable?

Peter Harris
Xcb mailing list
Xcb at lists.freedesktop.org

More information about the Xcb mailing list