[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]
Motif 2.1 Programmer's Reference
XmConvertUnits
A function that converts a value in one unit type to another unit type
Format
#include <Xm/Xm.h>
int XmConvertUnits
Widget
widgetint orientationint
from_unit_typeint from_valueint
to_unit_type
DESCRIPTION
XmConvertUnits 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 XmNunitType resource of the
XmPrimitive reference page.
widgetSpecifies the widget for which the data is to be converted.
orientationSpecifies whether the converter uses the horizontal or vertical screen
resolution when performing the conversions. The orientation parameter
can have values of XmHORIZONTAL or XmVERTICAL.
from_unit_typeSpecifies the current unit type of the supplied value
from_valueSpecifies the value to be converted
to_unit_typeConverts the value to the unit type specified
The parameters from_unit_type and to_unit_type can have
the following values:
XmPIXELSAll values provided to the widget are treated as pixel values. This is the
default for the resource.
XmMILLIMETERSAll values provided to the widget are treated as millimeter values.
Xm100TH_MILLIMETERSAll values provided to the widget are treated as 1/100 of a millimeter.
XmCENTIMETERSAll values provided to the widget are treated as centimeter values.
XmINCHESAll values provided to the widget are treated as inch values.
Xm1000TH_INCHESAll values provided to the widget are treated as 1/1000 of an inch.
XmPOINTSAll 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.
Xm100TH_POINTSAll 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.
XmFONT_UNITSAll 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 XmNhorizontalFontUnit and XmNverticalFontUnit.
Xm100TH_FONT_UNITSAll 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 XmNhorizontalFontUnit and XmNverticalFontUnit.
RETURN
Returns the converted value. If a NULL widget, incorrect
orientation, or incorrect unit_type is supplied as parameter
data, 0 (zero) is returned.
RELATED
XmPrimitive, XmSetFontUnits
(3), and XmScreen
(3).
[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]