diff options
author | Richard Hughes <richard@hughsie.com> | 2010-03-30 14:30:05 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2010-03-30 14:30:05 +0100 |
commit | 2d2e69254d85fd74a957ba4940a87ef9637278b8 (patch) | |
tree | c7579d0dcf90d589a44b4b0d8ef23d803c1f90a8 | |
parent | 2c94682f1455a69f532faf8a3bb7e06241e53d8b (diff) |
Add a missing accessor: up_client_get_lid_is_present()
-rw-r--r-- | libupower-glib/up-client.c | 20 | ||||
-rw-r--r-- | libupower-glib/up-client.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c index e92d0e9..1f6802e 100644 --- a/libupower-glib/up-client.c +++ b/libupower-glib/up-client.c @@ -458,6 +458,8 @@ up_client_get_can_hibernate (UpClient *client) * Get whether the laptop lid is closed. * * Return value: %TRUE if lid is closed or %FALSE otherwise. + * + * Since: 0.9.0 */ gboolean up_client_get_lid_is_closed (UpClient *client) @@ -468,6 +470,24 @@ up_client_get_lid_is_closed (UpClient *client) } /** + * up_client_get_lid_is_present: + * @client: a #UpClient instance. + * + * Get whether a laptop lid is present on this machine. + * + * Return value: %TRUE if the machine has a laptop lid + * + * Since: 0.9.2 + */ +gboolean +up_client_get_lid_is_present (UpClient *client) +{ + g_return_val_if_fail (UP_IS_CLIENT (client), FALSE); + up_client_get_properties_sync (client, NULL, NULL); + return client->priv->lid_is_present; +} + +/** * up_client_get_can_suspend: * @client: a #UpClient instance. * diff --git a/libupower-glib/up-client.h b/libupower-glib/up-client.h index 995c5fb..642999b 100644 --- a/libupower-glib/up-client.h +++ b/libupower-glib/up-client.h @@ -98,6 +98,7 @@ GPtrArray *up_client_get_devices (UpClient *client); const gchar *up_client_get_daemon_version (UpClient *client); gboolean up_client_get_can_hibernate (UpClient *client); gboolean up_client_get_lid_is_closed (UpClient *client); +gboolean up_client_get_lid_is_present (UpClient *client); gboolean up_client_get_can_suspend (UpClient *client); gboolean up_client_get_on_battery (UpClient *client); gboolean up_client_get_on_low_battery (UpClient *client); |