include/SDL_power.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 15 Nov 2016 01:30:08 -0800
changeset 10616 d17dd08640a4
parent 9998 f67cf37e9cd4
child 10638 d11daa346140
permissions -rw-r--r--
Fixed bug 1646 - Warnings from clang with -Weverything
icculus@3170
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 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@7191
    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
extern "C" {
icculus@3170
    37
#endif
icculus@3170
    38
icculus@3170
    39
/**
slouken@3407
    40
 *  \brief The basic state for the system's power supply.
icculus@3170
    41
 */
icculus@3170
    42
typedef enum
icculus@3170
    43
{
icculus@3170
    44
    SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
icculus@3170
    45
    SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
icculus@3170
    46
    SDL_POWERSTATE_NO_BATTERY,   /**< Plugged in, no battery available */
icculus@3170
    47
    SDL_POWERSTATE_CHARGING,     /**< Plugged in, charging battery */
slouken@3428
    48
    SDL_POWERSTATE_CHARGED       /**< Plugged in, battery charged */
icculus@3170
    49
} SDL_PowerState;
icculus@3170
    50
icculus@3170
    51
icculus@3170
    52
/**
slouken@3407
    53
 *  \brief Get the current power supply details.
slouken@7191
    54
 *
slouken@3407
    55
 *  \param secs Seconds of battery life left. You can pass a NULL here if
slouken@3407
    56
 *              you don't care. Will return -1 if we can't determine a
slouken@3407
    57
 *              value, or we're not running on a battery.
slouken@7191
    58
 *
slouken@3407
    59
 *  \param pct Percentage of battery life left, between 0 and 100. You can
slouken@3407
    60
 *             pass a NULL here if you don't care. Will return -1 if we
slouken@3407
    61
 *             can't determine a value, or we're not running on a battery.
slouken@7191
    62
 *
slouken@3407
    63
 *  \return The state of the battery (if any).
icculus@3170
    64
 */
icculus@3170
    65
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
icculus@3170
    66
icculus@3170
    67
/* Ends C function definitions when using C++ */
icculus@3170
    68
#ifdef __cplusplus
icculus@3170
    69
}
icculus@3170
    70
#endif
icculus@3170
    71
#include "close_code.h"
icculus@3170
    72
icculus@3170
    73
#endif /* _SDL_power_h */
icculus@3170
    74
icculus@3170
    75
/* vi: set ts=4 sw=4 expandtab: */