<!-- $XConsortium: CvtUn.sgm /main/9 1996/09/08 20:38:03 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->

<RefEntry Id="CDEMMA.MAN120.rsml.1">
<RefMeta>
<RefEntryTitle>XmConvertUnits</RefEntryTitle>
<ManVolNum>library call</ManVolNum>
</RefMeta>
<RefNameDiv>
<RefName><Function>XmConvertUnits</Function></RefName>
<RefPurpose>A function that converts a value in one unit type to another unit type
<IndexTerm>
<Primary>XmConvertUnits</Primary>
</IndexTerm></RefPurpose>
</RefNameDiv>
<!-- -->
<!-- @OSF_COPYRIGHT@-->
<!-- COPYRIGHT NOTICE-->
<!-- Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.-->
<!-- ALL RIGHTS RESERVED (MOTIF). See the file named COPY.MOTIF.DOC for-->
<!-- the full copyright text.-->
<!-- -->
<!-- HISTORY-->
<!-- -->
<!-- **-->
<!-- **-->
<!-- **  (c) Copyright 1989, 1990, 1992 by Open Software Foundation, Inc.-->
<!-- **      All Rights Reserved.-->
<!-- **-->
<!-- **  (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company-->
<!-- **-->
<!-- **  (c) Copyright 1987, 1988 by Digital Equipment Corporation,-->
<!-- **      Maynard, MA.  All Rights Reserved.-->
<!-- **-->
<!-- **-->
<RefSynopsisDiv>
<FuncSynopsis>
<FuncSynopsisInfo>#include &lt;Xm/Xm.h>
</FuncSynopsisInfo>
<FuncDef>int <Function>XmConvertUnits</Function></FuncDef>
<!--<ParamDef><Replaceable>widget, orientation, from_unit_type, from_value, to_unit_type</Replaceable></ParamDef>-->
<ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
<ParamDef>int <Parameter>orientation</Parameter></ParamDef>
<ParamDef>int <Parameter>from_unit_type</Parameter></ParamDef>
<ParamDef>int <Parameter>from_value</Parameter></ParamDef>
<ParamDef>int <Parameter>to_unit_type</Parameter></ParamDef>
</FuncSynopsis>
</RefSynopsisDiv>
<RefSect1>
<Title>DESCRIPTION</Title>
<Para><Function>XmConvertUnits</Function> converts the value and returns it as the return value from
the function.
For resources of type, dimension, or position, you can specify units
using the syntax described in the <SystemItem Class="Resource">XmNunitType</SystemItem> resource of the
<Classname>XmPrimitive</Classname> reference page.
</Para>
<VariableList>
<VarListEntry>
<Term><Symbol Role="Variable">widget</Symbol></Term>
<ListItem>
<Para>Specifies the widget for which the data is to be converted.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">orientation</Symbol></Term>
<ListItem>
<Para>Specifies whether the converter uses the horizontal or vertical screen
resolution when performing the conversions. The <Symbol Role="Variable">orientation</Symbol>
parameter can have values of
<SystemItem Class="Constant">XmHORIZONTAL</SystemItem> or <SystemItem Class="Constant">XmVERTICAL</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">from_unit_type</Symbol></Term>
<ListItem>
<Para>Specifies the current unit type of the supplied value
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">from_value</Symbol></Term>
<ListItem>
<Para>Specifies the value to be converted
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">to_unit_type</Symbol></Term>
<ListItem>
<Para>Converts the value to the unit type specified
</Para>
</ListItem>
</VarListEntry>
</VariableList>
<Para>The parameters <Symbol Role="Variable">from_unit_type</Symbol> and <Symbol Role="Variable">to_unit_type</Symbol> can have the
following values:
</Para>
<VariableList>
<VarListEntry>
<Term><SystemItem Class="Constant">XmPIXELS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as
pixel values. This
is the default for the resource.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmMILLIMETERS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as millimeter
values.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_MILLIMETERS</Symbol></Term>
<ListItem>
<Para>All values provided to the widget are
treated as 1/100 of a millimeter.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmCENTIMETERS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as centimeter
values.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmINCHES</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as inch
values.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm1000TH_INCHES</Symbol></Term>
<ListItem>
<Para>All values provided to the widget are treated
as 1/1000 of an inch.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmPOINTS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as point
values. A point is a unit used in text processing
applications and is defined as 1/72 of an inch.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_POINTS</Symbol></Term>
<ListItem>
<Para>All values provided to the widget are treated as
1/100 of a point.
A point is a unit typically used in text processing applications and
is defined as 1/72 of an inch.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmFONT_UNITS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as normal font
units. A font unit has horizontal and vertical components.
These are the values of the XmScreen resources <SystemItem Class="Resource">XmNhorizontalFontUnit</SystemItem>
and <SystemItem Class="Resource">XmNverticalFontUnit</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_FONT_UNITS</Symbol></Term>
<ListItem>
<Para>All values provided to the widget are
treated as 1/100 of a font unit.
A font unit has horizontal and vertical components.
These are the values of the XmScreen resources <SystemItem Class="Resource">XmNhorizontalFontUnit</SystemItem>
and <SystemItem Class="Resource">XmNverticalFontUnit</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>RETURN</Title>
<Para>Returns the converted value.
If a NULL widget, incorrect <Symbol Role="Variable">orientation</Symbol>, or incorrect <Symbol Role="Variable">unit_type</Symbol>
is supplied as parameter data, 0 (zero) is returned.
</Para>
</RefSect1>
<RefSect1>
<Title>RELATED</Title>
<Para><Classname>XmPrimitive</Classname>,
&cdeman.XmSetFontUnits;,
and
&cdeman.XmScreen;.
</Para>
</RefSect1>
</RefEntry>
<!--fickle 1.09 7/2/95-->
