diff options
Diffstat (limited to 'src/ifaces.vala')
-rw-r--r-- | src/ifaces.vala | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/src/ifaces.vala b/src/ifaces.vala index 9c769d1..e6eb849 100644 --- a/src/ifaces.vala +++ b/src/ifaces.vala @@ -1,15 +1,6 @@ namespace AstalBattery { -[DBus (name = "org.freedesktop.DBus.Properties")] -public interface Properties : Object { - public signal void properties_changed ( - string iface_name, - HashTable<string, Variant> props, - string[] invalidated_props - ); -} - [DBus (name = "org.freedesktop.UPower")] -interface IUPower : Object { +interface IUPower : DBusProxy { public abstract string[] enumerate_devices() throws Error; public abstract string get_display_device() throws Error; public abstract string get_critical_action() throws Error; @@ -23,24 +14,13 @@ interface IUPower : Object { public abstract bool lis_is_present { get; } } -[DBus (name = "org.freedesktop.UPower.KbdBacklight")] -interface IUPowerKdbBacklight : Object { - public abstract int get_brightness() throws Error; - public abstract int get_max_brightness() throws Error; - public abstract void set_brightness(int value) throws Error; - - public signal void brightness_changed(int value); - public signal void brightness_changed_with_source(int value, string source); -} - [DBus (name = "org.freedesktop.UPower.Device")] -public interface IUPowerDevice : Object { - // public abstract void refresh() throws Error; - // public abstract void get_history(); - // public abstract void get_statistics(); +public interface IUPowerDevice : DBusProxy { + public abstract HistoryDataPoint[] get_history (string type, uint32 timespan, uint32 resolution) throws GLib.Error; + public abstract StatisticsDataPoint[] get_statistics (string type) throws GLib.Error; + public abstract void refresh () throws GLib.Error; - // incompatible with gobject - // public abstract uint type { get; } + public abstract uint Type { get; } public abstract string native_path { owned get; } public abstract string vendor { owned get; } public abstract string model { owned get; } @@ -56,7 +36,7 @@ public interface IUPowerDevice : Object { public abstract double energy_full_design { get; } public abstract double energy_rate { get; } public abstract double voltage { get; } - public abstract int charge_cycles { get; } + public abstract int32 charge_cycles { get; } public abstract double luminosity { get; } public abstract int64 time_to_empty { get; } public abstract int64 time_to_full { get; } @@ -65,26 +45,21 @@ public interface IUPowerDevice : Object { public abstract bool is_present { get; } public abstract uint state { get; } public abstract bool is_rechargable { get; } - public abstract double capacitiy { get; } + public abstract double capacity { get; } public abstract uint technology { get; } - public abstract uint warning_level { get; } - public abstract uint battery_level { get; } + public abstract uint32 warning_level { get; } + public abstract uint32 battery_level { get; } public abstract string icon_name { owned get; } } -[DBus (name = "org.freedesktop.UPower.PowerProfiles")] -public interface IPowerProfiles : Object { - public abstract string[] actions { owned get; } - public abstract string active_profile { owned get; } - public abstract HashTable<string, Variant>[] active_profile_holds { owned get; } - public abstract string performance_degraded { owned get; } - public abstract string performance_inhibited { owned get; } - public abstract HashTable<string, Variant>[] profiles { owned get; } - public abstract string version { owned get; } - - public signal uint profile_released (uint cookie); +public struct HistoryDataPoint { + uint32 time; + double value; + uint32 state; +} - public abstract uint hold_profile(string profile, string reason, string application_id) throws Error; - public abstract void release_profile(uint cookie) throws Error; +public struct StatisticsDataPoint { + double value; + double accuracy; } } |