XmuCvtStringToColorCursor(Xmu) X Version 11 (Release 5)
6 January 1993
Name
XmuCvtStringToColorCursor - convert string to color cursor
Syntax
cc . . . -lXmu
#include <X11/Xmu/Converters.h>
Boolean XmuCvtStringToColorCursor(dpy, args, num_args, fromVal, toVal, data)
Display *dpy
XrmValuePtr args;
Cardinal *num_args;
XrmValuePtr fromVal;
XrmValuePtr toVal;
XtPointer *data;
Arguments
dpy Specifies the display to use for conversion warnings.
args Specifies the required conversion arguments.
numargs Specifies the number of required conversion arguments, which is
4.
fromVal Specifies the string to convert.
toVal Returns the converted value.
data This argument is ignored.
Description
This function converts a string to a Cursor with the foreground and back-
ground pixels specified by the conversion arguments. The string can
either be a standard cursor name formed by removing the ``XC_'' prefix
from any of the cursor defines listed on the XCreateFontCursor(XS) manual
page of the Xlib Manual, a font name and glyph index in decimal of the
form "FONT fontname index [[font] index]", or a bitmap filename accept-
able to XmuLocateBitmapFile.
To use this converter, include the following in the widget ClassInitial-
ize procedure:
static XtConvertArgRec colorCursorConvertArgs[] = {
{XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)},
{XtResourceString, (XtPointer) XtNpointerColor, sizeof(Pixel)},
{XtResourceString, (XtPointer) XtNpointerColorBackground, sizeof(Pixel
)},
{XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.colormap),
sizeof(Colormap)}
};
XtSetTypeConverter(XtRString, XtRColorCursor, XmuCvtStringToColorCursor,
colorCursorConvertArgs, XtNumber(colorCursorConvertArgs),
XtCacheByDisplay, NULL);
The widget must recognize XtNpointerColor and XtNpointerColorBackground
as resources, or specify other appropriate foreground and background
resources. The widget's Realize and SetValues methods must cause the
converter to be invoked with the appropriate arguments when one of the
foreground, background, or cursor resources has changed, or when the win-
dow is created, and must assign the cursor to the window of the widget.
See also
XmuCvtFunctionToCallback(Xmu), XmuCvtStringToBackingStore(Xmu),
XmuCvtStringToCursor(Xmu), XmuCvtStringToGravity(Xmu),
XmuCvtStringToJustify(Xmu), XmuCvtStringToLong(Xmu),
XmuCvtStringToOrientation(Xmu), XmuCvtStringToShapeStyle(Xmu),
XmuNewCvtStringToWidget(Xmu), XmuReshapeWidget(Xmu),
XmuCvtStringToWidget(Xmu)
Xlib - C Language X Interface