[Xcb] naming convention (finished)

Vincent Torri vtorri at univ-evry.fr
Sun Sep 17 15:05:53 PDT 2006



On Sun, 17 Sep 2006, Ian Osgood wrote:

>> 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.

I'm waiting Jamey's agreement

>> 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.

Not only cairo. All the C project I know use that scheme (well all that 
use underscore naming convention)

>> 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.

Yep, that's why I didn't do anything about it.
>
> Also XIDRange to xid_range instead of xidrange.

indeed

>> 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.

It's easy to change. I just need confirmation of Jamey again.

> 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.

i don't see any too.

> Symbols mentioned in the comments also need to be converted.

which ones ?

> In xcb_in.c, XCBReply and XCBError should be changed to XCB_REPLY and 
> XCB_ERROR. Possibly move them to xcbint.h.

ok, done

> The exported symbols in xcbxlib.c should also be converted, and 
> libX11/src/xcl/*.c should be adapted to the new names.

I'll modify xcb_xlib (well, it's done)

I'll let the others modify xcl ;)

> What does everyone else think about switching the prefix from "xcb_" to 
> simply "x_" as Bernardo suggested?

I'm not against it.

As I'm changing the files, I can also clean up a bit the files. Adding 
some new lines, and doing some indentation, like :

int i;
double d;

would become :

int    i;
double d;

If nobody is against it, I can do that.

Vincent


More information about the Xcb mailing list