XMCONVERTSTRINGTOUNITS(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmConvertStringToUnits πŸ’–

okay bestie, we're diving into XmConvertStringToUnits, a library call from the Xm crew. it's a function that converts a string specification to a unit value, and honestly? it's giving ✨measurement era✨


🌸 NAME 🌸

XmConvertStringToUnits β€” a function that converts a string specification to a unit value πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Xm/Xm.h>
int XmConvertStringToUnits(
Screen *screen,
String spec,
int orientation,
int to_type,
XtEnum *parse_error);

πŸ’… DESCRIPTION πŸ’…

XmConvertStringToUnits converts a string specification value and returns the converted value as the return value from the function. literally the whole vibe. it uses the specified screen's resolution to compute the number of units for the string specification. no cap. πŸ”₯

  • screen β€” specifies the screen whose resolution is to be used for the computation. πŸ‘‘
  • spec β€” specifies the string, in <floating value><unit> format, to be converted. that angle-bracket format is the moment, don't freestyle it. πŸŽ€
  • orientation β€” specifies whether the converter uses the horizontal or vertical screen resolution when performing the conversion. this parameter can have values of XmHORIZONTAL or XmVERTICAL. pick a lane, bestie 🫢
  • to_type β€” converts the value to the unit type specified. refer to the XmNunitType resource of the XmGadget, XmManager, or XmPrimitive reference page. this parameter can have one of the following values:
    • XmPIXELS β€” the returned value will be the number of pixels. ✨
    • XmMILLIMETERS β€” the returned value will be the number of millimeters.
    • Xm100TH_MILLIMETERS β€” the returned values will be the number of 1/100 millimeters.
    • XmCENTIMETERS β€” the returned values will be the number of centimeters.
    • XmINCHES β€” the returned values will be the number of inches.
    • Xm1000TH_INCHES β€” the returned values will be the number of 1/100 inches. πŸ‘€ (yes that's what it says, we report the facts here)
    • XmPOINTS β€” the returned value will be the number of points. a point is a text processing unit defined as 1/72 of an inch. πŸ’…
    • Xm100TH_POINTS β€” the returned values will be the number of 1/100 points.
    • XmFONT_UNITS β€” all values provided to the widget are treated as font units. a font unit has horizontal and vertical components. these are the values of the XmScreen resources XmNhorizontalFontUnit and XmNverticalFontUnit. 🧚
    • Xm100TH_FONT_UNITS β€” 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 XmNhorizontalFontUnit and XmNverticalFontUnit.
  • parse_error β€” specifies if a parsing error occurred. this is set to a value of True indicates that an error occurred, a value of False to indicate no error. so check it, bestie, don't just vibe past it πŸ™ˆ

⭐ RETURN ⭐

returns the converted value. πŸŽ‰

but listen β€” if a NULL screen, incorrect orientation, or incorrect unit_type is supplied as parameter data, or if a parsing error occurred, 0 (zero) is returned.

so like... 0 could be a real answer OR a "something went wrong" answer. it's giving ambiguous main character energy. check your parse_error, fr fr. πŸ’€


and that's the whole page, bestie!! 🫢✨ this was XmConvertStringToUnits(library call) β€” a library call from the Xm fam, no date on the original footer, just the title flexing itself back at us. obsessed. go forth and convert responsibly. πŸ‘‘πŸ’–πŸŒΈ