Resources [ HP Motif/iX System Administrator's Supplement ] MPE/iX 5.0 Documentation
HP Motif/iX System Administrator's Supplement
Resources
A resource is a piece of information that is used by an X client
application. It may be changed by the user to customize the application.
When an application is run, it creates a database of resources from
several sources, usually files. The names of files are the main
differences between the X Window System's implementation on an HP-UX
system and on MPE/iX. These differences are inherent in the way these two
operating systems name and maintain files. HP-UX uses a tree-like
directory structure, whereas MPE/iX uses accounts and groups.
By convention, each resource definition syntax is of the following form:
appname*resource: value
appname*Resource: value
The entries are case sensitive. The first entry indicates that the
resource named resource of the application named appname is bound to the
string "value". The next entry is the definition of a class resource,
due to the capitalization of the first character. For a detailed
discussion of resources in X, refer to the X Window System documentation.
Resources are loaded into the application's database in the order listed
below. The most current specification of a resource definition overrides
all earlier definitions of the same resource. Therefore, resource
definitions passed to a client application through command line options
override all other definitions of the same resource for that particular
instance of the application.
1. application specific class resource file
2. application specific user resource file
3. user resources
4. user environment specific resource files
5. command line options
The following sections describe where on MPE/iX the X software searches
for resources.
Application-specific class resource file
The application-specific class resource file contains the master set of
class-level resources for an application. For a discussion of class
resources versus instance resources, refer to Using the X Window System
(B1171-90037). This file should be provided by the application
developer, along with the application with an initial choice for each
resource. The system manager may then change any of the resource
definitions in this file to affect the system-wide behavior of the
application. Then, whenever that application is run it uses the resource
definitions from this file to set up the different attributes of its
environment.
[REV BEG]
Like HP-UX, on the HP 3000, the class-level resource file is located in
the group and account
/usr/lib/X11/app-defaults and follow the same rules for naming as on
HP-UX.[REV END]
Application-specific user resource file
The application-specific user resource file is used to specify resource
values that are used each time an application from a specific class of
applications is invoked by a particular user.
For example, a user wants the background display color to be red when he
is using any of the editing programs available to him. Given that all
editing programs use the same class name Edit, a resource file with that
name may be created in the user's home group, and the appropriate color
resource definition entry could be placed in it. Here is what the
resource definition may look like:
*Background: red
Because a specific client name is not supplied, this definition of
background applies to all applications that use this resource file.
If the user wishes to put this file in another group, he may use the CI
or shell environment variable XAPPLRESDIR to specify that group's name.
Upon execution, the application searches for this variable and appends
its contents to the class name of the application creating an
explicit file name. It then uses this file name to locate the
application-specific user resource file.
For example, given that the desired editing program resource file is
named EDIT and resides in the group MYPROGS, the CI variable may be set
as follows:
:SETVAR XAPPLRESDIR 'MYPROGS'
When the application is invoked, MYPROGS is appended to EDIT, the class
name of the application, creating EDIT.MYPROGS. All resource definitions
for the application are loaded from this file.
[REV BEG]
For the shell environment variable, given that the desired editing
program resource file is named EDIT and resides in the group MYPROGS the
shell variable may be set as follows:
:export XAPPLRESDIR MYPROGS
When the application is invoked, MYPROGS is appended to EDIT, the class
name of the application, creating EDIT.MYPROGS. All resource definitions
for the application are loaded from this file.[REV END]
User resources
To specify values for particular resources, do the following:
* Place the resource definitions in a user resource file.
* Load the resource definitions into the RESOURCE_MANAGER property
of the server.
The RESOURCE_MANAGER property is a data structure that is maintained by
the X display server. It is created, modified, and deleted using the
xrdb client application. This application may be executed on the
workstation on which the display server resides.
X Displays always use the RESOURCE_MANAGER property to contain user
resources. Xrdb must be used on the host workstation of the X display to
manipulate the resources in its resource database.
If the RESOURCE_MANAGER structure exists in the display server to which
an application is connecting, a local user resource file is not used.
However, if this property does not exist in the display server, the X
code attempts to obtain user resources from a resource file named
Xdefaults in the home group and account of the user on the MPE system on
which the client is executing.
User environment-specific resource file
The user environment-specific resource file contains any resource
definitions that are specific to executing clients on the HP 3000 system
that it resides on. If a CI or shell environment variable named
XENVIRONMENT exists, its content is used as a full file name of this
resource file. On HP-UX, if this variable does not exist, the
application searches for a file with a name of the following form:
Xdefaults-host
where host is the name of the system on which the application is
executing.
The Xdefaults-host feature is not supported on MPE/iX.
MPE/iX 5.0 Documentation