diff options
author | Maxim Sheronov <maxim.sheronov@gmail.com> | 2017-09-12 22:09:06 +0300 |
---|---|---|
committer | Maxim Sheronov <maxim.sheronov@gmail.com> | 2017-09-13 20:57:07 +0300 |
commit | 0fffa45158bebeb4aaba1df1d271c000fffbe7f7 (patch) | |
tree | 369918b0d7c9f367a7396c3584ac84ab550bd103 /platform/windows/power_windows.cpp | |
parent | 69017974beb16dcfa971f9b6f33a4f005be57bef (diff) |
Fix enums bindings
Add missed bindings for enums
Move some enums to class to have correct output of api.json
Diffstat (limited to 'platform/windows/power_windows.cpp')
-rw-r--r-- | platform/windows/power_windows.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp index b37e189a3a..8d86f160f1 100644 --- a/platform/windows/power_windows.cpp +++ b/platform/windows/power_windows.cpp @@ -64,19 +64,19 @@ bool PowerWindows::GetPowerInfo_Windows() { /* This API should exist back to Win95. */ if (!GetSystemPowerStatus(&status)) { /* !!! FIXME: push GetLastError() into GetError() */ - power_state = POWERSTATE_UNKNOWN; + power_state = OS::POWERSTATE_UNKNOWN; } else if (status.BatteryFlag == 0xFF) { /* unknown state */ - power_state = POWERSTATE_UNKNOWN; + power_state = OS::POWERSTATE_UNKNOWN; } else if (status.BatteryFlag & (1 << 7)) { /* no battery */ - power_state = POWERSTATE_NO_BATTERY; + power_state = OS::POWERSTATE_NO_BATTERY; } else if (status.BatteryFlag & (1 << 3)) { /* charging */ - power_state = POWERSTATE_CHARGING; + power_state = OS::POWERSTATE_CHARGING; need_details = TRUE; } else if (status.ACLineStatus == 1) { - power_state = POWERSTATE_CHARGED; /* on AC, not charging. */ + power_state = OS::POWERSTATE_CHARGED; /* on AC, not charging. */ need_details = TRUE; } else { - power_state = POWERSTATE_ON_BATTERY; /* not on AC. */ + power_state = OS::POWERSTATE_ON_BATTERY; /* not on AC. */ need_details = TRUE; } @@ -97,11 +97,11 @@ bool PowerWindows::GetPowerInfo_Windows() { return TRUE; /* always the definitive answer on Windows. */ } -PowerState PowerWindows::get_power_state() { +OS::PowerState PowerWindows::get_power_state() { if (GetPowerInfo_Windows()) { return power_state; } else { - return POWERSTATE_UNKNOWN; + return OS::POWERSTATE_UNKNOWN; } } @@ -122,7 +122,7 @@ int PowerWindows::get_power_percent_left() { } PowerWindows::PowerWindows() - : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) { } PowerWindows::~PowerWindows() { |