NAME
XCopyColormapAndFree − copy a colormap and return a new colormap ID.
Synopsis
Colormap XCopyColormapAndFree(display, colormap)
Display *display;
Colormap colormap;
Arguments
displaySpecifies a connection to an X server; returned from XOpenDisplay().
colormapSpecifies the colormap you are moving out of.
Description
XCopyColormapAndFree() 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 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
BadColorcolormap is invalid.
See Also
DefaultColormap(), DisplayCells(), XCreateColormap(), XFreeColormap(), XGetStandardColormap(), XInstallColormap(), XListInstalledColormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallColormap().
Copyright O’Reilly & Assoc. —