diff options
author | Richard Hughes <richard@hughsie.com> | 2013-02-12 10:53:49 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2013-02-12 11:08:27 +0000 |
commit | 9843589d2d80e6dc2b3f51338e64bd1da1c53860 (patch) | |
tree | e93621e62b1903064c9029e5c62a8bd60fe0638f | |
parent | 7cc34d457e806f0e8486207f49dc8c6e92dee7df (diff) |
Require applications to define UPOWER_ENABLE_DEPRECATED to use deprecated functionality
This can easily be done by doing #define UPOWER_ENABLE_DEPRECATED before
"#include <upower.h>" or adding -DUPOWER_ENABLE_DEPRECATED to the cflags line in
Makefile.am
See http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html
for more information on future plans and for rationale.
-rw-r--r-- | libupower-glib/Makefile.am | 1 | ||||
-rw-r--r-- | libupower-glib/up-client.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libupower-glib/Makefile.am b/libupower-glib/Makefile.am index 7444f54..5c03409 100644 --- a/libupower-glib/Makefile.am +++ b/libupower-glib/Makefile.am @@ -5,6 +5,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/libupower-glib \ -DUP_COMPILATION \ + -DUPOWER_ENABLE_DEPRECATED \ -DG_LOG_DOMAIN=\"libupower-glib\" \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" diff --git a/libupower-glib/up-client.h b/libupower-glib/up-client.h index 482cd90..17ec7ba 100644 --- a/libupower-glib/up-client.h +++ b/libupower-glib/up-client.h @@ -60,8 +60,10 @@ typedef struct void (*device_removed) (UpClient *client, UpDevice *device); void (*changed) (UpClient *client); + /* FIXME: remove when we next break API */ void (*notify_sleep) (UpClient *client, UpSleepKind sleep_kind); + /* FIXME: remove when we next break API */ void (*notify_resume) (UpClient *client, UpSleepKind sleep_kind); /*< private >*/ @@ -87,6 +89,7 @@ gboolean up_client_get_properties_sync (UpClient *client, gboolean up_client_enumerate_devices_sync (UpClient *client, GCancellable *cancellable, GError **error); +#ifdef UPOWER_ENABLE_DEPRECATED gboolean up_client_suspend_sync (UpClient *client, GCancellable *cancellable, GError **error); @@ -97,16 +100,21 @@ gboolean up_client_about_to_sleep_sync (UpClient *client, gboolean up_client_hibernate_sync (UpClient *client, GCancellable *cancellable, GError **error); +#endif /* accessors */ GPtrArray *up_client_get_devices (UpClient *client); const gchar *up_client_get_daemon_version (UpClient *client); +#ifdef UPOWER_ENABLE_DEPRECATED gboolean up_client_get_can_hibernate (UpClient *client); +#endif gboolean up_client_get_lid_is_closed (UpClient *client); gboolean up_client_get_lid_is_present (UpClient *client); gboolean up_client_get_lid_force_sleep (UpClient *client); gboolean up_client_get_is_docked (UpClient *client); +#ifdef UPOWER_ENABLE_DEPRECATED gboolean up_client_get_can_suspend (UpClient *client); +#endif gboolean up_client_get_on_battery (UpClient *client); gboolean up_client_get_on_low_battery (UpClient *client); |