Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtSetTypeCo(3x) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppSetTypeConverter(1)

XtCallConverter(1)

XtConvertAndStore(1)

XtDestructor(2)

XtTypeConverter(2)

 

NAME

XtSetTypeConverter − register a "new-style" type converter for all application contexts in a process. 

Synopsis

void XtSetTypeConverter(from_type, to_type, converter, convert_args, num_args, cache_type, destructor)

      String from_type, to_type;
      XtTypeConverter converter;
      XtConvertArgList convert_args;
      Cardinal num_args;
      XtCacheType cache_type;
      XtDestructor destructor;

Inputs

from_typeSpecifies the source type. 

to_typeSpecifies the destination type. 

converterSpecifies the resource type converter procedure. 

convert_args
Specifies additional conversion arguments, or NULL. 

num_argsSpecifies the count of additional conversion arguments, or zero. 

cache_type
Specifies whether or not resources produced by this converter are sharable or display-specific and when they should be freed.

destructor
Specifies a destroy procedure for resources produced by this conversion, or NULL if no additional action is required to deallocate resources produced by converter. 

Description

XtSetTypeConverter() registers converter in all application contexts as a "new-style" resource converter to convert data of resource type from_type to resource type to_type.  The convert_args array describes a list of additional arguments that will be computed and passed to the converter when it is invoked.  cache_type specifies how converted values should be cached, and destructor optionally specifies a procedure to be called to free up resources when a cached value is no longer needed.  XtSetTypeConverter() is identical to XtAppSetTypeConverter() except that it registers the converter in all current application contexts, and all future application contexts.  (In particular, note that XtAppSetTypeConverter() does not supersede XtSetTypeConverter() as is the case with many other XtApp functions.)  For more information about the arguments and usage of this function, see XtAppSetTypeConverter(). 

Structures

The XtConvertArgRec structure is defined as follows:

typedef enum {
/* address modeparameter representation */
   XtAddress,/* address */
   XtBaseOffset,/* offset */
   XtImmediate,/* constant */
   XtResourceString,/* resource name string */
   XtResourceQuark,/* resource name quark */
   XtWidgetBaseOffset,/* offset */
   XtProcedureArg/* procedure to call */
} XtAddressMode;
 typedef struct {
XtAddressMode address_mode;
XtPointer address_id;
Cardinal size;
} XtConvertArgRec, *XtConvertArgList;

The XtCacheType and its legal values are defined as follows:

typedef int XtCacheType;
 #define                 XtCacheNone       0x001
#define                 XtCacheAll        0x002
#define                 XtCacheByDisplay  0x003
#define                 XtCacheRefCount   0x100

See XtAppSetTypeConverter() for an explanation of each of the fields and values of these types. 

See Also

XtAppSetTypeConverter(1), XtCallConverter(1), XtConvertAndStore(1),
XtDestructor(2), XtTypeConverter(2). 

Copyright O’Reilly & Assoc.  —  X Toolkit Intrinsics Reference Manual © O’Reilly & Associates

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