Skip to content

Atom Functions

To use the functions and macros defined in this section, you should include the header file <X11/Xmu/Atoms.h> and link against the libXmu library.

XA_ATOM_PAIR(d);XA_CHARACTER_POSITION(d);XA_CLASS(d);XA_CLIENT_WINDOW(d);XA_CLIPBOARD(d);XA_COMPOUND_TEXT(d);XA_DECNET_ADDRESS(d);XA_DELETE(d);XA_FILENAME(d);XA_HOSTNAME(d);XA_IP_ADDRESS(d);XA_LENGTH(d);XA_LIST_LENGTH(d);XA_NAME(d);XA_NET_ADDRESS(d);XA_NULL(d);XA_OWNER_OS(d);XA_SPAN(d);XA_TARGETS(d);XA_TEXT(d);XA_TIMESTAMP(d);XA_USER(d);XA_UTF8_STRING(d);
XA_ATOM_PAIR(d);XA_CHARACTER_POSITION(d);XA_CLASS(d);XA_CLIENT_WINDOW(d);XA_CLIPBOARD(d);XA_COMPOUND_TEXT(d);XA_DECNET_ADDRESS(d);XA_DELETE(d);XA_FILENAME(d);XA_HOSTNAME(d);XA_IP_ADDRESS(d);XA_LENGTH(d);XA_LIST_LENGTH(d);XA_NAME(d);XA_NET_ADDRESS(d);XA_NULL(d);XA_OWNER_OS(d);XA_SPAN(d);XA_TARGETS(d);XA_TEXT(d);XA_TIMESTAMP(d);XA_USER(d);XA_UTF8_STRING(d);

These macros take a display as argument and return an Atom. The name of the atom is obtained from the macro name by removing the leading characters “XA_”. The Atom value is cached, such that subsequent requests do not cause another round-trip to the server.

AtomPtr XmuMakeAtom(const char *name);
AtomPtr XmuMakeAtom(const char *name);

name

specifies the atom name

This function creates and initializes an opaque object, an AtomPtr, for an Atom with the given name. XmuInternAtom can be used to cache the Atom value for one or more displays.

char *XmuNameOfAtom(AtomPtr atom_ptr);
char *XmuNameOfAtom(AtomPtr atom_ptr);

atom_ptr

specifies the AtomPtr

The function returns the name of an AtomPtr.

Atom XmuInternAtom(Display *dpy, AtomPtr atom_ptr);
Atom XmuInternAtom(Display *dpy, AtomPtr atom_ptr);

dpy

specifies the connection to the X server

atom_ptr

specifies the AtomPtr

This function returns the Atom for an AtomPtr. The Atom is cached, such that subsequent requests do not cause another round-trip to the server.

char *XmuGetAtomName(Display *dpy, Atom atom);
char *XmuGetAtomName(Display *dpy, Atom atom);

dpy

specifies the connection to the X server

atom

specifies the atom whose name is desired

This function returns the name of an Atom. The result is cached, such that subsequent requests do not cause another round-trip to the server.

void XmuInternStrings(Display *dpy, String *names, Cardinal count, Atom *atoms);
void XmuInternStrings(Display *dpy, String *names, Cardinal count, Atom *atoms);

dpy

specifies the connection to the X server

names

specifies the strings to intern

count

specifies the number of strings

atoms

returns the list of Atom values

This function converts a list of atom names into Atom values. The results are cached, such that subsequent requests do not cause further round-trips to the server. The caller is responsible for preallocating the array pointed at by atoms.