Path: blob/main/system/include/SDL/SDL_power.h
6169 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2011 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021#ifndef _SDL_power_h22#define _SDL_power_h2324/**25* \file SDL_power.h26*27* Header for the SDL power management routines.28*/2930#include "SDL_stdinc.h"3132#include "begin_code.h"33/* Set up for C function definitions, even when using C++ */34#ifdef __cplusplus35/* *INDENT-OFF* */36extern "C" {37/* *INDENT-ON* */38#endif3940/**41* \brief The basic state for the system's power supply.42*/43typedef enum44{45SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */46SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */47SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */48SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */49SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */50} SDL_PowerState;515253/**54* \brief Get the current power supply details.55*56* \param secs Seconds of battery life left. You can pass a NULL here if57* you don't care. Will return -1 if we can't determine a58* value, or we're not running on a battery.59*60* \param pct Percentage of battery life left, between 0 and 100. You can61* pass a NULL here if you don't care. Will return -1 if we62* can't determine a value, or we're not running on a battery.63*64* \return The state of the battery (if any).65*/66extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);6768/* Ends C function definitions when using C++ */69#ifdef __cplusplus70/* *INDENT-OFF* */71}72/* *INDENT-ON* */73#endif74#include "close_code.h"7576#endif /* _SDL_power_h */7778/* vi: set ts=4 sw=4 expandtab: */798081