SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_power.h Source File

SDL_power.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   arising from the use of this software.
00008 
00009   Permission is granted to anyone to use this software for any purpose,
00010   including commercial applications, and to alter it and redistribute it
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 #ifndef _SDL_power_h
00023 #define _SDL_power_h
00024 
00025 /**
00026  *  \file SDL_power.h
00027  *
00028  *  Header for the SDL power management routines.
00029  */
00030 
00031 #include "SDL_stdinc.h"
00032 
00033 #include "begin_code.h"
00034 /* Set up for C function definitions, even when using C++ */
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 /**
00040  *  \brief The basic state for the system's power supply.
00041  */
00042 typedef enum
00043 {
00044     SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
00045     SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
00046     SDL_POWERSTATE_NO_BATTERY,   /**< Plugged in, no battery available */
00047     SDL_POWERSTATE_CHARGING,     /**< Plugged in, charging battery */
00048     SDL_POWERSTATE_CHARGED       /**< Plugged in, battery charged */
00049 } SDL_PowerState;
00050 
00051 
00052 /**
00053  *  \brief Get the current power supply details.
00054  *
00055  *  \param secs Seconds of battery life left. You can pass a NULL here if
00056  *              you don't care. Will return -1 if we can't determine a
00057  *              value, or we're not running on a battery.
00058  *
00059  *  \param pct Percentage of battery life left, between 0 and 100. You can
00060  *             pass a NULL here if you don't care. Will return -1 if we
00061  *             can't determine a value, or we're not running on a battery.
00062  *
00063  *  \return The state of the battery (if any).
00064  */
00065 extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
00066 
00067 /* Ends C function definitions when using C++ */
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071 #include "close_code.h"
00072 
00073 #endif /* _SDL_power_h */
00074 
00075 /* vi: set ts=4 sw=4 expandtab: */