diff options
-rw-r--r-- | devkit-power-gobject/Makefile.am | 1 | ||||
-rw-r--r-- | devkit-power-gobject/dkp-enum.h | 44 | ||||
l--------- | devkit-power-gobject/up-enum.h | 1 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/dummy/Makefile.am | 1 | ||||
-rw-r--r-- | src/freebsd/Makefile.am | 1 | ||||
-rw-r--r-- | src/linux/Makefile.am | 1 | ||||
-rw-r--r-- | src/linux/up-device-csr.c | 2 | ||||
-rw-r--r-- | src/linux/up-device-hid.c | 2 | ||||
-rw-r--r-- | src/linux/up-device-supply.c | 4 | ||||
-rw-r--r-- | src/linux/up-device-wup.c | 2 | ||||
-rw-r--r-- | src/linux/up-input.c | 2 | ||||
-rw-r--r-- | src/up-backend.h | 2 | ||||
-rw-r--r-- | src/up-daemon.h | 2 | ||||
-rw-r--r-- | src/up-device-list.h | 2 | ||||
-rw-r--r-- | src/up-device.c | 2 | ||||
-rw-r--r-- | src/up-history.h | 2 | ||||
-rw-r--r-- | src/up-qos.c | 23 |
18 files changed, 29 insertions, 69 deletions
diff --git a/devkit-power-gobject/Makefile.am b/devkit-power-gobject/Makefile.am index c21b9a4..6b60381 100644 --- a/devkit-power-gobject/Makefile.am +++ b/devkit-power-gobject/Makefile.am @@ -67,7 +67,6 @@ libdevkit_power_gobject_la_CFLAGS = \ EXTRA_DIST = \ up-client.h \ up-device.h \ - up-enum.h \ up-history-obj.h \ up-qos-obj.h \ up-stats-obj.h \ diff --git a/devkit-power-gobject/dkp-enum.h b/devkit-power-gobject/dkp-enum.h index 0f370a1..90b70ce 100644 --- a/devkit-power-gobject/dkp-enum.h +++ b/devkit-power-gobject/dkp-enum.h @@ -72,50 +72,6 @@ typedef enum { DKP_QOS_TYPE_LAST } DkpQosType; -/* compat */ -typedef DkpDeviceType UpDeviceKind; -typedef DkpDeviceState UpDeviceState; -typedef DkpDeviceTechnology UpDeviceTechnology; -typedef DkpQosType UpQosType; -#define up_device_kind_to_text dkp_device_type_to_text -#define up_device_state_to_text dkp_device_state_to_text -#define up_device_technology_to_text dkp_device_technology_to_text -#define up_qos_type_to_text dkp_qos_type_to_text -#define up_device_kind_from_text dkp_device_type_from_text -#define up_device_state_from_text dkp_device_state_from_text -#define up_device_technology_from_text dkp_device_technology_from_text -#define up_qos_type_from_text dkp_qos_type_from_text -#define UP_DEVICE_KIND_UNKNOWN DKP_DEVICE_TYPE_UNKNOWN -#define UP_DEVICE_KIND_LINE_POWER DKP_DEVICE_TYPE_LINE_POWER -#define UP_DEVICE_KIND_BATTERY DKP_DEVICE_TYPE_BATTERY -#define UP_DEVICE_KIND_UPS DKP_DEVICE_TYPE_UPS -#define UP_DEVICE_KIND_MONITOR DKP_DEVICE_TYPE_MONITOR -#define UP_DEVICE_KIND_MOUSE DKP_DEVICE_TYPE_MOUSE -#define UP_DEVICE_KIND_KEYBOARD DKP_DEVICE_TYPE_KEYBOARD -#define UP_DEVICE_KIND_PDA DKP_DEVICE_TYPE_PDA -#define UP_DEVICE_KIND_PHONE DKP_DEVICE_TYPE_PHONE -#define UP_DEVICE_KIND_LAST DKP_DEVICE_TYPE_LAST -#define UP_DEVICE_STATE_UNKNOWN DKP_DEVICE_STATE_UNKNOWN -#define UP_DEVICE_STATE_CHARGING DKP_DEVICE_STATE_CHARGING -#define UP_DEVICE_STATE_DISCHARGING DKP_DEVICE_STATE_DISCHARGING -#define UP_DEVICE_STATE_EMPTY DKP_DEVICE_STATE_EMPTY -#define UP_DEVICE_STATE_FULLY_CHARGED DKP_DEVICE_STATE_FULLY_CHARGED -#define UP_DEVICE_STATE_PENDING_CHARGE DKP_DEVICE_STATE_PENDING_CHARGE -#define UP_DEVICE_STATE_PENDING_DISCHARGE DKP_DEVICE_STATE_PENDING_DISCHARGE -#define UP_DEVICE_STATE_LAST DKP_DEVICE_STATE_LAST -#define UP_DEVICE_TECHNOLOGY_UNKNOWN DKP_DEVICE_TECHNOLOGY_UNKNOWN -#define UP_DEVICE_TECHNOLOGY_LITHIUM_ION DKP_DEVICE_TECHNOLOGY_LITHIUM_ION -#define UP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER DKP_DEVICE_TECHNOLOGY_LITHIUM_POLYMER -#define UP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE DKP_DEVICE_TECHNOLOGY_LITHIUM_IRON_PHOSPHATE -#define UP_DEVICE_TECHNOLOGY_LEAD_ACID DKP_DEVICE_TECHNOLOGY_LEAD_ACID -#define UP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM DKP_DEVICE_TECHNOLOGY_NICKEL_CADMIUM -#define UP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE DKP_DEVICE_TECHNOLOGY_NICKEL_METAL_HYDRIDE -#define UP_DEVICE_TECHNOLOGY_LAST DKP_DEVICE_TECHNOLOGY_LAST -#define UP_QOS_KIND_UNKNOWN DKP_QOS_TYPE_UNKNOWN -#define UP_QOS_KIND_NETWORK DKP_QOS_TYPE_NETWORK -#define UP_QOS_KIND_CPU_DMA DKP_QOS_TYPE_CPU_DMA -#define UP_QOS_KIND_LAST DKP_QOS_TYPE_LAST - const gchar *dkp_device_type_to_text (DkpDeviceType type_enum); const gchar *dkp_device_state_to_text (DkpDeviceState state_enum); const gchar *dkp_device_technology_to_text (DkpDeviceTechnology technology_enum); diff --git a/devkit-power-gobject/up-enum.h b/devkit-power-gobject/up-enum.h deleted file mode 120000 index 7732128..0000000 --- a/devkit-power-gobject/up-enum.h +++ /dev/null @@ -1 +0,0 @@ -dkp-enum.h
\ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index 4fb06c5..9a04709 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,6 +25,7 @@ INCLUDES = \ $(GLIB_CFLAGS) DEVKIT_POWER_LIBS = $(top_builddir)/devkit-power-gobject/libdevkit-power-gobject.la +UPOWER_LIBS = $(top_builddir)/libupower-glib/libupower-glib.la BUILT_SOURCES = \ up-daemon-glue.h \ @@ -93,7 +94,8 @@ upowerd_LDADD = \ $(USB_LIBS) \ $(GIO_LIBS) \ $(DBUS_GLIB_LIBS) \ - $(POLKIT_LIBS) + $(POLKIT_LIBS) \ + $(UPOWER_LIBS) if BACKEND_TYPE_DUMMY upowerd_LDADD += \ diff --git a/src/dummy/Makefile.am b/src/dummy/Makefile.am index d2bc86a..bcfe937 100644 --- a/src/dummy/Makefile.am +++ b/src/dummy/Makefile.am @@ -5,6 +5,7 @@ INCLUDES = \ -DUP_COMPILATION \ -DEGG_TEST \ -I$(top_srcdir)/devkit-power-gobject \ + -I$(top_srcdir)/libupower-glib \ $(DBUS_GLIB_CFLAGS) \ $(POLKIT_CFLAGS) \ $(GLIB_CFLAGS) diff --git a/src/freebsd/Makefile.am b/src/freebsd/Makefile.am index 2bd456c..c524522 100644 --- a/src/freebsd/Makefile.am +++ b/src/freebsd/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ -I$(top_builddir)/src -I$(top_srcdir)/src \ -DUP_COMPILATION \ -I$(top_srcdir)/devkit-power-gobject \ + -I$(top_srcdir)/libupower-glib \ $(DBUS_GLIB_CFLAGS) \ $(POLKIT_CFLAGS) \ $(GLIB_CFLAGS) diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am index 2ab4dbb..e6d9630 100644 --- a/src/linux/Makefile.am +++ b/src/linux/Makefile.am @@ -5,6 +5,7 @@ INCLUDES = \ -DUP_COMPILATION \ -DG_UDEV_API_IS_SUBJECT_TO_CHANGE \ -I$(top_srcdir)/devkit-power-gobject \ + -I$(top_srcdir)/libupower-glib \ $(GIO_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(GUDEV_CFLAGS) \ diff --git a/src/linux/up-device-csr.c b/src/linux/up-device-csr.c index 209cd6d..3853258 100644 --- a/src/linux/up-device-csr.c +++ b/src/linux/up-device-csr.c @@ -37,7 +37,7 @@ #include "sysfs-utils.h" #include "egg-debug.h" -#include "up-enum.h" +#include "up-types.h" #include "up-device-csr.h" #define UP_DEVICE_CSR_REFRESH_TIMEOUT 30L diff --git a/src/linux/up-device-hid.c b/src/linux/up-device-hid.c index 2c18134..98ef795 100644 --- a/src/linux/up-device-hid.c +++ b/src/linux/up-device-hid.c @@ -50,7 +50,7 @@ #include "sysfs-utils.h" #include "egg-debug.h" -#include "up-enum.h" +#include "up-types.h" #include "up-device-hid.h" #define UP_DEVICE_HID_REFRESH_TIMEOUT 30l diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 821dff4..bb0c75e 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -36,7 +36,7 @@ #include "sysfs-utils.h" #include "egg-debug.h" -#include "up-enum.h" +#include "up-types.h" #include "up-device-supply.h" #define UP_DEVICE_SUPPLY_REFRESH_TIMEOUT 30 /* seconds */ @@ -626,7 +626,7 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) /* print what we did */ egg_debug ("guessing battery state '%s' using global on-battery:%i", - up_device_state_to_text (state), on_battery); + up_device_state_to_string (state), on_battery); g_object_unref (daemon); } diff --git a/src/linux/up-device-wup.c b/src/linux/up-device-wup.c index b8a180a..4f00634 100644 --- a/src/linux/up-device-wup.c +++ b/src/linux/up-device-wup.c @@ -44,7 +44,7 @@ #include "sysfs-utils.h" #include "egg-debug.h" -#include "up-enum.h" +#include "up-types.h" #include "up-device-wup.h" #define UP_DEVICE_WUP_REFRESH_TIMEOUT 10 /* seconds */ diff --git a/src/linux/up-input.c b/src/linux/up-input.c index ab886db..2cd6ec8 100644 --- a/src/linux/up-input.c +++ b/src/linux/up-input.c @@ -42,7 +42,7 @@ #include "sysfs-utils.h" #include "egg-debug.h" -#include "up-enum.h" +#include "up-types.h" #include "up-daemon.h" #include "up-input.h" #include "up-daemon.h" diff --git a/src/up-backend.h b/src/up-backend.h index 0b3523e..c2d3fcc 100644 --- a/src/up-backend.h +++ b/src/up-backend.h @@ -24,7 +24,7 @@ #include <glib-object.h> -#include "up-enum.h" +#include "up-types.h" #include "up-device.h" #include "up-daemon.h" diff --git a/src/up-daemon.h b/src/up-daemon.h index b5169cb..9361ae8 100644 --- a/src/up-daemon.h +++ b/src/up-daemon.h @@ -25,7 +25,7 @@ #include <polkit/polkit.h> #include <dbus/dbus-glib.h> -#include "up-enum.h" +#include "up-types.h" #include "up-device-list.h" G_BEGIN_DECLS diff --git a/src/up-device-list.h b/src/up-device-list.h index 8f1da9c..709c893 100644 --- a/src/up-device-list.h +++ b/src/up-device-list.h @@ -24,7 +24,7 @@ #include <glib-object.h> -#include "up-enum.h" +#include "up-types.h" G_BEGIN_DECLS diff --git a/src/up-device.c b/src/up-device.c index 5ace215..326de3f 100644 --- a/src/up-device.c +++ b/src/up-device.c @@ -795,7 +795,7 @@ up_device_compute_object_path (UpDevice *device) const gchar *type; guint i; - type = up_device_kind_to_text (device->priv->type); + type = up_device_kind_to_string (device->priv->type); native_path = device->priv->native_path; basename = g_path_get_basename (native_path); id = g_strjoin ("_", type, basename, NULL); diff --git a/src/up-history.h b/src/up-history.h index d18dae3..f29879a 100644 --- a/src/up-history.h +++ b/src/up-history.h @@ -24,7 +24,7 @@ #include <glib-object.h> -#include "up-enum.h" +#include "up-types.h" G_BEGIN_DECLS diff --git a/src/up-qos.c b/src/up-qos.c index e6a5b0d..d4d610e 100644 --- a/src/up-qos.c +++ b/src/up-qos.c @@ -40,6 +40,7 @@ #include "up-polkit.h" #include "up-qos-obj.h" #include "up-qos-glue.h" +#include "up-types.h" static void up_qos_finalize (GObject *object); @@ -121,7 +122,7 @@ up_qos_generate_cookie (UpQos *qos) * up_qos_get_lowest: **/ static gint -up_qos_get_lowest (UpQos *qos, UpQosType type) +up_qos_get_lowest (UpQos *qos, UpQosKind type) { guint i; gint lowest = G_MAXINT; @@ -153,7 +154,7 @@ up_qos_get_lowest (UpQos *qos, UpQosType type) * up_qos_latency_write: **/ static gboolean -up_qos_latency_write (UpQos *qos, UpQosType type, gint value) +up_qos_latency_write (UpQos *qos, UpQosKind type, gint value) { gchar *text = NULL; gint retval; @@ -187,7 +188,7 @@ out: * up_qos_latency_perhaps_changed: **/ static gboolean -up_qos_latency_perhaps_changed (UpQos *qos, UpQosType type) +up_qos_latency_perhaps_changed (UpQos *qos, UpQosKind type) { gint lowest; gint *last; @@ -206,7 +207,7 @@ up_qos_latency_perhaps_changed (UpQos *qos, UpQosType type) up_qos_latency_write (qos, type, lowest); /* emit signal */ - g_signal_emit (qos, signals [LATENCY_CHANGED], 0, up_qos_type_to_text (type), lowest); + g_signal_emit (qos, signals [LATENCY_CHANGED], 0, up_qos_kind_to_string (type), lowest); *last = lowest; return TRUE; } @@ -252,10 +253,10 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean gint pid; PolkitSubject *subject = NULL; gboolean retval; - UpQosType type; + UpQosKind type; /* get correct data */ - type = up_qos_type_from_text (type_text); + type = up_qos_kind_from_string (type_text); if (type == UP_QOS_KIND_UNKNOWN) { error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text); dbus_g_method_return_error (context, error); @@ -407,10 +408,10 @@ out: gboolean up_qos_get_latency (UpQos *qos, const gchar *type_text, gint *value, GError **error) { - UpQosType type; + UpQosKind type; /* get correct data */ - type = up_qos_type_from_text (type_text); + type = up_qos_kind_from_string (type_text); if (type == UP_QOS_KIND_UNKNOWN) { g_set_error (error, UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text); return FALSE; @@ -427,11 +428,11 @@ up_qos_get_latency (UpQos *qos, const gchar *type_text, gint *value, GError **er void up_qos_set_minimum_latency (UpQos *qos, const gchar *type_text, gint value, DBusGMethodInvocation *context) { - UpQosType type; + UpQosKind type; GError *error; /* type valid? */ - type = up_qos_type_from_text (type_text); + type = up_qos_kind_from_string (type_text); if (type == UP_QOS_KIND_UNKNOWN) { error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text); dbus_g_method_return_error (context, error); @@ -471,7 +472,7 @@ up_qos_get_latency_requests (UpQos *qos, GPtrArray **requests, GError **error) 3, obj->cmdline, 4, 0, //obj->timespec, 5, obj->persistent, - 6, up_qos_type_to_text (obj->type), + 6, up_qos_kind_to_string (obj->type), 7, obj->value, G_MAXUINT); g_ptr_array_add (*requests, g_value_get_boxed (&elem)); |