Functions¶
|
|
|
|
|
|
|
|
|
Details¶
- Gm.device_tree_get_compatibles(sysfs_root)¶
- Parameters:
sysfs_root (
str
) – Path where /sys is mounted. Defaults to/sys
ifNone
is passed.- Raises:
- Returns:
compatible machine types or
None
- Return type:
[
str
]
Read compatible machine types from
sysfs_root/firmware/devicetree/base/compatible
on Linux. If the path doesn’t exist or host is not Linux returnNone
.For debugging purposes
GMOBILE_DT_COMPATIBLES
can be set to a:
separated list of compatibles which will be returned instead.New in version 0.0.1.
- Gm.error_quark()¶
- Returns:
a #GQuark.
- Return type:
Gets the GM Error Quark.
New in version 0.0.1.
- Gm.init()¶
Call this function to initialize the library explicitly. This makes the embedded device information available.
New in version 0.0.1.
- Gm.svg_path_get_bounding_box(path, x1, x2, y1, y2)¶
- Parameters:
- Raises:
- Returns:
TRUE
when parsing was successful,FALSE
otherwise.See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths for path syntax introduction.
- Return type:
Returns the bounding box of an SVG path. As this is meant for display cutouts we operate on integer (whole pixel) values. When parsing fails,
FALSE
is returned anderror
contains the error information.New in version 0.0.1.
- Gm.timeout_add_seconds_once(priority, seconds, function, *data)¶
- Parameters:
priority (
int
) – the priority of the timeout source. Typically this will be in the range betweenGLib.PRIORITY_DEFAULT
andGLib.PRIORITY_HIGH
.seconds (
int
) – the timeout in secondsfunction (
GLib.SourceOnceFunc
) – function to call
- Returns:
the ID (greater than 0) of the event source.
- Return type:
Sets a function to be called after a timeout with priority priority. Correctly calculates the timeout even when the system is suspended in between.
This internally creates a main loop source using
GLib.timeout_source_new_seconds
() and attaches it to the main loop context usingGLib.Source.attach
().The timeout given is in terms of
CLOCK_BOOTTIME
time, it hence is also correct across suspend and resume. If that doesn’t matter useg_timeout_add_seconds_full
instead.Note that glib’s
g_timeout_add_seconds()
doesn’t take system suspend/resume into account: https://gitlab.gnome.org/GNOME/glib/-/issues/2739New in version 0.0.1.