NAME
XmuInternAtom − obtain an Atom from the server or an AtomPtr cache.
SYNOPSIS
Atom XmuInternAtom(d, atom_ptr)
Display ∗d;
AtomPtr atom_ptr;
Inputs
dSpecifies a connection to an X server; returned from XOpenDisplay().
atom_ptrSpecifies the AtomPtr.
Returns
The Atom corresponding to the string in atom_ptr for Display d.
DESCRIPTION
XmuInternAtom() returns an Atom that corresponds to the string initialized in atom_ptr for the specified display. If the Atom is not already in the AtomPtr cache, XmuInternAtom() queries the server and caches the result.
USAGE
Use XmuMakeAtom() to initialize an AtomPtr with a string, then use XmuInternAtom() to obtain the Atom that corresponds to that string for a particular display. Since a widget may be instantiated on more than one display, widget code should be sure that it is using the correct Atom. In widget code, you can call XmuMakeAtom() from your class_initialize() procedure, storing the resulting AtomPtr in a global variable or class field, and then call XmuInternAtom() in your code whenever you need the Atom.
Atoms are used when requesting or converting selection values in a widget or an application. This and the related Xmu Atom functions provide client-side caching and help avoid roundtrips to the server. There are also a number of very useful predefined Atom macros in <X11/Xmu/Atoms.h>. These macros (XA_TEXT(d), for example) each take a display argument and return the appropriate Atom for that display. They are named to complement the predefined Atoms from <X11/Xatom.h>.
STRUCTURES
AtomPtr is an opaque type.
SEE ALSO
XmuGetAtomName(6), XmuInternStrings(6), XmuMakeAtom(6), XmuNameofAtom(6).