21 #include "../SDL_internal.h" 44 #ifndef SDL_POWER_DISABLED 45 #ifdef SDL_POWER_HARDWIRED 48 SDL_GetPowerInfo_Hardwired(
SDL_PowerState * state,
int *seconds,
int *percent)
60 #ifndef SDL_POWER_DISABLED 61 #ifdef SDL_POWER_LINUX 66 #ifdef SDL_POWER_WINDOWS 69 #ifdef SDL_POWER_UIKIT 72 #ifdef SDL_POWER_MACOSX 75 #ifdef SDL_POWER_HAIKU 78 #ifdef SDL_POWER_ANDROID 84 #ifdef SDL_POWER_WINRT 87 #ifdef SDL_POWER_EMSCRIPTEN 91 #ifdef SDL_POWER_HARDWIRED 92 SDL_GetPowerInfo_Hardwired,
100 const int total =
sizeof(
implementations) /
sizeof(implementations[0]);
101 int _seconds, _percent;
106 if (seconds ==
NULL) {
110 if (percent ==
NULL) {
114 for (i = 0; i < total; i++) {
115 if (implementations[i](&retval, seconds, percent)) {
SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *)
SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *)
static SDL_GetPowerInfo_Impl implementations[]
SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *)
SDL_PowerState
The basic state for the system's power supply.
SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *)
SDL_bool(* SDL_GetPowerInfo_Impl)(SDL_PowerState *state, int *seconds, int *percent)
SDL_PowerState SDL_GetPowerInfo(int *seconds, int *percent)
Get the current power supply details.
SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *)