sdlpower.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // based on "sdl_power.h" (2.0.14)
  2. {**
  3. * \file SDL_power.h
  4. *
  5. * Header for the SDL power management routines.
  6. *}
  7. {**
  8. * The basic state for the system's power supply.
  9. *}
  10. type
  11. PPSDL_PowerState = ^PSDL_PowerState;
  12. PSDL_PowerState = ^TSDL_PowerState;
  13. TSDL_PowerState = (SDL_POWERSTATE_UNKNOWN, {**< cannot determine power status *}
  14. SDL_POWERSTATE_ON_BATTERY, {**< Not plugged in, running on the battery *}
  15. SDL_POWERSTATE_NO_BATTERY, {**< Plugged in, no battery available *}
  16. SDL_POWERSTATE_CHARGING, {**< Plugged in, charging battery *}
  17. SDL_POWERSTATE_CHARGED); {**< Plugged in, battery charged *}
  18. {**
  19. * \brief Get the current power supply details.
  20. *
  21. * \param secs Seconds of battery life left. You can pass a NULL here if
  22. * you don't care. Will return -1 if we can't determine a
  23. * value, or we're not running on a battery.
  24. *
  25. * \param pct Percentage of battery life left, between 0 and 100. You can
  26. * pass a NULL here if you don't care. Will return -1 if we
  27. * can't determine a value, or we're not running on a battery.
  28. *
  29. * \return The state of the battery (if any).
  30. *}
  31. function SDL_GetPowerInfo(secs: pcint; pct: pcint): TSDL_PowerState; cdecl;
  32. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetPowerInfo' {$ENDIF} {$ENDIF};