1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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
This commit is contained in:
Julian Murgia
2016-07-23 13:15:55 +02:00
committed by Rémi Verschelde
parent ef174abf6d
commit 94103c0c02
44 changed files with 2162 additions and 1 deletions

View File

@@ -32,6 +32,7 @@
#include "os/input.h"
#include "drivers/unix/os_unix.h"
#include "os/main_loop.h"
#include "power_javascript.h"
#include "servers/physics/physics_server_sw.h"
#include "servers/audio_server.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
@@ -81,6 +82,8 @@ private:
GetDataDirFunc get_data_dir_func;
PowerJavascript *power_manager;
#ifdef JAVASCRIPT_EVAL_ENABLED
JavaScript* javascript_eval;
#endif
@@ -174,6 +177,10 @@ public:
virtual bool is_joy_known(int p_device);
virtual String get_joy_guid(int p_device) const;
bool joy_connection_changed(int p_type, const EmscriptenGamepadEvent *p_event);
virtual PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func);
~OS_JavaScript();