[Xcb] naming convention (finished)

Jeremy A. Kolb jkolb at brandeis.edu
Mon Sep 18 06:07:49 PDT 2006


On Sun, 17 Sep 2006, Ian Osgood wrote:

> Thanks for doing this work, Vincent and Bernardo!
> 
> On Sep 17, 2006, at 2:38 AM, Vincent Torri wrote:
> 
> >
> > Hey,
> >
> > die, camel case, die !
> >
> > I have finally beaten that xsl stylesheet. It does compile without  
> > warning. Some remarks:
> >
> > 1) we must change the name of XCBButton and XCBHost in xproto.xml,  
> > otherwise, the compilation will fail.
> 
> xcb_button_index and xcb_host_mode were my suggestions.
> 
> >
> > 2) we should change the name of XCBSetupReq in xproto.xml to  
> > XCBSetupRequest, imho.
> 
> I agree.
> 
> >
> > 3) for defines and enum values, instead of TotoTata, I use TOTO_TATA.
> 
> At first I was against this, but I notice that cairo follows this  
> convention as well.
> 
> >
> > 4) Because of their name in xproto.xml, some enum values are not  
> > very good, like XCB_CWBACK_PIXEL. Maybe we should change the name  
> > so that we obtain XCB_CW_BACK_PIXEL. It's easy to do in xproto.xml  
> > (changing CW to Cw).
> 
> Agreed. Josh should look at this; I think we should be able to handle  
> it programatically.
> 
> Also XIDRange to xid_range instead of xidrange.
> 
> >
> > 5) the xsl stylesheet file is now a bit ugly. I'm sure that Josh  
> > will be able to clean it a bit later ;)
> >
> > 6) I've tried to look at the code, to see if there are some  
> > problems. I didn't see any, but I would like that more people see  
> > if there are problems in the output code.
> >
> > 7) I've also changed the naming convention of the xcb api. I think  
> > that it's better to have a consistent scheme.
> 
> I suggest converting BYTE to uint8_t, and possibly do the same for BOOL.
> 
> Do we actually need <type name="XID" newname="xid" />? I don't see  
> any XID types remaining in the protocol files. I think XID was an  
> Xlib client-only type that we got rid of in XCB.
> 
> Symbols mentioned in the comments also need to be converted.
> 
> In xcb_in.c, XCBReply and XCBError should be changed to XCB_REPLY and  
> XCB_ERROR. Possibly move them to xcbint.h.
> 
> The exported symbols in xcbxlib.c should also be converted, and  
> libX11/src/xcl/*.c should be adapted to the new names.
> 
> What does everyone else think about switching the prefix from "xcb_"  
> to simply "x_" as Bernardo suggested?
> 

I prefer "xcb_" because it tells people what lib it is.  I think "x_" 
could confuse people later on when there's more of a transition stage.  
"xcb_" is also more in tune with "gtk_", "ecore_", "cairo_" etc.

 > >
> > 8) I have modified a (short) prog without looking at xproto.h,  
> > modifying the names as they should be. There were no problem,  
> > compilation and execution. Of course, the program were short, but  
> > it was a test...
> >
> > I don't see any other remarks. The diff file is attached. It  
> > contains the changes in the .xsl file and in the api too. Please  
> > comment and check.
> >
> > thank you
> >
> > Vincent
> > <xcb.diff.bz2>
> > _______________________________________________
> > Xcb mailing list
> > Xcb at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/xcb
> 
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
> 



More information about the Xcb mailing list