include/SDL_power.h
changeset 3170 b7a48f533966
child 3407 d3baf5ac4e37
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_power.h	Sun Jun 07 06:06:35 2009 +0000
     1.3 @@ -0,0 +1,84 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2009 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +#ifndef _SDL_power_h
    1.27 +#define _SDL_power_h
    1.28 +
    1.29 +/**
    1.30 + * \file SDL_power.h
    1.31 + *
    1.32 + * Header for the SDL power management routines
    1.33 + */
    1.34 +
    1.35 +#include "SDL_stdinc.h"
    1.36 +
    1.37 +#include "begin_code.h"
    1.38 +/* Set up for C function definitions, even when using C++ */
    1.39 +#ifdef __cplusplus
    1.40 +/* *INDENT-OFF* */
    1.41 +extern "C" {
    1.42 +/* *INDENT-ON* */
    1.43 +#endif
    1.44 +
    1.45 +/**
    1.46 + * \enum SDL_PowerState
    1.47 + *
    1.48 + * \brief The basic state for the system's power supply.
    1.49 + */
    1.50 +typedef enum
    1.51 +{
    1.52 +    SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
    1.53 +    SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
    1.54 +    SDL_POWERSTATE_NO_BATTERY,   /**< Plugged in, no battery available */
    1.55 +    SDL_POWERSTATE_CHARGING,     /**< Plugged in, charging battery */
    1.56 +    SDL_POWERSTATE_CHARGED,      /**< Plugged in, battery charged */
    1.57 +} SDL_PowerState;
    1.58 +
    1.59 +
    1.60 +/**
    1.61 + * \fn int SDL_GetPowerInfo(void)
    1.62 + *
    1.63 + * \brief Get the current power supply details.
    1.64 + *
    1.65 + * \param secs Seconds of battery life left. You can pass a NULL here if
    1.66 + *                you don't care. Will return -1 if we can't determine a
    1.67 + *                value, or we're not running on a battery.
    1.68 + *
    1.69 + * \param pct Percentage of battery life left, between 0 and 100. You can
    1.70 + *                pass a NULL here if you don't care. Will return -1 if we
    1.71 + *                can't determine a value, or we're not running on a battery.
    1.72 + *
    1.73 + * \return The state of the battery (if any).
    1.74 + */
    1.75 +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
    1.76 +
    1.77 +/* Ends C function definitions when using C++ */
    1.78 +#ifdef __cplusplus
    1.79 +/* *INDENT-OFF* */
    1.80 +}
    1.81 +/* *INDENT-ON* */
    1.82 +#endif
    1.83 +#include "close_code.h"
    1.84 +
    1.85 +#endif /* _SDL_power_h */
    1.86 +
    1.87 +/* vi: set ts=4 sw=4 expandtab: */