X Version 11 (Release 6.1)
XmuCvtStringToColorCursor(X3xmu)
XmuCvtStringToColorCursor --
convert string to color cursor
Synopsis
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.
num_args-
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 background 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(X3xlib)
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 acceptable to
XmuLocateBitmapFile.
To use this converter, include
the following in the widget ClassInitialize 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 window is created,
and must assign the cursor to the window of the widget.
References
XmuCvtFunctionToCallback(X3xmu),
XmuCvtStringToBackingStore(X3xmu),
XmuCvtStringToCursor(X3xmu),
XmuCvtStringToGravity(X3xmu),
XmuCvtStringToJustify(X3xmu),
XmuCvtStringToLong(X3xmu),
XmuCvtStringToOrientation(X3xmu),
XmuCvtStringToShapeStyle(X3xmu),
XmuNewCvtStringToWidget(X3xmu),
XmuReshapeWidget(X3xmu),
XmuCvtStringToWidget(X3xmu)
Xlib - C Language X Interface
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004