Conceptually, a resource database is a set of resource name-value pairs (or resource bindings). The name in a resource binding is a list that is the concatenation of a path list and an attribute name .
A path list is a list of symbols (or strings) that corresponds to a path through a tree-structured hierarchy. For example, the path:
'(top middle bottom)
corresponds to a three-level hierarchy in which middle
is
the child of top
, and bottom
is the child of
middle
.
Typically, the path of a resource name corresponds to a path in a hierarchy of windows, and each symbol/string names a window in the hierarchy. However, the first element of the path can also represent the overall name of the entire program, and subsequent path elements can refer to an application-specific hierarchy of resource names not strictly related to windows. In addition, a resource name can contain a partially-specified path list. The asterisk symbol (*) is a wildcard that can correspond to any sequence of levels in the hierarchy (including the null sequence). For example, the path:
'(top * bottom)
corresponds to a hierarchy of two or more levels in which top
is at the top level and bot-
tom
is
at the bottom level. An element of a path list can be the name of an
individual window or the name of a class of windows.
The final element of a resource name list is an attribute name. This symbol (or string) identifies a specific attribute of the object(s) named by the preceding path list. The attribute name can also be the symbol * or the string "*", in which case the resource name refers to all attributes of the path object(s). However, this form of resource name is rarely useful.
Some examples of resource bindings are shown below. In these examples,
assume that mail
is the resource name of a mail reading
application. mail
uses a window of the class button
whose name is reply
.
Resource Name | Resource Value |
---|---|
(mail screen-1 reply background)
| 'green
|
(mail * background)
| 'red
|
(* button background)
| 'blue
|
These resource bindings specify the following:
background
attribute resource of mail
application's reply
button has the value of
green
on screen-1
.
background
attribute for the rest of the mail
application is always red
on all screens.
background
attribute for all button
windows is blue
.