{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- | SDL sensor management.
--
--     These APIs grant access to gyros and accelerometers on various platforms.
--
--     In order to use these functions, SDL_Init() must have been called with the SDL_INIT_SENSOR flag. This causes SDL to scan the system for sensors, and load appropriate drivers. The opaque structure used to identify an opened SDL sensor.
--
--     @since 3.2.0
module SDL3.Sys.Bindgen.Sensor (
  SDL3.Sys.Bindgen.Sensor.SDL_Sensor,
  SDL3.Sys.Bindgen.Sensor.SDL_SensorID (..),
  SDL3.Sys.Bindgen.Sensor.sDL_STANDARD_GRAVITY,
  SDL3.Sys.Bindgen.Sensor.SDL_SensorType (..),
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_INVALID,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_UNKNOWN,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_ACCEL,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_GYRO,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_ACCEL_L,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_GYRO_L,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_ACCEL_R,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_GYRO_R,
  pattern SDL3.Sys.Bindgen.Sensor.SDL_SENSOR_COUNT,
)
where

import Prelude (Bounded, Enum, Eq, Int, Integral, Num, Ord, Read, Real, Show, pure, (<*>), type (~))

import HsBindgen.Runtime.CEnum qualified as CEnum
import HsBindgen.Runtime.HasCField qualified as HasCField
import HsBindgen.Runtime.Marshal qualified as Marshal
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CompatHasField qualified as BG.CompatHasField
import SDL3.Sys.Bindgen.Stdinc qualified

-- | [C declaration]: @struct SDL_Sensor@, defined at @SDL3\/SDL_sensor.h 54:16@
data SDL_Sensor

-- | This is a unique ID for a sensor for the time it is connected to the system, and is never reused for the lifetime of the application.
--
--     The value 0 is an invalid ID.
--
--     @since 3.2.0
--
--     [C declaration]: @SDL_SensorID@, defined at @SDL3\/SDL_sensor.h 64:16@
newtype SDL_SensorID = SDL_SensorID
  { SDL_SensorID -> Uint32
unwrap :: SDL3.Sys.Bindgen.Stdinc.Uint32
  }
  deriving stock ((forall x. SDL_SensorID -> Rep SDL_SensorID x)
-> (forall x. Rep SDL_SensorID x -> SDL_SensorID)
-> Generic SDL_SensorID
forall x. Rep SDL_SensorID x -> SDL_SensorID
forall x. SDL_SensorID -> Rep SDL_SensorID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_SensorID -> Rep SDL_SensorID x
from :: forall x. SDL_SensorID -> Rep SDL_SensorID x
$cto :: forall x. Rep SDL_SensorID x -> SDL_SensorID
to :: forall x. Rep SDL_SensorID x -> SDL_SensorID
BG.Generic, SDL_SensorID -> SDL_SensorID -> Bool
(SDL_SensorID -> SDL_SensorID -> Bool)
-> (SDL_SensorID -> SDL_SensorID -> Bool) -> Eq SDL_SensorID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_SensorID -> SDL_SensorID -> Bool
== :: SDL_SensorID -> SDL_SensorID -> Bool
$c/= :: SDL_SensorID -> SDL_SensorID -> Bool
/= :: SDL_SensorID -> SDL_SensorID -> Bool
Eq, Eq SDL_SensorID
Eq SDL_SensorID =>
(SDL_SensorID -> SDL_SensorID -> Ordering)
-> (SDL_SensorID -> SDL_SensorID -> Bool)
-> (SDL_SensorID -> SDL_SensorID -> Bool)
-> (SDL_SensorID -> SDL_SensorID -> Bool)
-> (SDL_SensorID -> SDL_SensorID -> Bool)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> Ord SDL_SensorID
SDL_SensorID -> SDL_SensorID -> Bool
SDL_SensorID -> SDL_SensorID -> Ordering
SDL_SensorID -> SDL_SensorID -> SDL_SensorID
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_SensorID -> SDL_SensorID -> Ordering
compare :: SDL_SensorID -> SDL_SensorID -> Ordering
$c< :: SDL_SensorID -> SDL_SensorID -> Bool
< :: SDL_SensorID -> SDL_SensorID -> Bool
$c<= :: SDL_SensorID -> SDL_SensorID -> Bool
<= :: SDL_SensorID -> SDL_SensorID -> Bool
$c> :: SDL_SensorID -> SDL_SensorID -> Bool
> :: SDL_SensorID -> SDL_SensorID -> Bool
$c>= :: SDL_SensorID -> SDL_SensorID -> Bool
>= :: SDL_SensorID -> SDL_SensorID -> Bool
$cmax :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
max :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cmin :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
min :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
Ord, ReadPrec [SDL_SensorID]
ReadPrec SDL_SensorID
Int -> ReadS SDL_SensorID
ReadS [SDL_SensorID]
(Int -> ReadS SDL_SensorID)
-> ReadS [SDL_SensorID]
-> ReadPrec SDL_SensorID
-> ReadPrec [SDL_SensorID]
-> Read SDL_SensorID
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SDL_SensorID
readsPrec :: Int -> ReadS SDL_SensorID
$creadList :: ReadS [SDL_SensorID]
readList :: ReadS [SDL_SensorID]
$creadPrec :: ReadPrec SDL_SensorID
readPrec :: ReadPrec SDL_SensorID
$creadListPrec :: ReadPrec [SDL_SensorID]
readListPrec :: ReadPrec [SDL_SensorID]
Read, Int -> SDL_SensorID -> ShowS
[SDL_SensorID] -> ShowS
SDL_SensorID -> String
(Int -> SDL_SensorID -> ShowS)
-> (SDL_SensorID -> String)
-> ([SDL_SensorID] -> ShowS)
-> Show SDL_SensorID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_SensorID -> ShowS
showsPrec :: Int -> SDL_SensorID -> ShowS
$cshow :: SDL_SensorID -> String
show :: SDL_SensorID -> String
$cshowList :: [SDL_SensorID] -> ShowS
showList :: [SDL_SensorID] -> ShowS
Show)
  deriving newtype
    ( Word64 -> Int -> SDL_SensorID
SDL_SensorID -> Int -> Word64
(SDL_SensorID -> Int -> Word64)
-> (Word64 -> Int -> SDL_SensorID) -> Bitfield SDL_SensorID
forall a.
(a -> Int -> Word64) -> (Word64 -> Int -> a) -> Bitfield a
$cnarrow :: SDL_SensorID -> Int -> Word64
narrow :: SDL_SensorID -> Int -> Word64
$cextend :: Word64 -> Int -> SDL_SensorID
extend :: Word64 -> Int -> SDL_SensorID
BG.Bitfield
    , Eq SDL_SensorID
SDL_SensorID
Eq SDL_SensorID =>
(SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> SDL_SensorID
-> (Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> Bool)
-> (SDL_SensorID -> Maybe Int)
-> (SDL_SensorID -> Int)
-> (SDL_SensorID -> Bool)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int -> SDL_SensorID)
-> (SDL_SensorID -> Int)
-> Bits SDL_SensorID
Int -> SDL_SensorID
SDL_SensorID -> Bool
SDL_SensorID -> Int
SDL_SensorID -> Maybe Int
SDL_SensorID -> SDL_SensorID
SDL_SensorID -> Int -> Bool
SDL_SensorID -> Int -> SDL_SensorID
SDL_SensorID -> SDL_SensorID -> SDL_SensorID
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
.&. :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$c.|. :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
.|. :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cxor :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
xor :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$ccomplement :: SDL_SensorID -> SDL_SensorID
complement :: SDL_SensorID -> SDL_SensorID
$cshift :: SDL_SensorID -> Int -> SDL_SensorID
shift :: SDL_SensorID -> Int -> SDL_SensorID
$crotate :: SDL_SensorID -> Int -> SDL_SensorID
rotate :: SDL_SensorID -> Int -> SDL_SensorID
$czeroBits :: SDL_SensorID
zeroBits :: SDL_SensorID
$cbit :: Int -> SDL_SensorID
bit :: Int -> SDL_SensorID
$csetBit :: SDL_SensorID -> Int -> SDL_SensorID
setBit :: SDL_SensorID -> Int -> SDL_SensorID
$cclearBit :: SDL_SensorID -> Int -> SDL_SensorID
clearBit :: SDL_SensorID -> Int -> SDL_SensorID
$ccomplementBit :: SDL_SensorID -> Int -> SDL_SensorID
complementBit :: SDL_SensorID -> Int -> SDL_SensorID
$ctestBit :: SDL_SensorID -> Int -> Bool
testBit :: SDL_SensorID -> Int -> Bool
$cbitSizeMaybe :: SDL_SensorID -> Maybe Int
bitSizeMaybe :: SDL_SensorID -> Maybe Int
$cbitSize :: SDL_SensorID -> Int
bitSize :: SDL_SensorID -> Int
$cisSigned :: SDL_SensorID -> Bool
isSigned :: SDL_SensorID -> Bool
$cshiftL :: SDL_SensorID -> Int -> SDL_SensorID
shiftL :: SDL_SensorID -> Int -> SDL_SensorID
$cunsafeShiftL :: SDL_SensorID -> Int -> SDL_SensorID
unsafeShiftL :: SDL_SensorID -> Int -> SDL_SensorID
$cshiftR :: SDL_SensorID -> Int -> SDL_SensorID
shiftR :: SDL_SensorID -> Int -> SDL_SensorID
$cunsafeShiftR :: SDL_SensorID -> Int -> SDL_SensorID
unsafeShiftR :: SDL_SensorID -> Int -> SDL_SensorID
$crotateL :: SDL_SensorID -> Int -> SDL_SensorID
rotateL :: SDL_SensorID -> Int -> SDL_SensorID
$crotateR :: SDL_SensorID -> Int -> SDL_SensorID
rotateR :: SDL_SensorID -> Int -> SDL_SensorID
$cpopCount :: SDL_SensorID -> Int
popCount :: SDL_SensorID -> Int
BG.Bits
    , Bits SDL_SensorID
Bits SDL_SensorID =>
(SDL_SensorID -> Int)
-> (SDL_SensorID -> Int)
-> (SDL_SensorID -> Int)
-> FiniteBits SDL_SensorID
SDL_SensorID -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: SDL_SensorID -> Int
finiteBitSize :: SDL_SensorID -> Int
$ccountLeadingZeros :: SDL_SensorID -> Int
countLeadingZeros :: SDL_SensorID -> Int
$ccountTrailingZeros :: SDL_SensorID -> Int
countTrailingZeros :: SDL_SensorID -> Int
BG.FiniteBits
    , FFIType SDL_SensorID -> SDL_SensorID
SDL_SensorID -> FFIType SDL_SensorID
(SDL_SensorID -> FFIType SDL_SensorID)
-> (FFIType SDL_SensorID -> SDL_SensorID)
-> HasFFIType SDL_SensorID
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_SensorID -> FFIType SDL_SensorID
toFFIType :: SDL_SensorID -> FFIType SDL_SensorID
$cfromFFIType :: FFIType SDL_SensorID -> SDL_SensorID
fromFFIType :: FFIType SDL_SensorID -> SDL_SensorID
BG.HasFFIType
    , Ord SDL_SensorID
Ord SDL_SensorID =>
((SDL_SensorID, SDL_SensorID) -> [SDL_SensorID])
-> ((SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int)
-> ((SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int)
-> ((SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Bool)
-> ((SDL_SensorID, SDL_SensorID) -> Int)
-> ((SDL_SensorID, SDL_SensorID) -> Int)
-> Ix SDL_SensorID
(SDL_SensorID, SDL_SensorID) -> Int
(SDL_SensorID, SDL_SensorID) -> [SDL_SensorID]
(SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Bool
(SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int
forall a.
Ord a =>
((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
$crange :: (SDL_SensorID, SDL_SensorID) -> [SDL_SensorID]
range :: (SDL_SensorID, SDL_SensorID) -> [SDL_SensorID]
$cindex :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int
index :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int
$cunsafeIndex :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int
unsafeIndex :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Int
$cinRange :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Bool
inRange :: (SDL_SensorID, SDL_SensorID) -> SDL_SensorID -> Bool
$crangeSize :: (SDL_SensorID, SDL_SensorID) -> Int
rangeSize :: (SDL_SensorID, SDL_SensorID) -> Int
$cunsafeRangeSize :: (SDL_SensorID, SDL_SensorID) -> Int
unsafeRangeSize :: (SDL_SensorID, SDL_SensorID) -> Int
BG.Ix
    , Addr# -> Int# -> SDL_SensorID
ByteArray# -> Int# -> SDL_SensorID
Proxy SDL_SensorID -> Int#
SDL_SensorID -> Int#
(Proxy SDL_SensorID -> Int#)
-> (SDL_SensorID -> Int#)
-> (Proxy SDL_SensorID -> Int#)
-> (SDL_SensorID -> Int#)
-> (ByteArray# -> Int# -> SDL_SensorID)
-> (forall s.
    MutableByteArray# s
    -> Int# -> State# s -> (# State# s, SDL_SensorID #))
-> (forall s.
    MutableByteArray# s
    -> Int# -> SDL_SensorID -> State# s -> State# s)
-> (forall s.
    MutableByteArray# s
    -> Int# -> Int# -> SDL_SensorID -> State# s -> State# s)
-> (Addr# -> Int# -> SDL_SensorID)
-> (forall s.
    Addr# -> Int# -> State# s -> (# State# s, SDL_SensorID #))
-> (forall s.
    Addr# -> Int# -> SDL_SensorID -> State# s -> State# s)
-> (forall s.
    Addr# -> Int# -> Int# -> SDL_SensorID -> State# s -> State# s)
-> Prim SDL_SensorID
forall s.
Addr# -> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_SensorID #)
forall s. Addr# -> Int# -> SDL_SensorID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_SensorID #)
forall s.
MutableByteArray# s -> Int# -> SDL_SensorID -> State# s -> State# s
forall a.
(Proxy a -> Int#)
-> (a -> Int#)
-> (Proxy a -> Int#)
-> (a -> Int#)
-> (ByteArray# -> Int# -> a)
-> (forall s.
    MutableByteArray# s -> Int# -> State# s -> (# State# s, a #))
-> (forall s.
    MutableByteArray# s -> Int# -> a -> State# s -> State# s)
-> (forall s.
    MutableByteArray# s -> Int# -> Int# -> a -> State# s -> State# s)
-> (Addr# -> Int# -> a)
-> (forall s. Addr# -> Int# -> State# s -> (# State# s, a #))
-> (forall s. Addr# -> Int# -> a -> State# s -> State# s)
-> (forall s. Addr# -> Int# -> Int# -> a -> State# s -> State# s)
-> Prim a
$csizeOfType# :: Proxy SDL_SensorID -> Int#
sizeOfType# :: Proxy SDL_SensorID -> Int#
$csizeOf# :: SDL_SensorID -> Int#
sizeOf# :: SDL_SensorID -> Int#
$calignmentOfType# :: Proxy SDL_SensorID -> Int#
alignmentOfType# :: Proxy SDL_SensorID -> Int#
$calignment# :: SDL_SensorID -> Int#
alignment# :: SDL_SensorID -> Int#
$cindexByteArray# :: ByteArray# -> Int# -> SDL_SensorID
indexByteArray# :: ByteArray# -> Int# -> SDL_SensorID
$creadByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_SensorID #)
readByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_SensorID #)
$cwriteByteArray# :: forall s.
MutableByteArray# s -> Int# -> SDL_SensorID -> State# s -> State# s
writeByteArray# :: forall s.
MutableByteArray# s -> Int# -> SDL_SensorID -> State# s -> State# s
$csetByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
setByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
$cindexOffAddr# :: Addr# -> Int# -> SDL_SensorID
indexOffAddr# :: Addr# -> Int# -> SDL_SensorID
$creadOffAddr# :: forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_SensorID #)
readOffAddr# :: forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_SensorID #)
$cwriteOffAddr# :: forall s. Addr# -> Int# -> SDL_SensorID -> State# s -> State# s
writeOffAddr# :: forall s. Addr# -> Int# -> SDL_SensorID -> State# s -> State# s
$csetOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
setOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_SensorID -> State# s -> State# s
BG.Prim
    , Ptr SDL_SensorID -> IO SDL_SensorID
Ptr SDL_SensorID -> Int -> IO SDL_SensorID
Ptr SDL_SensorID -> Int -> SDL_SensorID -> IO ()
Ptr SDL_SensorID -> SDL_SensorID -> IO ()
SDL_SensorID -> Int
(SDL_SensorID -> Int)
-> (SDL_SensorID -> Int)
-> (Ptr SDL_SensorID -> Int -> IO SDL_SensorID)
-> (Ptr SDL_SensorID -> Int -> SDL_SensorID -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_SensorID)
-> (forall b. Ptr b -> Int -> SDL_SensorID -> IO ())
-> (Ptr SDL_SensorID -> IO SDL_SensorID)
-> (Ptr SDL_SensorID -> SDL_SensorID -> IO ())
-> Storable SDL_SensorID
forall b. Ptr b -> Int -> IO SDL_SensorID
forall b. Ptr b -> Int -> SDL_SensorID -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: SDL_SensorID -> Int
sizeOf :: SDL_SensorID -> Int
$calignment :: SDL_SensorID -> Int
alignment :: SDL_SensorID -> Int
$cpeekElemOff :: Ptr SDL_SensorID -> Int -> IO SDL_SensorID
peekElemOff :: Ptr SDL_SensorID -> Int -> IO SDL_SensorID
$cpokeElemOff :: Ptr SDL_SensorID -> Int -> SDL_SensorID -> IO ()
pokeElemOff :: Ptr SDL_SensorID -> Int -> SDL_SensorID -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_SensorID
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_SensorID
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_SensorID -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_SensorID -> IO ()
$cpeek :: Ptr SDL_SensorID -> IO SDL_SensorID
peek :: Ptr SDL_SensorID -> IO SDL_SensorID
$cpoke :: Ptr SDL_SensorID -> SDL_SensorID -> IO ()
poke :: Ptr SDL_SensorID -> SDL_SensorID -> IO ()
BG.Storable
    , SDL_SensorID
SDL_SensorID -> SDL_SensorID -> Bounded SDL_SensorID
forall a. a -> a -> Bounded a
$cminBound :: SDL_SensorID
minBound :: SDL_SensorID
$cmaxBound :: SDL_SensorID
maxBound :: SDL_SensorID
Bounded
    , Int -> SDL_SensorID
SDL_SensorID -> Int
SDL_SensorID -> [SDL_SensorID]
SDL_SensorID -> SDL_SensorID
SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
SDL_SensorID -> SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
(SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID)
-> (Int -> SDL_SensorID)
-> (SDL_SensorID -> Int)
-> (SDL_SensorID -> [SDL_SensorID])
-> (SDL_SensorID -> SDL_SensorID -> [SDL_SensorID])
-> (SDL_SensorID -> SDL_SensorID -> [SDL_SensorID])
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID -> [SDL_SensorID])
-> Enum SDL_SensorID
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: SDL_SensorID -> SDL_SensorID
succ :: SDL_SensorID -> SDL_SensorID
$cpred :: SDL_SensorID -> SDL_SensorID
pred :: SDL_SensorID -> SDL_SensorID
$ctoEnum :: Int -> SDL_SensorID
toEnum :: Int -> SDL_SensorID
$cfromEnum :: SDL_SensorID -> Int
fromEnum :: SDL_SensorID -> Int
$cenumFrom :: SDL_SensorID -> [SDL_SensorID]
enumFrom :: SDL_SensorID -> [SDL_SensorID]
$cenumFromThen :: SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
enumFromThen :: SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
$cenumFromTo :: SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
enumFromTo :: SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
$cenumFromThenTo :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
enumFromThenTo :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID -> [SDL_SensorID]
Enum
    , Enum SDL_SensorID
Real SDL_SensorID
(Real SDL_SensorID, Enum SDL_SensorID) =>
(SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID))
-> (SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID))
-> (SDL_SensorID -> Integer)
-> Integral SDL_SensorID
SDL_SensorID -> Integer
SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID)
SDL_SensorID -> SDL_SensorID -> SDL_SensorID
forall a.
(Real a, Enum a) =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
$cquot :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
quot :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$crem :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
rem :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cdiv :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
div :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cmod :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
mod :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cquotRem :: SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID)
quotRem :: SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID)
$cdivMod :: SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID)
divMod :: SDL_SensorID -> SDL_SensorID -> (SDL_SensorID, SDL_SensorID)
$ctoInteger :: SDL_SensorID -> Integer
toInteger :: SDL_SensorID -> Integer
Integral
    , Ptr SDL_SensorID -> IO SDL_SensorID
(Ptr SDL_SensorID -> IO SDL_SensorID) -> ReadRaw SDL_SensorID
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_SensorID -> IO SDL_SensorID
readRaw :: Ptr SDL_SensorID -> IO SDL_SensorID
Marshal.ReadRaw
    , Proxy SDL_SensorID -> Int
(Proxy SDL_SensorID -> Int)
-> (Proxy SDL_SensorID -> Int) -> StaticSize SDL_SensorID
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_SensorID -> Int
staticSizeOf :: Proxy SDL_SensorID -> Int
$cstaticAlignment :: Proxy SDL_SensorID -> Int
staticAlignment :: Proxy SDL_SensorID -> Int
Marshal.StaticSize
    , Ptr SDL_SensorID -> SDL_SensorID -> IO ()
(Ptr SDL_SensorID -> SDL_SensorID -> IO ())
-> WriteRaw SDL_SensorID
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_SensorID -> SDL_SensorID -> IO ()
writeRaw :: Ptr SDL_SensorID -> SDL_SensorID -> IO ()
Marshal.WriteRaw
    , Integer -> SDL_SensorID
SDL_SensorID -> SDL_SensorID
SDL_SensorID -> SDL_SensorID -> SDL_SensorID
(SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID)
-> (SDL_SensorID -> SDL_SensorID)
-> (Integer -> SDL_SensorID)
-> Num SDL_SensorID
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
+ :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$c- :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
- :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$c* :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
* :: SDL_SensorID -> SDL_SensorID -> SDL_SensorID
$cnegate :: SDL_SensorID -> SDL_SensorID
negate :: SDL_SensorID -> SDL_SensorID
$cabs :: SDL_SensorID -> SDL_SensorID
abs :: SDL_SensorID -> SDL_SensorID
$csignum :: SDL_SensorID -> SDL_SensorID
signum :: SDL_SensorID -> SDL_SensorID
$cfromInteger :: Integer -> SDL_SensorID
fromInteger :: Integer -> SDL_SensorID
Num
    , Num SDL_SensorID
Ord SDL_SensorID
(Num SDL_SensorID, Ord SDL_SensorID) =>
(SDL_SensorID -> Rational) -> Real SDL_SensorID
SDL_SensorID -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
$ctoRational :: SDL_SensorID -> Rational
toRational :: SDL_SensorID -> Rational
Real
    )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint32)
  => BG.CompatHasField.HasField "unwrap" SDL_SensorID ty
  where
  hasField :: SDL_SensorID -> (ty -> SDL_SensorID, ty)
hasField =
    \SDL_SensorID
x0 ->
      ( \ty
y1 ->
          SDL_SensorID{unwrap :: Uint32
unwrap = ty
Uint32
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_SensorID
x0
      )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint32)
  => BG.HasField "unwrap" (BG.Ptr SDL_SensorID) (BG.Ptr ty)
  where
  getField :: Ptr SDL_SensorID -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_SensorID -> Ptr (CFieldType SDL_SensorID "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_SensorID "unwrap" where
  type
    CFieldType SDL_SensorID "unwrap" =
      SDL3.Sys.Bindgen.Stdinc.Uint32

  offset# :: Proxy# SDL_SensorID -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_SensorID
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | A constant to represent standard gravity for accelerometer sensors.
--
--     The accelerometer returns the current acceleration in SI meters per second squared. This measurement includes the force of gravity, so a device at rest will have an value of SDL_STANDARD_GRAVITY away from the center of the earth, which is a positive Y value.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_STANDARD_GRAVITY@, defined at @SDL3\/SDL_sensor.h 76:9@
sDL_STANDARD_GRAVITY :: BG.CFloat
sDL_STANDARD_GRAVITY :: CFloat
sDL_STANDARD_GRAVITY = (CFloat
9.80665 :: BG.CFloat)

-- | The different sensors defined by SDL.
--
--     Additional sensors may be available, using platform dependent semantics.
--
--     Here are the additional Android sensors:
--
--     [https:\/\/developer.android.com\/reference\/android\/hardware\/SensorEvent.html\#values](https://developer.android.com/reference/android/hardware/SensorEvent.html#values)
--
--     Accelerometer sensor notes:
--
--     The accelerometer returns the current acceleration in SI meters per second squared. This measurement includes the force of gravity, so a device at rest will have an value of SDL_STANDARD_GRAVITY away from the center of the earth, which is a positive Y value.
--
--     * @values[0]@: Acceleration on the x axis
--
--     * @values[1]@: Acceleration on the y axis
--
--     * @values[2]@: Acceleration on the z axis
--
--     For phones and tablets held in natural orientation and game controllers held in front of you, the axes are defined as follows:
--
--     * -X ... +X : left ... right
--
--     * -Y ... +Y : bottom ... top
--
--     * -Z ... +Z : farther ... closer
--
--     The accelerometer axis data is not changed when the device is rotated.
--
--     Gyroscope sensor notes:
--
--     The gyroscope returns the current rate of rotation in radians per second. The rotation is positive in the counter-clockwise direction. That is, an observer looking from a positive location on one of the axes would see positive rotation on that axis when it appeared to be rotating counter-clockwise.
--
--     * @values[0]@: Angular speed around the x axis (pitch)
--
--     * @values[1]@: Angular speed around the y axis (yaw)
--
--     * @values[2]@: Angular speed around the z axis (roll)
--
--     For phones and tablets held in natural orientation and game controllers held in front of you, the axes are defined as follows:
--
--     * -X ... +X : left ... right
--
--     * -Y ... +Y : bottom ... top
--
--     * -Z ... +Z : farther ... closer
--
--     The gyroscope axis data is not changed when the device is rotated.
--
--     @since 3.2.0
--
--     [See also]: SDL_GetCurrentDisplayOrientation
--
--     [C declaration]: @enum SDL_SensorType@, defined at @SDL3\/SDL_sensor.h 132:14@
newtype SDL_SensorType = SDL_SensorType
  { SDL_SensorType -> CInt
unwrap :: BG.CInt
  }
  deriving stock ((forall x. SDL_SensorType -> Rep SDL_SensorType x)
-> (forall x. Rep SDL_SensorType x -> SDL_SensorType)
-> Generic SDL_SensorType
forall x. Rep SDL_SensorType x -> SDL_SensorType
forall x. SDL_SensorType -> Rep SDL_SensorType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_SensorType -> Rep SDL_SensorType x
from :: forall x. SDL_SensorType -> Rep SDL_SensorType x
$cto :: forall x. Rep SDL_SensorType x -> SDL_SensorType
to :: forall x. Rep SDL_SensorType x -> SDL_SensorType
BG.Generic, SDL_SensorType -> SDL_SensorType -> Bool
(SDL_SensorType -> SDL_SensorType -> Bool)
-> (SDL_SensorType -> SDL_SensorType -> Bool) -> Eq SDL_SensorType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_SensorType -> SDL_SensorType -> Bool
== :: SDL_SensorType -> SDL_SensorType -> Bool
$c/= :: SDL_SensorType -> SDL_SensorType -> Bool
/= :: SDL_SensorType -> SDL_SensorType -> Bool
Eq, Eq SDL_SensorType
Eq SDL_SensorType =>
(SDL_SensorType -> SDL_SensorType -> Ordering)
-> (SDL_SensorType -> SDL_SensorType -> Bool)
-> (SDL_SensorType -> SDL_SensorType -> Bool)
-> (SDL_SensorType -> SDL_SensorType -> Bool)
-> (SDL_SensorType -> SDL_SensorType -> Bool)
-> (SDL_SensorType -> SDL_SensorType -> SDL_SensorType)
-> (SDL_SensorType -> SDL_SensorType -> SDL_SensorType)
-> Ord SDL_SensorType
SDL_SensorType -> SDL_SensorType -> Bool
SDL_SensorType -> SDL_SensorType -> Ordering
SDL_SensorType -> SDL_SensorType -> SDL_SensorType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_SensorType -> SDL_SensorType -> Ordering
compare :: SDL_SensorType -> SDL_SensorType -> Ordering
$c< :: SDL_SensorType -> SDL_SensorType -> Bool
< :: SDL_SensorType -> SDL_SensorType -> Bool
$c<= :: SDL_SensorType -> SDL_SensorType -> Bool
<= :: SDL_SensorType -> SDL_SensorType -> Bool
$c> :: SDL_SensorType -> SDL_SensorType -> Bool
> :: SDL_SensorType -> SDL_SensorType -> Bool
$c>= :: SDL_SensorType -> SDL_SensorType -> Bool
>= :: SDL_SensorType -> SDL_SensorType -> Bool
$cmax :: SDL_SensorType -> SDL_SensorType -> SDL_SensorType
max :: SDL_SensorType -> SDL_SensorType -> SDL_SensorType
$cmin :: SDL_SensorType -> SDL_SensorType -> SDL_SensorType
min :: SDL_SensorType -> SDL_SensorType -> SDL_SensorType
Ord)
  deriving newtype (FFIType SDL_SensorType -> SDL_SensorType
SDL_SensorType -> FFIType SDL_SensorType
(SDL_SensorType -> FFIType SDL_SensorType)
-> (FFIType SDL_SensorType -> SDL_SensorType)
-> HasFFIType SDL_SensorType
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_SensorType -> FFIType SDL_SensorType
toFFIType :: SDL_SensorType -> FFIType SDL_SensorType
$cfromFFIType :: FFIType SDL_SensorType -> SDL_SensorType
fromFFIType :: FFIType SDL_SensorType -> SDL_SensorType
BG.HasFFIType)

instance Marshal.StaticSize SDL_SensorType where
  staticSizeOf :: Proxy SDL_SensorType -> Int
staticSizeOf = \Proxy SDL_SensorType
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_SensorType -> Int
staticAlignment = \Proxy SDL_SensorType
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_SensorType where
  readRaw :: Ptr SDL_SensorType -> IO SDL_SensorType
readRaw =
    \Ptr SDL_SensorType
ptr0 ->
      (CInt -> SDL_SensorType) -> IO (CInt -> SDL_SensorType)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt -> SDL_SensorType
SDL_SensorType
        IO (CInt -> SDL_SensorType) -> IO CInt -> IO SDL_SensorType
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_SensorType -> Int -> IO CInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_SensorType
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_SensorType where
  writeRaw :: Ptr SDL_SensorType -> SDL_SensorType -> IO ()
writeRaw =
    \Ptr SDL_SensorType
ptr0 ->
      \SDL_SensorType
s1 ->
        case SDL_SensorType
s1 of
          SDL_SensorType CInt
unwrap2 ->
            Ptr SDL_SensorType -> Int -> CInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_SensorType
ptr0 (Int
0 :: Int) CInt
unwrap2

deriving via Marshal.EquivStorable SDL_SensorType instance BG.Storable SDL_SensorType

deriving via BG.CInt instance BG.Prim SDL_SensorType

instance CEnum.CEnum SDL_SensorType where
  type CEnumZ SDL_SensorType = BG.CInt

  toCEnum :: CEnumZ SDL_SensorType -> SDL_SensorType
toCEnum = CInt -> SDL_SensorType
CEnumZ SDL_SensorType -> SDL_SensorType
SDL_SensorType

  fromCEnum :: SDL_SensorType -> CEnumZ SDL_SensorType
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_SensorType -> DeclaredValues SDL_SensorType
declaredValues =
    \proxy SDL_SensorType
_ ->
      [(CEnumZ SDL_SensorType, NonEmpty String)]
-> DeclaredValues SDL_SensorType
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (-CInt
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_INVALID")
        , (CInt
CEnumZ SDL_SensorType
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_UNKNOWN")
        , (CInt
CEnumZ SDL_SensorType
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_ACCEL")
        , (CInt
CEnumZ SDL_SensorType
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_GYRO")
        , (CInt
CEnumZ SDL_SensorType
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_ACCEL_L")
        , (CInt
CEnumZ SDL_SensorType
4, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_GYRO_L")
        , (CInt
CEnumZ SDL_SensorType
5, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_ACCEL_R")
        , (CInt
CEnumZ SDL_SensorType
6, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_GYRO_R")
        , (CInt
CEnumZ SDL_SensorType
7, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_SENSOR_COUNT")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_SensorType -> Int -> CEnumZ SDL_SensorType -> ShowS
showsUndeclared =
    String
-> proxy SDL_SensorType -> Int -> CEnumZ SDL_SensorType -> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_SensorType"

  readPrecUndeclared :: ReadPrec SDL_SensorType
readPrecUndeclared =
    String -> ReadPrec SDL_SensorType
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_SensorType"

  isDeclared :: SDL_SensorType -> Bool
isDeclared = SDL_SensorType -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_SensorType -> Maybe SDL_SensorType
mkDeclared = CEnumZ SDL_SensorType -> Maybe SDL_SensorType
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_SensorType where
  minDeclaredValue :: SDL_SensorType
minDeclaredValue = SDL_SensorType
SDL_SENSOR_INVALID

  maxDeclaredValue :: SDL_SensorType
maxDeclaredValue = SDL_SensorType
SDL_SENSOR_COUNT

instance Show SDL_SensorType where
  showsPrec :: Int -> SDL_SensorType -> ShowS
showsPrec = Int -> SDL_SensorType -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_SensorType where
  readPrec :: ReadPrec SDL_SensorType
readPrec = ReadPrec SDL_SensorType
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_SensorType]
readList = ReadS [SDL_SensorType]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_SensorType]
readListPrec = ReadPrec [SDL_SensorType]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "unwrap" SDL_SensorType ty
  where
  hasField :: SDL_SensorType -> (ty -> SDL_SensorType, ty)
hasField =
    \SDL_SensorType
x0 ->
      ( \ty
y1 ->
          SDL_SensorType{unwrap :: CInt
unwrap = ty
CInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_SensorType
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_SensorType) (BG.Ptr ty)
  where
  getField :: Ptr SDL_SensorType -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_SensorType -> Ptr (CFieldType SDL_SensorType "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_SensorType "unwrap" where
  type CFieldType SDL_SensorType "unwrap" = BG.CInt

  offset# :: Proxy# SDL_SensorType -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_SensorType
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | Returned for an invalid sensor
--
--     [C declaration]: @SDL_SENSOR_INVALID@, defined at @SDL3\/SDL_sensor.h 134:5@
pattern SDL_SENSOR_INVALID :: SDL_SensorType
pattern $mSDL_SENSOR_INVALID :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_INVALID :: SDL_SensorType
SDL_SENSOR_INVALID = SDL_SensorType (-1)

-- | Unknown sensor type
--
--     [C declaration]: @SDL_SENSOR_UNKNOWN@, defined at @SDL3\/SDL_sensor.h 135:5@
pattern SDL_SENSOR_UNKNOWN :: SDL_SensorType
pattern $mSDL_SENSOR_UNKNOWN :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_UNKNOWN :: SDL_SensorType
SDL_SENSOR_UNKNOWN = SDL_SensorType 0

-- | Accelerometer
--
--     [C declaration]: @SDL_SENSOR_ACCEL@, defined at @SDL3\/SDL_sensor.h 136:5@
pattern SDL_SENSOR_ACCEL :: SDL_SensorType
pattern $mSDL_SENSOR_ACCEL :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_ACCEL :: SDL_SensorType
SDL_SENSOR_ACCEL = SDL_SensorType 1

-- | Gyroscope
--
--     [C declaration]: @SDL_SENSOR_GYRO@, defined at @SDL3\/SDL_sensor.h 137:5@
pattern SDL_SENSOR_GYRO :: SDL_SensorType
pattern $mSDL_SENSOR_GYRO :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_GYRO :: SDL_SensorType
SDL_SENSOR_GYRO = SDL_SensorType 2

-- | Accelerometer for left Joy-Con controller and Wii nunchuk
--
--     [C declaration]: @SDL_SENSOR_ACCEL_L@, defined at @SDL3\/SDL_sensor.h 138:5@
pattern SDL_SENSOR_ACCEL_L :: SDL_SensorType
pattern $mSDL_SENSOR_ACCEL_L :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_ACCEL_L :: SDL_SensorType
SDL_SENSOR_ACCEL_L = SDL_SensorType 3

-- | Gyroscope for left Joy-Con controller
--
--     [C declaration]: @SDL_SENSOR_GYRO_L@, defined at @SDL3\/SDL_sensor.h 139:5@
pattern SDL_SENSOR_GYRO_L :: SDL_SensorType
pattern $mSDL_SENSOR_GYRO_L :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_GYRO_L :: SDL_SensorType
SDL_SENSOR_GYRO_L = SDL_SensorType 4

-- | Accelerometer for right Joy-Con controller
--
--     [C declaration]: @SDL_SENSOR_ACCEL_R@, defined at @SDL3\/SDL_sensor.h 140:5@
pattern SDL_SENSOR_ACCEL_R :: SDL_SensorType
pattern $mSDL_SENSOR_ACCEL_R :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_ACCEL_R :: SDL_SensorType
SDL_SENSOR_ACCEL_R = SDL_SensorType 5

-- | Gyroscope for right Joy-Con controller
--
--     [C declaration]: @SDL_SENSOR_GYRO_R@, defined at @SDL3\/SDL_sensor.h 141:5@
pattern SDL_SENSOR_GYRO_R :: SDL_SensorType
pattern $mSDL_SENSOR_GYRO_R :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_GYRO_R :: SDL_SensorType
SDL_SENSOR_GYRO_R = SDL_SensorType 6

-- | [C declaration]: @SDL_SENSOR_COUNT@, defined at @SDL3\/SDL_sensor.h 142:5@
pattern SDL_SENSOR_COUNT :: SDL_SensorType
pattern $mSDL_SENSOR_COUNT :: forall {r}. SDL_SensorType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_SENSOR_COUNT :: SDL_SensorType
SDL_SENSOR_COUNT = SDL_SensorType 7