Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
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
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.
Charge | |
|
Instances
Generic Charge Source # | |
Read Charge Source # | |
Show Charge Source # | |
Eq Charge Source # | |
Ord Charge Source # | |
Defined in SDL.Power | |
type Rep Charge Source # | |
Defined in SDL.Power type Rep Charge = D1 ('MetaData "Charge" "SDL.Power" "sdl2-2.5.5.0-inplace" '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)))) |