Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtaddconverter(3) [hpux man page]

XtAddConverter()														  XtAddConverter()

Name
  XtAddConverter - register an "old-style" resource converter.

Synopsis
  void XtAddConverter(from_type, to_type, converter, convert_args, num_args)
	 String from_type;
	 String to_type;
	 XtConverter converter;
	 XtConvertArgList convert_args;
	 Cardinal num_args;

Inputs
  from_type Specifies the resource name of the datatype that the converter converts from.

  to_type   Specifies the resource name of the datatype that the converter converts to.

  converter Specifies the converter procedure.	See XtConverter(2).

  convert_args
	    Specifies how to obtain any additional arguments needed for the conversion.

  num_args  Specifies the number elements in convert_args.

Availability
  Superseded by XtAppAddConverter().

Description
  XtAddConverter()  registers converter as a procedure to convert data of resource type from_type to resource type to_type.  The convert_args
  array is registered with the converter, and will be used to obtain arguments to pass to the converter each time it is invoked.

Usage
  XtAddConverter() has been superseded by XtAppAddConverter(), which allows the registration of converter functions on a per-application con-
  text	basis.	 XtAddConverter()  now calls XtAppAddConverter() passing the default application context created by XtInitialize().  Very few
  programs need multiple application contexts, and you can continue to use XtAddConverter() if you initialize your  application  with  XtIni-
  tialize().  We recommend, however, that you use XtAppInitialize(), XtAppAddConverter(), and the other XtApp*() application context specific
  functions.

  See XtAppAddConverter() for more information about converters and the XtConvertArgList data type.

  XtAddConverter() and XtAppAddConverter() register "old-style" converters which are still in common use, but are  not	as  flexible  as  the
  (incompatible)  "new-style"  converters added in Release 4.  If you must register an existing old-style converter, use XtAppAddConverter(),
  but if you are writing a converter of your own, consider using a new-style converter.  See XtAppSetTypeConverter().

See Also
  XtAppAddConverter(1), XtAppSetTypeConverter(1), XtSetTypeConverter(1),
  XtConverter(2), XtTypeConverter(2).

Xt - Resource Management													  XtAddConverter()

Check Out this Related Man Page

XtSetTypeConverter()													      XtSetTypeConverter()

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_type Specifies the source type.

  to_type   Specifies the destination type.

  converter Specifies the resource type converter procedure.

  convert_args
	    Specifies additional conversion arguments, or NULL.

  num_args  Specifies 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 deallo-
	    cate 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 proce-
  dure 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 mode     parameter 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).

Xt - Resource Management												      XtSetTypeConverter()
Man Page