xenocara/lib/libXt/man/XtConvertAndStore.man

138 lines
5.1 KiB
Groff
Raw Normal View History

2006-11-25 11:01:46 -07:00
.\" Copyright (c) 1993, 1994 X Consortium
2012-03-10 09:45:48 -07:00
.\"
2006-11-25 11:01:46 -07:00
.\" Permission is hereby granted, free of charge, to any person obtaining a
2012-03-10 09:45:48 -07:00
.\" copy of this software and associated documentation files (the "Software"),
.\" to deal in the Software without restriction, including without limitation
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
.\" and/or sell copies of the Software, and to permit persons to whom the
2006-11-25 11:01:46 -07:00
.\" Software furnished to do so, subject to the following conditions:
2012-03-10 09:45:48 -07:00
.\"
2006-11-25 11:01:46 -07:00
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
2012-03-10 09:45:48 -07:00
.\"
2006-11-25 11:01:46 -07:00
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2012-03-10 09:45:48 -07:00
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2006-11-25 11:01:46 -07:00
.\" SOFTWARE.
2012-03-10 09:45:48 -07:00
.\"
.\" Except as contained in this notice, the name of the X Consortium shall not
.\" be used in advertising or otherwise to promote the sale, use or other
.\" dealing in this Software without prior written authorization from the
2006-11-25 11:01:46 -07:00
.\" X Consortium.
.\"
.ds tk X Toolkit
.ds xT X Toolkit Intrinsics \- C Language Interface
.ds xI Intrinsics
.ds xW X Toolkit Athena Widgets \- C Language Interface
.ds xL Xlib \- C Language X Interface
.ds xC Inter-Client Communication Conventions Manual
.ds Rn 3
.ds Vn 2.2
.hw XtConvert-And-Store XtCall-Converter wid-get
.na
.TH XtConvertAndStore __libmansuffix__ __xorgversion__ "XT FUNCTIONS"
.SH NAME
XtConvertAndStore, XtCallConverter \- invoke resource converters
.SH SYNTAX
2020-01-14 13:48:59 -07:00
#include <X11/Intrinsic.h>
2006-11-25 11:01:46 -07:00
.HP
2020-01-14 13:48:59 -07:00
Boolean XtConvertAndStore(Widget \fIwidget\fP,
const char *\fIfrom_type\fP, XrmValuePtr \fIfrom\fP,
const char *\fIto_type\fP, XrmValuePtr \fIto_in_out\fP);
2006-11-25 11:01:46 -07:00
.HP
2020-01-14 13:48:59 -07:00
Boolean XtCallConverter(Display* \fIdpy\fP, XtTypeConverter \fIconverter\fP,
2006-11-25 11:01:46 -07:00
XrmValuePtr \fIargs\fP, Cardinal \fInum_args\fP, XrmValuePtr \fIfrom\fP,
2012-03-10 09:45:48 -07:00
XrmValuePtr \fIto_in_out\fP, XtCacheRef* \fIcache_ref_return\fP);
2006-11-25 11:01:46 -07:00
.SH ARGUMENTS
.IP \fIargs\fP 1i
2012-03-10 09:45:48 -07:00
Specifies the argument list that contains the additional arguments needed
2006-11-25 11:01:46 -07:00
to perform the conversion, or NULL.
.IP \fIconverter\fP 1i
Specifies the conversion procedure that is to be called.
.IP \fIfrom\fP 1i
Specifies the value to be converted.
.IP \fIfrom_type\fP 1i
Specifies the source type.
.IP \fInum_args\fP 1i
Specifies the number of additional arguments (often zero).
.IP \fIto_type\fP 1i
Specifies the destination type.
.IP \fIto_in_out\fP 1i
Returns the converted value.
.IP \fIwidget\fP 1i
Specifies the widget to use for additional arguments, if any are needed,
and the destroy callback list.
.IP \fIdpy\fP 1i
Specifies the display with which the conversion is to be associated.
.SH DESCRIPTION
The
2020-01-14 13:48:59 -07:00
.B XtConvertAndStore
2012-03-10 09:45:48 -07:00
function looks up the type converter registered to convert from_type
2006-11-25 11:01:46 -07:00
to to_type, computes any additional arguments needed, and then calls
2020-01-14 13:48:59 -07:00
.BR XtCallConverter .
2006-11-25 11:01:46 -07:00
(or
2020-01-14 13:48:59 -07:00
.B XtDirectConvert
2006-11-25 11:01:46 -07:00
if an old-style converter was registered with
2020-01-14 13:48:59 -07:00
.B XtAddConverter
2006-11-25 11:01:46 -07:00
or
2020-01-14 13:48:59 -07:00
.BR XtAppAddConverter .
2006-11-25 11:01:46 -07:00
) with the from and to_in_out arguments.
.LP
The
2020-01-14 13:48:59 -07:00
.B XtCallConverter
2006-11-25 11:01:46 -07:00
function looks up the specified type converter in the application
context associated with the display and, if the converter was not
registered or was registered with cache type
2020-01-14 13:48:59 -07:00
.B XtCacheAll
2006-11-25 11:01:46 -07:00
or
2020-01-14 13:48:59 -07:00
.B XtCacheByDisplay
2006-11-25 11:01:46 -07:00
looks in the conversion cache to see if this conversion procedure
2020-01-14 13:48:59 -07:00
has been called with the specified conversion arguments.
If so, it
2006-11-25 11:01:46 -07:00
checks the success status of the prior call, and if the conversion
failed,
2020-01-14 13:48:59 -07:00
.B XtCallConverter
2006-11-25 11:01:46 -07:00
returns
2020-01-14 13:48:59 -07:00
.B False
2006-11-25 11:01:46 -07:00
immediately; otherwise it checks the size specified in the \fIto\fP
argument and, if it is greater than or equal to the size stored in the
cache, copies the information stored in the cache into the location
specified by \fIto->addr\fP, stores the cache size into \fIto->size\fP,
and returns
2020-01-14 13:48:59 -07:00
.BR True .
2006-11-25 11:01:46 -07:00
If the size specified in the \fIto\fP argument is smaller than the size
stored in the cache,
2020-01-14 13:48:59 -07:00
.B XtCallConverter
2006-11-25 11:01:46 -07:00
copies the cache size into the \fIto->size\fP and returns
2020-01-14 13:48:59 -07:00
.BR False .
2012-03-10 09:45:48 -07:00
If the converter was registered with cache type
2020-01-14 13:48:59 -07:00
.B XtCacheNone
2006-11-25 11:01:46 -07:00
or no value was found in the conversion cache,
2020-01-14 13:48:59 -07:00
.B XtCallConverter
2006-11-25 11:01:46 -07:00
calls the converter and, if it was not registered with cache type
2020-01-14 13:48:59 -07:00
.BR XtCacheNone ,
2006-11-25 11:01:46 -07:00
enters the result into the cache.
2020-01-14 13:48:59 -07:00
.B XtCallConverter
2006-11-25 11:01:46 -07:00
then returns what the converter returned.
.LP
The \fIcache_ref_return\fP field specifies storage allocated by the
2020-01-14 13:48:59 -07:00
caller in which an opaque value will be stored.
If the type converter
2006-11-25 11:01:46 -07:00
has been registered with the
2020-01-14 13:48:59 -07:00
.B XtCacheRefCount
2006-11-25 11:01:46 -07:00
modifier and if the value returned in in \fIcache_ref_return\fP is
non-NULL, then the call should store the \fIcache_ref_return\fP value
in order to decrement the reference count when the converted value
2020-01-14 13:48:59 -07:00
is no longer required.
The \fIcache_ref_return\fP argument should be
2006-11-25 11:01:46 -07:00
NULL if the caller is unwilling or unable to store the value.
.SH "SEE ALSO"
2011-09-10 03:36:19 -06:00
XtAppReleaseCacheRefs(__libmansuffix__)
2006-11-25 11:01:46 -07:00
.br
\fI\*(xT\fP
.br
\fI\*(xL\fP