XCopyColormapAndFree()XCopyColormapAndFree()NameXCopyColormapAndFree – copy a colormap and return a new colormap ID.
Synopsis
Colormap XCopyColormapAndFree(display, colormap)
Display *display;
Colormap colormap;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
colormap Specifies the colormap you are moving out of.
Returns
The created colormap.
DescriptionXCopyColormapAndFree() is used to obtain a new virtual colormap when
allocating colorcells out of a previous colormap has failed due to
resource exhaustion (that is, too many cells or planes were in use in
the original colormap). The visual and screen for the new colormap is
the same as for the old.
XCopyColormapAndFree() moves all of the client's existing allocations
from colormap to the returned Colormap. The read/write or read-only
characteristics of each cell moved are preserved in the new colormap.
If colormap was created by the client with the alloc argument set to
AllocAll, the new colormap is also created with AllocAll, all color
values for all entries are copied from colormap, and then all entries
in colormap are freed.
If colormap was created by the client with AllocNone, or not created by
the client, the allocations to be moved are all those pixels and planes
that have been allocated by the client using XAllocColor, XAllocNamed‐
Color(), XAllocColorCells(), or XAllocColorPlanes() and that have not
been freed since they were allocated. Values in other entries of the
new Colormap are undefined.
For more information, see Volume One, Chapter 7, Color.
Errors
BadAlloc
BadColor colormap is invalid.
See AlsoXDefaultColormap(), XDisplayCells(), XCreateColormap(), XFreeCol‐
ormap(), XGetStandardColormap(), XInstallColormap(), XListInstalledCol‐
ormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallCol‐
ormap().
Xlib - Colormaps XCopyColormapAndFree()