Namespace

Gm – 0

Functions and Objects useful in mobile related, glib based projects

Version0.2.0
AuthorsThe Phosh Developers
LicenseLGPL-2.1-or-later
Websitehttps://gitlab.gnome.org/World/Phosh/gmobile
Sourcehttps://gitlab.gnome.org/World/Phosh/gmobile/

Build

C headersgmobile.h
pkg-config filesgmobile

Dependencies

GLib—2.0 The base type system library
Browse documentation
Gio—2.0 GObject Interfaces and Objects, Networking, IPC, and I/O
Browse documentation

Additional documentation

Classes

Cutout

A display cutout or notch.

since: 0.0.2

DeviceInfo

Get device dependent information.

since: 0.0.1

DisplayPanel

Physical properties of a display panel like size, cutouts and rounded corners.

since: 0.0.1

Structs

Rect

A rectangle.

since: 0.0.1

Error Domains

Error

Error codes returned by gmobile functions.

since: 0.0.1

Functions

device_tree_get_compatibles

Read compatible machine types from sysfs_root/firmware/devicetree/base/compatible on Linux. If the path doesn’t exist or host is not Linux return NULL.

since: 0.0.1

error_quark

Gets the GM Error Quark.

since: 0.0.1

init

Call this function to initialize the library explicitly. This makes the embedded device information available.

since: 0.0.1

svg_path_get_bounding_box

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 and error contains the error information.

since: 0.0.1

timeout_add_seconds_once

Sets a function to be called after a timeout with the default priority, G_PRIORITY_DEFAULT. Correctly calculates the timeout even when the system is suspended in between.

since: 0.0.1

timeout_add_seconds_once_full

Sets a function to be called after a timeout with priority priority. Correctly calculates the timeout even when the system is suspended in between.

since: 0.0.1

Function Macros

str_is_null_or_empty

Convenience macro to check if a given string is NULL or empty. Evaluates to a truth value if x is NULL or x is the empty string otherwise FALSE.

since: 0.0.5

strv_is_null_or_empty

Convenience macro to check if a given GStrv is NULL or empty. Evaluates to a truth value if x is NULL or x has no elements otherwise FALSE.

since: 0.0.5