Merge branch 'devel/upgrade' into tizen
[platform/upstream/libXt.git] / man / XtConvertAndStore.man
1 .\" Copyright (c) 1993, 1994  X Consortium
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining a
4 .\" copy of this software and associated documentation files (the "Software"),
5 .\" to deal in the Software without restriction, including without limitation
6 .\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 .\" and/or sell copies of the Software, and to permit persons to whom the
8 .\" Software furnished to do so, subject to the following conditions:
9 .\"
10 .\" The above copyright notice and this permission notice shall be included in
11 .\" all copies or substantial portions of the Software.
12 .\"
13 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16 .\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 .\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
18 .\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 .\" SOFTWARE.
20 .\"
21 .\" Except as contained in this notice, the name of the X Consortium shall not
22 .\" be used in advertising or otherwise to promote the sale, use or other
23 .\" dealing in this Software without prior written authorization from the
24 .\" X Consortium.
25 .\"
26 .ds tk X Toolkit
27 .ds xT X Toolkit Intrinsics \- C Language Interface
28 .ds xI Intrinsics
29 .ds xW X Toolkit Athena Widgets \- C Language Interface
30 .ds xL Xlib \- C Language X Interface
31 .ds xC Inter-Client Communication Conventions Manual
32 .ds Rn 3
33 .ds Vn 2.2
34 .hw XtConvert-And-Store XtCall-Converter wid-get
35 .na
36 .de Ds
37 .nf
38 .\\$1D \\$2 \\$1
39 .ft CW
40 .ps \\n(PS
41 .\".if \\n(VS>=40 .vs \\n(VSu
42 .\".if \\n(VS<=39 .vs \\n(VSp
43 ..
44 .de De
45 .ce 0
46 .if \\n(BD .DF
47 .nr BD 0
48 .in \\n(OIu
49 .if \\n(TM .ls 2
50 .sp \\n(DDu
51 .fi
52 ..
53 .de IN          \" send an index entry to the stderr
54 ..
55 .de Pn
56 .ie t \\$1\fB\^\\$2\^\fR\\$3
57 .el \\$1\fI\^\\$2\^\fP\\$3
58 ..
59 .de ZN
60 .ie t \fB\^\\$1\^\fR\\$2
61 .el \fI\^\\$1\^\fP\\$2
62 ..
63 .ny0
64 .TH XtConvertAndStore __libmansuffix__ __xorgversion__ "XT FUNCTIONS"
65 .SH NAME
66 XtConvertAndStore, XtCallConverter \- invoke resource converters
67 .SH SYNTAX
68 .HP
69 Boolean XtConvertAndStore(Widget \fIwidget\fP, String \fIfrom_type\fP,
70 XrmValuePtr \fIfrom\fP, String \fIto_type\fP, XrmValuePtr \fIto_in_out\fP);
71 .HP
72 Boolean XtCallConverter(Display* \fIdpy\fP, XtConverter \fIconverter\fP,
73 XrmValuePtr \fIargs\fP, Cardinal \fInum_args\fP, XrmValuePtr \fIfrom\fP,
74 XrmValuePtr \fIto_in_out\fP, XtCacheRef* \fIcache_ref_return\fP);
75 .SH ARGUMENTS
76 .IP \fIargs\fP 1i
77 Specifies the argument list that contains the additional arguments needed
78 to perform the conversion, or NULL.
79 .IP \fIconverter\fP 1i
80 Specifies the conversion procedure that is to be called.
81 .IP \fIfrom\fP 1i
82 Specifies the value to be converted.
83 .IP \fIfrom_type\fP 1i
84 Specifies the source type.
85 .IP \fInum_args\fP 1i
86 Specifies the number of additional arguments (often zero).
87 .IP \fIto_type\fP 1i
88 Specifies the destination type.
89 .IP \fIto_in_out\fP 1i
90 Returns the converted value.
91 .IP \fIwidget\fP 1i
92 Specifies the widget to use for additional arguments, if any are needed,
93 and the destroy callback list.
94 .IP \fIdpy\fP 1i
95 Specifies the display with which the conversion is to be associated.
96 .SH DESCRIPTION
97 The
98 .ZN XtConvertAndStore
99 function looks up the type converter registered to convert from_type
100 to to_type, computes any additional arguments needed, and then calls
101 .ZN XtCallConverter .
102 (or
103 .ZN XtDirectConvert
104 if an old-style converter was registered with
105 .ZN XtAddConverter
106 or
107 .ZN XtAppAddConverter .
108 ) with the from and to_in_out arguments.
109 .LP
110 The
111 .ZN XtCallConverter
112 function looks up the specified type converter in the application
113 context associated with the display and, if the converter was not
114 registered or was registered with cache type
115 .ZN XtCacheAll
116 or
117 .ZN XtCacheByDisplay
118 looks in the conversion cache to see if this conversion procedure
119 has been called with the specified conversion arguments. If so, it
120 checks the success status of the prior call, and if the conversion
121 failed,
122 .ZN XtCallConverter
123 returns
124 .ZN False
125 immediately; otherwise it checks the size specified in the \fIto\fP
126 argument and, if it is greater than or equal to the size stored in the
127 cache, copies the information stored in the cache into the location
128 specified by \fIto->addr\fP, stores the cache size into \fIto->size\fP,
129 and returns
130 .ZN True .
131 If the size specified in the \fIto\fP argument is smaller than the size
132 stored in the cache,
133 .ZN XtCallConverter
134 copies the cache size into the \fIto->size\fP and returns
135 .ZN False .
136 If the converter was registered with cache type
137 .ZN XtCacheNone
138 or no value was found in the conversion cache,
139 .ZN XtCallConverter
140 calls the converter and, if it was not registered with cache type
141 .ZN XtCacheNone ,
142 enters the result into the cache.
143 .ZN XtCallConverter
144 then returns what the converter returned.
145 .LP
146 The \fIcache_ref_return\fP field specifies storage allocated by the
147 caller in which an opaque value will be stored. If the type converter
148 has been registered with the
149 .ZN XtCacheRefCount
150 modifier and if the value returned in in \fIcache_ref_return\fP is
151 non-NULL, then the call should store the \fIcache_ref_return\fP value
152 in order to decrement the reference count when the converted value
153 is no longer required. The \fIcache_ref_return\fP argument should be
154 NULL if the caller is unwilling or unable to store the value.
155 .SH "SEE ALSO"
156 XtAppReleaseCacheRefs(__libmansuffix__)
157 .br
158 \fI\*(xT\fP
159 .br
160 \fI\*(xL\fP