| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
SDL.Power
Contents
Synopsis
- getPowerInfo :: (Functor m, MonadIO m) => m PowerState
- data PowerState
- data BatteryState
- data Charge = Charge {}
Power Status
getPowerInfo :: (Functor m, MonadIO m) => m PowerState Source #
Current power supply details.
Throws SDLException if the current power state can not be determined.
See SDL_GetPowerInfo for C documentation.
data PowerState Source #
Information about the power supply for the user's environment
Constructors
| Battery BatteryState Charge | The user is on a battery powered device. See |
| Mains | The user is on a device connected to the mains. |
| UnknownPowerState | SDL could not determine the power for the device. |
Instances
data BatteryState Source #
Information on battery consumption for battery powered devices
Constructors
| Draining | The battery is currently being drained. |
| Charged | The battery is fully charged. |
| Charging | The device is plugged in and the battery is charging. |
Instances
Information about how much charge a battery has.
Constructors
| Charge | |
Fields
| |
Instances
| Eq Charge Source # | |
| Ord Charge Source # | |
| Read Charge Source # | |
| Show Charge Source # | |
| Generic Charge Source # | |
| type Rep Charge Source # | |
Defined in SDL.Power type Rep Charge = D1 (MetaData "Charge" "SDL.Power" "sdl2-2.5.0.0-Lx238k9SgAK76UmMp4CYSj" False) (C1 (MetaCons "Charge" PrefixI True) (S1 (MetaSel (Just "chargeSecondsLeft") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe CInt)) :*: S1 (MetaSel (Just "chargePercent") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe CInt)))) | |