|
NAMEXmtAllocColor(), XmtAllocWidgetColor(), XmtFreeColor(), XmtFreeWidgetColor(), XmtStoreColor(), XmtStoreWidgetColor() - Xmt color allocation functions.SYNOPSIS#include <Xmt/Color.h>int XmtAllocColor(Widget w,
Colormap colormap, Visual *visual,
XmtColorTable colortable, String colorname,
Pixel *color_return)
int XmtAllocWidgetColor(Widget w, String colorname, Pixel *color_return) void XmtFreeColor(Widget w, Colormap colormap, Pixel color) void XmtFreeWidgetColor(Widget w, Pixel color) int XmtStoreColor(Widget w, Colormap colormap, Visual *visual, XmtColorTable colortable, String colorname, Pixel colorcell) int XmtStoreWidgetColor(Widget w, String colorname, Pixel colorcell) ARGUMENTSINPUTS
XmtAllocColor(), XmtAllocWidgetColor(), XmtStoreColor() and XmtStoreWidgetColor() return 0 upon successful allocation and non-zero on failure. A return value of 1 means that color name was unrecognized or malformed, and a return value of 2 (for XmtAllocColor() and XmtAllocWidgetColor() only) means that the specified colormap was full. DESCRIPTIONThese functions allocate and free colors specified with the extended Xmt color name syntax. With these functions, colors may be specified by name, or by RGB components, as usual, but may also be specified by symbolic name, by HSL components, or as HSL deltas relative to a standard background or foreground color. Xmt color names may also provide fallback colors for monochrome systems. See Chapter 4, Using Color, for an explanation of the Xmt color syntax.XmtAllocColor() allocates a shared, read-only color cell in colormap and returns it in color_return. This returned color cell will contain the color specified by colorname. Xmt AllocWidgetColor() is a simplified version of the function that uses a default colormap, visual and colortable-it is equivalent to calling XmtAllocColor() with a NULL colormap, visual and color table XmtFreeColor() frees a color allocated with XmtAllocColor(), and XmtFreeWidgetColor() frees a color allocated with XmtAllocWidgetColor(). Many applications will allocated colors when the start up and will never need to free them. If your application allocates colors dynamically, however, you may need to free allocated color cells with these functions. XmtStoreColor() and XmtStoreWidgetColor() are analogs to XmtAllocColor() and XmtAllocWidgetColor(), but instead of allocated a shared color cell in a colormap, they store the specified color into the already allocated privated read/write color cell, specified by colorcell. The application is responsible for allocating this private color cell (with XAllocColorCells(), for example) and for freeing it with XFreeColors(). USAGEMany applications can handle all of their color needs through the resource database. Call XmtRegisterPixelConverter() to register a resource converter that will allow you to use the extended Xmt color specification syntax in your resource files.SEE ALSOChapter 4, Using ColorXmtRegisterPixelConverter().
Visit the GSP FreeBSD Man Page Interface. |