{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# 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 offers cross-platform thread management functions. These are mostly concerned with starting threads, setting their priority, and dealing with their termination.
--
--     In addition, there is support for Thread Local Storage (data that is unique to each thread, but accessed from a single key).
--
--     On platforms without thread support (such as Emscripten when built without pthreads), these functions still exist, but things like @SDL_CreateThread()@ will report failure without doing anything.
--
--     If you\'re going to work with threads, you almost certainly need to have a good understanding of thread safety measures: locking and synchronization mechanisms are handled by the functions in SDL_mutex.h. The SDL thread object.
--
--     These are opaque data.
--
--     @since 3.2.0
--
--     [See also]: @SDL_CreateThread@, 'sDL_WaitThread'
module SDL3.Sys.Bindgen.Thread (
  SDL3.Sys.Bindgen.Thread.SDL_Thread,
  SDL3.Sys.Bindgen.Thread.SDL_ThreadID (..),
  SDL3.Sys.Bindgen.Thread.SDL_TLSID (..),
  SDL3.Sys.Bindgen.Thread.SDL_ThreadPriority (..),
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_PRIORITY_LOW,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_PRIORITY_NORMAL,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_PRIORITY_HIGH,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_PRIORITY_TIME_CRITICAL,
  SDL3.Sys.Bindgen.Thread.SDL_ThreadState (..),
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_UNKNOWN,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_ALIVE,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_DETACHED,
  pattern SDL3.Sys.Bindgen.Thread.SDL_THREAD_COMPLETE,
  SDL3.Sys.Bindgen.Thread.SDL_ThreadFunction_Aux (..),
  SDL3.Sys.Bindgen.Thread.SDL_ThreadFunction (..),
  SDL3.Sys.Bindgen.Thread.sDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER,
  SDL3.Sys.Bindgen.Thread.sDL_PROP_THREAD_CREATE_NAME_STRING,
  SDL3.Sys.Bindgen.Thread.sDL_PROP_THREAD_CREATE_USERDATA_POINTER,
  SDL3.Sys.Bindgen.Thread.sDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER,
  SDL3.Sys.Bindgen.Thread.SDL_TLSDestructorCallback_Aux (..),
  SDL3.Sys.Bindgen.Thread.SDL_TLSDestructorCallback (..),
)
where

import Prelude (
  Bounded,
  Enum,
  Eq,
  IO,
  Int,
  Integral,
  Num,
  Ord,
  Read,
  Real,
  Show,
  fmap,
  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.Atomic qualified
import SDL3.Sys.Bindgen.Stdinc qualified

-- | [C declaration]: @struct SDL_Thread@, defined at @SDL3\/SDL_thread.h 71:16@
data SDL_Thread

-- | A unique numeric ID that identifies a thread.
--
--     These are different from 'SDL_Thread' objects, which are generally what an application will operate on, but having a way to uniquely identify a thread can be useful at times.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetThreadID', 'sDL_GetCurrentThreadID'
--
--     [C declaration]: @SDL_ThreadID@, defined at @SDL3\/SDL_thread.h 85:16@
newtype SDL_ThreadID = SDL_ThreadID
  { SDL_ThreadID -> Uint64
unwrap :: SDL3.Sys.Bindgen.Stdinc.Uint64
  }
  deriving stock ((forall x. SDL_ThreadID -> Rep SDL_ThreadID x)
-> (forall x. Rep SDL_ThreadID x -> SDL_ThreadID)
-> Generic SDL_ThreadID
forall x. Rep SDL_ThreadID x -> SDL_ThreadID
forall x. SDL_ThreadID -> Rep SDL_ThreadID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_ThreadID -> Rep SDL_ThreadID x
from :: forall x. SDL_ThreadID -> Rep SDL_ThreadID x
$cto :: forall x. Rep SDL_ThreadID x -> SDL_ThreadID
to :: forall x. Rep SDL_ThreadID x -> SDL_ThreadID
BG.Generic, SDL_ThreadID -> SDL_ThreadID -> Bool
(SDL_ThreadID -> SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> SDL_ThreadID -> Bool) -> Eq SDL_ThreadID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_ThreadID -> SDL_ThreadID -> Bool
== :: SDL_ThreadID -> SDL_ThreadID -> Bool
$c/= :: SDL_ThreadID -> SDL_ThreadID -> Bool
/= :: SDL_ThreadID -> SDL_ThreadID -> Bool
Eq, Eq SDL_ThreadID
Eq SDL_ThreadID =>
(SDL_ThreadID -> SDL_ThreadID -> Ordering)
-> (SDL_ThreadID -> SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> Ord SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID -> Bool
SDL_ThreadID -> SDL_ThreadID -> Ordering
SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
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_ThreadID -> SDL_ThreadID -> Ordering
compare :: SDL_ThreadID -> SDL_ThreadID -> Ordering
$c< :: SDL_ThreadID -> SDL_ThreadID -> Bool
< :: SDL_ThreadID -> SDL_ThreadID -> Bool
$c<= :: SDL_ThreadID -> SDL_ThreadID -> Bool
<= :: SDL_ThreadID -> SDL_ThreadID -> Bool
$c> :: SDL_ThreadID -> SDL_ThreadID -> Bool
> :: SDL_ThreadID -> SDL_ThreadID -> Bool
$c>= :: SDL_ThreadID -> SDL_ThreadID -> Bool
>= :: SDL_ThreadID -> SDL_ThreadID -> Bool
$cmax :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
max :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cmin :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
min :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
Ord, ReadPrec [SDL_ThreadID]
ReadPrec SDL_ThreadID
Int -> ReadS SDL_ThreadID
ReadS [SDL_ThreadID]
(Int -> ReadS SDL_ThreadID)
-> ReadS [SDL_ThreadID]
-> ReadPrec SDL_ThreadID
-> ReadPrec [SDL_ThreadID]
-> Read SDL_ThreadID
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SDL_ThreadID
readsPrec :: Int -> ReadS SDL_ThreadID
$creadList :: ReadS [SDL_ThreadID]
readList :: ReadS [SDL_ThreadID]
$creadPrec :: ReadPrec SDL_ThreadID
readPrec :: ReadPrec SDL_ThreadID
$creadListPrec :: ReadPrec [SDL_ThreadID]
readListPrec :: ReadPrec [SDL_ThreadID]
Read, Int -> SDL_ThreadID -> ShowS
[SDL_ThreadID] -> ShowS
SDL_ThreadID -> String
(Int -> SDL_ThreadID -> ShowS)
-> (SDL_ThreadID -> String)
-> ([SDL_ThreadID] -> ShowS)
-> Show SDL_ThreadID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_ThreadID -> ShowS
showsPrec :: Int -> SDL_ThreadID -> ShowS
$cshow :: SDL_ThreadID -> String
show :: SDL_ThreadID -> String
$cshowList :: [SDL_ThreadID] -> ShowS
showList :: [SDL_ThreadID] -> ShowS
Show)
  deriving newtype
    ( Word64 -> Int -> SDL_ThreadID
SDL_ThreadID -> Int -> Word64
(SDL_ThreadID -> Int -> Word64)
-> (Word64 -> Int -> SDL_ThreadID) -> Bitfield SDL_ThreadID
forall a.
(a -> Int -> Word64) -> (Word64 -> Int -> a) -> Bitfield a
$cnarrow :: SDL_ThreadID -> Int -> Word64
narrow :: SDL_ThreadID -> Int -> Word64
$cextend :: Word64 -> Int -> SDL_ThreadID
extend :: Word64 -> Int -> SDL_ThreadID
BG.Bitfield
    , Eq SDL_ThreadID
SDL_ThreadID
Eq SDL_ThreadID =>
(SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> SDL_ThreadID
-> (Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> Bool)
-> (SDL_ThreadID -> Maybe Int)
-> (SDL_ThreadID -> Int)
-> (SDL_ThreadID -> Bool)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int)
-> Bits SDL_ThreadID
Int -> SDL_ThreadID
SDL_ThreadID -> Bool
SDL_ThreadID -> Int
SDL_ThreadID -> Maybe Int
SDL_ThreadID -> SDL_ThreadID
SDL_ThreadID -> Int -> Bool
SDL_ThreadID -> Int -> SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
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_ThreadID -> SDL_ThreadID -> SDL_ThreadID
.&. :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$c.|. :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
.|. :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cxor :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
xor :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$ccomplement :: SDL_ThreadID -> SDL_ThreadID
complement :: SDL_ThreadID -> SDL_ThreadID
$cshift :: SDL_ThreadID -> Int -> SDL_ThreadID
shift :: SDL_ThreadID -> Int -> SDL_ThreadID
$crotate :: SDL_ThreadID -> Int -> SDL_ThreadID
rotate :: SDL_ThreadID -> Int -> SDL_ThreadID
$czeroBits :: SDL_ThreadID
zeroBits :: SDL_ThreadID
$cbit :: Int -> SDL_ThreadID
bit :: Int -> SDL_ThreadID
$csetBit :: SDL_ThreadID -> Int -> SDL_ThreadID
setBit :: SDL_ThreadID -> Int -> SDL_ThreadID
$cclearBit :: SDL_ThreadID -> Int -> SDL_ThreadID
clearBit :: SDL_ThreadID -> Int -> SDL_ThreadID
$ccomplementBit :: SDL_ThreadID -> Int -> SDL_ThreadID
complementBit :: SDL_ThreadID -> Int -> SDL_ThreadID
$ctestBit :: SDL_ThreadID -> Int -> Bool
testBit :: SDL_ThreadID -> Int -> Bool
$cbitSizeMaybe :: SDL_ThreadID -> Maybe Int
bitSizeMaybe :: SDL_ThreadID -> Maybe Int
$cbitSize :: SDL_ThreadID -> Int
bitSize :: SDL_ThreadID -> Int
$cisSigned :: SDL_ThreadID -> Bool
isSigned :: SDL_ThreadID -> Bool
$cshiftL :: SDL_ThreadID -> Int -> SDL_ThreadID
shiftL :: SDL_ThreadID -> Int -> SDL_ThreadID
$cunsafeShiftL :: SDL_ThreadID -> Int -> SDL_ThreadID
unsafeShiftL :: SDL_ThreadID -> Int -> SDL_ThreadID
$cshiftR :: SDL_ThreadID -> Int -> SDL_ThreadID
shiftR :: SDL_ThreadID -> Int -> SDL_ThreadID
$cunsafeShiftR :: SDL_ThreadID -> Int -> SDL_ThreadID
unsafeShiftR :: SDL_ThreadID -> Int -> SDL_ThreadID
$crotateL :: SDL_ThreadID -> Int -> SDL_ThreadID
rotateL :: SDL_ThreadID -> Int -> SDL_ThreadID
$crotateR :: SDL_ThreadID -> Int -> SDL_ThreadID
rotateR :: SDL_ThreadID -> Int -> SDL_ThreadID
$cpopCount :: SDL_ThreadID -> Int
popCount :: SDL_ThreadID -> Int
BG.Bits
    , Bits SDL_ThreadID
Bits SDL_ThreadID =>
(SDL_ThreadID -> Int)
-> (SDL_ThreadID -> Int)
-> (SDL_ThreadID -> Int)
-> FiniteBits SDL_ThreadID
SDL_ThreadID -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: SDL_ThreadID -> Int
finiteBitSize :: SDL_ThreadID -> Int
$ccountLeadingZeros :: SDL_ThreadID -> Int
countLeadingZeros :: SDL_ThreadID -> Int
$ccountTrailingZeros :: SDL_ThreadID -> Int
countTrailingZeros :: SDL_ThreadID -> Int
BG.FiniteBits
    , FFIType SDL_ThreadID -> SDL_ThreadID
SDL_ThreadID -> FFIType SDL_ThreadID
(SDL_ThreadID -> FFIType SDL_ThreadID)
-> (FFIType SDL_ThreadID -> SDL_ThreadID)
-> HasFFIType SDL_ThreadID
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_ThreadID -> FFIType SDL_ThreadID
toFFIType :: SDL_ThreadID -> FFIType SDL_ThreadID
$cfromFFIType :: FFIType SDL_ThreadID -> SDL_ThreadID
fromFFIType :: FFIType SDL_ThreadID -> SDL_ThreadID
BG.HasFFIType
    , Ord SDL_ThreadID
Ord SDL_ThreadID =>
((SDL_ThreadID, SDL_ThreadID) -> [SDL_ThreadID])
-> ((SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int)
-> ((SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int)
-> ((SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Bool)
-> ((SDL_ThreadID, SDL_ThreadID) -> Int)
-> ((SDL_ThreadID, SDL_ThreadID) -> Int)
-> Ix SDL_ThreadID
(SDL_ThreadID, SDL_ThreadID) -> Int
(SDL_ThreadID, SDL_ThreadID) -> [SDL_ThreadID]
(SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Bool
(SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> 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_ThreadID, SDL_ThreadID) -> [SDL_ThreadID]
range :: (SDL_ThreadID, SDL_ThreadID) -> [SDL_ThreadID]
$cindex :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int
index :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int
$cunsafeIndex :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int
unsafeIndex :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Int
$cinRange :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Bool
inRange :: (SDL_ThreadID, SDL_ThreadID) -> SDL_ThreadID -> Bool
$crangeSize :: (SDL_ThreadID, SDL_ThreadID) -> Int
rangeSize :: (SDL_ThreadID, SDL_ThreadID) -> Int
$cunsafeRangeSize :: (SDL_ThreadID, SDL_ThreadID) -> Int
unsafeRangeSize :: (SDL_ThreadID, SDL_ThreadID) -> Int
BG.Ix
    , Addr# -> Int# -> SDL_ThreadID
ByteArray# -> Int# -> SDL_ThreadID
Proxy SDL_ThreadID -> Int#
SDL_ThreadID -> Int#
(Proxy SDL_ThreadID -> Int#)
-> (SDL_ThreadID -> Int#)
-> (Proxy SDL_ThreadID -> Int#)
-> (SDL_ThreadID -> Int#)
-> (ByteArray# -> Int# -> SDL_ThreadID)
-> (forall s.
    MutableByteArray# s
    -> Int# -> State# s -> (# State# s, SDL_ThreadID #))
-> (forall s.
    MutableByteArray# s
    -> Int# -> SDL_ThreadID -> State# s -> State# s)
-> (forall s.
    MutableByteArray# s
    -> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s)
-> (Addr# -> Int# -> SDL_ThreadID)
-> (forall s.
    Addr# -> Int# -> State# s -> (# State# s, SDL_ThreadID #))
-> (forall s.
    Addr# -> Int# -> SDL_ThreadID -> State# s -> State# s)
-> (forall s.
    Addr# -> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s)
-> Prim SDL_ThreadID
forall s.
Addr# -> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_ThreadID #)
forall s. Addr# -> Int# -> SDL_ThreadID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_ThreadID #)
forall s.
MutableByteArray# s -> Int# -> SDL_ThreadID -> 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_ThreadID -> Int#
sizeOfType# :: Proxy SDL_ThreadID -> Int#
$csizeOf# :: SDL_ThreadID -> Int#
sizeOf# :: SDL_ThreadID -> Int#
$calignmentOfType# :: Proxy SDL_ThreadID -> Int#
alignmentOfType# :: Proxy SDL_ThreadID -> Int#
$calignment# :: SDL_ThreadID -> Int#
alignment# :: SDL_ThreadID -> Int#
$cindexByteArray# :: ByteArray# -> Int# -> SDL_ThreadID
indexByteArray# :: ByteArray# -> Int# -> SDL_ThreadID
$creadByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_ThreadID #)
readByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_ThreadID #)
$cwriteByteArray# :: forall s.
MutableByteArray# s -> Int# -> SDL_ThreadID -> State# s -> State# s
writeByteArray# :: forall s.
MutableByteArray# s -> Int# -> SDL_ThreadID -> State# s -> State# s
$csetByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
setByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
$cindexOffAddr# :: Addr# -> Int# -> SDL_ThreadID
indexOffAddr# :: Addr# -> Int# -> SDL_ThreadID
$creadOffAddr# :: forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_ThreadID #)
readOffAddr# :: forall s. Addr# -> Int# -> State# s -> (# State# s, SDL_ThreadID #)
$cwriteOffAddr# :: forall s. Addr# -> Int# -> SDL_ThreadID -> State# s -> State# s
writeOffAddr# :: forall s. Addr# -> Int# -> SDL_ThreadID -> State# s -> State# s
$csetOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
setOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_ThreadID -> State# s -> State# s
BG.Prim
    , Ptr SDL_ThreadID -> IO SDL_ThreadID
Ptr SDL_ThreadID -> Int -> IO SDL_ThreadID
Ptr SDL_ThreadID -> Int -> SDL_ThreadID -> IO ()
Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
SDL_ThreadID -> Int
(SDL_ThreadID -> Int)
-> (SDL_ThreadID -> Int)
-> (Ptr SDL_ThreadID -> Int -> IO SDL_ThreadID)
-> (Ptr SDL_ThreadID -> Int -> SDL_ThreadID -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_ThreadID)
-> (forall b. Ptr b -> Int -> SDL_ThreadID -> IO ())
-> (Ptr SDL_ThreadID -> IO SDL_ThreadID)
-> (Ptr SDL_ThreadID -> SDL_ThreadID -> IO ())
-> Storable SDL_ThreadID
forall b. Ptr b -> Int -> IO SDL_ThreadID
forall b. Ptr b -> Int -> SDL_ThreadID -> 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_ThreadID -> Int
sizeOf :: SDL_ThreadID -> Int
$calignment :: SDL_ThreadID -> Int
alignment :: SDL_ThreadID -> Int
$cpeekElemOff :: Ptr SDL_ThreadID -> Int -> IO SDL_ThreadID
peekElemOff :: Ptr SDL_ThreadID -> Int -> IO SDL_ThreadID
$cpokeElemOff :: Ptr SDL_ThreadID -> Int -> SDL_ThreadID -> IO ()
pokeElemOff :: Ptr SDL_ThreadID -> Int -> SDL_ThreadID -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_ThreadID
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_ThreadID
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_ThreadID -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_ThreadID -> IO ()
$cpeek :: Ptr SDL_ThreadID -> IO SDL_ThreadID
peek :: Ptr SDL_ThreadID -> IO SDL_ThreadID
$cpoke :: Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
poke :: Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
BG.Storable
    , SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID -> Bounded SDL_ThreadID
forall a. a -> a -> Bounded a
$cminBound :: SDL_ThreadID
minBound :: SDL_ThreadID
$cmaxBound :: SDL_ThreadID
maxBound :: SDL_ThreadID
Bounded
    , Int -> SDL_ThreadID
SDL_ThreadID -> Int
SDL_ThreadID -> [SDL_ThreadID]
SDL_ThreadID -> SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
(SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID)
-> (Int -> SDL_ThreadID)
-> (SDL_ThreadID -> Int)
-> (SDL_ThreadID -> [SDL_ThreadID])
-> (SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID])
-> (SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID])
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID])
-> Enum SDL_ThreadID
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_ThreadID -> SDL_ThreadID
succ :: SDL_ThreadID -> SDL_ThreadID
$cpred :: SDL_ThreadID -> SDL_ThreadID
pred :: SDL_ThreadID -> SDL_ThreadID
$ctoEnum :: Int -> SDL_ThreadID
toEnum :: Int -> SDL_ThreadID
$cfromEnum :: SDL_ThreadID -> Int
fromEnum :: SDL_ThreadID -> Int
$cenumFrom :: SDL_ThreadID -> [SDL_ThreadID]
enumFrom :: SDL_ThreadID -> [SDL_ThreadID]
$cenumFromThen :: SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
enumFromThen :: SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
$cenumFromTo :: SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
enumFromTo :: SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
$cenumFromThenTo :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
enumFromThenTo :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID -> [SDL_ThreadID]
Enum
    , Enum SDL_ThreadID
Real SDL_ThreadID
(Real SDL_ThreadID, Enum SDL_ThreadID) =>
(SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID))
-> (SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID))
-> (SDL_ThreadID -> Integer)
-> Integral SDL_ThreadID
SDL_ThreadID -> Integer
SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID)
SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
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_ThreadID -> SDL_ThreadID -> SDL_ThreadID
quot :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$crem :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
rem :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cdiv :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
div :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cmod :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
mod :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cquotRem :: SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID)
quotRem :: SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID)
$cdivMod :: SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID)
divMod :: SDL_ThreadID -> SDL_ThreadID -> (SDL_ThreadID, SDL_ThreadID)
$ctoInteger :: SDL_ThreadID -> Integer
toInteger :: SDL_ThreadID -> Integer
Integral
    , Ptr SDL_ThreadID -> IO SDL_ThreadID
(Ptr SDL_ThreadID -> IO SDL_ThreadID) -> ReadRaw SDL_ThreadID
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_ThreadID -> IO SDL_ThreadID
readRaw :: Ptr SDL_ThreadID -> IO SDL_ThreadID
Marshal.ReadRaw
    , Proxy SDL_ThreadID -> Int
(Proxy SDL_ThreadID -> Int)
-> (Proxy SDL_ThreadID -> Int) -> StaticSize SDL_ThreadID
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_ThreadID -> Int
staticSizeOf :: Proxy SDL_ThreadID -> Int
$cstaticAlignment :: Proxy SDL_ThreadID -> Int
staticAlignment :: Proxy SDL_ThreadID -> Int
Marshal.StaticSize
    , Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
(Ptr SDL_ThreadID -> SDL_ThreadID -> IO ())
-> WriteRaw SDL_ThreadID
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
writeRaw :: Ptr SDL_ThreadID -> SDL_ThreadID -> IO ()
Marshal.WriteRaw
    , Integer -> SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID
SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
(SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID)
-> (SDL_ThreadID -> SDL_ThreadID)
-> (Integer -> SDL_ThreadID)
-> Num SDL_ThreadID
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
+ :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$c- :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
- :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$c* :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
* :: SDL_ThreadID -> SDL_ThreadID -> SDL_ThreadID
$cnegate :: SDL_ThreadID -> SDL_ThreadID
negate :: SDL_ThreadID -> SDL_ThreadID
$cabs :: SDL_ThreadID -> SDL_ThreadID
abs :: SDL_ThreadID -> SDL_ThreadID
$csignum :: SDL_ThreadID -> SDL_ThreadID
signum :: SDL_ThreadID -> SDL_ThreadID
$cfromInteger :: Integer -> SDL_ThreadID
fromInteger :: Integer -> SDL_ThreadID
Num
    , Num SDL_ThreadID
Ord SDL_ThreadID
(Num SDL_ThreadID, Ord SDL_ThreadID) =>
(SDL_ThreadID -> Rational) -> Real SDL_ThreadID
SDL_ThreadID -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
$ctoRational :: SDL_ThreadID -> Rational
toRational :: SDL_ThreadID -> Rational
Real
    )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint64)
  => BG.CompatHasField.HasField "unwrap" SDL_ThreadID ty
  where
  hasField :: SDL_ThreadID -> (ty -> SDL_ThreadID, ty)
hasField =
    \SDL_ThreadID
x0 ->
      ( \ty
y1 ->
          SDL_ThreadID{unwrap :: Uint64
unwrap = ty
Uint64
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_ThreadID
x0
      )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint64)
  => BG.HasField "unwrap" (BG.Ptr SDL_ThreadID) (BG.Ptr ty)
  where
  getField :: Ptr SDL_ThreadID -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_ThreadID -> Ptr (CFieldType SDL_ThreadID "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_ThreadID "unwrap" where
  type
    CFieldType SDL_ThreadID "unwrap" =
      SDL3.Sys.Bindgen.Stdinc.Uint64

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

-- | Thread local storage ID.
--
--     0 is the invalid ID. An app can create these and then set data for these IDs that is unique to each thread.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetTLS', 'sDL_SetTLS'
--
--     [C declaration]: @SDL_TLSID@, defined at @SDL3\/SDL_thread.h 98:23@
newtype SDL_TLSID = SDL_TLSID
  { SDL_TLSID -> SDL_AtomicInt
unwrap :: SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt
  }
  deriving stock ((forall x. SDL_TLSID -> Rep SDL_TLSID x)
-> (forall x. Rep SDL_TLSID x -> SDL_TLSID) -> Generic SDL_TLSID
forall x. Rep SDL_TLSID x -> SDL_TLSID
forall x. SDL_TLSID -> Rep SDL_TLSID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_TLSID -> Rep SDL_TLSID x
from :: forall x. SDL_TLSID -> Rep SDL_TLSID x
$cto :: forall x. Rep SDL_TLSID x -> SDL_TLSID
to :: forall x. Rep SDL_TLSID x -> SDL_TLSID
BG.Generic, SDL_TLSID -> SDL_TLSID -> Bool
(SDL_TLSID -> SDL_TLSID -> Bool)
-> (SDL_TLSID -> SDL_TLSID -> Bool) -> Eq SDL_TLSID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_TLSID -> SDL_TLSID -> Bool
== :: SDL_TLSID -> SDL_TLSID -> Bool
$c/= :: SDL_TLSID -> SDL_TLSID -> Bool
/= :: SDL_TLSID -> SDL_TLSID -> Bool
Eq, Int -> SDL_TLSID -> ShowS
[SDL_TLSID] -> ShowS
SDL_TLSID -> String
(Int -> SDL_TLSID -> ShowS)
-> (SDL_TLSID -> String)
-> ([SDL_TLSID] -> ShowS)
-> Show SDL_TLSID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_TLSID -> ShowS
showsPrec :: Int -> SDL_TLSID -> ShowS
$cshow :: SDL_TLSID -> String
show :: SDL_TLSID -> String
$cshowList :: [SDL_TLSID] -> ShowS
showList :: [SDL_TLSID] -> ShowS
Show)
  deriving newtype
    ( Ptr SDL_TLSID -> IO SDL_TLSID
Ptr SDL_TLSID -> Int -> IO SDL_TLSID
Ptr SDL_TLSID -> Int -> SDL_TLSID -> IO ()
Ptr SDL_TLSID -> SDL_TLSID -> IO ()
SDL_TLSID -> Int
(SDL_TLSID -> Int)
-> (SDL_TLSID -> Int)
-> (Ptr SDL_TLSID -> Int -> IO SDL_TLSID)
-> (Ptr SDL_TLSID -> Int -> SDL_TLSID -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_TLSID)
-> (forall b. Ptr b -> Int -> SDL_TLSID -> IO ())
-> (Ptr SDL_TLSID -> IO SDL_TLSID)
-> (Ptr SDL_TLSID -> SDL_TLSID -> IO ())
-> Storable SDL_TLSID
forall b. Ptr b -> Int -> IO SDL_TLSID
forall b. Ptr b -> Int -> SDL_TLSID -> 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_TLSID -> Int
sizeOf :: SDL_TLSID -> Int
$calignment :: SDL_TLSID -> Int
alignment :: SDL_TLSID -> Int
$cpeekElemOff :: Ptr SDL_TLSID -> Int -> IO SDL_TLSID
peekElemOff :: Ptr SDL_TLSID -> Int -> IO SDL_TLSID
$cpokeElemOff :: Ptr SDL_TLSID -> Int -> SDL_TLSID -> IO ()
pokeElemOff :: Ptr SDL_TLSID -> Int -> SDL_TLSID -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_TLSID
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_TLSID
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_TLSID -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_TLSID -> IO ()
$cpeek :: Ptr SDL_TLSID -> IO SDL_TLSID
peek :: Ptr SDL_TLSID -> IO SDL_TLSID
$cpoke :: Ptr SDL_TLSID -> SDL_TLSID -> IO ()
poke :: Ptr SDL_TLSID -> SDL_TLSID -> IO ()
BG.Storable
    , Ptr SDL_TLSID -> IO SDL_TLSID
(Ptr SDL_TLSID -> IO SDL_TLSID) -> ReadRaw SDL_TLSID
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_TLSID -> IO SDL_TLSID
readRaw :: Ptr SDL_TLSID -> IO SDL_TLSID
Marshal.ReadRaw
    , Proxy SDL_TLSID -> Int
(Proxy SDL_TLSID -> Int)
-> (Proxy SDL_TLSID -> Int) -> StaticSize SDL_TLSID
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_TLSID -> Int
staticSizeOf :: Proxy SDL_TLSID -> Int
$cstaticAlignment :: Proxy SDL_TLSID -> Int
staticAlignment :: Proxy SDL_TLSID -> Int
Marshal.StaticSize
    , Ptr SDL_TLSID -> SDL_TLSID -> IO ()
(Ptr SDL_TLSID -> SDL_TLSID -> IO ()) -> WriteRaw SDL_TLSID
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_TLSID -> SDL_TLSID -> IO ()
writeRaw :: Ptr SDL_TLSID -> SDL_TLSID -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt)
  => BG.CompatHasField.HasField "unwrap" SDL_TLSID ty
  where
  hasField :: SDL_TLSID -> (ty -> SDL_TLSID, ty)
hasField =
    \SDL_TLSID
x0 ->
      ( \ty
y1 ->
          SDL_TLSID{unwrap :: SDL_AtomicInt
unwrap = ty
SDL_AtomicInt
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_TLSID
x0
      )

instance
  (ty ~ SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_TLSID) (BG.Ptr ty)
  where
  getField :: Ptr SDL_TLSID -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_TLSID -> Ptr (CFieldType SDL_TLSID "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_TLSID "unwrap" where
  type
    CFieldType SDL_TLSID "unwrap" =
      SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt

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

-- | The SDL thread priority.
--
--     SDL will make system changes as necessary in order to apply the thread priority. Code which attempts to control thread state related to priority should be aware that calling SDL_SetCurrentThreadPriority may alter such state. SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
--
--     @since 3.2.0
--
--     [C declaration]: @enum SDL_ThreadPriority@, defined at @SDL3\/SDL_thread.h 111:14@
newtype SDL_ThreadPriority = SDL_ThreadPriority
  { SDL_ThreadPriority -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_ThreadPriority -> Rep SDL_ThreadPriority x)
-> (forall x. Rep SDL_ThreadPriority x -> SDL_ThreadPriority)
-> Generic SDL_ThreadPriority
forall x. Rep SDL_ThreadPriority x -> SDL_ThreadPriority
forall x. SDL_ThreadPriority -> Rep SDL_ThreadPriority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_ThreadPriority -> Rep SDL_ThreadPriority x
from :: forall x. SDL_ThreadPriority -> Rep SDL_ThreadPriority x
$cto :: forall x. Rep SDL_ThreadPriority x -> SDL_ThreadPriority
to :: forall x. Rep SDL_ThreadPriority x -> SDL_ThreadPriority
BG.Generic, SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
(SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> Eq SDL_ThreadPriority
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
== :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
$c/= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
/= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
Eq, Eq SDL_ThreadPriority
Eq SDL_ThreadPriority =>
(SDL_ThreadPriority -> SDL_ThreadPriority -> Ordering)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> Bool)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority)
-> (SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority)
-> Ord SDL_ThreadPriority
SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
SDL_ThreadPriority -> SDL_ThreadPriority -> Ordering
SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority
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_ThreadPriority -> SDL_ThreadPriority -> Ordering
compare :: SDL_ThreadPriority -> SDL_ThreadPriority -> Ordering
$c< :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
< :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
$c<= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
<= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
$c> :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
> :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
$c>= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
>= :: SDL_ThreadPriority -> SDL_ThreadPriority -> Bool
$cmax :: SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority
max :: SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority
$cmin :: SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority
min :: SDL_ThreadPriority -> SDL_ThreadPriority -> SDL_ThreadPriority
Ord)
  deriving newtype (FFIType SDL_ThreadPriority -> SDL_ThreadPriority
SDL_ThreadPriority -> FFIType SDL_ThreadPriority
(SDL_ThreadPriority -> FFIType SDL_ThreadPriority)
-> (FFIType SDL_ThreadPriority -> SDL_ThreadPriority)
-> HasFFIType SDL_ThreadPriority
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_ThreadPriority -> FFIType SDL_ThreadPriority
toFFIType :: SDL_ThreadPriority -> FFIType SDL_ThreadPriority
$cfromFFIType :: FFIType SDL_ThreadPriority -> SDL_ThreadPriority
fromFFIType :: FFIType SDL_ThreadPriority -> SDL_ThreadPriority
BG.HasFFIType)

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

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

instance Marshal.ReadRaw SDL_ThreadPriority where
  readRaw :: Ptr SDL_ThreadPriority -> IO SDL_ThreadPriority
readRaw =
    \Ptr SDL_ThreadPriority
ptr0 ->
      (CUInt -> SDL_ThreadPriority) -> IO (CUInt -> SDL_ThreadPriority)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_ThreadPriority
SDL_ThreadPriority
        IO (CUInt -> SDL_ThreadPriority)
-> IO CUInt -> IO SDL_ThreadPriority
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_ThreadPriority -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_ThreadPriority
ptr0 (Int
0 :: Int)

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

deriving via Marshal.EquivStorable SDL_ThreadPriority instance BG.Storable SDL_ThreadPriority

deriving via BG.CUInt instance BG.Prim SDL_ThreadPriority

instance CEnum.CEnum SDL_ThreadPriority where
  type CEnumZ SDL_ThreadPriority = BG.CUInt

  toCEnum :: CEnumZ SDL_ThreadPriority -> SDL_ThreadPriority
toCEnum = CUInt -> SDL_ThreadPriority
CEnumZ SDL_ThreadPriority -> SDL_ThreadPriority
SDL_ThreadPriority

  fromCEnum :: SDL_ThreadPriority -> CEnumZ SDL_ThreadPriority
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_ThreadPriority -> DeclaredValues SDL_ThreadPriority
declaredValues =
    \proxy SDL_ThreadPriority
_ ->
      [(CEnumZ SDL_ThreadPriority, NonEmpty String)]
-> DeclaredValues SDL_ThreadPriority
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_ThreadPriority
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_PRIORITY_LOW")
        , (CUInt
CEnumZ SDL_ThreadPriority
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_PRIORITY_NORMAL")
        , (CUInt
CEnumZ SDL_ThreadPriority
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_PRIORITY_HIGH")
        , (CUInt
CEnumZ SDL_ThreadPriority
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_PRIORITY_TIME_CRITICAL")
        ]

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

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

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

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

instance CEnum.SequentialCEnum SDL_ThreadPriority where
  minDeclaredValue :: SDL_ThreadPriority
minDeclaredValue = SDL_ThreadPriority
SDL_THREAD_PRIORITY_LOW

  maxDeclaredValue :: SDL_ThreadPriority
maxDeclaredValue = SDL_ThreadPriority
SDL_THREAD_PRIORITY_TIME_CRITICAL

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

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

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

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

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_ThreadPriority ty
  where
  hasField :: SDL_ThreadPriority -> (ty -> SDL_ThreadPriority, ty)
hasField =
    \SDL_ThreadPriority
x0 ->
      ( \ty
y1 ->
          SDL_ThreadPriority{unwrap :: CUInt
unwrap = ty
CUInt
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_ThreadPriority
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_ThreadPriority) (BG.Ptr ty)
  where
  getField :: Ptr SDL_ThreadPriority -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_ThreadPriority
-> Ptr (CFieldType SDL_ThreadPriority "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_ThreadPriority "unwrap" where
  type
    CFieldType SDL_ThreadPriority "unwrap" =
      BG.CUInt

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

-- | [C declaration]: @SDL_THREAD_PRIORITY_LOW@, defined at @SDL3\/SDL_thread.h 112:5@
pattern SDL_THREAD_PRIORITY_LOW :: SDL_ThreadPriority
pattern $mSDL_THREAD_PRIORITY_LOW :: forall {r}. SDL_ThreadPriority -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_PRIORITY_LOW :: SDL_ThreadPriority
SDL_THREAD_PRIORITY_LOW = SDL_ThreadPriority 0

-- | [C declaration]: @SDL_THREAD_PRIORITY_NORMAL@, defined at @SDL3\/SDL_thread.h 113:5@
pattern SDL_THREAD_PRIORITY_NORMAL :: SDL_ThreadPriority
pattern $mSDL_THREAD_PRIORITY_NORMAL :: forall {r}. SDL_ThreadPriority -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_PRIORITY_NORMAL :: SDL_ThreadPriority
SDL_THREAD_PRIORITY_NORMAL = SDL_ThreadPriority 1

-- | [C declaration]: @SDL_THREAD_PRIORITY_HIGH@, defined at @SDL3\/SDL_thread.h 114:5@
pattern SDL_THREAD_PRIORITY_HIGH :: SDL_ThreadPriority
pattern $mSDL_THREAD_PRIORITY_HIGH :: forall {r}. SDL_ThreadPriority -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_PRIORITY_HIGH :: SDL_ThreadPriority
SDL_THREAD_PRIORITY_HIGH = SDL_ThreadPriority 2

-- | [C declaration]: @SDL_THREAD_PRIORITY_TIME_CRITICAL@, defined at @SDL3\/SDL_thread.h 115:5@
pattern SDL_THREAD_PRIORITY_TIME_CRITICAL :: SDL_ThreadPriority
pattern $mSDL_THREAD_PRIORITY_TIME_CRITICAL :: forall {r}. SDL_ThreadPriority -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_PRIORITY_TIME_CRITICAL :: SDL_ThreadPriority
SDL_THREAD_PRIORITY_TIME_CRITICAL = SDL_ThreadPriority 3

-- | The SDL thread state.
--
--     The current state of a thread can be checked by calling SDL_GetThreadState.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetThreadState'
--
--     [C declaration]: @enum SDL_ThreadState@, defined at @SDL3\/SDL_thread.h 127:14@
newtype SDL_ThreadState = SDL_ThreadState
  { SDL_ThreadState -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_ThreadState -> Rep SDL_ThreadState x)
-> (forall x. Rep SDL_ThreadState x -> SDL_ThreadState)
-> Generic SDL_ThreadState
forall x. Rep SDL_ThreadState x -> SDL_ThreadState
forall x. SDL_ThreadState -> Rep SDL_ThreadState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_ThreadState -> Rep SDL_ThreadState x
from :: forall x. SDL_ThreadState -> Rep SDL_ThreadState x
$cto :: forall x. Rep SDL_ThreadState x -> SDL_ThreadState
to :: forall x. Rep SDL_ThreadState x -> SDL_ThreadState
BG.Generic, SDL_ThreadState -> SDL_ThreadState -> Bool
(SDL_ThreadState -> SDL_ThreadState -> Bool)
-> (SDL_ThreadState -> SDL_ThreadState -> Bool)
-> Eq SDL_ThreadState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_ThreadState -> SDL_ThreadState -> Bool
== :: SDL_ThreadState -> SDL_ThreadState -> Bool
$c/= :: SDL_ThreadState -> SDL_ThreadState -> Bool
/= :: SDL_ThreadState -> SDL_ThreadState -> Bool
Eq, Eq SDL_ThreadState
Eq SDL_ThreadState =>
(SDL_ThreadState -> SDL_ThreadState -> Ordering)
-> (SDL_ThreadState -> SDL_ThreadState -> Bool)
-> (SDL_ThreadState -> SDL_ThreadState -> Bool)
-> (SDL_ThreadState -> SDL_ThreadState -> Bool)
-> (SDL_ThreadState -> SDL_ThreadState -> Bool)
-> (SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState)
-> (SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState)
-> Ord SDL_ThreadState
SDL_ThreadState -> SDL_ThreadState -> Bool
SDL_ThreadState -> SDL_ThreadState -> Ordering
SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState
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_ThreadState -> SDL_ThreadState -> Ordering
compare :: SDL_ThreadState -> SDL_ThreadState -> Ordering
$c< :: SDL_ThreadState -> SDL_ThreadState -> Bool
< :: SDL_ThreadState -> SDL_ThreadState -> Bool
$c<= :: SDL_ThreadState -> SDL_ThreadState -> Bool
<= :: SDL_ThreadState -> SDL_ThreadState -> Bool
$c> :: SDL_ThreadState -> SDL_ThreadState -> Bool
> :: SDL_ThreadState -> SDL_ThreadState -> Bool
$c>= :: SDL_ThreadState -> SDL_ThreadState -> Bool
>= :: SDL_ThreadState -> SDL_ThreadState -> Bool
$cmax :: SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState
max :: SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState
$cmin :: SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState
min :: SDL_ThreadState -> SDL_ThreadState -> SDL_ThreadState
Ord)
  deriving newtype (FFIType SDL_ThreadState -> SDL_ThreadState
SDL_ThreadState -> FFIType SDL_ThreadState
(SDL_ThreadState -> FFIType SDL_ThreadState)
-> (FFIType SDL_ThreadState -> SDL_ThreadState)
-> HasFFIType SDL_ThreadState
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_ThreadState -> FFIType SDL_ThreadState
toFFIType :: SDL_ThreadState -> FFIType SDL_ThreadState
$cfromFFIType :: FFIType SDL_ThreadState -> SDL_ThreadState
fromFFIType :: FFIType SDL_ThreadState -> SDL_ThreadState
BG.HasFFIType)

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

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

instance Marshal.ReadRaw SDL_ThreadState where
  readRaw :: Ptr SDL_ThreadState -> IO SDL_ThreadState
readRaw =
    \Ptr SDL_ThreadState
ptr0 ->
      (CUInt -> SDL_ThreadState) -> IO (CUInt -> SDL_ThreadState)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_ThreadState
SDL_ThreadState
        IO (CUInt -> SDL_ThreadState) -> IO CUInt -> IO SDL_ThreadState
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_ThreadState -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_ThreadState
ptr0 (Int
0 :: Int)

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

deriving via Marshal.EquivStorable SDL_ThreadState instance BG.Storable SDL_ThreadState

deriving via BG.CUInt instance BG.Prim SDL_ThreadState

instance CEnum.CEnum SDL_ThreadState where
  type CEnumZ SDL_ThreadState = BG.CUInt

  toCEnum :: CEnumZ SDL_ThreadState -> SDL_ThreadState
toCEnum = CUInt -> SDL_ThreadState
CEnumZ SDL_ThreadState -> SDL_ThreadState
SDL_ThreadState

  fromCEnum :: SDL_ThreadState -> CEnumZ SDL_ThreadState
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_ThreadState -> DeclaredValues SDL_ThreadState
declaredValues =
    \proxy SDL_ThreadState
_ ->
      [(CEnumZ SDL_ThreadState, NonEmpty String)]
-> DeclaredValues SDL_ThreadState
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_ThreadState
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_UNKNOWN")
        , (CUInt
CEnumZ SDL_ThreadState
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_ALIVE")
        , (CUInt
CEnumZ SDL_ThreadState
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_DETACHED")
        , (CUInt
CEnumZ SDL_ThreadState
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_THREAD_COMPLETE")
        ]

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

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

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

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

instance CEnum.SequentialCEnum SDL_ThreadState where
  minDeclaredValue :: SDL_ThreadState
minDeclaredValue = SDL_ThreadState
SDL_THREAD_UNKNOWN

  maxDeclaredValue :: SDL_ThreadState
maxDeclaredValue = SDL_ThreadState
SDL_THREAD_COMPLETE

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

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

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

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

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_ThreadState ty
  where
  hasField :: SDL_ThreadState -> (ty -> SDL_ThreadState, ty)
hasField =
    \SDL_ThreadState
x0 ->
      ( \ty
y1 ->
          SDL_ThreadState{unwrap :: CUInt
unwrap = ty
CUInt
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_ThreadState
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_ThreadState) (BG.Ptr ty)
  where
  getField :: Ptr SDL_ThreadState -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_ThreadState -> Ptr (CFieldType SDL_ThreadState "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_ThreadState "unwrap" where
  type CFieldType SDL_ThreadState "unwrap" = BG.CUInt

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

-- | The thread is not valid
--
--     [C declaration]: @SDL_THREAD_UNKNOWN@, defined at @SDL3\/SDL_thread.h 129:5@
pattern SDL_THREAD_UNKNOWN :: SDL_ThreadState
pattern $mSDL_THREAD_UNKNOWN :: forall {r}. SDL_ThreadState -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_UNKNOWN :: SDL_ThreadState
SDL_THREAD_UNKNOWN = SDL_ThreadState 0

-- | The thread is currently running
--
--     [C declaration]: @SDL_THREAD_ALIVE@, defined at @SDL3\/SDL_thread.h 130:5@
pattern SDL_THREAD_ALIVE :: SDL_ThreadState
pattern $mSDL_THREAD_ALIVE :: forall {r}. SDL_ThreadState -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_ALIVE :: SDL_ThreadState
SDL_THREAD_ALIVE = SDL_ThreadState 1

-- | The thread is detached and can\'t be waited on
--
--     [C declaration]: @SDL_THREAD_DETACHED@, defined at @SDL3\/SDL_thread.h 131:5@
pattern SDL_THREAD_DETACHED :: SDL_ThreadState
pattern $mSDL_THREAD_DETACHED :: forall {r}. SDL_ThreadState -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_DETACHED :: SDL_ThreadState
SDL_THREAD_DETACHED = SDL_ThreadState 2

-- | The thread has finished and should be cleaned up with @SDL_WaitThread()@
--
--     [C declaration]: @SDL_THREAD_COMPLETE@, defined at @SDL3\/SDL_thread.h 132:5@
pattern SDL_THREAD_COMPLETE :: SDL_ThreadState
pattern $mSDL_THREAD_COMPLETE :: forall {r}. SDL_ThreadState -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_THREAD_COMPLETE :: SDL_ThreadState
SDL_THREAD_COMPLETE = SDL_ThreadState 3

-- | Auxiliary type used by 'SDL_ThreadFunction'
--
--     [C declaration]: @SDL_ThreadFunction@, defined at @SDL3\/SDL_thread.h 143:23@
newtype SDL_ThreadFunction_Aux = SDL_ThreadFunction_Aux
  { SDL_ThreadFunction_Aux -> Ptr Void -> IO CInt
unwrap :: BG.Ptr BG.Void -> IO BG.CInt
  }
  deriving stock ((forall x. SDL_ThreadFunction_Aux -> Rep SDL_ThreadFunction_Aux x)
-> (forall x.
    Rep SDL_ThreadFunction_Aux x -> SDL_ThreadFunction_Aux)
-> Generic SDL_ThreadFunction_Aux
forall x. Rep SDL_ThreadFunction_Aux x -> SDL_ThreadFunction_Aux
forall x. SDL_ThreadFunction_Aux -> Rep SDL_ThreadFunction_Aux x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_ThreadFunction_Aux -> Rep SDL_ThreadFunction_Aux x
from :: forall x. SDL_ThreadFunction_Aux -> Rep SDL_ThreadFunction_Aux x
$cto :: forall x. Rep SDL_ThreadFunction_Aux x -> SDL_ThreadFunction_Aux
to :: forall x. Rep SDL_ThreadFunction_Aux x -> SDL_ThreadFunction_Aux
BG.Generic)

-- __unique:__ @toSDL_ThreadFunction_Aux@
foreign import ccall safe "wrapper"
  hs_bindgen_d53137dca60d82b1_base
    :: (BG.Ptr BG.Void -> IO BG.CInt)
    -> IO (BG.FunPtr (BG.Ptr BG.Void -> IO BG.CInt))

-- __unique:__ @toSDL_ThreadFunction_Aux@
hs_bindgen_d53137dca60d82b1
  :: SDL_ThreadFunction_Aux
  -> IO (BG.FunPtr SDL_ThreadFunction_Aux)
hs_bindgen_d53137dca60d82b1 :: SDL_ThreadFunction_Aux -> IO (FunPtr SDL_ThreadFunction_Aux)
hs_bindgen_d53137dca60d82b1 =
  \SDL_ThreadFunction_Aux
fun0 ->
    (FunPtr (Ptr Void -> IO CInt) -> FunPtr SDL_ThreadFunction_Aux)
-> IO (FunPtr (Ptr Void -> IO CInt))
-> IO (FunPtr SDL_ThreadFunction_Aux)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
      FunPtr (Ptr Void -> IO CInt) -> FunPtr SDL_ThreadFunction_Aux
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr
      ( (Ptr Void -> IO CInt) -> IO (FunPtr (Ptr Void -> IO CInt))
hs_bindgen_d53137dca60d82b1_base
          ( \Ptr Void
x1 ->
              (CInt -> CInt) -> IO CInt -> IO CInt
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> CInt
CInt -> FFIType CInt
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType (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_ThreadFunction_Aux
fun0 (FFIType (Ptr Void) -> Ptr Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr Void)
x1))
          )
      )

-- __unique:__ @fromSDL_ThreadFunction_Aux@
foreign import ccall safe "dynamic"
  hs_bindgen_67f38a19566426bd_base
    :: BG.FunPtr (BG.Ptr BG.Void -> IO BG.CInt)
    -> BG.Ptr BG.Void
    -> IO BG.CInt

-- __unique:__ @fromSDL_ThreadFunction_Aux@
hs_bindgen_67f38a19566426bd
  :: BG.FunPtr SDL_ThreadFunction_Aux
  -> SDL_ThreadFunction_Aux
hs_bindgen_67f38a19566426bd :: FunPtr SDL_ThreadFunction_Aux -> SDL_ThreadFunction_Aux
hs_bindgen_67f38a19566426bd =
  \FunPtr SDL_ThreadFunction_Aux
funPtr0 ->
    (Ptr Void -> IO CInt) -> SDL_ThreadFunction_Aux
SDL_ThreadFunction_Aux
      ( \Ptr Void
x1 ->
          (CInt -> CInt) -> IO CInt -> IO CInt
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> CInt
FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType (FunPtr (Ptr Void -> IO CInt) -> Ptr Void -> IO CInt
hs_bindgen_67f38a19566426bd_base (FunPtr SDL_ThreadFunction_Aux -> FunPtr (Ptr Void -> IO CInt)
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr FunPtr SDL_ThreadFunction_Aux
funPtr0) (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x1))
      )

instance BG.ToFunPtr SDL_ThreadFunction_Aux where
  toFunPtr :: SDL_ThreadFunction_Aux -> IO (FunPtr SDL_ThreadFunction_Aux)
toFunPtr = SDL_ThreadFunction_Aux -> IO (FunPtr SDL_ThreadFunction_Aux)
hs_bindgen_d53137dca60d82b1

instance BG.FromFunPtr SDL_ThreadFunction_Aux where
  fromFunPtr :: FunPtr SDL_ThreadFunction_Aux -> SDL_ThreadFunction_Aux
fromFunPtr = FunPtr SDL_ThreadFunction_Aux -> SDL_ThreadFunction_Aux
hs_bindgen_67f38a19566426bd

instance
  (ty ~ (BG.Ptr BG.Void -> IO BG.CInt))
  => BG.CompatHasField.HasField "unwrap" SDL_ThreadFunction_Aux ty
  where
  hasField :: SDL_ThreadFunction_Aux -> (ty -> SDL_ThreadFunction_Aux, ty)
hasField =
    \SDL_ThreadFunction_Aux
x0 ->
      ( \ty
y1 ->
          SDL_ThreadFunction_Aux{unwrap :: Ptr Void -> IO CInt
unwrap = ty
Ptr Void -> IO 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_ThreadFunction_Aux
x0
      )

instance
  (ty ~ (BG.Ptr BG.Void -> IO BG.CInt))
  => BG.HasField "unwrap" (BG.Ptr SDL_ThreadFunction_Aux) (BG.Ptr ty)
  where
  getField :: Ptr SDL_ThreadFunction_Aux -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_ThreadFunction_Aux
-> Ptr (CFieldType SDL_ThreadFunction_Aux "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_ThreadFunction_Aux "unwrap" where
  type
    CFieldType SDL_ThreadFunction_Aux "unwrap" =
      BG.Ptr BG.Void -> IO BG.CInt

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

-- | The function passed to @SDL_CreateThread()@ as the new thread\'s entry point.
--
--     [@data@]: what was passed as @data@ to @SDL_CreateThread()@.
--
--     [Returns]: a value that can be reported through @SDL_WaitThread()@.
--
--     @since 3.2.0
--
--     [C declaration]: @SDL_ThreadFunction@, defined at @SDL3\/SDL_thread.h 143:23@
newtype SDL_ThreadFunction = SDL_ThreadFunction
  { SDL_ThreadFunction -> FunPtr SDL_ThreadFunction_Aux
unwrap :: BG.FunPtr SDL_ThreadFunction_Aux
  }
  deriving stock ((forall x. SDL_ThreadFunction -> Rep SDL_ThreadFunction x)
-> (forall x. Rep SDL_ThreadFunction x -> SDL_ThreadFunction)
-> Generic SDL_ThreadFunction
forall x. Rep SDL_ThreadFunction x -> SDL_ThreadFunction
forall x. SDL_ThreadFunction -> Rep SDL_ThreadFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_ThreadFunction -> Rep SDL_ThreadFunction x
from :: forall x. SDL_ThreadFunction -> Rep SDL_ThreadFunction x
$cto :: forall x. Rep SDL_ThreadFunction x -> SDL_ThreadFunction
to :: forall x. Rep SDL_ThreadFunction x -> SDL_ThreadFunction
BG.Generic, SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
(SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> Eq SDL_ThreadFunction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
== :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
$c/= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
/= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
Eq, Eq SDL_ThreadFunction
Eq SDL_ThreadFunction =>
(SDL_ThreadFunction -> SDL_ThreadFunction -> Ordering)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> Bool)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction)
-> (SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction)
-> Ord SDL_ThreadFunction
SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
SDL_ThreadFunction -> SDL_ThreadFunction -> Ordering
SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction
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_ThreadFunction -> SDL_ThreadFunction -> Ordering
compare :: SDL_ThreadFunction -> SDL_ThreadFunction -> Ordering
$c< :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
< :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
$c<= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
<= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
$c> :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
> :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
$c>= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
>= :: SDL_ThreadFunction -> SDL_ThreadFunction -> Bool
$cmax :: SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction
max :: SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction
$cmin :: SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction
min :: SDL_ThreadFunction -> SDL_ThreadFunction -> SDL_ThreadFunction
Ord, Int -> SDL_ThreadFunction -> ShowS
[SDL_ThreadFunction] -> ShowS
SDL_ThreadFunction -> String
(Int -> SDL_ThreadFunction -> ShowS)
-> (SDL_ThreadFunction -> String)
-> ([SDL_ThreadFunction] -> ShowS)
-> Show SDL_ThreadFunction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_ThreadFunction -> ShowS
showsPrec :: Int -> SDL_ThreadFunction -> ShowS
$cshow :: SDL_ThreadFunction -> String
show :: SDL_ThreadFunction -> String
$cshowList :: [SDL_ThreadFunction] -> ShowS
showList :: [SDL_ThreadFunction] -> ShowS
Show)
  deriving newtype
    ( FFIType SDL_ThreadFunction -> SDL_ThreadFunction
SDL_ThreadFunction -> FFIType SDL_ThreadFunction
(SDL_ThreadFunction -> FFIType SDL_ThreadFunction)
-> (FFIType SDL_ThreadFunction -> SDL_ThreadFunction)
-> HasFFIType SDL_ThreadFunction
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_ThreadFunction -> FFIType SDL_ThreadFunction
toFFIType :: SDL_ThreadFunction -> FFIType SDL_ThreadFunction
$cfromFFIType :: FFIType SDL_ThreadFunction -> SDL_ThreadFunction
fromFFIType :: FFIType SDL_ThreadFunction -> SDL_ThreadFunction
BG.HasFFIType
    , Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
Ptr SDL_ThreadFunction -> Int -> IO SDL_ThreadFunction
Ptr SDL_ThreadFunction -> Int -> SDL_ThreadFunction -> IO ()
Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
SDL_ThreadFunction -> Int
(SDL_ThreadFunction -> Int)
-> (SDL_ThreadFunction -> Int)
-> (Ptr SDL_ThreadFunction -> Int -> IO SDL_ThreadFunction)
-> (Ptr SDL_ThreadFunction -> Int -> SDL_ThreadFunction -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_ThreadFunction)
-> (forall b. Ptr b -> Int -> SDL_ThreadFunction -> IO ())
-> (Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction)
-> (Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ())
-> Storable SDL_ThreadFunction
forall b. Ptr b -> Int -> IO SDL_ThreadFunction
forall b. Ptr b -> Int -> SDL_ThreadFunction -> 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_ThreadFunction -> Int
sizeOf :: SDL_ThreadFunction -> Int
$calignment :: SDL_ThreadFunction -> Int
alignment :: SDL_ThreadFunction -> Int
$cpeekElemOff :: Ptr SDL_ThreadFunction -> Int -> IO SDL_ThreadFunction
peekElemOff :: Ptr SDL_ThreadFunction -> Int -> IO SDL_ThreadFunction
$cpokeElemOff :: Ptr SDL_ThreadFunction -> Int -> SDL_ThreadFunction -> IO ()
pokeElemOff :: Ptr SDL_ThreadFunction -> Int -> SDL_ThreadFunction -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_ThreadFunction
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_ThreadFunction
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_ThreadFunction -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_ThreadFunction -> IO ()
$cpeek :: Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
peek :: Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
$cpoke :: Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
poke :: Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
BG.Storable
    , Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
(Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction)
-> ReadRaw SDL_ThreadFunction
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
readRaw :: Ptr SDL_ThreadFunction -> IO SDL_ThreadFunction
Marshal.ReadRaw
    , Proxy SDL_ThreadFunction -> Int
(Proxy SDL_ThreadFunction -> Int)
-> (Proxy SDL_ThreadFunction -> Int)
-> StaticSize SDL_ThreadFunction
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_ThreadFunction -> Int
staticSizeOf :: Proxy SDL_ThreadFunction -> Int
$cstaticAlignment :: Proxy SDL_ThreadFunction -> Int
staticAlignment :: Proxy SDL_ThreadFunction -> Int
Marshal.StaticSize
    , Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
(Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ())
-> WriteRaw SDL_ThreadFunction
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
writeRaw :: Ptr SDL_ThreadFunction -> SDL_ThreadFunction -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ BG.FunPtr SDL_ThreadFunction_Aux)
  => BG.CompatHasField.HasField "unwrap" SDL_ThreadFunction ty
  where
  hasField :: SDL_ThreadFunction -> (ty -> SDL_ThreadFunction, ty)
hasField =
    \SDL_ThreadFunction
x0 ->
      ( \ty
y1 ->
          SDL_ThreadFunction{unwrap :: FunPtr SDL_ThreadFunction_Aux
unwrap = ty
FunPtr SDL_ThreadFunction_Aux
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_ThreadFunction
x0
      )

instance
  (ty ~ BG.FunPtr SDL_ThreadFunction_Aux)
  => BG.HasField "unwrap" (BG.Ptr SDL_ThreadFunction) (BG.Ptr ty)
  where
  getField :: Ptr SDL_ThreadFunction -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_ThreadFunction
-> Ptr (CFieldType SDL_ThreadFunction "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_ThreadFunction "unwrap" where
  type
    CFieldType SDL_ThreadFunction "unwrap" =
      BG.FunPtr SDL_ThreadFunction_Aux

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

-- | [C declaration]: @macro SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER@, literal @\"SDL.thread.create.entry_function\"@, defined at @SDL3\/SDL_thread.h 360:9@
sDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER :: BG.ByteString
sDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER :: ByteString
sDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER =
  [Word8] -> ByteString
BG.pack
    [ Word8
0x53
    , Word8
0x44
    , Word8
0x4C
    , Word8
0x2E
    , Word8
0x74
    , Word8
0x68
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x64
    , Word8
0x2E
    , Word8
0x63
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x74
    , Word8
0x65
    , Word8
0x2E
    , Word8
0x65
    , Word8
0x6E
    , Word8
0x74
    , Word8
0x72
    , Word8
0x79
    , Word8
0x5F
    , Word8
0x66
    , Word8
0x75
    , Word8
0x6E
    , Word8
0x63
    , Word8
0x74
    , Word8
0x69
    , Word8
0x6F
    , Word8
0x6E
    ]

-- | [C declaration]: @macro SDL_PROP_THREAD_CREATE_NAME_STRING@, literal @\"SDL.thread.create.name\"@, defined at @SDL3\/SDL_thread.h 361:9@
sDL_PROP_THREAD_CREATE_NAME_STRING :: BG.ByteString
sDL_PROP_THREAD_CREATE_NAME_STRING :: ByteString
sDL_PROP_THREAD_CREATE_NAME_STRING =
  [Word8] -> ByteString
BG.pack
    [ Word8
0x53
    , Word8
0x44
    , Word8
0x4C
    , Word8
0x2E
    , Word8
0x74
    , Word8
0x68
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x64
    , Word8
0x2E
    , Word8
0x63
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x74
    , Word8
0x65
    , Word8
0x2E
    , Word8
0x6E
    , Word8
0x61
    , Word8
0x6D
    , Word8
0x65
    ]

-- | [C declaration]: @macro SDL_PROP_THREAD_CREATE_USERDATA_POINTER@, literal @\"SDL.thread.create.userdata\"@, defined at @SDL3\/SDL_thread.h 362:9@
sDL_PROP_THREAD_CREATE_USERDATA_POINTER :: BG.ByteString
sDL_PROP_THREAD_CREATE_USERDATA_POINTER :: ByteString
sDL_PROP_THREAD_CREATE_USERDATA_POINTER =
  [Word8] -> ByteString
BG.pack
    [ Word8
0x53
    , Word8
0x44
    , Word8
0x4C
    , Word8
0x2E
    , Word8
0x74
    , Word8
0x68
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x64
    , Word8
0x2E
    , Word8
0x63
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x74
    , Word8
0x65
    , Word8
0x2E
    , Word8
0x75
    , Word8
0x73
    , Word8
0x65
    , Word8
0x72
    , Word8
0x64
    , Word8
0x61
    , Word8
0x74
    , Word8
0x61
    ]

-- | [C declaration]: @macro SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER@, literal @\"SDL.thread.create.stacksize\"@, defined at @SDL3\/SDL_thread.h 363:9@
sDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER :: BG.ByteString
sDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER :: ByteString
sDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER =
  [Word8] -> ByteString
BG.pack
    [ Word8
0x53
    , Word8
0x44
    , Word8
0x4C
    , Word8
0x2E
    , Word8
0x74
    , Word8
0x68
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x64
    , Word8
0x2E
    , Word8
0x63
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x74
    , Word8
0x65
    , Word8
0x2E
    , Word8
0x73
    , Word8
0x74
    , Word8
0x61
    , Word8
0x63
    , Word8
0x6B
    , Word8
0x73
    , Word8
0x69
    , Word8
0x7A
    , Word8
0x65
    ]

-- | Auxiliary type used by 'SDL_TLSDestructorCallback'
--
--     [C declaration]: @SDL_TLSDestructorCallback@, defined at @SDL3\/SDL_thread.h 553:24@
newtype SDL_TLSDestructorCallback_Aux = SDL_TLSDestructorCallback_Aux
  { SDL_TLSDestructorCallback_Aux -> Ptr Void -> IO ()
unwrap :: BG.Ptr BG.Void -> IO ()
  }
  deriving stock ((forall x.
 SDL_TLSDestructorCallback_Aux
 -> Rep SDL_TLSDestructorCallback_Aux x)
-> (forall x.
    Rep SDL_TLSDestructorCallback_Aux x
    -> SDL_TLSDestructorCallback_Aux)
-> Generic SDL_TLSDestructorCallback_Aux
forall x.
Rep SDL_TLSDestructorCallback_Aux x
-> SDL_TLSDestructorCallback_Aux
forall x.
SDL_TLSDestructorCallback_Aux
-> Rep SDL_TLSDestructorCallback_Aux x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_TLSDestructorCallback_Aux
-> Rep SDL_TLSDestructorCallback_Aux x
from :: forall x.
SDL_TLSDestructorCallback_Aux
-> Rep SDL_TLSDestructorCallback_Aux x
$cto :: forall x.
Rep SDL_TLSDestructorCallback_Aux x
-> SDL_TLSDestructorCallback_Aux
to :: forall x.
Rep SDL_TLSDestructorCallback_Aux x
-> SDL_TLSDestructorCallback_Aux
BG.Generic)

-- __unique:__ @toSDL_TLSDestructorCallback_Aux@
foreign import ccall safe "wrapper"
  hs_bindgen_7c0725308cb75f6c_base
    :: (BG.Ptr BG.Void -> IO ())
    -> IO (BG.FunPtr (BG.Ptr BG.Void -> IO ()))

-- __unique:__ @toSDL_TLSDestructorCallback_Aux@
hs_bindgen_7c0725308cb75f6c
  :: SDL_TLSDestructorCallback_Aux
  -> IO (BG.FunPtr SDL_TLSDestructorCallback_Aux)
hs_bindgen_7c0725308cb75f6c :: SDL_TLSDestructorCallback_Aux
-> IO (FunPtr SDL_TLSDestructorCallback_Aux)
hs_bindgen_7c0725308cb75f6c =
  \SDL_TLSDestructorCallback_Aux
fun0 ->
    (FunPtr (Ptr Void -> IO ())
 -> FunPtr SDL_TLSDestructorCallback_Aux)
-> IO (FunPtr (Ptr Void -> IO ()))
-> IO (FunPtr SDL_TLSDestructorCallback_Aux)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
      FunPtr (Ptr Void -> IO ()) -> FunPtr SDL_TLSDestructorCallback_Aux
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr
      ( (Ptr Void -> IO ()) -> IO (FunPtr (Ptr Void -> IO ()))
hs_bindgen_7c0725308cb75f6c_base
          ( \Ptr Void
x1 ->
              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_TLSDestructorCallback_Aux
fun0 (FFIType (Ptr Void) -> Ptr Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr Void)
x1)
          )
      )

-- __unique:__ @fromSDL_TLSDestructorCallback_Aux@
foreign import ccall safe "dynamic"
  hs_bindgen_bbd67b4f21094dd4_base
    :: BG.FunPtr (BG.Ptr BG.Void -> IO ())
    -> BG.Ptr BG.Void
    -> IO ()

-- __unique:__ @fromSDL_TLSDestructorCallback_Aux@
hs_bindgen_bbd67b4f21094dd4
  :: BG.FunPtr SDL_TLSDestructorCallback_Aux
  -> SDL_TLSDestructorCallback_Aux
hs_bindgen_bbd67b4f21094dd4 :: FunPtr SDL_TLSDestructorCallback_Aux
-> SDL_TLSDestructorCallback_Aux
hs_bindgen_bbd67b4f21094dd4 =
  \FunPtr SDL_TLSDestructorCallback_Aux
funPtr0 ->
    (Ptr Void -> IO ()) -> SDL_TLSDestructorCallback_Aux
SDL_TLSDestructorCallback_Aux
      ( \Ptr Void
x1 ->
          FunPtr (Ptr Void -> IO ()) -> Ptr Void -> IO ()
hs_bindgen_bbd67b4f21094dd4_base (FunPtr SDL_TLSDestructorCallback_Aux -> FunPtr (Ptr Void -> IO ())
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr FunPtr SDL_TLSDestructorCallback_Aux
funPtr0) (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x1)
      )

instance BG.ToFunPtr SDL_TLSDestructorCallback_Aux where
  toFunPtr :: SDL_TLSDestructorCallback_Aux
-> IO (FunPtr SDL_TLSDestructorCallback_Aux)
toFunPtr = SDL_TLSDestructorCallback_Aux
-> IO (FunPtr SDL_TLSDestructorCallback_Aux)
hs_bindgen_7c0725308cb75f6c

instance BG.FromFunPtr SDL_TLSDestructorCallback_Aux where
  fromFunPtr :: FunPtr SDL_TLSDestructorCallback_Aux
-> SDL_TLSDestructorCallback_Aux
fromFunPtr = FunPtr SDL_TLSDestructorCallback_Aux
-> SDL_TLSDestructorCallback_Aux
hs_bindgen_bbd67b4f21094dd4

instance
  (ty ~ (BG.Ptr BG.Void -> IO ()))
  => BG.CompatHasField.HasField "unwrap" SDL_TLSDestructorCallback_Aux ty
  where
  hasField :: SDL_TLSDestructorCallback_Aux
-> (ty -> SDL_TLSDestructorCallback_Aux, ty)
hasField =
    \SDL_TLSDestructorCallback_Aux
x0 ->
      ( \ty
y1 -> SDL_TLSDestructorCallback_Aux{unwrap :: Ptr Void -> IO ()
unwrap = ty
Ptr Void -> IO ()
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_TLSDestructorCallback_Aux
x0
      )

instance
  (ty ~ (BG.Ptr BG.Void -> IO ()))
  => BG.HasField "unwrap" (BG.Ptr SDL_TLSDestructorCallback_Aux) (BG.Ptr ty)
  where
  getField :: Ptr SDL_TLSDestructorCallback_Aux -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_TLSDestructorCallback_Aux
-> Ptr (CFieldType SDL_TLSDestructorCallback_Aux "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_TLSDestructorCallback_Aux "unwrap" where
  type
    CFieldType SDL_TLSDestructorCallback_Aux "unwrap" =
      BG.Ptr BG.Void -> IO ()

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

-- | The callback used to cleanup data passed to SDL_SetTLS.
--
--     This is called when a thread exits, to allow an app to free any resources.
--
--     [@value@]: a pointer previously handed to SDL_SetTLS.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_SetTLS'
--
--     [C declaration]: @SDL_TLSDestructorCallback@, defined at @SDL3\/SDL_thread.h 553:24@
newtype SDL_TLSDestructorCallback = SDL_TLSDestructorCallback
  { SDL_TLSDestructorCallback -> FunPtr SDL_TLSDestructorCallback_Aux
unwrap :: BG.FunPtr SDL_TLSDestructorCallback_Aux
  }
  deriving stock ((forall x.
 SDL_TLSDestructorCallback -> Rep SDL_TLSDestructorCallback x)
-> (forall x.
    Rep SDL_TLSDestructorCallback x -> SDL_TLSDestructorCallback)
-> Generic SDL_TLSDestructorCallback
forall x.
Rep SDL_TLSDestructorCallback x -> SDL_TLSDestructorCallback
forall x.
SDL_TLSDestructorCallback -> Rep SDL_TLSDestructorCallback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_TLSDestructorCallback -> Rep SDL_TLSDestructorCallback x
from :: forall x.
SDL_TLSDestructorCallback -> Rep SDL_TLSDestructorCallback x
$cto :: forall x.
Rep SDL_TLSDestructorCallback x -> SDL_TLSDestructorCallback
to :: forall x.
Rep SDL_TLSDestructorCallback x -> SDL_TLSDestructorCallback
BG.Generic, SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
(SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> (SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> Eq SDL_TLSDestructorCallback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
== :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
$c/= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
/= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
Eq, Eq SDL_TLSDestructorCallback
Eq SDL_TLSDestructorCallback =>
(SDL_TLSDestructorCallback
 -> SDL_TLSDestructorCallback -> Ordering)
-> (SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> (SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> (SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> (SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool)
-> (SDL_TLSDestructorCallback
    -> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback)
-> (SDL_TLSDestructorCallback
    -> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback)
-> Ord SDL_TLSDestructorCallback
SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Ordering
SDL_TLSDestructorCallback
-> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
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_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Ordering
compare :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Ordering
$c< :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
< :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
$c<= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
<= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
$c> :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
> :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
$c>= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
>= :: SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> Bool
$cmax :: SDL_TLSDestructorCallback
-> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
max :: SDL_TLSDestructorCallback
-> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
$cmin :: SDL_TLSDestructorCallback
-> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
min :: SDL_TLSDestructorCallback
-> SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
Ord, Int -> SDL_TLSDestructorCallback -> ShowS
[SDL_TLSDestructorCallback] -> ShowS
SDL_TLSDestructorCallback -> String
(Int -> SDL_TLSDestructorCallback -> ShowS)
-> (SDL_TLSDestructorCallback -> String)
-> ([SDL_TLSDestructorCallback] -> ShowS)
-> Show SDL_TLSDestructorCallback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_TLSDestructorCallback -> ShowS
showsPrec :: Int -> SDL_TLSDestructorCallback -> ShowS
$cshow :: SDL_TLSDestructorCallback -> String
show :: SDL_TLSDestructorCallback -> String
$cshowList :: [SDL_TLSDestructorCallback] -> ShowS
showList :: [SDL_TLSDestructorCallback] -> ShowS
Show)
  deriving newtype
    ( FFIType SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
SDL_TLSDestructorCallback -> FFIType SDL_TLSDestructorCallback
(SDL_TLSDestructorCallback -> FFIType SDL_TLSDestructorCallback)
-> (FFIType SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback)
-> HasFFIType SDL_TLSDestructorCallback
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_TLSDestructorCallback -> FFIType SDL_TLSDestructorCallback
toFFIType :: SDL_TLSDestructorCallback -> FFIType SDL_TLSDestructorCallback
$cfromFFIType :: FFIType SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
fromFFIType :: FFIType SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback
BG.HasFFIType
    , Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
Ptr SDL_TLSDestructorCallback
-> Int -> IO SDL_TLSDestructorCallback
Ptr SDL_TLSDestructorCallback
-> Int -> SDL_TLSDestructorCallback -> IO ()
Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
SDL_TLSDestructorCallback -> Int
(SDL_TLSDestructorCallback -> Int)
-> (SDL_TLSDestructorCallback -> Int)
-> (Ptr SDL_TLSDestructorCallback
    -> Int -> IO SDL_TLSDestructorCallback)
-> (Ptr SDL_TLSDestructorCallback
    -> Int -> SDL_TLSDestructorCallback -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_TLSDestructorCallback)
-> (forall b. Ptr b -> Int -> SDL_TLSDestructorCallback -> IO ())
-> (Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback)
-> (Ptr SDL_TLSDestructorCallback
    -> SDL_TLSDestructorCallback -> IO ())
-> Storable SDL_TLSDestructorCallback
forall b. Ptr b -> Int -> IO SDL_TLSDestructorCallback
forall b. Ptr b -> Int -> SDL_TLSDestructorCallback -> 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_TLSDestructorCallback -> Int
sizeOf :: SDL_TLSDestructorCallback -> Int
$calignment :: SDL_TLSDestructorCallback -> Int
alignment :: SDL_TLSDestructorCallback -> Int
$cpeekElemOff :: Ptr SDL_TLSDestructorCallback
-> Int -> IO SDL_TLSDestructorCallback
peekElemOff :: Ptr SDL_TLSDestructorCallback
-> Int -> IO SDL_TLSDestructorCallback
$cpokeElemOff :: Ptr SDL_TLSDestructorCallback
-> Int -> SDL_TLSDestructorCallback -> IO ()
pokeElemOff :: Ptr SDL_TLSDestructorCallback
-> Int -> SDL_TLSDestructorCallback -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_TLSDestructorCallback
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_TLSDestructorCallback
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_TLSDestructorCallback -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_TLSDestructorCallback -> IO ()
$cpeek :: Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
peek :: Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
$cpoke :: Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
poke :: Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
BG.Storable
    , Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
(Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback)
-> ReadRaw SDL_TLSDestructorCallback
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
readRaw :: Ptr SDL_TLSDestructorCallback -> IO SDL_TLSDestructorCallback
Marshal.ReadRaw
    , Proxy SDL_TLSDestructorCallback -> Int
(Proxy SDL_TLSDestructorCallback -> Int)
-> (Proxy SDL_TLSDestructorCallback -> Int)
-> StaticSize SDL_TLSDestructorCallback
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_TLSDestructorCallback -> Int
staticSizeOf :: Proxy SDL_TLSDestructorCallback -> Int
$cstaticAlignment :: Proxy SDL_TLSDestructorCallback -> Int
staticAlignment :: Proxy SDL_TLSDestructorCallback -> Int
Marshal.StaticSize
    , Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
(Ptr SDL_TLSDestructorCallback
 -> SDL_TLSDestructorCallback -> IO ())
-> WriteRaw SDL_TLSDestructorCallback
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
writeRaw :: Ptr SDL_TLSDestructorCallback -> SDL_TLSDestructorCallback -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ BG.FunPtr SDL_TLSDestructorCallback_Aux)
  => BG.CompatHasField.HasField "unwrap" SDL_TLSDestructorCallback ty
  where
  hasField :: SDL_TLSDestructorCallback -> (ty -> SDL_TLSDestructorCallback, ty)
hasField =
    \SDL_TLSDestructorCallback
x0 ->
      ( \ty
y1 ->
          SDL_TLSDestructorCallback{unwrap :: FunPtr SDL_TLSDestructorCallback_Aux
unwrap = ty
FunPtr SDL_TLSDestructorCallback_Aux
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_TLSDestructorCallback
x0
      )

instance
  (ty ~ BG.FunPtr SDL_TLSDestructorCallback_Aux)
  => BG.HasField "unwrap" (BG.Ptr SDL_TLSDestructorCallback) (BG.Ptr ty)
  where
  getField :: Ptr SDL_TLSDestructorCallback -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_TLSDestructorCallback
-> Ptr (CFieldType SDL_TLSDestructorCallback "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_TLSDestructorCallback "unwrap" where
  type
    CFieldType SDL_TLSDestructorCallback "unwrap" =
      BG.FunPtr SDL_TLSDestructorCallback_Aux

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