Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ reservecolors(1) — SunOS 5.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

olwm(1)

openwin(1)

Xsun(1)

reservecolors(1)

NAME

reservecolors − reserve colors in the X11 default colormap

SYNOPSIS

reservecolors [ −display dpy ] [ −nokeep ] [ −discard ]

DESCRIPTION

reservecolors reserves colors in the default colormap of the default screen at specified pixel locations.  It sets aside "placeholder" colors corresponding to colors in some other colormap with the intent of reducing colormap flashing.  The colors and locations specified should be the same as those allocated in this other colormap.  The presence of these reserved colors in the default colormap causes other color allocations to avoid these positions and to therefore not flash against the colors in the other colormap.  The pixel locations and color values to allocate are taken from standard input.  Each line of standard input contains the specification for one pixel.  An input line has the following format: <pixel> <color spec> <pixel> is an integer value between 0 and 255.  <color spec> is an X11 color specification, which is either a color name string or a hexadecimal RGB specification.  The two fields are separated with whitespace.  The list of valid color name strings and their corresponding values can be found in /usr/openwin/lib/X11/rgb.txt.  Refer to XParseColor in the Xlib documentation for details on X11 hexadecimal RGB specifications.  The pixels are allocated as read-write (non-sharable) colormap cells, so while the pixels are reserved they are unavailable to be used by any X11 clients who use the default colormap. To deallocate reserved pixels, run reservecolors with the -discard option.  The option -nokeep is ignored when -discard is used.  When the server has been started in the default configuration, there are already two pre-existing read-only colors at pixel locations 0 and 1 (white and black); these are server owned locations.  reservecolors will not be able to allocate colors at server owned locations.   Attempts to do so will generate an error.  An invocation of reservecolors is typically added to ~/.xinitrc.  It should be placed before the invocation of any program that allocates colors (such as the window manager).  To reduce colormap flashing on multiple screens, reservecolors should be run once for each screen, and should be placed before the invocation for each screen of any program that allocates colors.  If -nokeep is specified, rather than permanently reserving colors in the default colormap, reservecolors simply loads the specified values into the hardware colormap.  Note: these pixels may lie in unallocated areas of the default colormap and their contents may be displaced the next time a colormap is installed.  No color cells are actually allocated so it does not matter if the default colormap is not dynamic.  This utility can only be used when the screen’s default colormap class is dynamic (i.e. one of GrayScale, PseudoColor, or DirectColor).  That is to say, this utility should not be run when openwin(1) is started with the defclass device modifier set to StaticGray, StaticColor, or TrueColor.  An error message will be printed if this should happen and no colors will be reserved.  This utility may not always reduce colormap flashing, and in some  environments,  might actually increase it.  You should use it only if it is effective in your environment.  For example, if you reserve too many colors the default colormap might fill up, causing X11 programs which would ordinarily use the default colormap to start overflowing into alternate, non-default colormaps.  Colormap flashing usually increases when this happens. Thus, this utility should be used judiciously. This utility does not provide a general solution to the problem of colormap flashing.  It only suffices to reduce colormap flashing for some applications.

OPTIONS

−display
The X11 display to which to connect.

−nokeep
Do not allocate the specified colors in the default colormap.  Load the values only into the hardware colormap.  These colors may be displaced by subsequent colormap installations.

−discard
Discard the allocated colors reserved by all previous invocations of reservecolors for the default screen of the specified display. 

EXAMPLES

For example, suppose we have a hypothetical program which creates an alternate colormap and which is "hard-wired" to use the following pixel locations and colors:

Red at pixel 2
Green at pixel 3
Blue at pixel 4
Yellow at pixel 5

To avoid colormap flashing between this program’s window and applications using the default colormap, add the following command to ~/.xinitrc (prior to invoking olwm):

reservecolors <<EOF
2 Red
3 Green
4 Blue
5 Yellow
EOF

Instead of using color names, hexadecimal RGB specifications could also have been used:

reservecolors <<EOF
2 #ff0000
3 #00ff00
4 #0000ff
5 #ffff00
EOF

Refer to XParseColor in the Xlib documentation for more information about hexadecimal RGB specifications. 

FILES

~/.xinitrc

SEE ALSO

olwm(1), openwin(1), Xsun(1)

OpenWindows documentation

Xlib Reference Manual

Sun Microsystems  —  Last change: 21 May 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026