XMCONVERTUNITS(3)
β¨ XmConvertUnits β¨
okay bestie, so this one is a library call from the Xm family β yes, the Motif girlies are still thriving β and it's called XmConvertUnits. And what does it do? It takes a value in one unit type and converts it to another unit type. That's it. That's the whole job. It's giving unit conversion icon. π
π NAME π
XmConvertUnits β a function that converts a value in one unit type to another unit type. lowkey iconic, highkey necessary.
π¦ SYNOPSIS π¦
#include <Xm/Xm.h>
int XmConvertUnits(
Widget widget,
int orientation,
int from_unit_type,
int from_value,
int to_unit_type);
πΈ DESCRIPTION πΈ
So XmConvertUnits converts the value and hands it right back to you as the return value from the function. no side quests, just math. β¨
For resources of type dimension or position, you can specify units using the syntax described in the XmNunitType resource of the XmPrimitive reference page. iykyk.
Now let's meet the parameters, one by one, bestie:
widgetβ specifies the widget for which the data is to be converted. it's the main character of the conversion, fr fr.orientationβ specifies whether the converter uses the horizontal or vertical screen resolution when performing the conversions. this parameter can have values ofXmHORIZONTALorXmVERTICAL. pick your vibe.from_unit_typeβ specifies the current unit type of the supplied value. where you're coming from, emotionally.from_valueβ specifies the value to be converted. the actual number, the star of the show. πto_unit_typeβ converts the value to the unit type specified. where you're going, bestie. glow up complete.
The parameters from_unit_type and to_unit_type can have the following values:
XmPIXELSβ all values provided to the widget are treated as pixel values. this is the default for the resource. the og. the blueprint.XmMILLIMETERSβ all values provided to the widget are treated as millimeter values.Xm100TH_MILLIMETERSβ all values provided to the widget are treated as1/100of a millimeter. tiny tiny energy. π§XmCENTIMETERSβ all values provided to the widget are treated as centimeter values.XmINCHESβ all values provided to the widget are treated as inch values.Xm1000TH_INCHESβ all values provided to the widget are treated as1/1000of an inch.XmPOINTSβ all values provided to the widget are treated as point values. a point is a unit used in text processing applications and is defined as1/72of an inch. πXm100TH_POINTSβ all values provided to the widget are treated as1/100of a point. a point is a unit typically used in text processing applications and is defined as1/72of an inch.XmFONT_UNITSβ 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 theXmScreenresourcesXmNhorizontalFontUnitandXmNverticalFontUnit. two components, two vibes, both valid. π«ΆXm100TH_FONT_UNITSβ all values provided to the widget are treated as1/100of a font unit. a font unit has horizontal and vertical components. these are the values of theXmScreenresourcesXmNhorizontalFontUnitandXmNverticalFontUnit.
π RETURN π
Returns the converted value. slay. β¨
But β and hear me out β if a NULL widget, incorrect orientation, or incorrect unit_type is supplied as parameter data, 0 (zero) is returned. so if you're getting a zero back and you're confused... bestie, check your inputs. π
not me passing aNULLwidget and wondering why everything is0... anyway. π
π RELATED π
XmPrimitive, XmSetFontUnits(3), and XmScreen(3). go read those too, they're part of the lore.
okay that's the whole page, bestie!! it's a library call from the Xm crew, and that's genuinely all the version/date tea the footer gave us β so consider this your cute lil sign-off. stay converting, stay slaying, and remember: units don't lie, but NULL widgets absolutely will. πβ¨ππ¦
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms