{-# language CPP #-}
module OpenXR.Extensions.XR_MSFT_controller_model ( getControllerModelKeyMSFT
, loadControllerModelMSFT
, getControllerModelPropertiesMSFT
, getControllerModelStateMSFT
, ControllerModelKeyMSFT(..)
, ControllerModelKeyStateMSFT(..)
, ControllerModelNodePropertiesMSFT(..)
, ControllerModelPropertiesMSFT(..)
, ControllerModelNodeStateMSFT(..)
, ControllerModelStateMSFT(..)
, MSFT_controller_model_SPEC_VERSION
, pattern MSFT_controller_model_SPEC_VERSION
, MSFT_CONTROLLER_MODEL_EXTENSION_NAME
, pattern MSFT_CONTROLLER_MODEL_EXTENSION_NAME
, MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT
, pattern MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT
, NULL_CONTROLLER_MODEL_KEY_MSFT
, pattern NULL_CONTROLLER_MODEL_KEY_MSFT
) where
import OpenXR.CStruct.Utils (FixedArray)
import OpenXR.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showParen)
import Numeric (showHex)
import Data.ByteString (packCString)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import OpenXR.CStruct (FromCStruct)
import OpenXR.CStruct (FromCStruct(..))
import OpenXR.CStruct (ToCStruct)
import OpenXR.CStruct (ToCStruct(..))
import OpenXR.Zero (Zero)
import OpenXR.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Word (Word8)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import OpenXR.CStruct.Utils (advancePtrBytes)
import OpenXR.CStruct.Utils (lowerArrayPtr)
import OpenXR.CStruct.Utils (pokeFixedLengthNullTerminatedByteString)
import OpenXR.NamedType ((:::))
import OpenXR.Dynamic (InstanceCmds(pXrGetControllerModelKeyMSFT))
import OpenXR.Dynamic (InstanceCmds(pXrGetControllerModelPropertiesMSFT))
import OpenXR.Dynamic (InstanceCmds(pXrGetControllerModelStateMSFT))
import OpenXR.Dynamic (InstanceCmds(pXrLoadControllerModelMSFT))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.SemanticPaths (Path)
import OpenXR.Core10.SemanticPaths (Path(..))
import OpenXR.Core10.Space (Posef)
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Handles (Session)
import OpenXR.Core10.Handles (Session(..))
import OpenXR.Core10.Handles (Session_T)
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_CONTROLLER_MODEL_STATE_MSFT))
import OpenXR.Core10.APIConstants (NULL_CONTROLLER_MODEL_KEY_MSFT)
import OpenXR.Core10.APIConstants (pattern NULL_CONTROLLER_MODEL_KEY_MSFT)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrGetControllerModelKeyMSFT
:: FunPtr (Ptr Session_T -> Path -> Ptr ControllerModelKeyStateMSFT -> IO Result) -> Ptr Session_T -> Path -> Ptr ControllerModelKeyStateMSFT -> IO Result
getControllerModelKeyMSFT :: forall io
. (MonadIO io)
=>
Session
->
("topLevelUserPath" ::: Path)
-> io (ControllerModelKeyStateMSFT)
getControllerModelKeyMSFT :: Session
-> ("topLevelUserPath" ::: Path) -> io ControllerModelKeyStateMSFT
getControllerModelKeyMSFT session :: Session
session topLevelUserPath :: "topLevelUserPath" ::: Path
topLevelUserPath = IO ControllerModelKeyStateMSFT -> io ControllerModelKeyStateMSFT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ControllerModelKeyStateMSFT -> io ControllerModelKeyStateMSFT)
-> (ContT
ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
-> IO ControllerModelKeyStateMSFT)
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
-> io ControllerModelKeyStateMSFT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
-> IO ControllerModelKeyStateMSFT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
-> io ControllerModelKeyStateMSFT)
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
-> io ControllerModelKeyStateMSFT
forall a b. (a -> b) -> a -> b
$ do
let xrGetControllerModelKeyMSFTPtr :: FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
xrGetControllerModelKeyMSFTPtr = InstanceCmds
-> FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
pXrGetControllerModelKeyMSFT (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
IO () -> ContT ControllerModelKeyStateMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelKeyStateMSFT IO ())
-> IO () -> ContT ControllerModelKeyStateMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
xrGetControllerModelKeyMSFTPtr FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
-> FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetControllerModelKeyMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrGetControllerModelKeyMSFT' :: Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result
xrGetControllerModelKeyMSFT' = FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
-> Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result
mkXrGetControllerModelKeyMSFT FunPtr
(Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result)
xrGetControllerModelKeyMSFTPtr
Ptr ControllerModelKeyStateMSFT
pControllerModelKeyState <- ((Ptr ControllerModelKeyStateMSFT
-> IO ControllerModelKeyStateMSFT)
-> IO ControllerModelKeyStateMSFT)
-> ContT
ControllerModelKeyStateMSFT IO (Ptr ControllerModelKeyStateMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct ControllerModelKeyStateMSFT =>
(Ptr ControllerModelKeyStateMSFT -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ControllerModelKeyStateMSFT)
Result
r <- IO Result -> ContT ControllerModelKeyStateMSFT IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ControllerModelKeyStateMSFT IO Result)
-> IO Result -> ContT ControllerModelKeyStateMSFT IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetControllerModelKeyMSFT" (Ptr Session_T
-> ("topLevelUserPath" ::: Path)
-> Ptr ControllerModelKeyStateMSFT
-> IO Result
xrGetControllerModelKeyMSFT' (Session -> Ptr Session_T
sessionHandle (Session
session)) ("topLevelUserPath" ::: Path
topLevelUserPath) (Ptr ControllerModelKeyStateMSFT
pControllerModelKeyState))
IO () -> ContT ControllerModelKeyStateMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelKeyStateMSFT IO ())
-> IO () -> ContT ControllerModelKeyStateMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
ControllerModelKeyStateMSFT
controllerModelKeyState <- IO ControllerModelKeyStateMSFT
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ControllerModelKeyStateMSFT
-> ContT
ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT)
-> IO ControllerModelKeyStateMSFT
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
forall a b. (a -> b) -> a -> b
$ Ptr ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ControllerModelKeyStateMSFT Ptr ControllerModelKeyStateMSFT
pControllerModelKeyState
ControllerModelKeyStateMSFT
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelKeyStateMSFT
-> ContT
ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT)
-> ControllerModelKeyStateMSFT
-> ContT ControllerModelKeyStateMSFT IO ControllerModelKeyStateMSFT
forall a b. (a -> b) -> a -> b
$ (ControllerModelKeyStateMSFT
controllerModelKeyState)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrLoadControllerModelMSFT
:: FunPtr (Ptr Session_T -> ControllerModelKeyMSFT -> Word32 -> Ptr Word32 -> Ptr Word8 -> IO Result) -> Ptr Session_T -> ControllerModelKeyMSFT -> Word32 -> Ptr Word32 -> Ptr Word8 -> IO Result
loadControllerModelMSFT :: forall io
. (MonadIO io)
=>
Session
->
ControllerModelKeyMSFT
-> io (("buffer" ::: Vector Word8))
loadControllerModelMSFT :: Session -> ControllerModelKeyMSFT -> io ("buffer" ::: Vector Word8)
loadControllerModelMSFT session :: Session
session modelKey :: ControllerModelKeyMSFT
modelKey = IO ("buffer" ::: Vector Word8) -> io ("buffer" ::: Vector Word8)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("buffer" ::: Vector Word8) -> io ("buffer" ::: Vector Word8))
-> (ContT
("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
-> IO ("buffer" ::: Vector Word8))
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
-> io ("buffer" ::: Vector Word8)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
-> IO ("buffer" ::: Vector Word8)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
-> io ("buffer" ::: Vector Word8))
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
-> io ("buffer" ::: Vector Word8)
forall a b. (a -> b) -> a -> b
$ do
let xrLoadControllerModelMSFTPtr :: FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
xrLoadControllerModelMSFTPtr = InstanceCmds
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
pXrLoadControllerModelMSFT (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: Vector Word8) IO ())
-> IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
xrLoadControllerModelMSFTPtr FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrLoadControllerModelMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrLoadControllerModelMSFT' :: Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result
xrLoadControllerModelMSFT' = FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
-> Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result
mkXrLoadControllerModelMSFT FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result)
xrLoadControllerModelMSFTPtr
let session' :: Ptr Session_T
session' = Session -> Ptr Session_T
sessionHandle (Session
session)
"bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput <- ((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT
("buffer" ::: Vector Word8)
IO
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT
("buffer" ::: Vector Word8)
IO
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)))
-> ((("bufferCountOutput"
::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT
("buffer" ::: Vector Word8)
IO
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a b. (a -> b) -> a -> b
$ IO ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> (("bufferCountOutput"
::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ())
-> (("bufferCountOutput"
::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT ("buffer" ::: Vector Word8) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: Vector Word8) IO Result)
-> IO Result -> ContT ("buffer" ::: Vector Word8) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrLoadControllerModelMSFT" (Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result
xrLoadControllerModelMSFT' Ptr Session_T
session' (ControllerModelKeyMSFT
modelKey) (0) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr Word8
forall a. Ptr a
nullPtr))
IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: Vector Word8) IO ())
-> IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
"bufferCapacityInput" ::: Word32
bufferCountOutput <- IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32)
forall a b. (a -> b) -> a -> b
$ ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput
"buffer" ::: Ptr Word8
pBuffer <- ((("buffer" ::: Ptr Word8) -> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Ptr Word8)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("buffer" ::: Ptr Word8) -> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Ptr Word8))
-> ((("buffer" ::: Ptr Word8) -> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8))
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Ptr Word8)
forall a b. (a -> b) -> a -> b
$ IO ("buffer" ::: Ptr Word8)
-> (("buffer" ::: Ptr Word8) -> IO ())
-> (("buffer" ::: Ptr Word8) -> IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("buffer" ::: Ptr Word8)
forall a. Int -> IO (Ptr a)
callocBytes @Word8 (("bufferCapacityInput" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ("bufferCapacityInput" ::: Word32
bufferCountOutput))) ("buffer" ::: Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r' <- IO Result -> ContT ("buffer" ::: Vector Word8) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: Vector Word8) IO Result)
-> IO Result -> ContT ("buffer" ::: Vector Word8) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrLoadControllerModelMSFT" (Ptr Session_T
-> ControllerModelKeyMSFT
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr Word8)
-> IO Result
xrLoadControllerModelMSFT' Ptr Session_T
session' (ControllerModelKeyMSFT
modelKey) (("bufferCapacityInput" ::: Word32
bufferCountOutput)) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr Word8
pBuffer))
IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: Vector Word8) IO ())
-> IO () -> ContT ("buffer" ::: Vector Word8) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r'))
"bufferCapacityInput" ::: Word32
bufferCountOutput' <- IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
-> ContT
("buffer" ::: Vector Word8) IO ("bufferCapacityInput" ::: Word32)
forall a b. (a -> b) -> a -> b
$ ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput
"buffer" ::: Vector Word8
buffer' <- IO ("buffer" ::: Vector Word8)
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("buffer" ::: Vector Word8)
-> ContT
("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8))
-> IO ("buffer" ::: Vector Word8)
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
forall a b. (a -> b) -> a -> b
$ Int -> (Int -> IO Word8) -> IO ("buffer" ::: Vector Word8)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("bufferCapacityInput" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ("bufferCapacityInput" ::: Word32
bufferCountOutput')) (\i :: Int
i -> ("buffer" ::: Ptr Word8) -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek @Word8 (("buffer" ::: Ptr Word8
pBuffer ("buffer" ::: Ptr Word8) -> Int -> "buffer" ::: Ptr Word8
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (1 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word8)))
("buffer" ::: Vector Word8)
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("buffer" ::: Vector Word8)
-> ContT
("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8))
-> ("buffer" ::: Vector Word8)
-> ContT ("buffer" ::: Vector Word8) IO ("buffer" ::: Vector Word8)
forall a b. (a -> b) -> a -> b
$ ("buffer" ::: Vector Word8
buffer')
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrGetControllerModelPropertiesMSFT
:: FunPtr (Ptr Session_T -> ControllerModelKeyMSFT -> Ptr ControllerModelPropertiesMSFT -> IO Result) -> Ptr Session_T -> ControllerModelKeyMSFT -> Ptr ControllerModelPropertiesMSFT -> IO Result
getControllerModelPropertiesMSFT :: forall io
. (MonadIO io)
=>
Session
->
ControllerModelKeyMSFT
-> io (ControllerModelPropertiesMSFT)
getControllerModelPropertiesMSFT :: Session
-> ControllerModelKeyMSFT -> io ControllerModelPropertiesMSFT
getControllerModelPropertiesMSFT session :: Session
session modelKey :: ControllerModelKeyMSFT
modelKey = IO ControllerModelPropertiesMSFT
-> io ControllerModelPropertiesMSFT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ControllerModelPropertiesMSFT
-> io ControllerModelPropertiesMSFT)
-> (ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT)
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
-> io ControllerModelPropertiesMSFT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
-> io ControllerModelPropertiesMSFT)
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
-> io ControllerModelPropertiesMSFT
forall a b. (a -> b) -> a -> b
$ do
let xrGetControllerModelPropertiesMSFTPtr :: FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
xrGetControllerModelPropertiesMSFTPtr = InstanceCmds
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
pXrGetControllerModelPropertiesMSFT (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
IO () -> ContT ControllerModelPropertiesMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelPropertiesMSFT IO ())
-> IO () -> ContT ControllerModelPropertiesMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
xrGetControllerModelPropertiesMSFTPtr FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetControllerModelPropertiesMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrGetControllerModelPropertiesMSFT' :: Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result
xrGetControllerModelPropertiesMSFT' = FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
-> Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result
mkXrGetControllerModelPropertiesMSFT FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result)
xrGetControllerModelPropertiesMSFTPtr
Ptr ControllerModelPropertiesMSFT
pProperties <- ((Ptr ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT)
-> IO ControllerModelPropertiesMSFT)
-> ContT
ControllerModelPropertiesMSFT
IO
(Ptr ControllerModelPropertiesMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct ControllerModelPropertiesMSFT =>
(Ptr ControllerModelPropertiesMSFT -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ControllerModelPropertiesMSFT)
Result
r <- IO Result -> ContT ControllerModelPropertiesMSFT IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ControllerModelPropertiesMSFT IO Result)
-> IO Result -> ContT ControllerModelPropertiesMSFT IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetControllerModelPropertiesMSFT" (Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelPropertiesMSFT
-> IO Result
xrGetControllerModelPropertiesMSFT' (Session -> Ptr Session_T
sessionHandle (Session
session)) (ControllerModelKeyMSFT
modelKey) (Ptr ControllerModelPropertiesMSFT
pProperties))
IO () -> ContT ControllerModelPropertiesMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelPropertiesMSFT IO ())
-> IO () -> ContT ControllerModelPropertiesMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
ControllerModelPropertiesMSFT
properties <- IO ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT)
-> IO ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
forall a b. (a -> b) -> a -> b
$ Ptr ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ControllerModelPropertiesMSFT Ptr ControllerModelPropertiesMSFT
pProperties
ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT)
-> ControllerModelPropertiesMSFT
-> ContT
ControllerModelPropertiesMSFT IO ControllerModelPropertiesMSFT
forall a b. (a -> b) -> a -> b
$ (ControllerModelPropertiesMSFT
properties)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrGetControllerModelStateMSFT
:: FunPtr (Ptr Session_T -> ControllerModelKeyMSFT -> Ptr ControllerModelStateMSFT -> IO Result) -> Ptr Session_T -> ControllerModelKeyMSFT -> Ptr ControllerModelStateMSFT -> IO Result
getControllerModelStateMSFT :: forall io
. (MonadIO io)
=>
Session
->
ControllerModelKeyMSFT
-> io (ControllerModelStateMSFT)
getControllerModelStateMSFT :: Session -> ControllerModelKeyMSFT -> io ControllerModelStateMSFT
getControllerModelStateMSFT session :: Session
session modelKey :: ControllerModelKeyMSFT
modelKey = IO ControllerModelStateMSFT -> io ControllerModelStateMSFT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ControllerModelStateMSFT -> io ControllerModelStateMSFT)
-> (ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
-> IO ControllerModelStateMSFT)
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
-> io ControllerModelStateMSFT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
-> IO ControllerModelStateMSFT
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
-> io ControllerModelStateMSFT)
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
-> io ControllerModelStateMSFT
forall a b. (a -> b) -> a -> b
$ do
let xrGetControllerModelStateMSFTPtr :: FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
xrGetControllerModelStateMSFTPtr = InstanceCmds
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
pXrGetControllerModelStateMSFT (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
IO () -> ContT ControllerModelStateMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelStateMSFT IO ())
-> IO () -> ContT ControllerModelStateMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
xrGetControllerModelStateMSFTPtr FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
-> FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetControllerModelStateMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrGetControllerModelStateMSFT' :: Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result
xrGetControllerModelStateMSFT' = FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
-> Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result
mkXrGetControllerModelStateMSFT FunPtr
(Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result)
xrGetControllerModelStateMSFTPtr
Ptr ControllerModelStateMSFT
pState <- ((Ptr ControllerModelStateMSFT -> IO ControllerModelStateMSFT)
-> IO ControllerModelStateMSFT)
-> ContT ControllerModelStateMSFT IO (Ptr ControllerModelStateMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct ControllerModelStateMSFT =>
(Ptr ControllerModelStateMSFT -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ControllerModelStateMSFT)
Result
r <- IO Result -> ContT ControllerModelStateMSFT IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ControllerModelStateMSFT IO Result)
-> IO Result -> ContT ControllerModelStateMSFT IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetControllerModelStateMSFT" (Ptr Session_T
-> ControllerModelKeyMSFT
-> Ptr ControllerModelStateMSFT
-> IO Result
xrGetControllerModelStateMSFT' (Session -> Ptr Session_T
sessionHandle (Session
session)) (ControllerModelKeyMSFT
modelKey) (Ptr ControllerModelStateMSFT
pState))
IO () -> ContT ControllerModelStateMSFT IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ControllerModelStateMSFT IO ())
-> IO () -> ContT ControllerModelStateMSFT IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
ControllerModelStateMSFT
state <- IO ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT)
-> IO ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
forall a b. (a -> b) -> a -> b
$ Ptr ControllerModelStateMSFT -> IO ControllerModelStateMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ControllerModelStateMSFT Ptr ControllerModelStateMSFT
pState
ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT)
-> ControllerModelStateMSFT
-> ContT ControllerModelStateMSFT IO ControllerModelStateMSFT
forall a b. (a -> b) -> a -> b
$ (ControllerModelStateMSFT
state)
newtype ControllerModelKeyMSFT = ControllerModelKeyMSFT Word64
deriving newtype (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
(ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> Eq ControllerModelKeyMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c/= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
== :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c== :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
Eq, Eq ControllerModelKeyMSFT
Eq ControllerModelKeyMSFT =>
(ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Ordering)
-> (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> (ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool)
-> (ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT)
-> (ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT)
-> Ord ControllerModelKeyMSFT
ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Ordering
ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT
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
min :: ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT
$cmin :: ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT
max :: ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT
$cmax :: ControllerModelKeyMSFT
-> ControllerModelKeyMSFT -> ControllerModelKeyMSFT
>= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c>= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
> :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c> :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
<= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c<= :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
< :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
$c< :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Bool
compare :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Ordering
$ccompare :: ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> Ordering
$cp1Ord :: Eq ControllerModelKeyMSFT
Ord, Ptr b -> Int -> IO ControllerModelKeyMSFT
Ptr b -> Int -> ControllerModelKeyMSFT -> IO ()
Ptr ControllerModelKeyMSFT -> IO ControllerModelKeyMSFT
Ptr ControllerModelKeyMSFT -> Int -> IO ControllerModelKeyMSFT
Ptr ControllerModelKeyMSFT
-> Int -> ControllerModelKeyMSFT -> IO ()
Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ()
ControllerModelKeyMSFT -> Int
(ControllerModelKeyMSFT -> Int)
-> (ControllerModelKeyMSFT -> Int)
-> (Ptr ControllerModelKeyMSFT -> Int -> IO ControllerModelKeyMSFT)
-> (Ptr ControllerModelKeyMSFT
-> Int -> ControllerModelKeyMSFT -> IO ())
-> (forall b. Ptr b -> Int -> IO ControllerModelKeyMSFT)
-> (forall b. Ptr b -> Int -> ControllerModelKeyMSFT -> IO ())
-> (Ptr ControllerModelKeyMSFT -> IO ControllerModelKeyMSFT)
-> (Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ())
-> Storable ControllerModelKeyMSFT
forall b. Ptr b -> Int -> IO ControllerModelKeyMSFT
forall b. Ptr b -> Int -> ControllerModelKeyMSFT -> 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
poke :: Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ()
$cpoke :: Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ()
peek :: Ptr ControllerModelKeyMSFT -> IO ControllerModelKeyMSFT
$cpeek :: Ptr ControllerModelKeyMSFT -> IO ControllerModelKeyMSFT
pokeByteOff :: Ptr b -> Int -> ControllerModelKeyMSFT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ControllerModelKeyMSFT -> IO ()
peekByteOff :: Ptr b -> Int -> IO ControllerModelKeyMSFT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ControllerModelKeyMSFT
pokeElemOff :: Ptr ControllerModelKeyMSFT
-> Int -> ControllerModelKeyMSFT -> IO ()
$cpokeElemOff :: Ptr ControllerModelKeyMSFT
-> Int -> ControllerModelKeyMSFT -> IO ()
peekElemOff :: Ptr ControllerModelKeyMSFT -> Int -> IO ControllerModelKeyMSFT
$cpeekElemOff :: Ptr ControllerModelKeyMSFT -> Int -> IO ControllerModelKeyMSFT
alignment :: ControllerModelKeyMSFT -> Int
$calignment :: ControllerModelKeyMSFT -> Int
sizeOf :: ControllerModelKeyMSFT -> Int
$csizeOf :: ControllerModelKeyMSFT -> Int
Storable, ControllerModelKeyMSFT
ControllerModelKeyMSFT -> Zero ControllerModelKeyMSFT
forall a. a -> Zero a
zero :: ControllerModelKeyMSFT
$czero :: ControllerModelKeyMSFT
Zero)
instance Show ControllerModelKeyMSFT where
showsPrec :: Int -> ControllerModelKeyMSFT -> ShowS
showsPrec p :: Int
p (ControllerModelKeyMSFT x :: Word64
x) = Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "ControllerModelKeyMSFT 0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word64 -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Word64
x)
data ControllerModelKeyStateMSFT = ControllerModelKeyStateMSFT
{
ControllerModelKeyStateMSFT -> ControllerModelKeyMSFT
modelKey :: ControllerModelKeyMSFT }
deriving (Typeable, ControllerModelKeyStateMSFT -> ControllerModelKeyStateMSFT -> Bool
(ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> Bool)
-> (ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> Bool)
-> Eq ControllerModelKeyStateMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControllerModelKeyStateMSFT -> ControllerModelKeyStateMSFT -> Bool
$c/= :: ControllerModelKeyStateMSFT -> ControllerModelKeyStateMSFT -> Bool
== :: ControllerModelKeyStateMSFT -> ControllerModelKeyStateMSFT -> Bool
$c== :: ControllerModelKeyStateMSFT -> ControllerModelKeyStateMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ControllerModelKeyStateMSFT)
#endif
deriving instance Show ControllerModelKeyStateMSFT
instance ToCStruct ControllerModelKeyStateMSFT where
withCStruct :: ControllerModelKeyStateMSFT
-> (Ptr ControllerModelKeyStateMSFT -> IO b) -> IO b
withCStruct x :: ControllerModelKeyStateMSFT
x f :: Ptr ControllerModelKeyStateMSFT -> IO b
f = Int -> Int -> (Ptr ControllerModelKeyStateMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr ControllerModelKeyStateMSFT -> IO b) -> IO b)
-> (Ptr ControllerModelKeyStateMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ControllerModelKeyStateMSFT
p -> Ptr ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelKeyStateMSFT
p ControllerModelKeyStateMSFT
x (Ptr ControllerModelKeyStateMSFT -> IO b
f Ptr ControllerModelKeyStateMSFT
p)
pokeCStruct :: Ptr ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> IO b -> IO b
pokeCStruct p :: Ptr ControllerModelKeyStateMSFT
p ControllerModelKeyStateMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT
-> Int -> Ptr ControllerModelKeyMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ControllerModelKeyMSFT)) (ControllerModelKeyMSFT
modelKey)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ControllerModelKeyStateMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ControllerModelKeyStateMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ControllerModelKeyMSFT -> ControllerModelKeyMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT
-> Int -> Ptr ControllerModelKeyMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ControllerModelKeyMSFT)) (ControllerModelKeyMSFT
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ControllerModelKeyStateMSFT where
peekCStruct :: Ptr ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
peekCStruct p :: Ptr ControllerModelKeyStateMSFT
p = do
ControllerModelKeyMSFT
modelKey <- Ptr ControllerModelKeyMSFT -> IO ControllerModelKeyMSFT
forall a. Storable a => Ptr a -> IO a
peek @ControllerModelKeyMSFT ((Ptr ControllerModelKeyStateMSFT
p Ptr ControllerModelKeyStateMSFT
-> Int -> Ptr ControllerModelKeyMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ControllerModelKeyMSFT))
ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT)
-> ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
forall a b. (a -> b) -> a -> b
$ ControllerModelKeyMSFT -> ControllerModelKeyStateMSFT
ControllerModelKeyStateMSFT
ControllerModelKeyMSFT
modelKey
instance Storable ControllerModelKeyStateMSFT where
sizeOf :: ControllerModelKeyStateMSFT -> Int
sizeOf ~ControllerModelKeyStateMSFT
_ = 24
alignment :: ControllerModelKeyStateMSFT -> Int
alignment ~ControllerModelKeyStateMSFT
_ = 8
peek :: Ptr ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
peek = Ptr ControllerModelKeyStateMSFT -> IO ControllerModelKeyStateMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> IO ()
poke ptr :: Ptr ControllerModelKeyStateMSFT
ptr poked :: ControllerModelKeyStateMSFT
poked = Ptr ControllerModelKeyStateMSFT
-> ControllerModelKeyStateMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelKeyStateMSFT
ptr ControllerModelKeyStateMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ControllerModelKeyStateMSFT where
zero :: ControllerModelKeyStateMSFT
zero = ControllerModelKeyMSFT -> ControllerModelKeyStateMSFT
ControllerModelKeyStateMSFT
ControllerModelKeyMSFT
forall a. Zero a => a
zero
data ControllerModelNodePropertiesMSFT = ControllerModelNodePropertiesMSFT
{
ControllerModelNodePropertiesMSFT -> ByteString
parentNodeName :: ByteString
,
ControllerModelNodePropertiesMSFT -> ByteString
nodeName :: ByteString
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ControllerModelNodePropertiesMSFT)
#endif
deriving instance Show ControllerModelNodePropertiesMSFT
instance ToCStruct ControllerModelNodePropertiesMSFT where
withCStruct :: ControllerModelNodePropertiesMSFT
-> (Ptr ControllerModelNodePropertiesMSFT -> IO b) -> IO b
withCStruct x :: ControllerModelNodePropertiesMSFT
x f :: Ptr ControllerModelNodePropertiesMSFT -> IO b
f = Int
-> Int -> (Ptr ControllerModelNodePropertiesMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 144 8 ((Ptr ControllerModelNodePropertiesMSFT -> IO b) -> IO b)
-> (Ptr ControllerModelNodePropertiesMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ControllerModelNodePropertiesMSFT
p -> Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelNodePropertiesMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelNodePropertiesMSFT
p ControllerModelNodePropertiesMSFT
x (Ptr ControllerModelNodePropertiesMSFT -> IO b
f Ptr ControllerModelNodePropertiesMSFT
p)
pokeCStruct :: Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelNodePropertiesMSFT -> IO b -> IO b
pokeCStruct p :: Ptr ControllerModelNodePropertiesMSFT
p ControllerModelNodePropertiesMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n CChar) -> ByteString -> IO ()
pokeFixedLengthNullTerminatedByteString ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))) (ByteString
parentNodeName)
Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n CChar) -> ByteString -> IO ()
pokeFixedLengthNullTerminatedByteString ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))) (ByteString
nodeName)
IO b
f
cStructSize :: Int
cStructSize = 144
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ControllerModelNodePropertiesMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ControllerModelNodePropertiesMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n CChar) -> ByteString -> IO ()
pokeFixedLengthNullTerminatedByteString ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))) (ByteString
forall a. Monoid a => a
mempty)
Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n CChar) -> ByteString -> IO ()
pokeFixedLengthNullTerminatedByteString ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))) (ByteString
forall a. Monoid a => a
mempty)
IO b
f
instance FromCStruct ControllerModelNodePropertiesMSFT where
peekCStruct :: Ptr ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT
peekCStruct p :: Ptr ControllerModelNodePropertiesMSFT
p = do
ByteString
parentNodeName <- CString -> IO ByteString
packCString (Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> CString
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))))
ByteString
nodeName <- CString -> IO ByteString
packCString (Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
-> CString
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ControllerModelNodePropertiesMSFT
p Ptr ControllerModelNodePropertiesMSFT
-> Int
-> Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (FixedArray MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT CChar))))
ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT)
-> ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT
forall a b. (a -> b) -> a -> b
$ ByteString -> ByteString -> ControllerModelNodePropertiesMSFT
ControllerModelNodePropertiesMSFT
ByteString
parentNodeName ByteString
nodeName
instance Storable ControllerModelNodePropertiesMSFT where
sizeOf :: ControllerModelNodePropertiesMSFT -> Int
sizeOf ~ControllerModelNodePropertiesMSFT
_ = 144
alignment :: ControllerModelNodePropertiesMSFT -> Int
alignment ~ControllerModelNodePropertiesMSFT
_ = 8
peek :: Ptr ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT
peek = Ptr ControllerModelNodePropertiesMSFT
-> IO ControllerModelNodePropertiesMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelNodePropertiesMSFT -> IO ()
poke ptr :: Ptr ControllerModelNodePropertiesMSFT
ptr poked :: ControllerModelNodePropertiesMSFT
poked = Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelNodePropertiesMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelNodePropertiesMSFT
ptr ControllerModelNodePropertiesMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ControllerModelNodePropertiesMSFT where
zero :: ControllerModelNodePropertiesMSFT
zero = ByteString -> ByteString -> ControllerModelNodePropertiesMSFT
ControllerModelNodePropertiesMSFT
ByteString
forall a. Monoid a => a
mempty
ByteString
forall a. Monoid a => a
mempty
data ControllerModelPropertiesMSFT = ControllerModelPropertiesMSFT
{
ControllerModelPropertiesMSFT -> "bufferCapacityInput" ::: Word32
nodeCapacityInput :: Word32
,
ControllerModelPropertiesMSFT -> "bufferCapacityInput" ::: Word32
nodeCountOutput :: Word32
,
ControllerModelPropertiesMSFT
-> Ptr ControllerModelNodePropertiesMSFT
nodeProperties :: Ptr ControllerModelNodePropertiesMSFT
}
deriving (Typeable, ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool
(ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool)
-> (ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool)
-> Eq ControllerModelPropertiesMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool
$c/= :: ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool
== :: ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool
$c== :: ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ControllerModelPropertiesMSFT)
#endif
deriving instance Show ControllerModelPropertiesMSFT
instance ToCStruct ControllerModelPropertiesMSFT where
withCStruct :: ControllerModelPropertiesMSFT
-> (Ptr ControllerModelPropertiesMSFT -> IO b) -> IO b
withCStruct x :: ControllerModelPropertiesMSFT
x f :: Ptr ControllerModelPropertiesMSFT -> IO b
f = Int -> Int -> (Ptr ControllerModelPropertiesMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr ControllerModelPropertiesMSFT -> IO b) -> IO b)
-> (Ptr ControllerModelPropertiesMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ControllerModelPropertiesMSFT
p -> Ptr ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelPropertiesMSFT
p ControllerModelPropertiesMSFT
x (Ptr ControllerModelPropertiesMSFT -> IO b
f Ptr ControllerModelPropertiesMSFT
p)
pokeCStruct :: Ptr ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> IO b -> IO b
pokeCStruct p :: Ptr ControllerModelPropertiesMSFT
p ControllerModelPropertiesMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
nodeCapacityInput)
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
nodeCountOutput)
Ptr (Ptr ControllerModelNodePropertiesMSFT)
-> Ptr ControllerModelNodePropertiesMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int -> Ptr (Ptr ControllerModelNodePropertiesMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ControllerModelNodePropertiesMSFT))) (Ptr ControllerModelNodePropertiesMSFT
nodeProperties)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ControllerModelPropertiesMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ControllerModelPropertiesMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct ControllerModelPropertiesMSFT where
peekCStruct :: Ptr ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
peekCStruct p :: Ptr ControllerModelPropertiesMSFT
p = do
"bufferCapacityInput" ::: Word32
nodeCapacityInput <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
"bufferCapacityInput" ::: Word32
nodeCountOutput <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
Ptr ControllerModelNodePropertiesMSFT
nodeProperties <- Ptr (Ptr ControllerModelNodePropertiesMSFT)
-> IO (Ptr ControllerModelNodePropertiesMSFT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ControllerModelNodePropertiesMSFT) ((Ptr ControllerModelPropertiesMSFT
p Ptr ControllerModelPropertiesMSFT
-> Int -> Ptr (Ptr ControllerModelNodePropertiesMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ControllerModelNodePropertiesMSFT)))
ControllerModelPropertiesMSFT -> IO ControllerModelPropertiesMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelPropertiesMSFT -> IO ControllerModelPropertiesMSFT)
-> ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
forall a b. (a -> b) -> a -> b
$ ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelPropertiesMSFT
ControllerModelPropertiesMSFT
"bufferCapacityInput" ::: Word32
nodeCapacityInput "bufferCapacityInput" ::: Word32
nodeCountOutput Ptr ControllerModelNodePropertiesMSFT
nodeProperties
instance Storable ControllerModelPropertiesMSFT where
sizeOf :: ControllerModelPropertiesMSFT -> Int
sizeOf ~ControllerModelPropertiesMSFT
_ = 32
alignment :: ControllerModelPropertiesMSFT -> Int
alignment ~ControllerModelPropertiesMSFT
_ = 8
peek :: Ptr ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
peek = Ptr ControllerModelPropertiesMSFT
-> IO ControllerModelPropertiesMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> IO ()
poke ptr :: Ptr ControllerModelPropertiesMSFT
ptr poked :: ControllerModelPropertiesMSFT
poked = Ptr ControllerModelPropertiesMSFT
-> ControllerModelPropertiesMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelPropertiesMSFT
ptr ControllerModelPropertiesMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ControllerModelPropertiesMSFT where
zero :: ControllerModelPropertiesMSFT
zero = ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> Ptr ControllerModelNodePropertiesMSFT
-> ControllerModelPropertiesMSFT
ControllerModelPropertiesMSFT
"bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero
"bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero
Ptr ControllerModelNodePropertiesMSFT
forall a. Zero a => a
zero
data ControllerModelNodeStateMSFT = ControllerModelNodeStateMSFT
{
ControllerModelNodeStateMSFT -> Posef
nodePose :: Posef }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ControllerModelNodeStateMSFT)
#endif
deriving instance Show ControllerModelNodeStateMSFT
instance ToCStruct ControllerModelNodeStateMSFT where
withCStruct :: ControllerModelNodeStateMSFT
-> (Ptr ControllerModelNodeStateMSFT -> IO b) -> IO b
withCStruct x :: ControllerModelNodeStateMSFT
x f :: Ptr ControllerModelNodeStateMSFT -> IO b
f = Int -> Int -> (Ptr ControllerModelNodeStateMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr ControllerModelNodeStateMSFT -> IO b) -> IO b)
-> (Ptr ControllerModelNodeStateMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ControllerModelNodeStateMSFT
p -> Ptr ControllerModelNodeStateMSFT
-> ControllerModelNodeStateMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelNodeStateMSFT
p ControllerModelNodeStateMSFT
x (Ptr ControllerModelNodeStateMSFT -> IO b
f Ptr ControllerModelNodeStateMSFT
p)
pokeCStruct :: Ptr ControllerModelNodeStateMSFT
-> ControllerModelNodeStateMSFT -> IO b -> IO b
pokeCStruct p :: Ptr ControllerModelNodeStateMSFT
p ControllerModelNodeStateMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Posef)) (Posef
nodePose)
IO b
f
cStructSize :: Int
cStructSize = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ControllerModelNodeStateMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ControllerModelNodeStateMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Posef)) (Posef
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ControllerModelNodeStateMSFT where
peekCStruct :: Ptr ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT
peekCStruct p :: Ptr ControllerModelNodeStateMSFT
p = do
Posef
nodePose <- Ptr Posef -> IO Posef
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Posef ((Ptr ControllerModelNodeStateMSFT
p Ptr ControllerModelNodeStateMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Posef))
ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT)
-> ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT
forall a b. (a -> b) -> a -> b
$ Posef -> ControllerModelNodeStateMSFT
ControllerModelNodeStateMSFT
Posef
nodePose
instance Storable ControllerModelNodeStateMSFT where
sizeOf :: ControllerModelNodeStateMSFT -> Int
sizeOf ~ControllerModelNodeStateMSFT
_ = 48
alignment :: ControllerModelNodeStateMSFT -> Int
alignment ~ControllerModelNodeStateMSFT
_ = 8
peek :: Ptr ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT
peek = Ptr ControllerModelNodeStateMSFT -> IO ControllerModelNodeStateMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ControllerModelNodeStateMSFT
-> ControllerModelNodeStateMSFT -> IO ()
poke ptr :: Ptr ControllerModelNodeStateMSFT
ptr poked :: ControllerModelNodeStateMSFT
poked = Ptr ControllerModelNodeStateMSFT
-> ControllerModelNodeStateMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelNodeStateMSFT
ptr ControllerModelNodeStateMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ControllerModelNodeStateMSFT where
zero :: ControllerModelNodeStateMSFT
zero = Posef -> ControllerModelNodeStateMSFT
ControllerModelNodeStateMSFT
Posef
forall a. Zero a => a
zero
data ControllerModelStateMSFT = ControllerModelStateMSFT
{
ControllerModelStateMSFT -> "bufferCapacityInput" ::: Word32
nodeCapacityInput :: Word32
,
ControllerModelStateMSFT -> "bufferCapacityInput" ::: Word32
nodeCountOutput :: Word32
,
ControllerModelStateMSFT -> Ptr ControllerModelNodeStateMSFT
nodeStates :: Ptr ControllerModelNodeStateMSFT
}
deriving (Typeable, ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool
(ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool)
-> (ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool)
-> Eq ControllerModelStateMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool
$c/= :: ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool
== :: ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool
$c== :: ControllerModelStateMSFT -> ControllerModelStateMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ControllerModelStateMSFT)
#endif
deriving instance Show ControllerModelStateMSFT
instance ToCStruct ControllerModelStateMSFT where
withCStruct :: ControllerModelStateMSFT
-> (Ptr ControllerModelStateMSFT -> IO b) -> IO b
withCStruct x :: ControllerModelStateMSFT
x f :: Ptr ControllerModelStateMSFT -> IO b
f = Int -> Int -> (Ptr ControllerModelStateMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr ControllerModelStateMSFT -> IO b) -> IO b)
-> (Ptr ControllerModelStateMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ControllerModelStateMSFT
p -> Ptr ControllerModelStateMSFT
-> ControllerModelStateMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelStateMSFT
p ControllerModelStateMSFT
x (Ptr ControllerModelStateMSFT -> IO b
f Ptr ControllerModelStateMSFT
p)
pokeCStruct :: Ptr ControllerModelStateMSFT
-> ControllerModelStateMSFT -> IO b -> IO b
pokeCStruct p :: Ptr ControllerModelStateMSFT
p ControllerModelStateMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
nodeCapacityInput)
("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
nodeCountOutput)
Ptr (Ptr ControllerModelNodeStateMSFT)
-> Ptr ControllerModelNodeStateMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int -> Ptr (Ptr ControllerModelNodeStateMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ControllerModelNodeStateMSFT))) (Ptr ControllerModelNodeStateMSFT
nodeStates)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ControllerModelStateMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr ControllerModelStateMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_CONTROLLER_MODEL_STATE_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct ControllerModelStateMSFT where
peekCStruct :: Ptr ControllerModelStateMSFT -> IO ControllerModelStateMSFT
peekCStruct p :: Ptr ControllerModelStateMSFT
p = do
"bufferCapacityInput" ::: Word32
nodeCapacityInput <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
"bufferCapacityInput" ::: Word32
nodeCountOutput <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
Ptr ControllerModelNodeStateMSFT
nodeStates <- Ptr (Ptr ControllerModelNodeStateMSFT)
-> IO (Ptr ControllerModelNodeStateMSFT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ControllerModelNodeStateMSFT) ((Ptr ControllerModelStateMSFT
p Ptr ControllerModelStateMSFT
-> Int -> Ptr (Ptr ControllerModelNodeStateMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ControllerModelNodeStateMSFT)))
ControllerModelStateMSFT -> IO ControllerModelStateMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ControllerModelStateMSFT -> IO ControllerModelStateMSFT)
-> ControllerModelStateMSFT -> IO ControllerModelStateMSFT
forall a b. (a -> b) -> a -> b
$ ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> Ptr ControllerModelNodeStateMSFT
-> ControllerModelStateMSFT
ControllerModelStateMSFT
"bufferCapacityInput" ::: Word32
nodeCapacityInput "bufferCapacityInput" ::: Word32
nodeCountOutput Ptr ControllerModelNodeStateMSFT
nodeStates
instance Storable ControllerModelStateMSFT where
sizeOf :: ControllerModelStateMSFT -> Int
sizeOf ~ControllerModelStateMSFT
_ = 32
alignment :: ControllerModelStateMSFT -> Int
alignment ~ControllerModelStateMSFT
_ = 8
peek :: Ptr ControllerModelStateMSFT -> IO ControllerModelStateMSFT
peek = Ptr ControllerModelStateMSFT -> IO ControllerModelStateMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ControllerModelStateMSFT -> ControllerModelStateMSFT -> IO ()
poke ptr :: Ptr ControllerModelStateMSFT
ptr poked :: ControllerModelStateMSFT
poked = Ptr ControllerModelStateMSFT
-> ControllerModelStateMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ControllerModelStateMSFT
ptr ControllerModelStateMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ControllerModelStateMSFT where
zero :: ControllerModelStateMSFT
zero = ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> Ptr ControllerModelNodeStateMSFT
-> ControllerModelStateMSFT
ControllerModelStateMSFT
"bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero
"bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero
Ptr ControllerModelNodeStateMSFT
forall a. Zero a => a
zero
type MSFT_controller_model_SPEC_VERSION = 2
pattern MSFT_controller_model_SPEC_VERSION :: forall a . Integral a => a
pattern $bMSFT_controller_model_SPEC_VERSION :: a
$mMSFT_controller_model_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
MSFT_controller_model_SPEC_VERSION = 2
type MSFT_CONTROLLER_MODEL_EXTENSION_NAME = "XR_MSFT_controller_model"
pattern MSFT_CONTROLLER_MODEL_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bMSFT_CONTROLLER_MODEL_EXTENSION_NAME :: a
$mMSFT_CONTROLLER_MODEL_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
MSFT_CONTROLLER_MODEL_EXTENSION_NAME = "XR_MSFT_controller_model"
type MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT = 64
pattern MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT :: forall a . Integral a => a
pattern $bMAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT :: a
$mMAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT = 64