[Xcb] [PATCH vw] Add macros for automatically loading lists of atoms

William Swanson swansontec at gmail.com
Wed Nov 21 00:14:54 PST 2012


Hello again,
I have updated my atom-list utility library. This new version is
splits the initialization function in two, so it now follows the
standard XCB request / reply format. I have also simplified the macro
usage a bit:

#define MY_ATOMS WM_PROTOCOLS, WM_DELETE_WINDOW
XCB_ATOM_LIST_DECLARE (my_atoms, MY_ATOMS);
XCB_ATOM_LIST_DEFINE (my_atoms, MY_ATOMS);

/* In main:*/
my_atoms_init_cookie_t cookie;
my_atoms_t atoms;

cookie = my_atoms_init (connection);
if (!my_atoms_init_reply (connection, &cookie, &atoms, NULL);
  {
    ... error handling ...
  }

/* Now we can use atoms.WM_PROTOCOLS and so forth */

I think the macros are starting to look pretty user-friendly at this
point, and they certainly solve a real pain point with XCB usage.

The only downside I can think of at this point is that the macros
require C99 variable-length macro parameter lists, which everyone
seems to support anyhow.

-William
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Create-the-atom-list-sub-library.patch
Type: application/octet-stream
Size: 18127 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20121121/c230a0e1/attachment-0001.obj>


More information about the Xcb mailing list