| Top |
| UpClient * | up_client_new () |
| UpClient * | up_client_new_full () |
| UpDevice * | up_client_get_display_device () |
| char * | up_client_get_critical_action () |
| GPtrArray * | up_client_get_devices () |
| GPtrArray * | up_client_get_devices2 () |
| const gchar * | up_client_get_daemon_version () |
| gboolean | up_client_get_on_battery () |
A helper GObject to use for accessing UPower information, and to be notified when it is changed.
UpClient *
up_client_new (void);
Creates a new UpClient object. If connecting to upowerd on D-Bus fails,
this returns NULL and prints out a warning with the error message.
Consider using up_client_new_full() instead which allows you to handle errors
and cancelling long operations yourself.
Since: 0.9.0
UpClient * up_client_new_full (GCancellable *cancellable,GError **error);
Creates a new UpClient object. If connecting to upowerd on D-Bus fails,
this returns NULL and sets error
.
cancellable |
A GCancellable or |
[allow-none] |
error |
Return location for error or |
Since: 0.99.5
UpDevice *
up_client_get_display_device (UpClient *client);
Get the composite display device.
Since: 1.0
char *
up_client_get_critical_action (UpClient *client);
Gets a string representing the configured critical action, depending on availability.
Since: 1.0
GPtrArray *
up_client_get_devices (UpClient *client);
up_client_get_devices has been deprecated since version 0.99.8 and should not be used in newly-written code.
Get a copy of the device objects. This function does not set the free function for the GPtrArray so you need use g_object_unref on all elements when you are finished with the array.
an array of UpDevice objects or NULL on error, free with g_ptr_array_unref().
[element-type UpDevice][transfer full]
Since: 0.9.0
GPtrArray *
up_client_get_devices2 (UpClient *client);
Get a copy of the device objects.
an array of UpDevice objects or NULL on error, free with g_ptr_array_unref().
[element-type UpDevice][transfer full]
Since: 0.99.8
const gchar *
up_client_get_daemon_version (UpClient *client);
Get UPower daemon version.
Since: 0.9.0
“daemon-version” property“daemon-version” gchar *
The daemon version.
Owner: UpClient
Flags: Read
Default value: NULL
Since: 0.9.0
“on-battery” property“on-battery” gboolean
If the computer is on battery power.
Owner: UpClient
Flags: Read
Default value: FALSE
Since: 0.9.0
“device-added” signalvoid user_function (UpClient *client, UpDevice *device, gpointer user_data)
The ::device-added signal is emitted when a power device is added.
Flags: Run Last
Since: 0.9.0