04.04.2013 Views

Volume One: Xlib Programming Manual - Niksula

Volume One: Xlib Programming Manual - Niksula

Volume One: Xlib Programming Manual - Niksula

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

XTerm*Foreground: maroon<br />

#else<br />

! resources for monochrome screens here<br />

XTerm*reverseVideo: true<br />

#endif<br />

13.2.4 The Low Level Xrm Routines<br />

The basic routines that every application that processes resources this way will include:<br />

XrmInitialize()<br />

Initializes the resource manager database. Must be called before any other routines.<br />

XrmParseCommand()<br />

Parses command line options into a data structure compatible with other resource manager routines.<br />

Various styles of command line options (with or without arguments and with various styles of<br />

arguments) are supported.<br />

XrmGetFileDatabase()<br />

Reads a resource file and stores the data in a resource manager database structure. This routine can<br />

be used to read the .Xdefaults file, the app−defaults/* file, and the file (if any) pointed to by the<br />

XENVIRONMENT environment variable.<br />

XrmGetStringDatabase()<br />

Reads preferences from a string. This routine can be used to read resource specifications from the<br />

copy of the XA_RESOURCE_MANAGER property stored in the Display structure.<br />

XrmMergeDatabases()<br />

Merges databases created with other routines into a single combined database. This routine is used<br />

to combine the separate resource databases created with the functions described immediately above.<br />

The order in which the various databases are merged determines which databases take precedence.<br />

XrmGetResource()<br />

Extract a resource definition from the database so that it can be used to set program variables.<br />

Several new functions were added to <strong>Xlib</strong> in R5 to support changes in the Xt Intrinsics. Some <strong>Xlib</strong> applications may find<br />

these useful:<br />

XrmSetDatabase()<br />

Associates a resource database with a display. This function is useful in applications that manipulate<br />

multiple displays or multiple databases. New in R5.<br />

XrmGetDatabase()<br />

Queries the database of a display. This function is useful in applications that manipulate multiple<br />

displays or multiple databases. New in R5.<br />

XrmLocaleOfDatabase()<br />

Returns the locale of a resource database (for internationalization). New in R5.<br />

XrmCombineDatabase()<br />

Merge the contents of two resource databases stored in memory. New in R5. This is more flexible<br />

than XrmMergeDatabases().<br />

XrmCombineFileDatabase()<br />

Merge the contents of two databases read from files. New in R5. This is more flexible than<br />

XrmMergeDatabases().<br />

XrmEnumerateDatabase()<br />

Calls a user−supplied procedure once for each entry in a resource database that matches any<br />

completion of a specified partial name and class list. The enumeration can be performed a single<br />

level below these name and class prefixes, or for all levels below. New in R5.<br />

The sequence of operations for a typical R4 application is shown in Figure 13−2. For the R5 order of merging resource<br />

files and properties, see <strong>Volume</strong> Four, X Toolkit Intrinsics <strong>Programming</strong> <strong>Manual</strong>.

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

Saved successfully!

Ooh no, something went wrong!