comparison include/SDL_power.h @ 3170:b7a48f533966

Initial work on power subsystem for SDL 1.3.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 07 Jun 2009 06:06:35 +0000
parents
children d3baf5ac4e37
comparison
equal deleted inserted replaced
3169:f294338ca6eb 3170:b7a48f533966
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 #ifndef _SDL_power_h
24 #define _SDL_power_h
25
26 /**
27 * \file SDL_power.h
28 *
29 * Header for the SDL power management routines
30 */
31
32 #include "SDL_stdinc.h"
33
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 /* *INDENT-OFF* */
38 extern "C" {
39 /* *INDENT-ON* */
40 #endif
41
42 /**
43 * \enum SDL_PowerState
44 *
45 * \brief The basic state for the system's power supply.
46 */
47 typedef enum
48 {
49 SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
50 SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
51 SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
52 SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
53 SDL_POWERSTATE_CHARGED, /**< Plugged in, battery charged */
54 } SDL_PowerState;
55
56
57 /**
58 * \fn int SDL_GetPowerInfo(void)
59 *
60 * \brief Get the current power supply details.
61 *
62 * \param secs Seconds of battery life left. You can pass a NULL here if
63 * you don't care. Will return -1 if we can't determine a
64 * value, or we're not running on a battery.
65 *
66 * \param pct Percentage of battery life left, between 0 and 100. You can
67 * pass a NULL here if you don't care. Will return -1 if we
68 * can't determine a value, or we're not running on a battery.
69 *
70 * \return The state of the battery (if any).
71 */
72 extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
73
74 /* Ends C function definitions when using C++ */
75 #ifdef __cplusplus
76 /* *INDENT-OFF* */
77 }
78 /* *INDENT-ON* */
79 #endif
80 #include "close_code.h"
81
82 #endif /* _SDL_power_h */
83
84 /* vi: set ts=4 sw=4 expandtab: */