1.4 The CMS Package
The X Window System has various ways of allocating, specifying, and using colors. While
all of these methods are available to applications without XView intervening, XView pro-
vides its own model for color specification that may be used as an alternative. It does not
provide anything more than what is already available, but it may provide a simpler interface
to request and specify colors. This model is especially useful when specifying colors for
XView objects, such as panel buttons and scrollbars.
XView applications deal with color by using colormap segments. Window-based objects
(canvases, panels, textsw, etc.) use colormap segments to get their colors. These objects get
a default colormap segment when they are created, but you can assign a new one using the
WIN_CMS attribute. Colormap segments must be applied to windows to assure that the win-
dow can access the color you are attempting to draw into.
A colormap segment from the CMS package is a subset of the available cells in a colormap on
the X server. These are XView entities (i.e., not Xlib) that provide a veneer over the Xlib
color mechanism. Colormap segments can be created as either static or dynamic and are
derived from an underlying colormap of the same type.
Applications that use color must include the file <xview/cms.h>. The owner of a colormap
segment is the XView screen object with which the colormap is associated. If an owner is
not specified (NULL owner), the default screen of the default server is used as ...