1XtConvertAndStore(3) XT FUNCTIONS XtConvertAndStore(3)
2
3
4
6 XtConvertAndStore, XtCallConverter - invoke resource converters
7
9 #include <X11/Intrinsic.h>
10
11 Boolean XtConvertAndStore(Widget widget, const char *from_type, XrmVal‐
12 uePtr from, const char *to_type, XrmValuePtr to_in_out);
13
14 Boolean XtCallConverter(Display* dpy, XtTypeConverter converter, Xrm‐
15 ValuePtr args, Cardinal num_args, XrmValuePtr from, XrmValuePtr
16 to_in_out, XtCacheRef* cache_ref_return);
17
19 args Specifies the argument list that contains the additional
20 arguments needed to perform the conversion, or NULL.
21
22 converter Specifies the conversion procedure that is to be called.
23
24 from Specifies the value to be converted.
25
26 from_type Specifies the source type.
27
28 num_args Specifies the number of additional arguments (often zero).
29
30 to_type Specifies the destination type.
31
32 to_in_out Returns the converted value.
33
34 widget Specifies the widget to use for additional arguments, if any
35 are needed, and the destroy callback list.
36
37 dpy Specifies the display with which the conversion is to be
38 associated.
39
41 The XtConvertAndStore function looks up the type converter registered
42 to convert from_type to to_type, computes any additional arguments
43 needed, and then calls XtCallConverter. (or XtDirectConvert if an old-
44 style converter was registered with XtAddConverter or XtAppAddCon‐
45 verter. ) with the from and to_in_out arguments.
46
47 The XtCallConverter function looks up the specified type converter in
48 the application context associated with the display and, if the con‐
49 verter was not registered or was registered with cache type XtCacheAll
50 or XtCacheByDisplay looks in the conversion cache to see if this con‐
51 version procedure has been called with the specified conversion argu‐
52 ments. If so, it checks the success status of the prior call, and if
53 the conversion failed, XtCallConverter returns False immediately; oth‐
54 erwise it checks the size specified in the to argument and, if it is
55 greater than or equal to the size stored in the cache, copies the
56 information stored in the cache into the location specified by
57 to->addr, stores the cache size into to->size, and returns True. If
58 the size specified in the to argument is smaller than the size stored
59 in the cache, XtCallConverter copies the cache size into the to->size
60 and returns False. If the converter was registered with cache type
61 XtCacheNone or no value was found in the conversion cache, XtCall‐
62 Converter calls the converter and, if it was not registered with cache
63 type XtCacheNone, enters the result into the cache. XtCallConverter
64 then returns what the converter returned.
65
66 The cache_ref_return field specifies storage allocated by the caller in
67 which an opaque value will be stored. If the type converter has been
68 registered with the XtCacheRefCount modifier and if the value returned
69 in in cache_ref_return is non-NULL, then the call should store the
70 cache_ref_return value in order to decrement the reference count when
71 the converted value is no longer required. The cache_ref_return argu‐
72 ment should be NULL if the caller is unwilling or unable to store the
73 value.
74
76 XtAppReleaseCacheRefs(3)
77 X Toolkit Intrinsics - C Language Interface
78 Xlib - C Language X Interface
79
80
81
82X Version 11 libXt 1.2.0 XtConvertAndStore(3)