mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-20 07:37:03 +02:00
Add Device Power State (Windows, Linux, Mac and Android) (#197)
Uses native power state methods to display battery percentage and charging state correctly. Mainly for qlaunch. Tested on Windows, Linux. Mac and Android Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/197 Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
6bf5ae700a
commit
8c33b0bb5d
11 changed files with 269 additions and 14 deletions
14
src/common/device_power_state.h
Normal file
14
src/common/device_power_state.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Common {
|
||||
struct PowerStatus {
|
||||
int percentage = -1;
|
||||
bool charging = false;
|
||||
bool has_battery = true;
|
||||
};
|
||||
|
||||
PowerStatus GetPowerStatus();
|
||||
} // namespace Common
|
||||
Loading…
Add table
Add a link
Reference in a new issue