GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XmtAllocColor(3) FreeBSD Library Functions Manual XmtAllocColor(3)

XmtAllocColor(), XmtAllocWidgetColor(), XmtFreeColor(), XmtFreeWidgetColor(), XmtStoreColor(), XmtStoreWidgetColor() - Xmt color allocation functions.

#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)

INPUTS
w
The widget for which the color is to be allocated or freed.
colormap
The colormap in which the color is to be allocated, or None to use the colormap of w.
visual
The visual of the colormap, used to determine if colors are being allocated for a monochrome display. Pass NULL to use the visual of w.
colortable
The XmtColorTable in which symbolic color names should be looked up, or NULL to use the default color table of the application.
colorname
The name of the color to be allocated. This may be a standard X color name, or may use one of the enhanced Xmt color specification schemes.
color
For XmtFreeColor() and XmtFreeWidgetColor(), specifies a Pixel value previously returned by XmtAlloc Color() or XmtAllocWidgetColor(), respectively.
colorcell
For XmtStoreColor() and XmtStoreWidgetColor(), specifies a read/write color cell in colormap that the application has previously allocated.
OUTPUTS
color_return
For XmtAllocColor() and XmtAllocWidgetColor(), returns an allocated pixel that contains the specified color.
RETURNS

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.

These 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().

Many 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.

Chapter 4, Using Color
XmtRegisterPixelConverter().
Motif Tools Xmt

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.