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