Top |
UpClient * | up_client_new () |
UpClient * | up_client_new_full () |
void | up_client_new_async () |
UpClient * | up_client_new_finish () |
UpDevice * | up_client_get_display_device () |
char * | up_client_get_critical_action () |
GPtrArray * | up_client_get_devices () |
GPtrArray * | up_client_get_devices2 () |
void | up_client_get_devices_async () |
GPtrArray * | up_client_get_devices_finish () |
const gchar * | up_client_get_daemon_version () |
gboolean | up_client_get_lid_is_closed () |
gboolean | up_client_get_lid_is_present () |
gboolean | up_client_get_on_battery () |
char * | 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
void up_client_new_async (GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously creates a new UpClient object.
This is an asynchronous failable function.
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback to call when the request is satisfied |
|
user_data |
the data to pass to |
Since: 0.99.14
UpClient * up_client_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with up_client_new_async()
.
res |
a GAsyncResult obtained from the GAsyncReadyCallback passed
to |
|
error |
return location for error or |
Since: 0.99.14
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
void up_client_get_devices_async (UpClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously fetches the list of UpDevice objects.
client |
a UpClient instance. |
|
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback to call when the request is satisfied |
|
user_data |
the data to pass to |
Since: 0.99.14
GPtrArray * up_client_get_devices_finish (UpClient *client
,GAsyncResult *res
,GError **error
);
Finishes an operation started with up_client_get_devices_async()
.
client |
a UpClient instance. |
|
res |
a GAsyncResult obtained from the GAsyncReadyCallback passed
to |
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
);
up_client_get_lid_is_closed
is deprecated and should not be used in newly-written code.
Get whether the laptop lid is closed.
Since: 0.9.0
gboolean
up_client_get_lid_is_present (UpClient *client
);
up_client_get_lid_is_present
is deprecated and should not be used in newly-written code.
Get whether a laptop lid is present on this machine.
Since: 0.9.2
“daemon-version”
property “daemon-version” char *
The daemon version.
Owner: UpClient
Flags: Read
Default value: NULL
Since: 0.9.0
“lid-is-closed”
property “lid-is-closed” gboolean
If the laptop lid is closed.
Owner: UpClient
Flags: Read
Default value: FALSE
Since: 0.9.0
“lid-is-present”
property “lid-is-present” gboolean
If a laptop lid is present.
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
“device-removed”
signalvoid user_function (UpClient *client, char *object_path, gpointer user_data)
The ::device-removed signal is emitted when a power device is removed.
Flags: Run Last
Since: 1.0