Blob Blame History Raw
'\" t
...\" RepTypRe.sgm /main/8 1996/09/08 20:58:50 rws $
.de P!
.fl
\!!1 setgray
.fl
\\&.\"
.fl
\!!0 setgray
.fl			\" force out current output buffer
\!!save /psv exch def currentpoint translate 0 0 moveto
\!!/showpage{}def
.fl			\" prolog
.sy sed -e 's/^/!/' \\$1\" bring in postscript file
\!!psv restore
.
.de pF
.ie     \\*(f1 .ds f1 \\n(.f
.el .ie \\*(f2 .ds f2 \\n(.f
.el .ie \\*(f3 .ds f3 \\n(.f
.el .ie \\*(f4 .ds f4 \\n(.f
.el .tm ? font overflow
.ft \\$1
..
.de fP
.ie     !\\*(f4 \{\
.	ft \\*(f4
.	ds f4\"
'	br \}
.el .ie !\\*(f3 \{\
.	ft \\*(f3
.	ds f3\"
'	br \}
.el .ie !\\*(f2 \{\
.	ft \\*(f2
.	ds f2\"
'	br \}
.el .ie !\\*(f1 \{\
.	ft \\*(f1
.	ds f1\"
'	br \}
.el .tm ? font underflow
..
.ds f1\"
.ds f2\"
.ds f3\"
.ds f4\"
.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 
.TH "XmRepTypeRegister" "library call"
.SH "NAME"
\fBXmRepTypeRegister\fP \(em A representation type manager function
that registers a representation type resource
.iX "XmRepTypeRegister"
.iX "representation type manager functions" "XmRepTypeRegister"
.SH "SYNOPSIS"
.PP
.nf
#include <Xm/RepType\&.h>
\fBXmRepTypeId \fBXmRepTypeRegister\fP\fR(
\fBString \fBrep_type\fR\fR,
\fBString *\fBvalue_names\fR\fR,
\fBunsigned char *\fBvalues\fR\fR,
\fBunsigned char \fBnum_values\fR\fR);
.fi
.SH "DESCRIPTION"
.PP
\fBXmRepTypeRegister\fP registers a representation
type resource with the representation type manager\&. All
features of the representation type management facility become
available for the specified representation type\&. The function
installs a forward type converter to convert string values to
numerical representation type values\&.
.PP
When the \fIvalues\fP argument is NULL, consecutive numerical
values are assumed\&. The order of the strings in the \fIvalue_names\fP
array determines the numerical values for the resource\&. For example,
the first value name is 0 (zero); the second value name is 1; and so on\&.
.PP
If it is non-NULL, the \fIvalues\fP argument can be used to assign values
to representation types that have nonconsecutive values or have
duplicate names for the same value\&. Representation types registered
in this manner will consume additional storage and will be slightly
slower than representation types with consecutive values\&.
.PP
A representation type can only be registered once; if the
same representation type name is registered more than once, the
behavior is undefined\&.
.PP
The function \fBXmRepTypeAddReverse\fP installs a reverse converter
for a registered representation type\&. The reverse converter takes
a representation type numerical value and returns the corresponding
string value\&. If the list of numerical values for a representation
type contains duplicate values, the reverse converter uses the first
name in the \fIvalue_names\fP list that matches the specified numeric
value\&. For example, if a \fIvalue_names\fP array has \fIcancel\fP,
\fIproceed\fP, and \fIabort\fP, and the corresponding \fIvalues\fP array
contains 0, 1, and 0, the reverse converter will return \fIcancel\fP
instead of \fIabort\fP for an input value of 0\&.
.IP "\fIrep_type\fP" 10
Specifies the representation type name\&.
.IP "\fIvalue_names\fP" 10
Specifies a pointer to an array of value names associated with the
representation type\&. A value name is specified in lowercase characters
without an \fBXm\fP prefix\&. Words within a name are separated with
underscores\&.
.IP "\fIvalues\fP" 10
Specifies a pointer to an array of values associated with the
representation type\&. A value in this array is associated with
the value name in the corresponding position of the \fIvalue_names\fP
array\&.
.IP "\fInum_values\fP" 10
Specifies the number of entries in the \fIvalue_names\fP and
\fIvalues\fP arrays\&.
.SH "RETURN"
.PP
Returns the identification number for the specified representation
type\&.
.SH "RELATED"
.PP
\fBXmRepTypeAddReverse\fP(3),
\fBXmRepTypeGetId\fP(3),
\fBXmRepTypeGetNameList\fP(3),
\fBXmRepTypeGetRecord\fP(3),
\fBXmRepTypeGetRegistered\fP(3), and
\fBXmRepTypeValidValue\fP(3)\&.
...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29