Top | ![]() |
![]() |
![]() |
![]() |
gchar * | daemon-version | Read |
gboolean | lid-is-closed | Read |
gboolean | lid-is-present | Read |
gboolean | on-battery | Read |
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, 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, 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
gboolean
up_client_get_lid_is_closed (UpClient *client
);
Get whether the laptop lid is closed.
Since: 0.9.0
gboolean
up_client_get_lid_is_present (UpClient *client
);
Get whether a laptop lid is present on this machine.
Since: 0.9.2
“daemon-version”
property“daemon-version” gchar *
The daemon version.
Flags: Read
Default value: NULL
Since: 0.9.0
“lid-is-closed”
property“lid-is-closed” gboolean
If the laptop lid is closed.
Flags: Read
Default value: FALSE
Since: 0.9.0
“lid-is-present”
property“lid-is-present” gboolean
If a laptop lid is present.
Flags: Read
Default value: FALSE
Since: 0.9.0
“on-battery”
property“on-battery” gboolean
If the computer is on battery power.
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