From 94103c0c025f04e75d5e163d9f0bdde27bb0c848 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Sat, 23 Jul 2016 13:15:55 +0200 Subject: Add API to access battery power state Done: - X11, server (tested) - Windows (developed, would be nice to retest) - OSX (not tested) Prepared (not developed): - Android (code is here, but may not compile) - iphone - winrt - bb10 - haiku - javascript --- platform/server/os_server.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'platform/server/os_server.h') diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 2b6225c48d..a035076726 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -38,6 +38,7 @@ #include "servers/audio_server.h" #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "servers/physics_2d/physics_2d_server_sw.h" +#include "../x11/power_x11.h" //bitch #undef CursorShape @@ -65,6 +66,8 @@ class OS_Server : public OS_Unix { bool force_quit; InputDefault *input; + + PowerX11 *power_manager; @@ -105,6 +108,10 @@ public: virtual void move_window_to_foreground(); void run(); + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); OS_Server(); }; -- cgit v1.2.3