Next Prev Up

13.4.1 Complete Names and Classes

A resource binding contains a resource name list that can contain names, class names, or a mixture of both. A class name is a symbol or string that represents a group of related objects. The set of names used as class names are not specified by CLX. Instead, class names are defined by agreement between those who use class names when creating resource bindings (that is, users) and those who use class names when accessing resource values (that is, application programmers).

In order to access a value in a resource database, an application uses a key consisting of two items: a complete resource name and a complete resource class. A complete resource name is a resource name list containing no wildcard elements. A complete resource class is a list of exactly the same form. The distinction between a complete resource name and a complete resource class lies in how they are used to access resource bindings. The elements of a complete resource name are interpreted as names of individual objects; the elements of a complete resource class are interpreted as names of object classes. The complete resource name and class lists used in a resource database access must have the same length.

Like any resource name list, a complete resource name consists of a path list and an attribute name. The first path list element is typically a symbol (or string) identifying the application as a whole. The second element can be a screen root identifier. Subsequent elements can be identifiers for each ancestor window of an application window. Thus, a path list typically identifies a specific window by tracing a path to it through the application window hierarchy. The final element of a complete resource name (its attribute name) is typically the name of a specific attribute of the window given by the path list (for example, 'background). An attribute name can refer to a feature associated with the window by the application but not by the X server (for example, a font identifier). Similarly, a complete resource class typically represents a path to a window in the application window hierarchy and a specific window attribute. However, a complete resource class contains the class name for each window and for the window attribute.

For instance, in the previous example, the mail application can attempt to look up the value of the background resource for the reply button window by using the following complete resource name:

(mail screen-1 reply background)

and the following complete resource class:

(application root button fill)

This complete resource name contains a path list identifying the reply button window -- (mail screen-1 reply) -- and an attribute name for the window background. The corresponding resource class contains the class names for the same path list and window attribute.

Next Prev Up
© 1988, 1989 Texas Instruments Incorporated
Conversion to HTML made by Gilbert Baumann.
Last build: Tue Dec 16 23:30:42 1997