[Xcb] xid

Jeremy Kolb jkolb at brandeis.edu
Thu Oct 12 05:15:20 PDT 2006


I think this is why we shouldn't use xcb_generate_id() because there's
nothing that explicitly tells us these are xids. It's going to be
confusing to people without an explicit generate/new.

Jeremy

Josh Triplett wrote:
> Russell Shaw wrote:
>> I see that:
>>
>>   typedef uint32_t xcb_cursor_t;
>>   typedef uint32_t xcb_font_t;
>>   typedef uint32_t xcb_gcontext_t;
>>   typedef uint32_t xcb_colormap_t;
>>   ...
>>
>> are just a substitute for uin32_t xid.
>>
>> Wouldn't it be cleaner, simpler, and more logical just to use
>> "typedef uint32_t xcbid" everywhere?
> 
> Possibly, but for several reasons we didn't want to do this:
> 
> 1) The typedefs make for more self-documenting code.  If you see a
> protocol description and it takes an xcb_window_t, you know that it
> operates on a window.
> 
> 2) The typedefs reduce the amount of older code that needs changing.
> 
> 3) The typedefs do no harm to compiled code or ABI.
> 
> 3) The typedefs reduced the amount of XSLT that needed changing. :)
> 
> - Josh Triplett
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb



More information about the Xcb mailing list