Units
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "CLUTTER_TYPE_UNITS" ) ]
[ Version ( since = "1.0" ) ]
public struct Units
An opaque structure, to be used to store sizing and positioning values along with their unit.
Content:
Creation methods:
- public Units.from_cm (float cm)
Stores a value in centimeters inside units
- public Units.from_em (float em)
Stores a value in em inside units
, using the default font
name as returned by get_font_name
- public Units.from_em_for_font (string font_name, float em)
Stores a value in em inside units
using font_name
- public Units.from_mm (float mm)
Stores a value in millimiters inside units
- public Units.from_pixels (int px)
Stores a value in pixels inside units
- public Units.from_pt (float pt)
Stores a value in typographic points inside units
- public Units.from_string (string str)
Parses a value and updates units
with it
Methods:
- public Units? copy ()
Copies this
- public void free ()
Frees the resources allocated by this
- public UnitType get_unit_type ()
Retrieves the unit type of the value stored inside
this
- public float get_unit_value ()
Retrieves the value stored inside this
- public float to_pixels ()
Converts a value in Units to pixels
- public string to_string ()
Converts this into a string