Next: xcolormap
Up: simxlib
Previous: xvisualinfolist
x_colormap
NAME
x_colormap - part of Simula to Xlib interface
DESCRIPTION
Xlib_Colormap class X_Colormap(Display);
ref(Xlib_Display) Display;
Class to define and manipulate the colormap of the X Server.
Actual colors are defined with objects of class XColors. A
XColormap must be initialized by call of the create-
operations. The last operation should be 'Free' in order to
deallocate XWindow Server datastructures. After call to
Free no other procedure in this object may be called.
The use of colors in X is not clear to the present author,
please consult an X11 tutorial for details on how to use
colors and colormaps.
SUPERS: Xlib_Colormap, Xlib_Object ;
KIND: Abstract, only subclass XColormap
INIT: call CreateColormap or CopyColormapAndFree
Sequencing: <Create> (<Modify>)* Free
: Create= CreateColormap / CopyColormapAndFree
:
Modify=(AllocColor/AllocColorCells/AllocColorPlanes/AllocNamedColor
:
/FreeColors/LookupColor/ParseColor/QueryColor/QueryColors
: /StoreColor/StoreColors/StoreNamedColor) *
CREATE OPERATIONS
CreateColormap
procedure CreateColormap(w, vis, alloc);
ref (Xlib_Window) w;
integer vis;
integer alloc;!= AllocNone/AllocAll;
Creates an empty colormap. Alloc values:
CopyColormapAndFree
procedure CopyColormapAndFree(cmap);
ref (X_Colormap) cmap;
Creates a new colormap and copies a colormap 'cmap' setting
into it. Frees all of the clients entries in 'cmap'.
Free
procedure Free;
Deletes a colormap and installs the default colormap.
COLOR MODIFY OPERATIONS
AllocColor
integer procedure AllocColor(colorcell_def);
ref (XColors) colorcell_def;
Allocates a read-only colormap cell with closest hardware-
supported color.
AllocColorCells
integer procedure AllocColorCells(contig, plane_masks,
nplanes,
pixels, ncolors);
name plane_masks, pixels;
boolean contig;
integer array plane_masks, pixels;
integer nplanes, ncolors;
Allocates read/write (nonshared) colorcells.
AllocColorPlanes
integer procedure AllocColorPlanes(contig, pixels,
ncolors,
nreds, ngreens, nblues,
rmask, gmask, bmask);
name pixels, rmask, gmask, bmask;
boolean contig;
integer array pixels, rmask, gmask, bmask;
integer ncolors, nreds, ngreens, nblues;
Allocates read/write (nonshareable) colorplanes.
AllocNamedColor
integer procedure AllocNamedColor(color_name,
colorcell_def,
rgb_db_def);
text color_name;
ref (XColors) colorcell_def, rgb_db_def;
Allocates a read-only colorcell from color name.
FreeColors
procedure FreeColors(pixels,npixels,planes);
integer array pixels;
integer npixels,planes;
Frees colormap cells or planes.
LookupColor
integer procedure LookupColor(color_name,
rgb_db_def, hardware_def);
text color_name;
ref (XColors) rgb_db_def, hardware_def;
Gets database RGB values and closest hardware-supported RGB
values from color name.
ParseColor
procedure ParseColor(spec, rgb_db_def);
text spec;
ref (XColors) rgb_db_def;
Looks up RGB values from ASCII color name or translates
hexadecimal value.
QueryColor
procedure QueryColor(colorcell_def);
ref (XColors) colorcell_def;
Obtains the RGB values and flags for a specified colorcell.
QueryColors
procedure QueryColors(colorcell_defs);
ref (XColors) colorcell_defs;
Obtains RGB values for an array of colorcells.
StoreColor
procedure StoreColor(colorcell_def);
ref (XColors) colorcell_def;
Sets or changes the RGB values of a read/write colormap
entry to the closest possible hardware color.
StoreColors
procedure StoreColors(colorcell_defs);
ref (XColors) colorcell_defs;
Sets or changes the RGB values of read/write colorcells to
the closest possible hardware color.
StoreNamedColor
procedure StoreNamedColor(colorname, pixel, flags);
text colorname;
integer pixel;
integer flags;!= DoRed/DoGreen/DoBlue;
Sets RGB values of a read/write colorcell by color name.
Flags can be any of DoRed/DoGreen/DoBlue or a sum of them.