XRUTILITIES(3X)

NAME
Utilities - Utilities for performing some general functions

SYNOPSIS
#include <X/Xib.h>
#include <Xr/Xrlib.h>

XrStringWidth (fontInfo, str, charWidth, charPad, spacePad)
FontInfo * fontInfo;
STRING8 str;
INT32 charWidth;
INT32 charPad;
INT32 spacePad;

XrMapButton (eventCode, event)
INT8 eventCode;
XEvent * event;

XrGetWindowEvent (eventCode, windowEvent)
INT8 eventCode;
xrWindowEvent * windowEvent;

INT8 *
XrVersion ()

DESCRIPTION

XrStringWidth
    XrStringWidth() calculates the width in pixels of a character string using the font information contained in the structure pointed at by fontInfo. The string is represented by the rest of the parameters. str points to the string to be used in the calculation. charWidth contains the length of the string in characters or is set to the define XrNULLTERMINATED if the string is null-terminated. charPad and spacePad contain the additional space to be placed between characters and spaces respectively.

    The pixel width of the string is returned as the value of the function.

XrMapButton
    XrMapButton takes as a parameter an eventCode which contains one of the following defines: XrSELECT, XrSELECTUP, XrMENUPOST, XrMENUITEMSELECT. The event parameter will be compared against the conditions necessary for the above defines and if a match is found TRUE will be returned. If no match is found, FALSE will be returned.

XrGetWindowEvent
    XrGetWindowEvent() takes as input one of the defines XrSELECT, XrSELECTUP, XrMENUPOST, XrMENUITEMSELECT and fills out the xrWindowEvent structure with the values necessary for the define. The structure can then be used to add a function into a window that will be invoked under one of the defines conditions.

XrVersion
    XrVersion() returns a pointer to a string which contains the version of Xrlib being used. The string will have the format of X-ray Version ## - ##.## The ## contains the X library version that the Xr library was built with. The ##.## can be ignored. The string returned is static and thus cannot be modified.