Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cmap_compact(1)

olwm(1)

openwin(1)

xnews(1)

reservecolors(1)

NAME

reservecolors − reserve colors in the X11/NeWS default colormap

SYNOPSIS

reservecolors [ −display dpy ] [ −svmono ] [ −invramp ] [ −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 causes other color allocations to avoid these positions and to therefore not flash against the colors in the other colormap.  Its main purpose is to reduce colormap flashing with Sunview programs running under the Sunview Binary Compatibility mode of X11/NeWS.  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 $OPENWINHOME/lib/rgb.txt.  Refer to XParseColor in the Xlib Reference Manual 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 shared by X11/NeWS applications. To deallocate reserved pixels, run reservecolors with the -discard option.  The options -svmono and -nokeep are 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.  If colormap compaction is enabled (see cmap_compact(1), the server owned locations will be at 254 and 255.  A common use of this utility is to reserve the colors Black and White in the same pixel locations used by Sunview monochrome programs (e.g. cmdtool). Because of this, a simplified way is provided to specify this situation.  If -svmono is specified, the colors and pixels used by Sunview monochrome programs are reserved.  Standard input is ignored in this case.  Similarly, there is another convenience option called -invramp which can be used to allocate an inverse grayscale ramp in pixel locations 2 to 31.  This ramp has gray values which proceed from #efefef down to #000000 and is compatible with the colors used by FrameMaker 2.0.  Again, standard input is ignored whenever a convenience option like this is used.  Both -svmono and -invramp may be used together on the same command line.  In order to effectively use the feature which reads the pixel locations and color values from standard input, you must know the specific pixel locations and color values used by the program (or programs) with which you want to reduce colormap flashing.  This information may not always be documented and may be difficult to figure out, so this particular feature is typically only useful to application developers. 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 default colormap class (visual) for the screen is dynamic.  That is to say, this utility may not be run when xnews is started with the staticvis device modifier.  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 private 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 a few selected applications.

OPTIONS

−display
The X11 display to which to connect.

−svmono
Reserves colors compatible with Sunview monochrome programs running under Sunview Binary Compatibility mode of X11/NeWS.  These colors currently are "White" at pixel 254 and "Black" at pixel 255. 

−invramp
Reserves colors compatible with the Sunview program FrameMaker 2.0.

−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, to set aside the two pixel locations that Sunview monochrome programs use, add the following command to ~/.xinitrc (prior to invoking olwm):

$OPENWINHOME/bin/reservecolors -svmono

As another example, suppose we have a hypothetical Sunview color program which uses 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 applications which use the default colormap and this Sunview application, add the following command to ~/.xinitrc (prior to invoking olwm):

$OPENWINHOME/bin/reservecolors <<EOF
2 Red
3 Green
4 Blue
5 Yellow
EOF

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

$OPENWINHOME/bin/reservecolors <<EOF
2 #ff0000
3 #00ff00
4 #0000ff
5 #ffff00
EOF

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

FILES

~/.xinitrc

SEE ALSO

cmap_compact(1), olwm(1), openwin(1), xnews(1)

OpenWindows Version 3.1 Programmer’s Guide

Xlib Reference Manual

SunOS 5.1/SPARC  —  Last change: 31 January 1991

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