icculus@3170
|
1 |
/*
|
slouken@5535
|
2 |
Simple DirectMedia Layer
|
slouken@6885
|
3 |
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
|
icculus@3170
|
4 |
|
slouken@5535
|
5 |
This software is provided 'as-is', without any express or implied
|
slouken@5535
|
6 |
warranty. In no event will the authors be held liable for any damages
|
slouken@5535
|
7 |
arising from the use of this software.
|
icculus@3170
|
8 |
|
slouken@5535
|
9 |
Permission is granted to anyone to use this software for any purpose,
|
slouken@5535
|
10 |
including commercial applications, and to alter it and redistribute it
|
slouken@5535
|
11 |
freely, subject to the following restrictions:
|
icculus@3170
|
12 |
|
slouken@5535
|
13 |
1. The origin of this software must not be misrepresented; you must not
|
slouken@5535
|
14 |
claim that you wrote the original software. If you use this software
|
slouken@5535
|
15 |
in a product, an acknowledgment in the product documentation would be
|
slouken@5535
|
16 |
appreciated but is not required.
|
slouken@5535
|
17 |
2. Altered source versions must be plainly marked as such, and must not be
|
slouken@5535
|
18 |
misrepresented as being the original software.
|
slouken@5535
|
19 |
3. This notice may not be removed or altered from any source distribution.
|
icculus@3170
|
20 |
*/
|
icculus@3170
|
21 |
|
icculus@3170
|
22 |
#ifndef _SDL_power_h
|
icculus@3170
|
23 |
#define _SDL_power_h
|
icculus@3170
|
24 |
|
icculus@3170
|
25 |
/**
|
slouken@3407
|
26 |
* \file SDL_power.h
|
slouken@3407
|
27 |
*
|
slouken@3407
|
28 |
* Header for the SDL power management routines.
|
icculus@3170
|
29 |
*/
|
icculus@3170
|
30 |
|
icculus@3170
|
31 |
#include "SDL_stdinc.h"
|
icculus@3170
|
32 |
|
icculus@3170
|
33 |
#include "begin_code.h"
|
icculus@3170
|
34 |
/* Set up for C function definitions, even when using C++ */
|
icculus@3170
|
35 |
#ifdef __cplusplus
|
icculus@3170
|
36 |
/* *INDENT-OFF* */
|
icculus@3170
|
37 |
extern "C" {
|
icculus@3170
|
38 |
/* *INDENT-ON* */
|
icculus@3170
|
39 |
#endif
|
icculus@3170
|
40 |
|
icculus@3170
|
41 |
/**
|
slouken@3407
|
42 |
* \brief The basic state for the system's power supply.
|
icculus@3170
|
43 |
*/
|
icculus@3170
|
44 |
typedef enum
|
icculus@3170
|
45 |
{
|
icculus@3170
|
46 |
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
|
icculus@3170
|
47 |
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
|
icculus@3170
|
48 |
SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
|
icculus@3170
|
49 |
SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
|
slouken@3428
|
50 |
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
icculus@3170
|
51 |
} SDL_PowerState;
|
icculus@3170
|
52 |
|
icculus@3170
|
53 |
|
icculus@3170
|
54 |
/**
|
slouken@3407
|
55 |
* \brief Get the current power supply details.
|
slouken@3407
|
56 |
*
|
slouken@3407
|
57 |
* \param secs Seconds of battery life left. You can pass a NULL here if
|
slouken@3407
|
58 |
* you don't care. Will return -1 if we can't determine a
|
slouken@3407
|
59 |
* value, or we're not running on a battery.
|
slouken@3407
|
60 |
*
|
slouken@3407
|
61 |
* \param pct Percentage of battery life left, between 0 and 100. You can
|
slouken@3407
|
62 |
* pass a NULL here if you don't care. Will return -1 if we
|
slouken@3407
|
63 |
* can't determine a value, or we're not running on a battery.
|
slouken@3407
|
64 |
*
|
slouken@3407
|
65 |
* \return The state of the battery (if any).
|
icculus@3170
|
66 |
*/
|
icculus@3170
|
67 |
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
icculus@3170
|
68 |
|
icculus@3170
|
69 |
/* Ends C function definitions when using C++ */
|
icculus@3170
|
70 |
#ifdef __cplusplus
|
icculus@3170
|
71 |
/* *INDENT-OFF* */
|
icculus@3170
|
72 |
}
|
icculus@3170
|
73 |
/* *INDENT-ON* */
|
icculus@3170
|
74 |
#endif
|
icculus@3170
|
75 |
#include "close_code.h"
|
icculus@3170
|
76 |
|
icculus@3170
|
77 |
#endif /* _SDL_power_h */
|
icculus@3170
|
78 |
|
icculus@3170
|
79 |
/* vi: set ts=4 sw=4 expandtab: */
|