Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtConvert(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppAddConverter(1)

XtDirectConvert(1)

XtGetApplicationResources(1)

XtGetSubresources(1)

 

Name

XtConvert — convert resource type. 

Synopsis

void XtConvert(object, from_type, from, to_type, to_return)

    Widget object;
    String from_type;
    XrmValuePtr from;
    String to_type;
    XrmValuePtr to_return;

Arguments

objectSpecifies the object to use for additional arguments (if any are needed); may be of class Object or any subclass thereof. 

from_typeSpecifies the source type. 

fromSpecifies the value to be converted. 

to_typeSpecifies the destination type. 

to_returnReturns the converted value. 

Description

XtConvert has been superseded by XtConvertAndStore.  XtConvert looks up the appropriate resource converter registered to convert from_type to to_type and then calls XtDirectConvert to convert from to to_return.  If the conversion is successful, to_return.addr will be non-NULL. 

In addition, the Xmu library (miscellaneous utilities) contains converters between XtRString and XtRBackingStore, XtRCursor, XtRJustify, XtROrientation, XtRPixmap, and XtRWidget and between XtRFunction and XtRCallback.  See Chapter 9, Resource Management and Type Conversion, in Volume Four, X Toolkit Intrinsics Programming Manual, for details. 

All resource-fetching routines (e.g., XtGetSubresources, XtGetApplicationResources as well as the internal code that reads the resource database when a widget is created) call resource converters if the user-specified resource is represented in a different form from the desired representation.  A widget seldom has to access resource converters explicitly with XtConvert or XtDirectConvert. 

XtConvert accesses the widget object to obtain values for any additional arguments the resource converter needs.  The computation of additional arguments is discussed with XtAppAddConverter.  XtConvert invokes XtDirectConvert to perform the actual conversion.  It is usually easier to access resource conversion indirectly through the resource mechanism. 

Structures

typedef struct {
    unsigned int size;
    caddr_t addr;
} XrmValue, ∗XrmValuePtr;

See Also

XtAppAddConverter(1), XtDirectConvert(1), XtGetApplicationResources(1), XtGetSubresources(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026