path: root/libdevkit-power/dkp-client.h
diff options
authorDavid Zeuthen <>2008-11-11 13:58:26 -0500
committerDavid Zeuthen <>2008-11-11 13:58:26 -0500
commitc9dbc80f367c5f537e96cf634badbae6fa2adc91 (patch)
treeaad708ab3601defd5d0e03a589fdf38c8d812f8c /libdevkit-power/dkp-client.h
parentd34ad4346454b9bf03cd60a5d65fed558e691f43 (diff)
turn some methods into properties
GetOnBattery() -> :on-battery (bool) GetLowBattery() -> :on-low-battery (bool) CanSuspend() -> :can-suspend (bool) CanHibernate() -> :can-hibernate (bool) also add a new property for the daemon version :daemon-version (string) introduce a new Changed() signal that replaces ::LowBatteryChanged() ::OnBatteryChanged() Also fix a few bugs - we need to compute ::on-battery and ::on-low-battery *after* the actual device is updated - need to fire Device::Changed() before Power::DeviceChanged() otherwise devkit-power --monitor-detail lies also fix up libdevkit-power and devkit-power(1) to use these changes.
Diffstat (limited to 'libdevkit-power/dkp-client.h')
1 files changed, 10 insertions, 20 deletions
diff --git a/libdevkit-power/dkp-client.h b/libdevkit-power/dkp-client.h
index 70680d1..2582109 100644
--- a/libdevkit-power/dkp-client.h
+++ b/libdevkit-power/dkp-client.h
@@ -48,36 +48,26 @@ typedef struct
typedef struct
GObjectClass parent_class;
- void (*added) (DkpClient *client,
+ void (*device_added) (DkpClient *client,
const DkpClientDevice *device);
- void (*changed) (DkpClient *client,
+ void (*device_changed) (DkpClient *client,
const DkpClientDevice *device);
- void (*removed) (DkpClient *client,
+ void (*device_removed) (DkpClient *client,
const DkpClientDevice *device);
- void (*on_battery_changed) (DkpClient *client,
+ void (*changed) (DkpClient *client,
gboolean on_battery);
- void (*low_battery_changed) (DkpClient *client,
- gboolean low_battery);
} DkpClientClass;
GType dkp_client_get_type (void) G_GNUC_CONST;
DkpClient *dkp_client_new (void);
GPtrArray *dkp_client_enumerate_devices (DkpClient *client,
GError **error);
-gboolean dkp_client_get_on_battery (DkpClient *client,
- gboolean *on_battery,
- GError **error);
-gboolean dkp_client_get_low_battery (DkpClient *client,
- gboolean *low_battery,
- GError **error);
-gboolean dkp_client_can_suspend (DkpClient *client,
- gboolean interactive,
- gboolean *can_suspend,
- GError **error);
-gboolean dkp_client_can_hibernate (DkpClient *client,
- gboolean interactive,
- gboolean *can_hibernate,
- GError **error);
+const gchar *dkp_client_get_daemon_version (DkpClient *client);
+gboolean dkp_client_can_hibernate (DkpClient *client);
+gboolean dkp_client_can_suspend (DkpClient *client);
+gboolean dkp_client_on_battery (DkpClient *client);
+gboolean dkp_client_on_low_battery (DkpClient *client);