12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFT(activeForeground, Foreground), rule 3 eliminates entry C.15.3. QuarksMost uses of the resource manager involve defining names, classes, and representation types asstring constants. However, always referring to strings in the resource manager can be slow,because it is so heavily used in some toolkits. To solve this problem, a shorthand for a string isused in place of the string in many ofthe resource manager functions. Simple comparisons canbe performed rather than string comparisons. The shorthand name for a string is called a quarkand is the type XrmQuark. Onsome occasions, you may want to allocate a quark that has nostring equivalent.Aquark is to a string what an atom is to a string in the server, but its use is entirely local to yourapplication.To allocate a new quark, use XrmUniqueQuark.XrmQuark XrmUniqueQuark()The XrmUniqueQuark function allocates a quark that is guaranteed not to represent any stringthat is known to the resource manager.Each name, class, and representation type is typedef’d asan XrmQuark.typedef int XrmQuark, *XrmQuarkList;typedef XrmQuark XrmName;typedef XrmQuark XrmClass;typedef XrmQuark XrmRepresentation;#define NULLQUARK ((XrmQuark) 0)Lists are represented as null-terminated arrays of quarks. The size of the array must be largeenough for the number of components used.typedef XrmQuarkList XrmNameList;typedef XrmQuarkList XrmClassList;To convert a string to a quark, use XrmStringToQuark or XrmPermStringToQuark.385

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!