From c108a8e8a4126a0e0c13fd3022e71fca8e3bdd31 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 30 May 2015 19:59:13 -0700 Subject: Share generated code between daemon and library Since we use the same GDBus code in libupower-glib and the daemon, auto-generate a private library that can be used by both. --- Makefile.am | 2 +- configure.ac | 1 + dbus/Makefile.am | 64 +++ dbus/org.freedesktop.UPower.Device.xml | 717 +++++++++++++++++++++++++++ dbus/org.freedesktop.UPower.KbdBacklight.xml | 101 ++++ dbus/org.freedesktop.UPower.Wakeups.xml | 131 +++++ dbus/org.freedesktop.UPower.xml | 204 ++++++++ doc/dbus/Makefile.am | 8 +- libupower-glib/Makefile.am | 47 +- libupower-glib/up-client.c | 50 +- libupower-glib/up-device.c | 232 ++++----- libupower-glib/up-wakeups.c | 34 +- src/Makefile.am | 52 +- src/org.freedesktop.UPower.Device.xml | 717 --------------------------- src/org.freedesktop.UPower.KbdBacklight.xml | 101 ---- src/org.freedesktop.UPower.Wakeups.xml | 131 ----- src/org.freedesktop.UPower.xml | 204 -------- 17 files changed, 1389 insertions(+), 1407 deletions(-) create mode 100644 dbus/Makefile.am create mode 100644 dbus/org.freedesktop.UPower.Device.xml create mode 100644 dbus/org.freedesktop.UPower.KbdBacklight.xml create mode 100644 dbus/org.freedesktop.UPower.Wakeups.xml create mode 100644 dbus/org.freedesktop.UPower.xml delete mode 100644 src/org.freedesktop.UPower.Device.xml delete mode 100644 src/org.freedesktop.UPower.KbdBacklight.xml delete mode 100644 src/org.freedesktop.UPower.Wakeups.xml delete mode 100644 src/org.freedesktop.UPower.xml diff --git a/Makefile.am b/Makefile.am index b2e6693..746dd53 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -SUBDIRS = etc libupower-glib src doc tools po +SUBDIRS = etc dbus libupower-glib src doc tools po if BACKEND_TYPE_LINUX SUBDIRS += rules diff --git a/configure.ac b/configure.ac index 8895721..8a9d889 100644 --- a/configure.ac +++ b/configure.ac @@ -242,6 +242,7 @@ AC_CONFIG_FILES([ Makefile upower-glib.pc etc/Makefile +dbus/Makefile src/Makefile src/dummy/Makefile src/freebsd/Makefile diff --git a/dbus/Makefile.am b/dbus/Makefile.am new file mode 100644 index 0000000..017c7eb --- /dev/null +++ b/dbus/Makefile.am @@ -0,0 +1,64 @@ +noinst_LTLIBRARIES=libupower-dbus.la + +AM_CPPFLAGS = \ + $(GIO_CFLAGS) \ + $(GIO_UNIX_CFLAGS) \ + $(GLIB_CFLAGS) + +libupower_dbus_la_LIBADD = \ + $(GIO_LIBS) \ + $(GIO_UNIX_LIBS) \ + $(GLIB_LIBS) + +BUILT_SOURCES = \ + up-daemon-generated.h \ + up-daemon-generated.c \ + up-device-generated.h \ + up-device-generated.c \ + up-kbd-backlight-generated.h \ + up-kbd-backlight-generated.c \ + up-wakeups-generated.h \ + up-wakeups-generated.c + +libupower_dbus_la_SOURCES = $(BUILT_SOURCES) + +up-daemon-generated.h: org.freedesktop.UPower.xml Makefile.am + $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower. \ + --generate-c-code up-daemon-generated \ + --c-namespace Up \ + --annotate "org.freedesktop.UPower" "org.gtk.GDBus.C.Name" ExportedDaemon \ + $(srcdir)/org.freedesktop.UPower.xml +up-daemon-generated.c: up-daemon-generated.h + +up-device-generated.h: org.freedesktop.UPower.Device.xml Makefile.am + $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.Device. \ + --generate-c-code up-device-generated \ + --c-namespace Up \ + --annotate "org.freedesktop.UPower.Device" "org.gtk.GDBus.C.Name" ExportedDevice \ + $(srcdir)/org.freedesktop.UPower.Device.xml +up-device-generated.c: up-device-generated.h + +up-kbd-backlight-generated.h: org.freedesktop.UPower.KbdBacklight.xml Makefile.am + $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.KbdBacklight. \ + --generate-c-code up-kbd-backlight-generated \ + --c-namespace Up \ + --annotate "org.freedesktop.UPower.KbdBacklight" "org.gtk.GDBus.C.Name" ExportedKbdBacklight \ + $(srcdir)/org.freedesktop.UPower.KbdBacklight.xml +up-kbd-backlight-generated.c: up-kbd-backlight-generated.h + +up-wakeups-generated.h: org.freedesktop.UPower.Wakeups.xml Makefile.am + $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.Wakeups. \ + --generate-c-code up-wakeups-generated \ + --c-namespace Up \ + --annotate "org.freedesktop.UPower.Wakeups" "org.gtk.GDBus.C.Name" ExportedWakeups \ + $(srcdir)/org.freedesktop.UPower.Wakeups.xml +up-wakeups-generated.c: up-wakeups-generated.h + +dbusifdir = $(datadir)/dbus-1/interfaces +dist_dbusif_DATA = \ + org.freedesktop.UPower.xml \ + org.freedesktop.UPower.Device.xml \ + org.freedesktop.UPower.KbdBacklight.xml \ + org.freedesktop.UPower.Wakeups.xml + +-include $(top_srcdir)/git.mk diff --git a/dbus/org.freedesktop.UPower.Device.xml b/dbus/org.freedesktop.UPower.Device.xml new file mode 100644 index 0000000..8ce9c15 --- /dev/null +++ b/dbus/org.freedesktop.UPower.Device.xml @@ -0,0 +1,717 @@ + +]> + + + + + + Objects implementing this interface are usually discovered through + the org.freedesktop.UPower interface on + the /org/freedesktop/UPower object on + the D-Bus system bus service with the well-known + name org.freedesktop.UPower using + the + EnumerateDevices + method. + + + + +$ dbus-send --print-reply \ + --system \ + --dest=org.freedesktop.UPower \ + /org/freedesktop/UPower/devices/battery_BAT0 \ + org.freedesktop.DBus.Properties.GetAll \ + string:org.freedesktop.UPower.Device + +method return sender=:1.386 -> dest=:1.477 reply_serial=2 + array [ + dict entry( + string "native-path" + variant string "/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0" + ) + dict entry( + string "vendor" + variant string "SONY" + ) + dict entry( + string "model" + variant string "42T4568" + ) + dict entry( + string "serial" + variant string "4179" + ) + dict entry( + string "update-time" + variant uint64 1226417875 + ) + dict entry( + string "type" + variant uint 2 + ) + dict entry( + string "power-supply" + variant boolean true + ) + dict entry( + string "has-history" + variant boolean true + ) + dict entry( + string "has-statistics" + variant boolean true + ) + dict entry( + string "online" + variant boolean false + ) + dict entry( + string "energy" + variant double 72.85 + ) + dict entry( + string "energy-empty" + variant double 0 + ) + dict entry( + string "energy-full" + variant double 74.55 + ) + dict entry( + string "energy-full-design" + variant double 74.88 + ) + dict entry( + string "energy-rate" + variant double 0 + ) + dict entry( + string "voltage" + variant double 16.415 + ) + dict entry( + string "time-to-empty" + variant int64 0 + ) + dict entry( + string "time-to-full" + variant int64 0 + ) + dict entry( + string "percentage" + variant double 97.7197 + ) + dict entry( + string "is-present" + variant boolean true + ) + dict entry( + string "state" + variant uint 3 + ) + dict entry( + string "is-rechargeable" + variant boolean true + ) + dict entry( + string "capacity" + variant double 100 + ) + dict entry( + string "technology" + variant uint 1 + ) + ] + + + + + Unless otherwise noted, an empty string or the value 0 in a + property on this interface means not set. + + + + + + + + + + + + Refreshes the data collected from the power source. + + + Callers need the org.freedesktop.upower.refresh-power-source authorization + + if an error occured while refreshing + + + + + + + + + The type of history. + Valid types are rate or charge. + + + The amount of data to return in seconds, or 0 for all. + + + + + The approximate number of points to return. + A higher resolution is more accurate, at the expense of plotting speed. + + + + + + The history data for the power device, if the device supports history. + Data is ordered from the earliest in time, to the newest data point. + Each element contains the following members: + + + time + + The time value in seconds from the gettimeofday() method. + + + + value + + The data value, for instance the rate in W or the charge in %. + + + + state + + The state of the device, for instance charging or + discharging. + + + + + + + + + Gets history for the power device that is persistent across reboots. + + + + + + + + + + The mode for the statistics. + Valid types are charging or discharging. + + + + The statistics data for the power device. + Each element contains the following members: + + + value + + The value of the percentage point, usually in seconds + + + + accuracy + + The accuracy of the prediction in percent. + + + + + + + + + Gets statistics for the power device that may be interesting + to show on a graph in the session. + + + + + + + + + + + OS specific native path of the power source. On Linux this + is the sysfs path, for + example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. Is + blank if the device is being driven by a user space + driver. + + + + + + + + + + Name of the vendor of the battery. + + + + + + + + + + Name of the model of this battery. + + + + + + + + + + Unique serial number of the battery. + + + + + + + + + + The point in time (seconds since the Epoch Jan 1, 1970 + 0:00 UTC) that data was read from the power source. + + + + + + + + + + Type of power source. + + + + 0Unknown + + + 1Line Power + + + 2Battery + + + 3Ups + + + 4Monitor + + + 5Mouse + + + 6Keyboard + + + 7Pda + + + 8Phone + + + + + + + + + + + If the power device is used to supply the system. + This would be set TRUE for laptop batteries and UPS devices, + but set FALSE for wireless mice or PDAs. + + + + + + + + + + If the power device has history. + + + + + + + + + + If the power device has statistics. + + + + + + + + + + Whether power is currently being provided through line power. + This property is only valid if the property + type + has the value "line-power". + + + + + + + + + + Amount of energy (measured in Wh) currently available in + the power source. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Amount of energy (measured in Wh) in the power source when + it's considered to be empty. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Amount of energy (measured in Wh) in the power source when + it's considered full. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Amount of energy (measured in Wh) the power source is + designed to hold when it's considered full. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Amount of energy being drained from the source, measured + in W. If positive, the source is being discharged, if + negative it's being charged. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Voltage in the Cell or being recorded by the meter. + + + + + + + + + + Luminosity being recorded by the meter. + + + + + + + + + + Number of seconds until the power source is considered empty. + Is set to 0 if unknown. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Number of seconds until the power source is considered full. + Is set to 0 if unknown. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + The amount of energy left in the power source expressed as + a percentage between 0 and 100. Typically this is the same as + (energy - + energy-empty) / + (energy-full - + energy-empty). + However, some primitive power sources are capable of only + reporting percentages and in this case the energy-* + properties will be unset while this property is set. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + The temperature of the device in degrees Celsius. This property is + only valid if the property + type + has the value "battery". + + + + + + + + + + If the power source is present in the bay. + This field is required as some batteries are hot-removable, for example + expensive UPS and most laptop batteries. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + The battery power state. + + + + 0Unknown + + + 1Charging + + + 2Discharging + + + 3Empty + + + 4Fully charged + + + 5Pending charge + + + 6Pending discharge + + + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + If the power source is rechargeable. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + The capacity of the power source expressed as a percentage between 0 and 100. + The capacity of the battery will reduce with age. + A capacity value less than 75% is usually a sign that you should renew your battery. + Typically this value is the same as + (full-design / + full) * 100. + However, some primitive power sources are not capable reporting capacity + and in this case the capacity property will be unset. + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Technology used in the battery: + + + + 0Unknown + + + 1Lithium ion + + + 2Lithium polymer + + + 3Lithium iron phosphate + + + 4Lead acid + + + 5Nickel cadmium + + + 6Nickel metal hydride + + + + This property is only valid if the property + type + has the value "battery". + + + + + + + + + + Warning level of the battery: + + + + 0Unknown + + + 1None + + + 2Discharging (only for UPSes) + + + 3Low + + + 4Critical + + + 5Action + + + + + + + + + + + An icon name, following the Icon Naming Specification + + + + + + + diff --git a/dbus/org.freedesktop.UPower.KbdBacklight.xml b/dbus/org.freedesktop.UPower.KbdBacklight.xml new file mode 100644 index 0000000..994380f --- /dev/null +++ b/dbus/org.freedesktop.UPower.KbdBacklight.xml @@ -0,0 +1,101 @@ + +]> + + + + + + org.freedesktop.UPower.KbdBacklight is a DBus interface implemented + by UPower. + It allows the keyboard backlight (if present) to be controlled. + + + + + + + + + + The maximum value of the keyboard backlight brightness. + + + + + + + Get the maximum brightness level for the keyboard backlight. + + + + if an error occured while getting the maximum brightness + + + + + + + + + + The current value of the keyboard backlight brightness. + + + + + + + Get the brightness level of the keyboard backlight. + + + + if an error occured while getting the brightness + + + + + + + + + + The value to set the KbdBacklight brightness. + + + + + + + Set the brightness level of the keyboard backlight. + + + + if an error occured while setting the brightness + + + + + + + + + + The new brightness value of the keyboard backlight. + + + + + + + The keyboard backlight brightness level has changed. + + + + + + + + diff --git a/dbus/org.freedesktop.UPower.Wakeups.xml b/dbus/org.freedesktop.UPower.Wakeups.xml new file mode 100644 index 0000000..7faa126 --- /dev/null +++ b/dbus/org.freedesktop.UPower.Wakeups.xml @@ -0,0 +1,131 @@ + +]> + + + + + + org.freedesktop.UPower.Wakeups is a DBus interface implemented + by UPower. + It allows applications to watch what applications and drivers are + causing the wakeups on the system. + + + + + + + + + If the system has the ability to profile wakeups. + + + + + + + + + + + The number of wakeups per second. + + + + + + + Get the number of wakeups per second. + + + + if an error occured while getting the latency + + + + + + + + + + The number of wakeups per second. + + + + + + + The number of wakeups per second has changed. + + + + + + + + + + + The data of all the processes and drivers which contribute to the + wakeups on the system. + + + is_userspace + + If the wakeup is from userspace. + + + + id + + The process ID of the application, or the IRQ for kernel drivers. + + + + value + + The number of wakeups per second. + + + + cmdline + + The command line for the application, or NULL for kernel drivers. + + + + details + + The details about the wakeup. + + + + + + + + + Gets all the wakeups from drivers and applications. + + + + + + + + + + + The wakeup data has changed. + + + + + + + + diff --git a/dbus/org.freedesktop.UPower.xml b/dbus/org.freedesktop.UPower.xml new file mode 100644 index 0000000..c376521 --- /dev/null +++ b/dbus/org.freedesktop.UPower.xml @@ -0,0 +1,204 @@ + + + + + + + + The UPower service is available via the system message + bus. To access the service, use + the org.freedesktop.UPower interface on + the /org/freedesktop/UPower object on + the D-Bus system bus service with the well-known + name org.freedesktop.UPower. + + + + +$ dbus-send --print-reply \ + --system \ + --dest=org.freedesktop.UPower \ + /org/freedesktop/UPower \ + org.freedesktop.UPower.EnumerateDevices + +method return sender=:1.386 -> dest=:1.451 reply_serial=2 + array [ + object path "/org/freedesktop/UPower/devices/line_power_AC" + object path "/org/freedesktop/UPower/devices/battery_BAT0" + ] + + + + + + + + + + + + An array of object paths for devices. + + + + + + Enumerate all power objects on the system. + + + + + + + + + An object path for the "display device. + + + + + + Get the object to the "display device", a composite device that represents the + status icon to show in desktop environments. You can also access the object directly + as its path is guaranteed to be /org/freedesktop/UPower/devices/DisplayDevice. + The following standard org.freedesktop.UPower.Device + properties will be defined (only IsPresent takes a special meaning): + + + Typethe type of the display device, UPS or Battery. Note that this value can change, as opposed to real devices. + + + Statethe power state of the display device, such as Charging or Discharging. + + + Percentagethe amount of energy left on the device. + + + EnergyAmount of energy (measured in Wh) currently available in the power source. + + + EnergyFullAmount of energy (measured in Wh) in the power source when it's considered full. + + + EnergyRateAmount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged. + + + TimeToEmptyNumber of seconds until the power source is considered empty. + + + TimeToFullNumber of seconds until the power source is considered full. + + + IsPresentWhether a status icon using this information should be presented. + + + IconNameAn icon name representing the device state. + + + WarningLevelThe same as the overall WarningLevel + + + + + + + + + + + A string representing the critical action configured and available. + + + + + + When the system's power supply is critical (critically low batteries or UPS), + the system will take this action. Possible values are: + + + HybridSleep + + + Hibernate + + + PowerOff + + + + + + + + + + + + Object path of device that was added. + + + + + + Emitted when a device is added. + + + + + + + + + + Object path of device that was removed. + + + + + + Emitted when a device is removed. + + + + + + + + + + Version of the running daemon, e.g. 002. + + + + + + Indicates whether the system is running on battery power. + This property is provided for convenience. + + + + + + + + Indicates if the laptop lid is closed where the display cannot be seen. + + + + + + + + + + If the system has a lid device. + + + + + + + + diff --git a/doc/dbus/Makefile.am b/doc/dbus/Makefile.am index 4ac2710..78c12fb 100644 --- a/doc/dbus/Makefile.am +++ b/doc/dbus/Makefile.am @@ -1,19 +1,19 @@ all : org.freedesktop.UPower.ref.xml org.freedesktop.UPower.Device.ref.xml org.freedesktop.UPower.KbdBacklight.ref.xml org.freedesktop.UPower.Wakeups.ref.xml -org.freedesktop.UPower.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl +org.freedesktop.UPower.ref.xml : $(top_srcdir)/dbus/org.freedesktop.UPower.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl echo """" > $@ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ -org.freedesktop.UPower.Device.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.Device.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl +org.freedesktop.UPower.Device.ref.xml : $(top_srcdir)/dbus/org.freedesktop.UPower.Device.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl echo """" > $@ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ -org.freedesktop.UPower.KbdBacklight.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.KbdBacklight.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl +org.freedesktop.UPower.KbdBacklight.ref.xml : $(top_srcdir)/dbus/org.freedesktop.UPower.KbdBacklight.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl echo """" > $@ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ -org.freedesktop.UPower.Wakeups.ref.xml : $(top_srcdir)/src/org.freedesktop.UPower.Wakeups.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl +org.freedesktop.UPower.Wakeups.ref.xml : $(top_srcdir)/dbus/org.freedesktop.UPower.Wakeups.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl echo """" > $@ $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ diff --git a/libupower-glib/Makefile.am b/libupower-glib/Makefile.am index 8b1d4ad..efa47fa 100644 --- a/libupower-glib/Makefile.am +++ b/libupower-glib/Makefile.am @@ -3,6 +3,7 @@ AM_CPPFLAGS = \ $(GIO_UNIX_CFLAGS) \ -I$(top_builddir) \ -I$(top_srcdir) \ + -I$(top_srcdir)/dbus \ -I$(top_srcdir)/libupower-glib \ -DUP_COMPILATION \ -DG_LOG_DOMAIN=\"libupower-glib\" \ @@ -14,44 +15,6 @@ INTROSPECTION_GIRS = INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) -BUILT_SOURCES = $(NULL) - -up_client_dbus_built_sources = up-client-glue.c up-client-glue.h -BUILT_SOURCES += $(up_client_dbus_built_sources) - -$(up_client_dbus_built_sources) : Makefile.am $(top_srcdir)/src/org.freedesktop.UPower.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix org.freedesktop.UPower. \ - --generate-c-code up-client-glue \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower" \ - "org.gtk.GDBus.C.Name" ClientGlue \ - $(top_srcdir)/src/org.freedesktop.UPower.xml - -up_device_dbus_built_sources = up-device-glue.c up-device-glue.h -BUILT_SOURCES += $(up_device_dbus_built_sources) - -$(up_device_dbus_built_sources) : Makefile.am $(top_srcdir)/src/org.freedesktop.UPower.Device.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix org.freedesktop.UPower.Device. \ - --generate-c-code up-device-glue \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower.Device" \ - "org.gtk.GDBus.C.Name" DeviceGlue \ - $(top_srcdir)/src/org.freedesktop.UPower.Device.xml - -up_wakeups_dbus_built_sources = up-wakeups-glue.c up-wakeups-glue.h -BUILT_SOURCES += $(up_wakeups_dbus_built_sources) - -$(up_wakeups_dbus_built_sources) : Makefile.am $(top_srcdir)/src/org.freedesktop.UPower.Wakeups.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix org.freedesktop.UPower.Wakeups. \ - --generate-c-code up-wakeups-glue \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower.Wakeups" \ - "org.gtk.GDBus.C.Name" WakeupsGlue \ - $(top_srcdir)/src/org.freedesktop.UPower.Wakeups.xml - lib_LTLIBRARIES = \ libupower-glib.la @@ -74,15 +37,13 @@ libupower_glib_la_SOURCES = \ up-wakeup-item.c \ up-stats-item.c \ up-history-item.c \ - up-device.c \ - $(up_client_dbus_built_sources) \ - $(up_device_dbus_built_sources) \ - $(up_wakeups_dbus_built_sources) + up-device.c libupower_glib_la_LIBADD = \ $(INTLLIBS) \ $(GLIB_LIBS) \ - $(GIO_UNIX_LIBS) + $(GIO_UNIX_LIBS) \ + $(top_builddir)/dbus/libupower-dbus.la libupower_glib_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c index 4780aa5..5b2218f 100644 --- a/libupower-glib/up-client.c +++ b/libupower-glib/up-client.c @@ -36,7 +36,7 @@ #include #include "up-client.h" -#include "up-client-glue.h" +#include "up-daemon-generated.h" #include "up-device.h" static void up_client_class_init (UpClientClass *klass); @@ -52,7 +52,7 @@ static void up_client_finalize (GObject *object); **/ struct _UpClientPrivate { - UpClientGlue *proxy; + UpExportedDaemon *proxy; }; enum { @@ -95,10 +95,10 @@ up_client_get_devices (UpClient *client) g_return_val_if_fail (UP_IS_CLIENT (client), NULL); - if (up_client_glue_call_enumerate_devices_sync (client->priv->proxy, - &devices, - NULL, - &error) == FALSE) { + if (up_exported_daemon_call_enumerate_devices_sync (client->priv->proxy, + &devices, + NULL, + &error) == FALSE) { g_warning ("up_client_get_devices failed: %s", error->message); g_error_free (error); return NULL; @@ -166,9 +166,9 @@ up_client_get_critical_action (UpClient *client) char *action; g_return_val_if_fail (UP_IS_CLIENT (client), NULL); - if (!up_client_glue_call_get_critical_action_sync (client->priv->proxy, - &action, - NULL, NULL)) { + if (!up_exported_daemon_call_get_critical_action_sync (client->priv->proxy, + &action, + NULL, NULL)) { return NULL; } return action; @@ -188,7 +188,7 @@ const gchar * up_client_get_daemon_version (UpClient *client) { g_return_val_if_fail (UP_IS_CLIENT (client), NULL); - return up_client_glue_get_daemon_version (client->priv->proxy); + return up_exported_daemon_get_daemon_version (client->priv->proxy); } /** @@ -205,7 +205,7 @@ gboolean up_client_get_lid_is_closed (UpClient *client) { g_return_val_if_fail (UP_IS_CLIENT (client), FALSE); - return up_client_glue_get_lid_is_closed (client->priv->proxy); + return up_exported_daemon_get_lid_is_closed (client->priv->proxy); } /** @@ -222,7 +222,7 @@ gboolean up_client_get_lid_is_present (UpClient *client) { g_return_val_if_fail (UP_IS_CLIENT (client), FALSE); - return up_client_glue_get_lid_is_present (client->priv->proxy); + return up_exported_daemon_get_lid_is_present (client->priv->proxy); } /** @@ -239,7 +239,7 @@ gboolean up_client_get_on_battery (UpClient *client) { g_return_val_if_fail (UP_IS_CLIENT (client), FALSE); - return up_client_glue_get_on_battery (client->priv->proxy); + return up_exported_daemon_get_on_battery (client->priv->proxy); } /* @@ -281,7 +281,7 @@ up_client_notify_cb (GObject *gobject, * up_client_added_cb: */ static void -up_device_added_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *client) +up_device_added_cb (UpExportedDaemon *proxy, const gchar *object_path, UpClient *client) { up_client_add (client, object_path); } @@ -290,7 +290,7 @@ up_device_added_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *cli * up_client_removed_cb: */ static void -up_device_removed_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *client) +up_device_removed_cb (UpExportedDaemon *proxy, const gchar *object_path, UpClient *client) { g_signal_emit (client, signals [UP_CLIENT_DEVICE_REMOVED], 0, object_path); } @@ -309,16 +309,16 @@ up_client_get_property (GObject *object, switch (prop_id) { case PROP_DAEMON_VERSION: - g_value_set_string (value, up_client_glue_get_daemon_version (client->priv->proxy)); + g_value_set_string (value, up_exported_daemon_get_daemon_version (client->priv->proxy)); break; case PROP_ON_BATTERY: - g_value_set_boolean (value, up_client_glue_get_on_battery (client->priv->proxy)); + g_value_set_boolean (value, up_exported_daemon_get_on_battery (client->priv->proxy)); break; case PROP_LID_IS_CLOSED: - g_value_set_boolean (value, up_client_glue_get_lid_is_closed (client->priv->proxy)); + g_value_set_boolean (value, up_exported_daemon_get_lid_is_closed (client->priv->proxy)); break; case PROP_LID_IS_PRESENT: - g_value_set_boolean (value, up_client_glue_get_lid_is_present (client->priv->proxy)); + g_value_set_boolean (value, up_exported_daemon_get_lid_is_present (client->priv->proxy)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -442,12 +442,12 @@ up_client_init (UpClient *client) client->priv = UP_CLIENT_GET_PRIVATE (client); /* connect to main interface */ - client->priv->proxy = up_client_glue_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "org.freedesktop.UPower", - "/org/freedesktop/UPower", - NULL, - &error); + client->priv->proxy = up_exported_daemon_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + "org.freedesktop.UPower", + "/org/freedesktop/UPower", + NULL, + &error); if (client->priv->proxy == NULL) { g_warning ("Couldn't connect to proxy: %s", error->message); g_error_free (error); diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c index f053f3d..ec1b25b 100644 --- a/libupower-glib/up-device.c +++ b/libupower-glib/up-device.c @@ -37,7 +37,7 @@ #include #include "up-device.h" -#include "up-device-glue.h" +#include "up-device-generated.h" #include "up-stats-item.h" #include "up-history-item.h" @@ -54,7 +54,7 @@ static void up_device_finalize (GObject *object); **/ struct _UpDevicePrivate { - UpDeviceGlue *proxy_device; + UpExportedDevice *proxy_device; /* For use when a UpDevice isn't backed by a D-Bus object * by the UPower daemon */ @@ -100,7 +100,7 @@ G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT) * up_device_changed_cb: */ static void -up_device_changed_cb (UpDeviceGlue *proxy, GParamSpec *pspec, UpDevice *device) +up_device_changed_cb (UpExportedDevice *proxy, GParamSpec *pspec, UpDevice *device) { if (g_strcmp0 (pspec->name, "type") == 0) g_object_notify (G_OBJECT (device), "kind"); @@ -124,7 +124,7 @@ up_device_changed_cb (UpDeviceGlue *proxy, GParamSpec *pspec, UpDevice *device) gboolean up_device_set_object_path_sync (UpDevice *device, const gchar *object_path, GCancellable *cancellable, GError **error) { - UpDeviceGlue *proxy_device; + UpExportedDevice *proxy_device; gboolean ret = TRUE; g_return_val_if_fail (UP_IS_DEVICE (device), FALSE); @@ -144,12 +144,12 @@ up_device_set_object_path_sync (UpDevice *device, const gchar *object_path, GCan g_clear_pointer (&device->priv->offline_props, g_hash_table_unref); /* connect to the correct path for all the other methods */ - proxy_device = up_device_glue_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "org.freedesktop.UPower", - object_path, - cancellable, - error); + proxy_device = up_exported_device_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + "org.freedesktop.UPower", + object_path, + cancellable, + error); if (proxy_device == NULL) return FALSE; @@ -271,77 +271,77 @@ up_device_to_text (UpDevice *device) is_display = (g_strcmp0 ("/org/freedesktop/UPower/devices/DisplayDevice", up_device_get_object_path (device)) == 0); /* get a human readable time */ - t = (time_t) up_device_glue_get_update_time (priv->proxy_device); + t = (time_t) up_exported_device_get_update_time (priv->proxy_device); time_tm = localtime (&t); strftime (time_buf, sizeof time_buf, "%c", time_tm); string = g_string_new (""); if (!is_display) - g_string_append_printf (string, " native-path: %s\n", up_device_glue_get_native_path (priv->proxy_device)); - vendor = up_device_glue_get_vendor (priv->proxy_device); + g_string_append_printf (string, " native-path: %s\n", up_exported_device_get_native_path (priv->proxy_device)); + vendor = up_exported_device_get_vendor (priv->proxy_device); if (vendor != NULL && vendor[0] != '\0') g_string_append_printf (string, " vendor: %s\n", vendor); - model = up_device_glue_get_model (priv->proxy_device); + model = up_exported_device_get_model (priv->proxy_device); if (model != NULL && model[0] != '\0') g_string_append_printf (string, " model: %s\n", model); - serial = up_device_glue_get_serial (priv->proxy_device); + serial = up_exported_device_get_serial (priv->proxy_device); if (serial != NULL && serial[0] != '\0') g_string_append_printf (string, " serial: %s\n", serial); - g_string_append_printf (string, " power supply: %s\n", up_device_bool_to_string (up_device_glue_get_power_supply (priv->proxy_device))); - g_string_append_printf (string, " updated: %s (%d seconds ago)\n", time_buf, (int) (time (NULL) - up_device_glue_get_update_time (priv->proxy_device))); - g_string_append_printf (string, " has history: %s\n", up_device_bool_to_string (up_device_glue_get_has_history (priv->proxy_device))); - g_string_append_printf (string, " has statistics: %s\n", up_device_bool_to_string (up_device_glue_get_has_statistics (priv->proxy_device))); + g_string_append_printf (string, " power supply: %s\n", up_device_bool_to_string (up_exported_device_get_power_supply (priv->proxy_device))); + g_string_append_printf (string, " updated: %s (%d seconds ago)\n", time_buf, (int) (time (NULL) - up_exported_device_get_update_time (priv->proxy_device))); + g_string_append_printf (string, " has history: %s\n", up_device_bool_to_string (up_exported_device_get_has_history (priv->proxy_device))); + g_string_append_printf (string, " has statistics: %s\n", up_device_bool_to_string (up_exported_device_get_has_statistics (priv->proxy_device))); - kind = up_device_glue_get_type_ (priv->proxy_device); + kind = up_exported_device_get_type_ (priv->proxy_device); g_string_append_printf (string, " %s\n", up_device_kind_to_string (kind)); if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_MOUSE || kind == UP_DEVICE_KIND_KEYBOARD || kind == UP_DEVICE_KIND_UPS) - g_string_append_printf (string, " present: %s\n", up_device_bool_to_string (up_device_glue_get_is_present (priv->proxy_device))); + g_string_append_printf (string, " present: %s\n", up_device_bool_to_string (up_exported_device_get_is_present (priv->proxy_device))); if ((kind == UP_DEVICE_KIND_PHONE || kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_MOUSE || kind == UP_DEVICE_KIND_KEYBOARD) && !is_display) - g_string_append_printf (string, " rechargeable: %s\n", up_device_bool_to_string (up_device_glue_get_is_rechargeable (priv->proxy_device))); + g_string_append_printf (string, " rechargeable: %s\n", up_device_bool_to_string (up_exported_device_get_is_rechargeable (priv->proxy_device))); if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_MOUSE || kind == UP_DEVICE_KIND_KEYBOARD || kind == UP_DEVICE_KIND_UPS) - g_string_append_printf (string, " state: %s\n", up_device_state_to_string (up_device_glue_get_state (priv->proxy_device))); - g_string_append_printf (string, " warning-level: %s\n", up_device_level_to_string (up_device_glue_get_warning_level (priv->proxy_device))); + g_string_append_printf (string, " state: %s\n", up_device_state_to_string (up_exported_device_get_state (priv->proxy_device))); + g_string_append_printf (string, " warning-level: %s\n", up_device_level_to_string (up_exported_device_get_warning_level (priv->proxy_device))); if (kind == UP_DEVICE_KIND_BATTERY) { - g_string_append_printf (string, " energy: %g Wh\n", up_device_glue_get_energy (priv->proxy_device)); + g_string_append_printf (string, " energy: %g Wh\n", up_exported_device_get_energy (priv->proxy_device)); if (!is_display) - g_string_append_printf (string, " energy-empty: %g Wh\n", up_device_glue_get_energy_empty (priv->proxy_device)); - g_string_append_printf (string, " energy-full: %g Wh\n", up_device_glue_get_energy_full (priv->proxy_device)); + g_string_append_printf (string, " energy-empty: %g Wh\n", up_exported_device_get_energy_empty (priv->proxy_device)); + g_string_append_printf (string, " energy-full: %g Wh\n", up_exported_device_get_energy_full (priv->proxy_device)); if (!is_display) - g_string_append_printf (string, " energy-full-design: %g Wh\n", up_device_glue_get_energy_full_design (priv->proxy_device)); + g_string_append_printf (string, " energy-full-design: %g Wh\n", up_exported_device_get_energy_full_design (priv->proxy_device)); } if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_MONITOR) - g_string_append_printf (string, " energy-rate: %g W\n", up_device_glue_get_energy_rate (priv->proxy_device)); + g_string_append_printf (string, " energy-rate: %g W\n", up_exported_device_get_energy_rate (priv->proxy_device)); if (kind == UP_DEVICE_KIND_UPS || kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_MONITOR) { - if (up_device_glue_get_voltage (priv->proxy_device) > 0) - g_string_append_printf (string, " voltage: %g V\n", up_device_glue_get_voltage (priv->proxy_device)); + if (up_exported_device_get_voltage (priv->proxy_device) > 0) + g_string_append_printf (string, " voltage: %g V\n", up_exported_device_get_voltage (priv->proxy_device)); } if (kind == UP_DEVICE_KIND_KEYBOARD) { - if (up_device_glue_get_luminosity (priv->proxy_device) > 0) - g_string_append_printf (string, " luminosity: %g lx\n", up_device_glue_get_luminosity (priv->proxy_device)); + if (up_exported_device_get_luminosity (priv->proxy_device) > 0) + g_string_append_printf (string, " luminosity: %g lx\n", up_exported_device_get_luminosity (priv->proxy_device)); } if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_UPS) { - if (up_device_glue_get_time_to_full (priv->proxy_device) > 0) { - time_str = up_device_to_text_time_to_string (up_device_glue_get_time_to_full (priv->proxy_device)); + if (up_exported_device_get_time_to_full (priv->proxy_device) > 0) { + time_str = up_device_to_text_time_to_string (up_exported_device_get_time_to_full (priv->proxy_device)); g_string_append_printf (string, " time to full: %s\n", time_str); g_free (time_str); } - if (up_device_glue_get_time_to_empty (priv->proxy_device) > 0) { - time_str = up_device_to_text_time_to_string (up_device_glue_get_time_to_empty (priv->proxy_device)); + if (up_exported_device_get_time_to_empty (priv->proxy_device) > 0) { + time_str = up_device_to_text_time_to_string (up_exported_device_get_time_to_empty (priv->proxy_device)); g_string_append_printf (string, " time to empty: %s\n", time_str); g_free (time_str); } @@ -354,24 +354,24 @@ up_device_to_text (UpDevice *device) kind == UP_DEVICE_KIND_COMPUTER || kind == UP_DEVICE_KIND_MEDIA_PLAYER || kind == UP_DEVICE_KIND_UPS) - g_string_append_printf (string, " percentage: %g%%\n", up_device_glue_get_percentage (priv->proxy_device)); + g_string_append_printf (string, " percentage: %g%%\n", up_exported_device_get_percentage (priv->proxy_device)); if (kind == UP_DEVICE_KIND_BATTERY) { - if (up_device_glue_get_temperature (priv->proxy_device) > 0) - g_string_append_printf (string, " temperature: %g degrees C\n", up_device_glue_get_temperature (priv->proxy_device)); - if (up_device_glue_get_capacity (priv->proxy_device) > 0) - g_string_append_printf (string, " capacity: %g%%\n", up_device_glue_get_capacity (priv->proxy_device)); + if (up_exported_device_get_temperature (priv->proxy_device) > 0) + g_string_append_printf (string, " temperature: %g degrees C\n", up_exported_device_get_temperature (priv->proxy_device)); + if (up_exported_device_get_capacity (priv->proxy_device) > 0) + g_string_append_printf (string, " capacity: %g%%\n", up_exported_device_get_capacity (priv->proxy_device)); } if (kind == UP_DEVICE_KIND_BATTERY) { - if (up_device_glue_get_technology (priv->proxy_device) != UP_DEVICE_TECHNOLOGY_UNKNOWN) - g_string_append_printf (string, " technology: %s\n", up_device_technology_to_string (up_device_glue_get_technology (priv->proxy_device))); + if (up_exported_device_get_technology (priv->proxy_device) != UP_DEVICE_TECHNOLOGY_UNKNOWN) + g_string_append_printf (string, " technology: %s\n", up_device_technology_to_string (up_exported_device_get_technology (priv->proxy_device))); } if (kind == UP_DEVICE_KIND_LINE_POWER) - g_string_append_printf (string, " online: %s\n", up_device_bool_to_string (up_device_glue_get_online (priv->proxy_device))); + g_string_append_printf (string, " online: %s\n", up_device_bool_to_string (up_exported_device_get_online (priv->proxy_device))); - g_string_append_printf (string, " icon-name: '%s'\n", up_device_glue_get_icon_name (priv->proxy_device)); + g_string_append_printf (string, " icon-name: '%s'\n", up_exported_device_get_icon_name (priv->proxy_device)); /* if we can, get history */ - if (up_device_glue_get_has_history (priv->proxy_device)) { + if (up_exported_device_get_has_history (priv->proxy_device)) { up_device_to_text_history (device, string, "charge"); up_device_to_text_history (device, string, "rate"); } @@ -398,7 +398,7 @@ up_device_refresh_sync (UpDevice *device, GCancellable *cancellable, GError **er g_return_val_if_fail (UP_IS_DEVICE (device), FALSE); g_return_val_if_fail (device->priv->proxy_device != NULL, FALSE); - return up_device_glue_call_refresh_sync (device->priv->proxy_device, cancellable, error); + return up_exported_device_call_refresh_sync (device->priv->proxy_device, cancellable, error); } /** @@ -433,13 +433,13 @@ up_device_get_history_sync (UpDevice *device, const gchar *type, guint timespec, g_return_val_if_fail (device->priv->proxy_device != NULL, NULL); /* get compound data */ - ret = up_device_glue_call_get_history_sync (device->priv->proxy_device, - type, - timespec, - resolution, - &gva, - NULL, - &error_local); + ret = up_exported_device_call_get_history_sync (device->priv->proxy_device, + type, + timespec, + resolution, + &gva, + NULL, + &error_local); if (!ret) { g_set_error (error, 1, 0, "GetHistory(%s,%i) on %s failed: %s", type, timespec, up_device_get_object_path (device), error_local->message); @@ -513,11 +513,11 @@ up_device_get_statistics_sync (UpDevice *device, const gchar *type, GCancellable g_return_val_if_fail (device->priv->proxy_device != NULL, NULL); /* get compound data */ - ret = up_device_glue_call_get_statistics_sync (device->priv->proxy_device, - type, - &gva, - NULL, - &error_local); + ret = up_exported_device_call_get_statistics_sync (device->priv->proxy_device, + type, + &gva, + NULL, + &error_local); if (!ret) { g_set_error (error, 1, 0, "GetStatistics(%s) on %s failed: %s", type, up_device_get_object_path (device), error_local->message); @@ -582,88 +582,88 @@ up_device_set_property (GObject *object, guint prop_id, const GValue *value, GPa switch (prop_id) { case PROP_NATIVE_PATH: - up_device_glue_set_native_path (device->priv->proxy_device, g_value_get_string (value)); + up_exported_device_set_native_path (device->priv->proxy_device, g_value_get_string (value)); break; case PROP_VENDOR: - up_device_glue_set_vendor (device->priv->proxy_device, g_value_get_string (value)); + up_exported_device_set_vendor (device->priv->proxy_device, g_value_get_string (value)); break; case PROP_MODEL: - up_device_glue_set_model (device->priv->proxy_device, g_value_get_string (value)); + up_exported_device_set_model (device->priv->proxy_device, g_value_get_string (value)); break; case PROP_SERIAL: - up_device_glue_set_serial (device->priv->proxy_device, g_value_get_string (value)); + up_exported_device_set_serial (device->priv->proxy_device, g_value_get_string (value)); break; case PROP_UPDATE_TIME: - up_device_glue_set_update_time (device->priv->proxy_device, g_value_get_uint64 (value)); + up_exported_device_set_update_time (device->priv->proxy_device, g_value_get_uint64 (value)); break; case PROP_KIND: - up_device_glue_set_type_ (device->priv->proxy_device, g_value_get_uint (value)); + up_exported_device_set_type_ (device->priv->proxy_device, g_value_get_uint (value)); break; case PROP_POWER_SUPPLY: - up_device_glue_set_power_supply (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_power_supply (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_ONLINE: - up_device_glue_set_online (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_online (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_IS_PRESENT: - up_device_glue_set_is_present (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_is_present (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_IS_RECHARGEABLE: - up_device_glue_set_is_rechargeable (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_is_rechargeable (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_HAS_HISTORY: - up_device_glue_set_has_history (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_has_history (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_HAS_STATISTICS: - up_device_glue_set_has_statistics (device->priv->proxy_device, g_value_get_boolean (value)); + up_exported_device_set_has_statistics (device->priv->proxy_device, g_value_get_boolean (value)); break; case PROP_STATE: - up_device_glue_set_state (device->priv->proxy_device, g_value_get_uint (value)); + up_exported_device_set_state (device->priv->proxy_device, g_value_get_uint (value)); break; case PROP_CAPACITY: - up_device_glue_set_capacity (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_capacity (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_ENERGY: - up_device_glue_set_energy (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_energy (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_ENERGY_EMPTY: - up_device_glue_set_energy_empty (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_energy_empty (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_ENERGY_FULL: - up_device_glue_set_energy_full (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_energy_full (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_ENERGY_FULL_DESIGN: - up_device_glue_set_energy_full_design (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_energy_full_design (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_ENERGY_RATE: - up_device_glue_set_energy_rate (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_energy_rate (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_VOLTAGE: - up_device_glue_set_voltage (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_voltage (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_LUMINOSITY: - up_device_glue_set_luminosity (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_luminosity (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_TIME_TO_EMPTY: - up_device_glue_set_time_to_empty (device->priv->proxy_device, g_value_get_int64 (value)); + up_exported_device_set_time_to_empty (device->priv->proxy_device, g_value_get_int64 (value)); break; case PROP_TIME_TO_FULL: - up_device_glue_set_time_to_full (device->priv->proxy_device, g_value_get_int64 (value)); + up_exported_device_set_time_to_full (device->priv->proxy_device, g_value_get_int64 (value)); break; case PROP_PERCENTAGE: - up_device_glue_set_percentage (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_percentage (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_TEMPERATURE: - up_device_glue_set_temperature (device->priv->proxy_device, g_value_get_double (value)); + up_exported_device_set_temperature (device->priv->proxy_device, g_value_get_double (value)); break; case PROP_TECHNOLOGY: - up_device_glue_set_technology (device->priv->proxy_device, g_value_get_uint (value)); + up_exported_device_set_technology (device->priv->proxy_device, g_value_get_uint (value)); break; case PROP_WARNING_LEVEL: - up_device_glue_set_warning_level (device->priv->proxy_device, g_value_get_uint (value)); + up_exported_device_set_warning_level (device->priv->proxy_device, g_value_get_uint (value)); break; case PROP_ICON_NAME: - up_device_glue_set_icon_name (device->priv->proxy_device, g_value_get_string (value)); + up_exported_device_set_icon_name (device->priv->proxy_device, g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -693,88 +693,88 @@ up_device_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe switch (prop_id) { case PROP_UPDATE_TIME: - g_value_set_uint64 (value, up_device_glue_get_update_time (device->priv->proxy_device)); + g_value_set_uint64 (value, up_exported_device_get_update_time (device->priv->proxy_device)); break; case PROP_VENDOR: - g_value_set_string (value, up_device_glue_get_vendor (device->priv->proxy_device)); + g_value_set_string (value, up_exported_device_get_vendor (device->priv->proxy_device)); break; case PROP_MODEL: - g_value_set_string (value, up_device_glue_get_model (device->priv->proxy_device)); + g_value_set_string (value, up_exported_device_get_model (device->priv->proxy_device)); break; case PROP_SERIAL: - g_value_set_string (value, up_device_glue_get_serial (device->priv->proxy_device)); + g_value_set_string (value, up_exported_device_get_serial (device->priv->proxy_device)); break; case PROP_NATIVE_PATH: - g_value_set_string (value, up_device_glue_get_native_path (device->priv->proxy_device)); + g_value_set_string (value, up_exported_device_get_native_path (device->priv->proxy_device)); break; case PROP_POWER_SUPPLY: - g_value_set_boolean (value, up_device_glue_get_power_supply (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_power_supply (device->priv->proxy_device)); break; case PROP_ONLINE: - g_value_set_boolean (value, up_device_glue_get_online (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_online (device->priv->proxy_device)); break; case PROP_IS_PRESENT: - g_value_set_boolean (value, up_device_glue_get_is_present (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_is_present (device->priv->proxy_device)); break; case PROP_IS_RECHARGEABLE: - g_value_set_boolean (value, up_device_glue_get_is_rechargeable (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_is_rechargeable (device->priv->proxy_device)); break; case PROP_HAS_HISTORY: - g_value_set_boolean (value, up_device_glue_get_has_history (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_has_history (device->priv->proxy_device)); break; case PROP_HAS_STATISTICS: - g_value_set_boolean (value, up_device_glue_get_has_statistics (device->priv->proxy_device)); + g_value_set_boolean (value, up_exported_device_get_has_statistics (device->priv->proxy_device)); break; case PROP_KIND: - g_value_set_uint (value, up_device_glue_get_type_ (device->priv->proxy_device)); + g_value_set_uint (value, up_exported_device_get_type_ (device->priv->proxy_device)); break; case PROP_STATE: - g_value_set_uint (value, up_device_glue_get_state (device->priv->proxy_device)); + g_value_set_uint (value, up_exported_device_get_state (device->priv->proxy_device)); break; case PROP_TECHNOLOGY: - g_value_set_uint (value, up_device_glue_get_technology (device->priv->proxy_device)); + g_value_set_uint (value, up_exported_device_get_technology (device->priv->proxy_device)); break; case PROP_CAPACITY: - g_value_set_double (value, up_device_glue_get_capacity (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_capacity (device->priv->proxy_device)); break; case PROP_ENERGY: - g_value_set_double (value, up_device_glue_get_energy (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_energy (device->priv->proxy_device)); break; case PROP_ENERGY_EMPTY: - g_value_set_double (value, up_device_glue_get_energy_empty (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_energy_empty (device->priv->proxy_device)); break; case PROP_ENERGY_FULL: - g_value_set_double (value, up_device_glue_get_energy_full (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_energy_full (device->priv->proxy_device)); break; case PROP_ENERGY_FULL_DESIGN: - g_value_set_double (value, up_device_glue_get_energy_full_design (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_energy_full_design (device->priv->proxy_device)); break; case PROP_ENERGY_RATE: - g_value_set_double (value, up_device_glue_get_energy_rate (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_energy_rate (device->priv->proxy_device)); break; case PROP_VOLTAGE: - g_value_set_double (value, up_device_glue_get_voltage (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_voltage (device->priv->proxy_device)); break; case PROP_LUMINOSITY: - g_value_set_double (value, up_device_glue_get_luminosity (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_luminosity (device->priv->proxy_device)); break; case PROP_TIME_TO_EMPTY: - g_value_set_int64 (value, up_device_glue_get_time_to_empty (device->priv->proxy_device)); + g_value_set_int64 (value, up_exported_device_get_time_to_empty (device->priv->proxy_device)); break; case PROP_TIME_TO_FULL: - g_value_set_int64 (value, up_device_glue_get_time_to_full (device->priv->proxy_device)); + g_value_set_int64 (value, up_exported_device_get_time_to_full (device->priv->proxy_device)); break; case PROP_PERCENTAGE: - g_value_set_double (value, up_device_glue_get_percentage (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_percentage (device->priv->proxy_device)); break; case PROP_TEMPERATURE: - g_value_set_double (value, up_device_glue_get_temperature (device->priv->proxy_device)); + g_value_set_double (value, up_exported_device_get_temperature (device->priv->proxy_device)); break; case PROP_WARNING_LEVEL: - g_value_set_uint (value, up_device_glue_get_warning_level (device->priv->proxy_device)); + g_value_set_uint (value, up_exported_device_get_warning_level (device->priv->proxy_device)); break; case PROP_ICON_NAME: - g_value_set_string (value, up_device_glue_get_icon_name (device->priv->proxy_device)); + g_value_set_string (value, up_exported_device_get_icon_name (device->priv->proxy_device)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); diff --git a/libupower-glib/up-wakeups.c b/libupower-glib/up-wakeups.c index c4dfec8..f4f3ec1 100644 --- a/libupower-glib/up-wakeups.c +++ b/libupower-glib/up-wakeups.c @@ -26,7 +26,7 @@ #include #include "up-wakeups.h" -#include "up-wakeups-glue.h" +#include "up-wakeups-generated.h" static void up_wakeups_class_init (UpWakeupsClass *klass); static void up_wakeups_init (UpWakeups *wakeups); @@ -36,7 +36,7 @@ static void up_wakeups_finalize (GObject *object); struct UpWakeupsPrivate { - UpWakeupsGlue *proxy; + UpExportedWakeups *proxy; }; enum { @@ -70,8 +70,8 @@ up_wakeups_get_total_sync (UpWakeups *wakeups, GCancellable *cancellable, GError g_return_val_if_fail (UP_IS_WAKEUPS (wakeups), FALSE); g_return_val_if_fail (wakeups->priv->proxy != NULL, FALSE); - ret = up_wakeups_glue_call_get_total_sync (wakeups->priv->proxy, &total, - cancellable, error); + ret = up_exported_wakeups_call_get_total_sync (wakeups->priv->proxy, &total, + cancellable, error); if (!ret) total = 0; return total; @@ -104,10 +104,10 @@ up_wakeups_get_data_sync (UpWakeups *wakeups, GCancellable *cancellable, GError g_return_val_if_fail (wakeups->priv->proxy != NULL, NULL); /* get compound data */ - ret = up_wakeups_glue_call_get_data_sync (wakeups->priv->proxy, - &gva, - NULL, - &error_local); + ret = up_exported_wakeups_call_get_data_sync (wakeups->priv->proxy, + &gva, + NULL, + &error_local); if (!ret) { g_warning ("GetData on failed: %s", error_local->message); @@ -192,14 +192,14 @@ gboolean up_wakeups_get_has_capability (UpWakeups *wakeups) { g_return_val_if_fail (UP_IS_WAKEUPS (wakeups), FALSE); - return up_wakeups_glue_get_has_capability (wakeups->priv->proxy); + return up_exported_wakeups_get_has_capability (wakeups->priv->proxy); } /** * up_wakeups_total_changed_cb: **/ static void -up_wakeups_total_changed_cb (UpWakeupsGlue *proxy, guint value, UpWakeups *wakeups) +up_wakeups_total_changed_cb (UpExportedWakeups *proxy, guint value, UpWakeups *wakeups) { g_signal_emit (wakeups, signals [UP_WAKEUPS_TOTAL_CHANGED], 0, value); } @@ -208,7 +208,7 @@ up_wakeups_total_changed_cb (UpWakeupsGlue *proxy, guint value, UpWakeups *wakeu * up_wakeups_data_changed_cb: **/ static void -up_wakeups_data_changed_cb (UpWakeupsGlue *proxy, UpWakeups *wakeups) +up_wakeups_data_changed_cb (UpExportedWakeups *proxy, UpWakeups *wakeups) { g_signal_emit (wakeups, signals [UP_WAKEUPS_DATA_CHANGED], 0); } @@ -249,12 +249,12 @@ up_wakeups_init (UpWakeups *wakeups) wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups); /* connect to main interface */ - wakeups->priv->proxy = up_wakeups_glue_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - "org.freedesktop.UPower", - "/org/freedesktop/UPower/Wakeups", - NULL, - &error); + wakeups->priv->proxy = up_exported_wakeups_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + "org.freedesktop.UPower", + "/org/freedesktop/UPower/Wakeups", + NULL, + &error); if (wakeups->priv->proxy == NULL) { g_warning ("Couldn't connect to proxy: %s", error->message); g_error_free (error); diff --git a/src/Makefile.am b/src/Makefile.am index 16ae5e9..c0f4e36 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,6 +25,7 @@ AM_CPPFLAGS = \ -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \ -DUP_COMPILATION \ -DG_LOG_DOMAIN=\"UPower\" \ + -I$(top_srcdir)/dbus \ -I$(top_srcdir)/libupower-glib \ -I$(top_srcdir) \ $(GIO_CFLAGS) \ @@ -32,17 +33,11 @@ AM_CPPFLAGS = \ $(GUDEV_CFLAGS) \ $(GLIB_CFLAGS) -UPOWER_LIBS = $(top_builddir)/libupower-glib/libupower-glib.la +UPOWER_LIBS = \ + $(top_builddir)/dbus/libupower-dbus.la \ + $(top_builddir)/libupower-glib/libupower-glib.la BUILT_SOURCES = \ - up-daemon-generated.h \ - up-daemon-generated.c \ - up-device-generated.h \ - up-device-generated.c \ - up-kbd-backlight-generated.h \ - up-kbd-backlight-generated.c \ - up-wakeups-generated.h \ - up-wakeups-generated.c \ up-marshal.h \ up-marshal.c @@ -52,43 +47,8 @@ up-marshal.h: up-marshal.list up-marshal.c: up-marshal.list echo "#include \"up-marshal.h\"" > $@ && glib-genmarshal $< --prefix=up_marshal --body >> $@ -up-daemon-generated.h: org.freedesktop.UPower.xml Makefile.am - $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower. \ - --generate-c-code up-daemon-generated \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower" "org.gtk.GDBus.C.Name" ExportedDaemon \ - $(srcdir)/org.freedesktop.UPower.xml - -up-device-generated.h: org.freedesktop.UPower.Device.xml Makefile.am - $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.Device. \ - --generate-c-code up-device-generated \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower.Device" "org.gtk.GDBus.C.Name" ExportedDevice \ - $(srcdir)/org.freedesktop.UPower.Device.xml - -up-kbd-backlight-generated.h: org.freedesktop.UPower.KbdBacklight.xml Makefile.am - $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.KbdBacklight. \ - --generate-c-code up-kbd-backlight-generated \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower.KbdBacklight" "org.gtk.GDBus.C.Name" ExportedKbdBacklight \ - $(srcdir)/org.freedesktop.UPower.KbdBacklight.xml - -up-wakeups-generated.h: org.freedesktop.UPower.Wakeups.xml Makefile.am - $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.UPower.Wakeups. \ - --generate-c-code up-wakeups-generated \ - --c-namespace Up \ - --annotate "org.freedesktop.UPower.Wakeups" "org.gtk.GDBus.C.Name" ExportedWakeups \ - $(srcdir)/org.freedesktop.UPower.Wakeups.xml - libexec_PROGRAMS = upowerd -dbusifdir = $(datadir)/dbus-1/interfaces -dbusif_DATA = \ - org.freedesktop.UPower.xml \ - org.freedesktop.UPower.Device.xml \ - org.freedesktop.UPower.KbdBacklight.xml \ - org.freedesktop.UPower.Wakeups.xml - upowerd_SOURCES = \ up-daemon.h \ up-daemon.c \ @@ -237,10 +197,6 @@ MAINTAINERCLEANFILES = \ $(dbusservice_DATA) EXTRA_DIST = \ - org.freedesktop.UPower.xml \ - org.freedesktop.UPower.Device.xml \ - org.freedesktop.UPower.KbdBacklight.xml \ - org.freedesktop.UPower.Wakeups.xml \ up-marshal.list \ $(systemdservice_in_files) \ $(dbusservice_in_files) \ diff --git a/src/org.freedesktop.UPower.Device.xml b/src/org.freedesktop.UPower.Device.xml deleted file mode 100644 index 8ce9c15..0000000 --- a/src/org.freedesktop.UPower.Device.xml +++ /dev/null @@ -1,717 +0,0 @@ - -]> - - - - - - Objects implementing this interface are usually discovered through - the org.freedesktop.UPower interface on - the /org/freedesktop/UPower object on - the D-Bus system bus service with the well-known - name org.freedesktop.UPower using - the - EnumerateDevices - method. - - - - -$ dbus-send --print-reply \ - --system \ - --dest=org.freedesktop.UPower \ - /org/freedesktop/UPower/devices/battery_BAT0 \ - org.freedesktop.DBus.Properties.GetAll \ - string:org.freedesktop.UPower.Device - -method return sender=:1.386 -> dest=:1.477 reply_serial=2 - array [ - dict entry( - string "native-path" - variant string "/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0" - ) - dict entry( - string "vendor" - variant string "SONY" - ) - dict entry( - string "model" - variant string "42T4568" - ) - dict entry( - string "serial" - variant string "4179" - ) - dict entry( - string "update-time" - variant uint64 1226417875 - ) - dict entry( - string "type" - variant uint 2 - ) - dict entry( - string "power-supply" - variant boolean true - ) - dict entry( - string "has-history" - variant boolean true - ) - dict entry( - string "has-statistics" - variant boolean true - ) - dict entry( - string "online" - variant boolean false - ) - dict entry( - string "energy" - variant double 72.85 - ) - dict entry( - string "energy-empty" - variant double 0 - ) - dict entry( - string "energy-full" - variant double 74.55 - ) - dict entry( - string "energy-full-design" - variant double 74.88 - ) - dict entry( - string "energy-rate" - variant double 0 - ) - dict entry( - string "voltage" - variant double 16.415 - ) - dict entry( - string "time-to-empty" - variant int64 0 - ) - dict entry( - string "time-to-full" - variant int64 0 - ) - dict entry( - string "percentage" - variant double 97.7197 - ) - dict entry( - string "is-present" - variant boolean true - ) - dict entry( - string "state" - variant uint 3 - ) - dict entry( - string "is-rechargeable" - variant boolean true - ) - dict entry( - string "capacity" - variant double 100 - ) - dict entry( - string "technology" - variant uint 1 - ) - ] - - - - - Unless otherwise noted, an empty string or the value 0 in a - property on this interface means not set. - - - - - - - - - - - - Refreshes the data collected from the power source. - - - Callers need the org.freedesktop.upower.refresh-power-source authorization - - if an error occured while refreshing - - - - - - - - - The type of history. - Valid types are rate or charge. - - - The amount of data to return in seconds, or 0 for all. - - - - - The approximate number of points to return. - A higher resolution is more accurate, at the expense of plotting speed. - - - - - - The history data for the power device, if the device supports history. - Data is ordered from the earliest in time, to the newest data point. - Each element contains the following members: - - - time - - The time value in seconds from the gettimeofday() method. - - - - value - - The data value, for instance the rate in W or the charge in %. - - - - state - - The state of the device, for instance charging or - discharging. - - - - - - - - - Gets history for the power device that is persistent across reboots. - - - - - - - - - - The mode for the statistics. - Valid types are charging or discharging. - - - - The statistics data for the power device. - Each element contains the following members: - - - value - - The value of the percentage point, usually in seconds - - - - accuracy - - The accuracy of the prediction in percent. - - - - - - - - - Gets statistics for the power device that may be interesting - to show on a graph in the session. - - - - - - - - - - - OS specific native path of the power source. On Linux this - is the sysfs path, for - example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. Is - blank if the device is being driven by a user space - driver. - - - - - - - - - - Name of the vendor of the battery. - - - - - - - - - - Name of the model of this battery. - - - - - - - - - - Unique serial number of the battery. - - - - - - - - - - The point in time (seconds since the Epoch Jan 1, 1970 - 0:00 UTC) that data was read from the power source. - - - - - - - - - - Type of power source. - - - - 0Unknown - - - 1Line Power - - - 2Battery - - - 3Ups - - - 4Monitor - - - 5Mouse - - - 6Keyboard - - - 7Pda - - - 8Phone - - - - - - - - - - - If the power device is used to supply the system. - This would be set TRUE for laptop batteries and UPS devices, - but set FALSE for wireless mice or PDAs. - - - - - - - - - - If the power device has history. - - - - - - - - - - If the power device has statistics. - - - - - - - - - - Whether power is currently being provided through line power. - This property is only valid if the property - type - has the value "line-power". - - - - - - - - - - Amount of energy (measured in Wh) currently available in - the power source. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Amount of energy (measured in Wh) in the power source when - it's considered to be empty. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Amount of energy (measured in Wh) in the power source when - it's considered full. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Amount of energy (measured in Wh) the power source is - designed to hold when it's considered full. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Amount of energy being drained from the source, measured - in W. If positive, the source is being discharged, if - negative it's being charged. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Voltage in the Cell or being recorded by the meter. - - - - - - - - - - Luminosity being recorded by the meter. - - - - - - - - - - Number of seconds until the power source is considered empty. - Is set to 0 if unknown. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Number of seconds until the power source is considered full. - Is set to 0 if unknown. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - The amount of energy left in the power source expressed as - a percentage between 0 and 100. Typically this is the same as - (energy - - energy-empty) / - (energy-full - - energy-empty). - However, some primitive power sources are capable of only - reporting percentages and in this case the energy-* - properties will be unset while this property is set. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - The temperature of the device in degrees Celsius. This property is - only valid if the property - type - has the value "battery". - - - - - - - - - - If the power source is present in the bay. - This field is required as some batteries are hot-removable, for example - expensive UPS and most laptop batteries. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - The battery power state. - - - - 0Unknown - - - 1Charging - - - 2Discharging - - - 3Empty - - - 4Fully charged - - - 5Pending charge - - - 6Pending discharge - - - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - If the power source is rechargeable. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - The capacity of the power source expressed as a percentage between 0 and 100. - The capacity of the battery will reduce with age. - A capacity value less than 75% is usually a sign that you should renew your battery. - Typically this value is the same as - (full-design / - full) * 100. - However, some primitive power sources are not capable reporting capacity - and in this case the capacity property will be unset. - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Technology used in the battery: - - - - 0Unknown - - - 1Lithium ion - - - 2Lithium polymer - - - 3Lithium iron phosphate - - - 4Lead acid - - - 5Nickel cadmium - - - 6Nickel metal hydride - - - - This property is only valid if the property - type - has the value "battery". - - - - - - - - - - Warning level of the battery: - - - - 0Unknown - - - 1None - - - 2Discharging (only for UPSes) - - - 3Low - - - 4Critical - - - 5Action - - - - - - - - - - - An icon name, following the Icon Naming Specification - - - - - - - diff --git a/src/org.freedesktop.UPower.KbdBacklight.xml b/src/org.freedesktop.UPower.KbdBacklight.xml deleted file mode 100644 index 994380f..0000000 --- a/src/org.freedesktop.UPower.KbdBacklight.xml +++ /dev/null @@ -1,101 +0,0 @@ - -]> - - - - - - org.freedesktop.UPower.KbdBacklight is a DBus interface implemented - by UPower. - It allows the keyboard backlight (if present) to be controlled. - - - - - - - - - - The maximum value of the keyboard backlight brightness. - - - - - - - Get the maximum brightness level for the keyboard backlight. - - - - if an error occured while getting the maximum brightness - - - - - - - - - - The current value of the keyboard backlight brightness. - - - - - - - Get the brightness level of the keyboard backlight. - - - - if an error occured while getting the brightness - - - - - - - - - - The value to set the KbdBacklight brightness. - - - - - - - Set the brightness level of the keyboard backlight. - - - - if an error occured while setting the brightness - - - - - - - - - - The new brightness value of the keyboard backlight. - - - - - - - The keyboard backlight brightness level has changed. - - - - - - - - diff --git a/src/org.freedesktop.UPower.Wakeups.xml b/src/org.freedesktop.UPower.Wakeups.xml deleted file mode 100644 index 7faa126..0000000 --- a/src/org.freedesktop.UPower.Wakeups.xml +++ /dev/null @@ -1,131 +0,0 @@ - -]> - - - - - - org.freedesktop.UPower.Wakeups is a DBus interface implemented - by UPower. - It allows applications to watch what applications and drivers are - causing the wakeups on the system. - - - - - - - - - If the system has the ability to profile wakeups. - - - - - - - - - - - The number of wakeups per second. - - - - - - - Get the number of wakeups per second. - - - - if an error occured while getting the latency - - - - - - - - - - The number of wakeups per second. - - - - - - - The number of wakeups per second has changed. - - - - - - - - - - - The data of all the processes and drivers which contribute to the - wakeups on the system. - - - is_userspace - - If the wakeup is from userspace. - - - - id - - The process ID of the application, or the IRQ for kernel drivers. - - - - value - - The number of wakeups per second. - - - - cmdline - - The command line for the application, or NULL for kernel drivers. - - - - details - - The details about the wakeup. - - - - - - - - - Gets all the wakeups from drivers and applications. - - - - - - - - - - - The wakeup data has changed. - - - - - - - - diff --git a/src/org.freedesktop.UPower.xml b/src/org.freedesktop.UPower.xml deleted file mode 100644 index c376521..0000000 --- a/src/org.freedesktop.UPower.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - The UPower service is available via the system message - bus. To access the service, use - the org.freedesktop.UPower interface on - the /org/freedesktop/UPower object on - the D-Bus system bus service with the well-known - name org.freedesktop.UPower. - - - - -$ dbus-send --print-reply \ - --system \ - --dest=org.freedesktop.UPower \ - /org/freedesktop/UPower \ - org.freedesktop.UPower.EnumerateDevices - -method return sender=:1.386 -> dest=:1.451 reply_serial=2 - array [ - object path "/org/freedesktop/UPower/devices/line_power_AC" - object path "/org/freedesktop/UPower/devices/battery_BAT0" - ] - - - - - - - - - - - - An array of object paths for devices. - - - - - - Enumerate all power objects on the system. - - - - - - - - - An object path for the "display device. - - - - - - Get the object to the "display device", a composite device that represents the - status icon to show in desktop environments. You can also access the object directly - as its path is guaranteed to be /org/freedesktop/UPower/devices/DisplayDevice. - The following standard org.freedesktop.UPower.Device - properties will be defined (only IsPresent takes a special meaning): - - - Typethe type of the display device, UPS or Battery. Note that this value can change, as opposed to real devices. - - - Statethe power state of the display device, such as Charging or Discharging. - - - Percentagethe amount of energy left on the device. - - - EnergyAmount of energy (measured in Wh) currently available in the power source. - - - EnergyFullAmount of energy (measured in Wh) in the power source when it's considered full. - - - EnergyRateAmount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged. - - - TimeToEmptyNumber of seconds until the power source is considered empty. - - - TimeToFullNumber of seconds until the power source is considered full. - - - IsPresentWhether a status icon using this information should be presented. - - - IconNameAn icon name representing the device state. - - - WarningLevelThe same as the overall WarningLevel - - - - - - - - - - - A string representing the critical action configured and available. - - - - - - When the system's power supply is critical (critically low batteries or UPS), - the system will take this action. Possible values are: - - - HybridSleep - - - Hibernate - - - PowerOff - - - - - - - - - - - - Object path of device that was added. - - - - - - Emitted when a device is added. - - - - - - - - - - Object path of device that was removed. - - - - - - Emitted when a device is removed. - - - - - - - - - - Version of the running daemon, e.g. 002. - - - - - - Indicates whether the system is running on battery power. - This property is provided for convenience. - - - - - - - - Indicates if the laptop lid is closed where the display cannot be seen. - - - - - - - - - - If the system has a lid device. - - - - - - - - -- cgit v1.2.3