SDL_power.h 2.4 KB

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