{-# language CPP #-}
-- | = Name
--
-- XR_EXT_hand_tracking - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_hand_tracking  XR_EXT_hand_tracking>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 52
--
-- = Revision
--
-- 2
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'OpenXR.Core10.APIConstants.HAND_JOINT_COUNT_EXT', 'HandEXT',
-- 'HandJointEXT', 'HandJointLocationEXT', 'HandJointLocationsEXT',
-- 'HandJointSetEXT', 'HandJointVelocitiesEXT', 'HandJointVelocityEXT',
-- 'HandJointsLocateInfoEXT', 'HandTrackerCreateInfoEXT',
-- 'SystemHandTrackingPropertiesEXT', 'createHandTrackerEXT',
-- 'destroyHandTrackerEXT', 'locateHandJointsEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_hand_tracking OpenXR Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module OpenXR.Extensions.XR_EXT_hand_tracking  ( createHandTrackerEXT
                                               , withHandTrackerEXT
                                               , destroyHandTrackerEXT
                                               , locateHandJointsEXT
                                               , SystemHandTrackingPropertiesEXT(..)
                                               , HandTrackerCreateInfoEXT(..)
                                               , HandJointsLocateInfoEXT(..)
                                               , HandJointLocationEXT(..)
                                               , HandJointVelocityEXT(..)
                                               , HandJointLocationsEXT(..)
                                               , HandJointVelocitiesEXT(..)
                                               , HandEXT( HAND_LEFT_EXT
                                                        , HAND_RIGHT_EXT
                                                        , ..
                                                        )
                                               , HandJointEXT( HAND_JOINT_PALM_EXT
                                                             , HAND_JOINT_WRIST_EXT
                                                             , HAND_JOINT_THUMB_METACARPAL_EXT
                                                             , HAND_JOINT_THUMB_PROXIMAL_EXT
                                                             , HAND_JOINT_THUMB_DISTAL_EXT
                                                             , HAND_JOINT_THUMB_TIP_EXT
                                                             , HAND_JOINT_INDEX_METACARPAL_EXT
                                                             , HAND_JOINT_INDEX_PROXIMAL_EXT
                                                             , HAND_JOINT_INDEX_INTERMEDIATE_EXT
                                                             , HAND_JOINT_INDEX_DISTAL_EXT
                                                             , HAND_JOINT_INDEX_TIP_EXT
                                                             , HAND_JOINT_MIDDLE_METACARPAL_EXT
                                                             , HAND_JOINT_MIDDLE_PROXIMAL_EXT
                                                             , HAND_JOINT_MIDDLE_INTERMEDIATE_EXT
                                                             , HAND_JOINT_MIDDLE_DISTAL_EXT
                                                             , HAND_JOINT_MIDDLE_TIP_EXT
                                                             , HAND_JOINT_RING_METACARPAL_EXT
                                                             , HAND_JOINT_RING_PROXIMAL_EXT
                                                             , HAND_JOINT_RING_INTERMEDIATE_EXT
                                                             , HAND_JOINT_RING_DISTAL_EXT
                                                             , HAND_JOINT_RING_TIP_EXT
                                                             , HAND_JOINT_LITTLE_METACARPAL_EXT
                                                             , HAND_JOINT_LITTLE_PROXIMAL_EXT
                                                             , HAND_JOINT_LITTLE_INTERMEDIATE_EXT
                                                             , HAND_JOINT_LITTLE_DISTAL_EXT
                                                             , HAND_JOINT_LITTLE_TIP_EXT
                                                             , ..
                                                             )
                                               , HandJointSetEXT( HAND_JOINT_SET_DEFAULT_EXT
                                                                , ..
                                                                )
                                               , EXT_hand_tracking_SPEC_VERSION
                                               , pattern EXT_hand_tracking_SPEC_VERSION
                                               , EXT_HAND_TRACKING_EXTENSION_NAME
                                               , pattern EXT_HAND_TRACKING_EXTENSION_NAME
                                               , HandTrackerEXT(..)
                                               , HAND_JOINT_COUNT_EXT
                                               , pattern HAND_JOINT_COUNT_EXT
                                               ) where

import OpenXR.Internal.Utils (enumReadPrec)
import OpenXR.Internal.Utils (enumShowsPrec)
import OpenXR.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
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 (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
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.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(..))
import Foreign.C.Types (CFloat(CFloat))
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 Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.Core10.FundamentalTypes (bool32ToBool)
import OpenXR.Core10.FundamentalTypes (boolToBool32)
import OpenXR.CStruct.Extends (forgetExtensions)
import OpenXR.Core10.FundamentalTypes (Bool32)
import OpenXR.CStruct.Extends (Chain)
import OpenXR.CStruct.Extends (Extends)
import OpenXR.CStruct.Extends (Extendss)
import OpenXR.CStruct.Extends (Extensible(..))
import {-# SOURCE #-} OpenXR.Extensions.XR_MSFT_hand_tracking_mesh (HandPoseTypeInfoMSFT)
import OpenXR.Extensions.Handles (HandTrackerEXT)
import OpenXR.Extensions.Handles (HandTrackerEXT(..))
import OpenXR.Extensions.Handles (HandTrackerEXT(HandTrackerEXT))
import OpenXR.Extensions.Handles (HandTrackerEXT_T)
import OpenXR.Dynamic (InstanceCmds(pXrCreateHandTrackerEXT))
import OpenXR.Dynamic (InstanceCmds(pXrDestroyHandTrackerEXT))
import OpenXR.Dynamic (InstanceCmds(pXrLocateHandJointsEXT))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.CStruct.Extends (PeekChain)
import OpenXR.CStruct.Extends (PeekChain(..))
import OpenXR.CStruct.Extends (PokeChain)
import OpenXR.CStruct.Extends (PokeChain(..))
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.CStruct.Extends (SomeStruct)
import OpenXR.Core10.Enums.SpaceLocationFlags (SpaceLocationFlags)
import OpenXR.Core10.Enums.SpaceVelocityFlags (SpaceVelocityFlags)
import OpenXR.Core10.Handles (Space_T)
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.FundamentalTypes (Time)
import OpenXR.Core10.Space (Vector3f)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_JOINTS_LOCATE_INFO_EXT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_JOINT_LOCATIONS_EXT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_JOINT_VELOCITIES_EXT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_TRACKER_CREATE_INFO_EXT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT))
import OpenXR.Core10.APIConstants (HAND_JOINT_COUNT_EXT)
import OpenXR.Extensions.Handles (HandTrackerEXT(..))
import OpenXR.Core10.APIConstants (pattern HAND_JOINT_COUNT_EXT)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrCreateHandTrackerEXT
  :: FunPtr (Ptr Session_T -> Ptr (SomeStruct HandTrackerCreateInfoEXT) -> Ptr (Ptr HandTrackerEXT_T) -> IO Result) -> Ptr Session_T -> Ptr (SomeStruct HandTrackerCreateInfoEXT) -> Ptr (Ptr HandTrackerEXT_T) -> IO Result

-- | xrCreateHandTrackerEXT - Create a hand joints handle.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrCreateHandTrackerEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to calling 'createHandTrackerEXT'
--
-- -   #VUID-xrCreateHandTrackerEXT-session-parameter# @session@ /must/ be
--     a valid 'OpenXR.Core10.Handles.Session' handle
--
-- -   #VUID-xrCreateHandTrackerEXT-createInfo-parameter# @createInfo@
--     /must/ be a pointer to a valid 'HandTrackerCreateInfoEXT' structure
--
-- -   #VUID-xrCreateHandTrackerEXT-handTracker-parameter# @handTracker@
--     /must/ be a pointer to an 'OpenXR.Extensions.Handles.HandTrackerEXT'
--     handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
--     -   'OpenXR.Core10.Enums.Result.SESSION_LOSS_PENDING'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SESSION_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FEATURE_UNSUPPORTED'
--
-- If the system does not support hand tracking, runtime /must/ return
-- 'OpenXR.Core10.Enums.Result.ERROR_FEATURE_UNSUPPORTED' from
-- 'createHandTrackerEXT'. In this case, the runtime /must/ return
-- 'OpenXR.Core10.FundamentalTypes.FALSE' for @supportsHandTracking@ in
-- 'SystemHandTrackingPropertiesEXT' when the function
-- 'OpenXR.Core10.Device.getSystemProperties' is called, so that the
-- application /can/ avoid creating a hand tracker.
--
-- = See Also
--
-- 'HandTrackerCreateInfoEXT', 'OpenXR.Extensions.Handles.HandTrackerEXT',
-- 'OpenXR.Core10.Handles.Session'
createHandTrackerEXT :: forall a io
                      . (Extendss HandTrackerCreateInfoEXT a, PokeChain a, MonadIO io)
                     => -- | @session@ is an 'OpenXR.Core10.Handles.Session' in which the hand
                        -- tracker will be active.
                        Session
                     -> -- | @createInfo@ is the 'HandTrackerCreateInfoEXT' used to specify the hand
                        -- tracker.
                        (HandTrackerCreateInfoEXT a)
                     -> io (Result, HandTrackerEXT)
createHandTrackerEXT :: Session
-> HandTrackerCreateInfoEXT a -> io (Result, HandTrackerEXT)
createHandTrackerEXT session :: Session
session createInfo :: HandTrackerCreateInfoEXT a
createInfo = IO (Result, HandTrackerEXT) -> io (Result, HandTrackerEXT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, HandTrackerEXT) -> io (Result, HandTrackerEXT))
-> (ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
    -> IO (Result, HandTrackerEXT))
-> ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
-> io (Result, HandTrackerEXT)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
-> IO (Result, HandTrackerEXT)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
 -> io (Result, HandTrackerEXT))
-> ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
-> io (Result, HandTrackerEXT)
forall a b. (a -> b) -> a -> b
$ do
  let cmds :: InstanceCmds
cmds = Session -> InstanceCmds
instanceCmds (Session
session :: Session)
  let xrCreateHandTrackerEXTPtr :: FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO Result)
xrCreateHandTrackerEXTPtr = InstanceCmds
-> FunPtr
     (Ptr Session_T
      -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
      -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
      -> IO Result)
pXrCreateHandTrackerEXT InstanceCmds
cmds
  IO () -> ContT (Result, HandTrackerEXT) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandTrackerEXT) IO ())
-> IO () -> ContT (Result, HandTrackerEXT) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO Result)
xrCreateHandTrackerEXTPtr FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO Result)
-> FunPtr
     (Ptr Session_T
      -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
      -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> 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 xrCreateHandTrackerEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrCreateHandTrackerEXT' :: Ptr Session_T
-> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
-> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
-> IO Result
xrCreateHandTrackerEXT' = FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO Result)
-> Ptr Session_T
-> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
-> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
-> IO Result
mkXrCreateHandTrackerEXT FunPtr
  (Ptr Session_T
   -> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
   -> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO Result)
xrCreateHandTrackerEXTPtr
  Ptr (HandTrackerCreateInfoEXT a)
createInfo' <- ((Ptr (HandTrackerCreateInfoEXT a) -> IO (Result, HandTrackerEXT))
 -> IO (Result, HandTrackerEXT))
-> ContT
     (Result, HandTrackerEXT) IO (Ptr (HandTrackerCreateInfoEXT a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (HandTrackerCreateInfoEXT a) -> IO (Result, HandTrackerEXT))
  -> IO (Result, HandTrackerEXT))
 -> ContT
      (Result, HandTrackerEXT) IO (Ptr (HandTrackerCreateInfoEXT a)))
-> ((Ptr (HandTrackerCreateInfoEXT a)
     -> IO (Result, HandTrackerEXT))
    -> IO (Result, HandTrackerEXT))
-> ContT
     (Result, HandTrackerEXT) IO (Ptr (HandTrackerCreateInfoEXT a))
forall a b. (a -> b) -> a -> b
$ HandTrackerCreateInfoEXT a
-> (Ptr (HandTrackerCreateInfoEXT a)
    -> IO (Result, HandTrackerEXT))
-> IO (Result, HandTrackerEXT)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (HandTrackerCreateInfoEXT a
createInfo)
  "handTracker" ::: Ptr (Ptr HandTrackerEXT_T)
pHandTracker <- ((("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
  -> IO (Result, HandTrackerEXT))
 -> IO (Result, HandTrackerEXT))
-> ContT
     (Result, HandTrackerEXT)
     IO
     ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
   -> IO (Result, HandTrackerEXT))
  -> IO (Result, HandTrackerEXT))
 -> ContT
      (Result, HandTrackerEXT)
      IO
      ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T)))
-> ((("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
     -> IO (Result, HandTrackerEXT))
    -> IO (Result, HandTrackerEXT))
-> ContT
     (Result, HandTrackerEXT)
     IO
     ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
forall a b. (a -> b) -> a -> b
$ IO ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
-> (("handTracker" ::: Ptr (Ptr HandTrackerEXT_T)) -> IO ())
-> (("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
    -> IO (Result, HandTrackerEXT))
-> IO (Result, HandTrackerEXT)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
forall a. Int -> IO (Ptr a)
callocBytes @(Ptr HandTrackerEXT_T) 8) ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T)) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT (Result, HandTrackerEXT) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, HandTrackerEXT) IO Result)
-> IO Result -> ContT (Result, HandTrackerEXT) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrCreateHandTrackerEXT" (Ptr Session_T
-> ("createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT))
-> ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
-> IO Result
xrCreateHandTrackerEXT' (Session -> Ptr Session_T
sessionHandle (Session
session)) (Ptr (HandTrackerCreateInfoEXT a)
-> "createInfo" ::: Ptr (SomeStruct HandTrackerCreateInfoEXT)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (HandTrackerCreateInfoEXT a)
createInfo') ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T)
pHandTracker))
  IO () -> ContT (Result, HandTrackerEXT) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandTrackerEXT) IO ())
-> IO () -> ContT (Result, HandTrackerEXT) 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))
  Ptr HandTrackerEXT_T
handTracker <- IO (Ptr HandTrackerEXT_T)
-> ContT (Result, HandTrackerEXT) IO (Ptr HandTrackerEXT_T)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO (Ptr HandTrackerEXT_T)
 -> ContT (Result, HandTrackerEXT) IO (Ptr HandTrackerEXT_T))
-> IO (Ptr HandTrackerEXT_T)
-> ContT (Result, HandTrackerEXT) IO (Ptr HandTrackerEXT_T)
forall a b. (a -> b) -> a -> b
$ ("handTracker" ::: Ptr (Ptr HandTrackerEXT_T))
-> IO (Ptr HandTrackerEXT_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr HandTrackerEXT_T) "handTracker" ::: Ptr (Ptr HandTrackerEXT_T)
pHandTracker
  (Result, HandTrackerEXT)
-> ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, HandTrackerEXT)
 -> ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT))
-> (Result, HandTrackerEXT)
-> ContT (Result, HandTrackerEXT) IO (Result, HandTrackerEXT)
forall a b. (a -> b) -> a -> b
$ (Result
r, ((\h :: Ptr HandTrackerEXT_T
h -> Ptr HandTrackerEXT_T -> InstanceCmds -> HandTrackerEXT
HandTrackerEXT Ptr HandTrackerEXT_T
h InstanceCmds
cmds ) Ptr HandTrackerEXT_T
handTracker))

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createHandTrackerEXT' and 'destroyHandTrackerEXT'
--
-- To ensure that 'destroyHandTrackerEXT' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withHandTrackerEXT :: forall a io r . (Extendss HandTrackerCreateInfoEXT a, PokeChain a, MonadIO io) => Session -> HandTrackerCreateInfoEXT a -> (io (Result, HandTrackerEXT) -> ((Result, HandTrackerEXT) -> io ()) -> r) -> r
withHandTrackerEXT :: Session
-> HandTrackerCreateInfoEXT a
-> (io (Result, HandTrackerEXT)
    -> ((Result, HandTrackerEXT) -> io ()) -> r)
-> r
withHandTrackerEXT session :: Session
session createInfo :: HandTrackerCreateInfoEXT a
createInfo b :: io (Result, HandTrackerEXT)
-> ((Result, HandTrackerEXT) -> io ()) -> r
b =
  io (Result, HandTrackerEXT)
-> ((Result, HandTrackerEXT) -> io ()) -> r
b (Session
-> HandTrackerCreateInfoEXT a -> io (Result, HandTrackerEXT)
forall (a :: [*]) (io :: * -> *).
(Extendss HandTrackerCreateInfoEXT a, PokeChain a, MonadIO io) =>
Session
-> HandTrackerCreateInfoEXT a -> io (Result, HandTrackerEXT)
createHandTrackerEXT Session
session HandTrackerCreateInfoEXT a
createInfo)
    (\(_, o1 :: HandTrackerEXT
o1) -> HandTrackerEXT -> io ()
forall (io :: * -> *). MonadIO io => HandTrackerEXT -> io ()
destroyHandTrackerEXT HandTrackerEXT
o1)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrDestroyHandTrackerEXT
  :: FunPtr (Ptr HandTrackerEXT_T -> IO Result) -> Ptr HandTrackerEXT_T -> IO Result

-- | xrDestroyHandTrackerEXT - Destroy a hand joints handle
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrDestroyHandTrackerEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to calling 'destroyHandTrackerEXT'
--
-- -   #VUID-xrDestroyHandTrackerEXT-handTracker-parameter# @handTracker@
--     /must/ be a valid 'OpenXR.Extensions.Handles.HandTrackerEXT' handle
--
-- == Thread Safety
--
-- -   Access to @handTracker@, and any child handles, /must/ be externally
--     synchronized
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Extensions.Handles.HandTrackerEXT'
destroyHandTrackerEXT :: forall io
                       . (MonadIO io)
                      => -- | @handTracker@ is an 'OpenXR.Extensions.Handles.HandTrackerEXT'
                         -- previously created by 'createHandTrackerEXT'.
                         HandTrackerEXT
                      -> io ()
destroyHandTrackerEXT :: HandTrackerEXT -> io ()
destroyHandTrackerEXT handTracker :: HandTrackerEXT
handTracker = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let xrDestroyHandTrackerEXTPtr :: FunPtr (Ptr HandTrackerEXT_T -> IO Result)
xrDestroyHandTrackerEXTPtr = InstanceCmds -> FunPtr (Ptr HandTrackerEXT_T -> IO Result)
pXrDestroyHandTrackerEXT (HandTrackerEXT -> InstanceCmds
instanceCmds (HandTrackerEXT
handTracker :: HandTrackerEXT))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr HandTrackerEXT_T -> IO Result)
xrDestroyHandTrackerEXTPtr FunPtr (Ptr HandTrackerEXT_T -> IO Result)
-> FunPtr (Ptr HandTrackerEXT_T -> IO Result) -> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr HandTrackerEXT_T -> 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 xrDestroyHandTrackerEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrDestroyHandTrackerEXT' :: Ptr HandTrackerEXT_T -> IO Result
xrDestroyHandTrackerEXT' = FunPtr (Ptr HandTrackerEXT_T -> IO Result)
-> Ptr HandTrackerEXT_T -> IO Result
mkXrDestroyHandTrackerEXT FunPtr (Ptr HandTrackerEXT_T -> IO Result)
xrDestroyHandTrackerEXTPtr
  Result
r <- String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrDestroyHandTrackerEXT" (Ptr HandTrackerEXT_T -> IO Result
xrDestroyHandTrackerEXT' (HandTrackerEXT -> Ptr HandTrackerEXT_T
handTrackerEXTHandle (HandTrackerEXT
handTracker)))
  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))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrLocateHandJointsEXT
  :: FunPtr (Ptr HandTrackerEXT_T -> Ptr HandJointsLocateInfoEXT -> Ptr (SomeStruct HandJointLocationsEXT) -> IO Result) -> Ptr HandTrackerEXT_T -> Ptr HandJointsLocateInfoEXT -> Ptr (SomeStruct HandJointLocationsEXT) -> IO Result

-- | xrLocateHandJointsEXT - Locate hand joint locations
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrLocateHandJointsEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to calling 'locateHandJointsEXT'
--
-- -   #VUID-xrLocateHandJointsEXT-handTracker-parameter# @handTracker@
--     /must/ be a valid 'OpenXR.Extensions.Handles.HandTrackerEXT' handle
--
-- -   #VUID-xrLocateHandJointsEXT-locateInfo-parameter# @locateInfo@
--     /must/ be a pointer to a valid 'HandJointsLocateInfoEXT' structure
--
-- -   #VUID-xrLocateHandJointsEXT-locations-parameter# @locations@ /must/
--     be a pointer to an 'HandJointLocationsEXT' structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
--     -   'OpenXR.Core10.Enums.Result.SESSION_LOSS_PENDING'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SESSION_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_TIME_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'HandJointLocationsEXT', 'HandJointsLocateInfoEXT',
-- 'OpenXR.Extensions.Handles.HandTrackerEXT'
locateHandJointsEXT :: forall a io
                     . (Extendss HandJointLocationsEXT a, PokeChain a, PeekChain a, MonadIO io)
                    => -- | @handTracker@ is an 'OpenXR.Extensions.Handles.HandTrackerEXT'
                       -- previously created by 'createHandTrackerEXT'.
                       HandTrackerEXT
                    -> -- | @locateInfo@ is a pointer to 'HandJointsLocateInfoEXT' describing
                       -- information to locate hand joints.
                       HandJointsLocateInfoEXT
                    -> io (Result, HandJointLocationsEXT a)
locateHandJointsEXT :: HandTrackerEXT
-> HandJointsLocateInfoEXT -> io (Result, HandJointLocationsEXT a)
locateHandJointsEXT handTracker :: HandTrackerEXT
handTracker locateInfo :: HandJointsLocateInfoEXT
locateInfo = IO (Result, HandJointLocationsEXT a)
-> io (Result, HandJointLocationsEXT a)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, HandJointLocationsEXT a)
 -> io (Result, HandJointLocationsEXT a))
-> (ContT
      (Result, HandJointLocationsEXT a)
      IO
      (Result, HandJointLocationsEXT a)
    -> IO (Result, HandJointLocationsEXT a))
-> ContT
     (Result, HandJointLocationsEXT a)
     IO
     (Result, HandJointLocationsEXT a)
-> io (Result, HandJointLocationsEXT a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, HandJointLocationsEXT a)
  IO
  (Result, HandJointLocationsEXT a)
-> IO (Result, HandJointLocationsEXT a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, HandJointLocationsEXT a)
   IO
   (Result, HandJointLocationsEXT a)
 -> io (Result, HandJointLocationsEXT a))
-> ContT
     (Result, HandJointLocationsEXT a)
     IO
     (Result, HandJointLocationsEXT a)
-> io (Result, HandJointLocationsEXT a)
forall a b. (a -> b) -> a -> b
$ do
  let xrLocateHandJointsEXTPtr :: FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> IO Result)
xrLocateHandJointsEXTPtr = InstanceCmds
-> FunPtr
     (Ptr HandTrackerEXT_T
      -> Ptr HandJointsLocateInfoEXT
      -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
      -> IO Result)
pXrLocateHandJointsEXT (HandTrackerEXT -> InstanceCmds
instanceCmds (HandTrackerEXT
handTracker :: HandTrackerEXT))
  IO () -> ContT (Result, HandJointLocationsEXT a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandJointLocationsEXT a) IO ())
-> IO () -> ContT (Result, HandJointLocationsEXT a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> IO Result)
xrLocateHandJointsEXTPtr FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> IO Result)
-> FunPtr
     (Ptr HandTrackerEXT_T
      -> Ptr HandJointsLocateInfoEXT
      -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> 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 xrLocateHandJointsEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrLocateHandJointsEXT' :: Ptr HandTrackerEXT_T
-> Ptr HandJointsLocateInfoEXT
-> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
-> IO Result
xrLocateHandJointsEXT' = FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> IO Result)
-> Ptr HandTrackerEXT_T
-> Ptr HandJointsLocateInfoEXT
-> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
-> IO Result
mkXrLocateHandJointsEXT FunPtr
  (Ptr HandTrackerEXT_T
   -> Ptr HandJointsLocateInfoEXT
   -> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
   -> IO Result)
xrLocateHandJointsEXTPtr
  Ptr HandJointsLocateInfoEXT
locateInfo' <- ((Ptr HandJointsLocateInfoEXT
  -> IO (Result, HandJointLocationsEXT a))
 -> IO (Result, HandJointLocationsEXT a))
-> ContT
     (Result, HandJointLocationsEXT a) IO (Ptr HandJointsLocateInfoEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr HandJointsLocateInfoEXT
   -> IO (Result, HandJointLocationsEXT a))
  -> IO (Result, HandJointLocationsEXT a))
 -> ContT
      (Result, HandJointLocationsEXT a) IO (Ptr HandJointsLocateInfoEXT))
-> ((Ptr HandJointsLocateInfoEXT
     -> IO (Result, HandJointLocationsEXT a))
    -> IO (Result, HandJointLocationsEXT a))
-> ContT
     (Result, HandJointLocationsEXT a) IO (Ptr HandJointsLocateInfoEXT)
forall a b. (a -> b) -> a -> b
$ HandJointsLocateInfoEXT
-> (Ptr HandJointsLocateInfoEXT
    -> IO (Result, HandJointLocationsEXT a))
-> IO (Result, HandJointLocationsEXT a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (HandJointsLocateInfoEXT
locateInfo)
  Ptr (HandJointLocationsEXT a)
pLocations <- ((Ptr (HandJointLocationsEXT a)
  -> IO (Result, HandJointLocationsEXT a))
 -> IO (Result, HandJointLocationsEXT a))
-> ContT
     (Result, HandJointLocationsEXT a)
     IO
     (Ptr (HandJointLocationsEXT a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct (HandJointLocationsEXT a) =>
(Ptr (HandJointLocationsEXT a) -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(HandJointLocationsEXT _))
  Result
r <- IO Result -> ContT (Result, HandJointLocationsEXT a) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, HandJointLocationsEXT a) IO Result)
-> IO Result -> ContT (Result, HandJointLocationsEXT a) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrLocateHandJointsEXT" (Ptr HandTrackerEXT_T
-> Ptr HandJointsLocateInfoEXT
-> ("locations" ::: Ptr (SomeStruct HandJointLocationsEXT))
-> IO Result
xrLocateHandJointsEXT' (HandTrackerEXT -> Ptr HandTrackerEXT_T
handTrackerEXTHandle (HandTrackerEXT
handTracker)) Ptr HandJointsLocateInfoEXT
locateInfo' (Ptr (HandJointLocationsEXT a)
-> "locations" ::: Ptr (SomeStruct HandJointLocationsEXT)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (HandJointLocationsEXT a)
pLocations)))
  IO () -> ContT (Result, HandJointLocationsEXT a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandJointLocationsEXT a) IO ())
-> IO () -> ContT (Result, HandJointLocationsEXT a) 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))
  HandJointLocationsEXT a
locations <- IO (HandJointLocationsEXT a)
-> ContT
     (Result, HandJointLocationsEXT a) IO (HandJointLocationsEXT a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO (HandJointLocationsEXT a)
 -> ContT
      (Result, HandJointLocationsEXT a) IO (HandJointLocationsEXT a))
-> IO (HandJointLocationsEXT a)
-> ContT
     (Result, HandJointLocationsEXT a) IO (HandJointLocationsEXT a)
forall a b. (a -> b) -> a -> b
$ Ptr (HandJointLocationsEXT a) -> IO (HandJointLocationsEXT a)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(HandJointLocationsEXT _) Ptr (HandJointLocationsEXT a)
pLocations
  (Result, HandJointLocationsEXT a)
-> ContT
     (Result, HandJointLocationsEXT a)
     IO
     (Result, HandJointLocationsEXT a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, HandJointLocationsEXT a)
 -> ContT
      (Result, HandJointLocationsEXT a)
      IO
      (Result, HandJointLocationsEXT a))
-> (Result, HandJointLocationsEXT a)
-> ContT
     (Result, HandJointLocationsEXT a)
     IO
     (Result, HandJointLocationsEXT a)
forall a b. (a -> b) -> a -> b
$ (Result
r, HandJointLocationsEXT a
locations)


-- | XrSystemHandTrackingPropertiesEXT - System property for hand tracking
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrSystemHandTrackingPropertiesEXT-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'SystemHandTrackingPropertiesEXT'
--
-- -   #VUID-XrSystemHandTrackingPropertiesEXT-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT'
--
-- -   #VUID-XrSystemHandTrackingPropertiesEXT-next-next# @next@ /must/ be
--     @NULL@ or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- If a runtime returns 'OpenXR.Core10.FundamentalTypes.FALSE' for
-- @supportsHandTracking@, the runtime /must/ return
-- 'OpenXR.Core10.Enums.Result.ERROR_FEATURE_UNSUPPORTED' from
-- 'createHandTrackerEXT'.
--
-- = See Also
--
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrBool32 >,
-- 'OpenXR.Core10.Enums.StructureType.StructureType'
data SystemHandTrackingPropertiesEXT = SystemHandTrackingPropertiesEXT
  { -- | @supportsHandTracking@ is an
    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrBool32 >,
    -- indicating if current system is capable of hand tracking input.
    SystemHandTrackingPropertiesEXT -> Bool
supportsHandTracking :: Bool }
  deriving (Typeable, SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> Bool
(SystemHandTrackingPropertiesEXT
 -> SystemHandTrackingPropertiesEXT -> Bool)
-> (SystemHandTrackingPropertiesEXT
    -> SystemHandTrackingPropertiesEXT -> Bool)
-> Eq SystemHandTrackingPropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> Bool
$c/= :: SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> Bool
== :: SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> Bool
$c== :: SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SystemHandTrackingPropertiesEXT)
#endif
deriving instance Show SystemHandTrackingPropertiesEXT

instance ToCStruct SystemHandTrackingPropertiesEXT where
  withCStruct :: SystemHandTrackingPropertiesEXT
-> (Ptr SystemHandTrackingPropertiesEXT -> IO b) -> IO b
withCStruct x :: SystemHandTrackingPropertiesEXT
x f :: Ptr SystemHandTrackingPropertiesEXT -> IO b
f = Int -> Int -> (Ptr SystemHandTrackingPropertiesEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr SystemHandTrackingPropertiesEXT -> IO b) -> IO b)
-> (Ptr SystemHandTrackingPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SystemHandTrackingPropertiesEXT
p -> Ptr SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SystemHandTrackingPropertiesEXT
p SystemHandTrackingPropertiesEXT
x (Ptr SystemHandTrackingPropertiesEXT -> IO b
f Ptr SystemHandTrackingPropertiesEXT
p)
  pokeCStruct :: Ptr SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr SystemHandTrackingPropertiesEXT
p SystemHandTrackingPropertiesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
supportsHandTracking))
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr SystemHandTrackingPropertiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr SystemHandTrackingPropertiesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct SystemHandTrackingPropertiesEXT where
  peekCStruct :: Ptr SystemHandTrackingPropertiesEXT
-> IO SystemHandTrackingPropertiesEXT
peekCStruct p :: Ptr SystemHandTrackingPropertiesEXT
p = do
    Bool32
supportsHandTracking <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SystemHandTrackingPropertiesEXT
p Ptr SystemHandTrackingPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    SystemHandTrackingPropertiesEXT
-> IO SystemHandTrackingPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SystemHandTrackingPropertiesEXT
 -> IO SystemHandTrackingPropertiesEXT)
-> SystemHandTrackingPropertiesEXT
-> IO SystemHandTrackingPropertiesEXT
forall a b. (a -> b) -> a -> b
$ Bool -> SystemHandTrackingPropertiesEXT
SystemHandTrackingPropertiesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
supportsHandTracking)

instance Storable SystemHandTrackingPropertiesEXT where
  sizeOf :: SystemHandTrackingPropertiesEXT -> Int
sizeOf ~SystemHandTrackingPropertiesEXT
_ = 24
  alignment :: SystemHandTrackingPropertiesEXT -> Int
alignment ~SystemHandTrackingPropertiesEXT
_ = 8
  peek :: Ptr SystemHandTrackingPropertiesEXT
-> IO SystemHandTrackingPropertiesEXT
peek = Ptr SystemHandTrackingPropertiesEXT
-> IO SystemHandTrackingPropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> IO ()
poke ptr :: Ptr SystemHandTrackingPropertiesEXT
ptr poked :: SystemHandTrackingPropertiesEXT
poked = Ptr SystemHandTrackingPropertiesEXT
-> SystemHandTrackingPropertiesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SystemHandTrackingPropertiesEXT
ptr SystemHandTrackingPropertiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SystemHandTrackingPropertiesEXT where
  zero :: SystemHandTrackingPropertiesEXT
zero = Bool -> SystemHandTrackingPropertiesEXT
SystemHandTrackingPropertiesEXT
           Bool
forall a. Zero a => a
zero


-- | XrHandTrackerCreateInfoEXT - Information to create a hand joints handle
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandTrackerCreateInfoEXT-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'HandTrackerCreateInfoEXT'
--
-- -   #VUID-XrHandTrackerCreateInfoEXT-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_HAND_TRACKER_CREATE_INFO_EXT'
--
-- -   #VUID-XrHandTrackerCreateInfoEXT-next-next# @next@ /must/ be @NULL@
--     or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>.
--     See also:
--     'OpenXR.Extensions.XR_MSFT_hand_tracking_mesh.HandPoseTypeInfoMSFT'
--
-- -   #VUID-XrHandTrackerCreateInfoEXT-hand-parameter# @hand@ /must/ be a
--     valid 'HandEXT' value
--
-- -   #VUID-XrHandTrackerCreateInfoEXT-handJointSet-parameter#
--     @handJointSet@ /must/ be a valid 'HandJointSetEXT' value
--
-- = See Also
--
-- 'HandEXT', 'HandJointSetEXT',
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'createHandTrackerEXT'
data HandTrackerCreateInfoEXT (es :: [Type]) = HandTrackerCreateInfoEXT
  { -- | @next@ is @NULL@ or a pointer to the next structure in a structure
    -- chain. No such structures are defined in core OpenXR or this extension.
    HandTrackerCreateInfoEXT es -> Chain es
next :: Chain es
  , -- | @hand@ is an 'HandEXT' which describes which hand the tracker is
    -- tracking.
    HandTrackerCreateInfoEXT es -> HandEXT
hand :: HandEXT
  , -- | @handJointSet@ is an 'HandJointSetEXT' describe the set of hand joints
    -- to retrieve.
    HandTrackerCreateInfoEXT es -> HandJointSetEXT
handJointSet :: HandJointSetEXT
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandTrackerCreateInfoEXT (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (HandTrackerCreateInfoEXT es)

instance Extensible HandTrackerCreateInfoEXT where
  extensibleTypeName :: String
extensibleTypeName = "HandTrackerCreateInfoEXT"
  setNext :: HandTrackerCreateInfoEXT ds
-> Chain es -> HandTrackerCreateInfoEXT es
setNext x :: HandTrackerCreateInfoEXT ds
x next :: Chain es
next = HandTrackerCreateInfoEXT ds
x{$sel:next:HandTrackerCreateInfoEXT :: Chain es
next = Chain es
next}
  getNext :: HandTrackerCreateInfoEXT es -> Chain es
getNext HandTrackerCreateInfoEXT{..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends HandTrackerCreateInfoEXT e => b) -> Maybe b
  extends :: proxy e -> (Extends HandTrackerCreateInfoEXT e => b) -> Maybe b
extends _ f :: Extends HandTrackerCreateInfoEXT e => b
f
    | Just Refl <- (Typeable e, Typeable HandPoseTypeInfoMSFT) =>
Maybe (e :~: HandPoseTypeInfoMSFT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @HandPoseTypeInfoMSFT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends HandTrackerCreateInfoEXT e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance (Extendss HandTrackerCreateInfoEXT es, PokeChain es) => ToCStruct (HandTrackerCreateInfoEXT es) where
  withCStruct :: HandTrackerCreateInfoEXT es
-> (Ptr (HandTrackerCreateInfoEXT es) -> IO b) -> IO b
withCStruct x :: HandTrackerCreateInfoEXT es
x f :: Ptr (HandTrackerCreateInfoEXT es) -> IO b
f = Int -> Int -> (Ptr (HandTrackerCreateInfoEXT es) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr (HandTrackerCreateInfoEXT es) -> IO b) -> IO b)
-> (Ptr (HandTrackerCreateInfoEXT es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr (HandTrackerCreateInfoEXT es)
p -> Ptr (HandTrackerCreateInfoEXT es)
-> HandTrackerCreateInfoEXT es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (HandTrackerCreateInfoEXT es)
p HandTrackerCreateInfoEXT es
x (Ptr (HandTrackerCreateInfoEXT es) -> IO b
f Ptr (HandTrackerCreateInfoEXT es)
p)
  pokeCStruct :: Ptr (HandTrackerCreateInfoEXT es)
-> HandTrackerCreateInfoEXT es -> IO b -> IO b
pokeCStruct p :: Ptr (HandTrackerCreateInfoEXT es)
p HandTrackerCreateInfoEXT{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_TRACKER_CREATE_INFO_EXT)
    Ptr ()
next'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
next''
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr HandEXT -> HandEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandEXT)) (HandEXT
hand)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr HandJointSetEXT -> HandJointSetEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandJointSetEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr HandJointSetEXT)) (HandJointSetEXT
handJointSet)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr (HandTrackerCreateInfoEXT es) -> IO b -> IO b
pokeZeroCStruct p :: Ptr (HandTrackerCreateInfoEXT es)
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_TRACKER_CREATE_INFO_EXT)
    Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr HandEXT -> HandEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandEXT)) (HandEXT
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr HandJointSetEXT -> HandJointSetEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandJointSetEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr HandJointSetEXT)) (HandJointSetEXT
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance (Extendss HandTrackerCreateInfoEXT es, PeekChain es) => FromCStruct (HandTrackerCreateInfoEXT es) where
  peekCStruct :: Ptr (HandTrackerCreateInfoEXT es)
-> IO (HandTrackerCreateInfoEXT es)
peekCStruct p :: Ptr (HandTrackerCreateInfoEXT es)
p = do
    Ptr ()
next <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ())))
    Chain es
next' <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
next)
    HandEXT
hand <- Ptr HandEXT -> IO HandEXT
forall a. Storable a => Ptr a -> IO a
peek @HandEXT ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandEXT))
    HandJointSetEXT
handJointSet <- Ptr HandJointSetEXT -> IO HandJointSetEXT
forall a. Storable a => Ptr a -> IO a
peek @HandJointSetEXT ((Ptr (HandTrackerCreateInfoEXT es)
p Ptr (HandTrackerCreateInfoEXT es) -> Int -> Ptr HandJointSetEXT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr HandJointSetEXT))
    HandTrackerCreateInfoEXT es -> IO (HandTrackerCreateInfoEXT es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandTrackerCreateInfoEXT es -> IO (HandTrackerCreateInfoEXT es))
-> HandTrackerCreateInfoEXT es -> IO (HandTrackerCreateInfoEXT es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> HandEXT -> HandJointSetEXT -> HandTrackerCreateInfoEXT es
forall (es :: [*]).
Chain es
-> HandEXT -> HandJointSetEXT -> HandTrackerCreateInfoEXT es
HandTrackerCreateInfoEXT
             Chain es
next' HandEXT
hand HandJointSetEXT
handJointSet

instance es ~ '[] => Zero (HandTrackerCreateInfoEXT es) where
  zero :: HandTrackerCreateInfoEXT es
zero = Chain es
-> HandEXT -> HandJointSetEXT -> HandTrackerCreateInfoEXT es
forall (es :: [*]).
Chain es
-> HandEXT -> HandJointSetEXT -> HandTrackerCreateInfoEXT es
HandTrackerCreateInfoEXT
           ()
           HandEXT
forall a. Zero a => a
zero
           HandJointSetEXT
forall a. Zero a => a
zero


-- | XrHandJointsLocateInfoEXT - Describes the information to locate hand
-- joints
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandJointsLocateInfoEXT-extension-notenabled# The @@
--     extension /must/ be enabled prior to using 'HandJointsLocateInfoEXT'
--
-- -   #VUID-XrHandJointsLocateInfoEXT-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_HAND_JOINTS_LOCATE_INFO_EXT'
--
-- -   #VUID-XrHandJointsLocateInfoEXT-next-next# @next@ /must/ be @NULL@
--     or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- -   #VUID-XrHandJointsLocateInfoEXT-baseSpace-parameter# @baseSpace@
--     /must/ be a valid 'OpenXR.Core10.Handles.Space' handle
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Space',
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrTime >,
-- 'locateHandJointsEXT'
data HandJointsLocateInfoEXT = HandJointsLocateInfoEXT
  { -- | @baseSpace@ is an 'OpenXR.Core10.Handles.Space' within which the
    -- returned hand joint locations will be represented.
    HandJointsLocateInfoEXT -> Ptr Space_T
baseSpace :: Ptr Space_T
  , -- | @time@ is an
    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrTime >
    -- at which to locate the hand joints.
    HandJointsLocateInfoEXT -> Time
time :: Time
  }
  deriving (Typeable, HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool
(HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool)
-> (HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool)
-> Eq HandJointsLocateInfoEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool
$c/= :: HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool
== :: HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool
$c== :: HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandJointsLocateInfoEXT)
#endif
deriving instance Show HandJointsLocateInfoEXT

instance ToCStruct HandJointsLocateInfoEXT where
  withCStruct :: HandJointsLocateInfoEXT
-> (Ptr HandJointsLocateInfoEXT -> IO b) -> IO b
withCStruct x :: HandJointsLocateInfoEXT
x f :: Ptr HandJointsLocateInfoEXT -> IO b
f = Int -> Int -> (Ptr HandJointsLocateInfoEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr HandJointsLocateInfoEXT -> IO b) -> IO b)
-> (Ptr HandJointsLocateInfoEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandJointsLocateInfoEXT
p -> Ptr HandJointsLocateInfoEXT
-> HandJointsLocateInfoEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointsLocateInfoEXT
p HandJointsLocateInfoEXT
x (Ptr HandJointsLocateInfoEXT -> IO b
f Ptr HandJointsLocateInfoEXT
p)
  pokeCStruct :: Ptr HandJointsLocateInfoEXT
-> HandJointsLocateInfoEXT -> IO b -> IO b
pokeCStruct p :: Ptr HandJointsLocateInfoEXT
p HandJointsLocateInfoEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINTS_LOCATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Space_T) -> Ptr Space_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr (Ptr Space_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Space_T))) (Ptr Space_T
baseSpace)
    Ptr Time -> Time -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Time)) (Time
time)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr HandJointsLocateInfoEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandJointsLocateInfoEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINTS_LOCATE_INFO_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Space_T) -> Ptr Space_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr (Ptr Space_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Space_T))) (Ptr Space_T
forall a. Zero a => a
zero)
    Ptr Time -> Time -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Time)) (Time
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct HandJointsLocateInfoEXT where
  peekCStruct :: Ptr HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT
peekCStruct p :: Ptr HandJointsLocateInfoEXT
p = do
    Ptr Space_T
baseSpace <- Ptr (Ptr Space_T) -> IO (Ptr Space_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Space_T) ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr (Ptr Space_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Space_T)))
    Time
time <- Ptr Time -> IO Time
forall a. Storable a => Ptr a -> IO a
peek @Time ((Ptr HandJointsLocateInfoEXT
p Ptr HandJointsLocateInfoEXT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Time))
    HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT)
-> HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT
forall a b. (a -> b) -> a -> b
$ Ptr Space_T -> Time -> HandJointsLocateInfoEXT
HandJointsLocateInfoEXT
             Ptr Space_T
baseSpace Time
time

instance Storable HandJointsLocateInfoEXT where
  sizeOf :: HandJointsLocateInfoEXT -> Int
sizeOf ~HandJointsLocateInfoEXT
_ = 32
  alignment :: HandJointsLocateInfoEXT -> Int
alignment ~HandJointsLocateInfoEXT
_ = 8
  peek :: Ptr HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT
peek = Ptr HandJointsLocateInfoEXT -> IO HandJointsLocateInfoEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr HandJointsLocateInfoEXT -> HandJointsLocateInfoEXT -> IO ()
poke ptr :: Ptr HandJointsLocateInfoEXT
ptr poked :: HandJointsLocateInfoEXT
poked = Ptr HandJointsLocateInfoEXT
-> HandJointsLocateInfoEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointsLocateInfoEXT
ptr HandJointsLocateInfoEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero HandJointsLocateInfoEXT where
  zero :: HandJointsLocateInfoEXT
zero = Ptr Space_T -> Time -> HandJointsLocateInfoEXT
HandJointsLocateInfoEXT
           Ptr Space_T
forall a. Zero a => a
zero
           Time
forall a. Zero a => a
zero


-- | XrHandJointLocationEXT - Describes the location and radius of a hand
-- joint
--
-- == Member Descriptions
--
-- = Description
--
-- If the returned @locationFlags@ has
-- @XR_SPACE_LOCATION_POSITION_VALID_BIT@ set, the returned radius /must/
-- be a positive value.
--
-- If the returned @locationFlags@ has
-- @XR_SPACE_LOCATION_POSITION_VALID_BIT@ unset, the returned radius value
-- is undefined and should be avoided.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandJointLocationEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to using 'HandJointLocationEXT'
--
-- -   #VUID-XrHandJointLocationEXT-locationFlags-parameter#
--     @locationFlags@ /must/ be a valid combination of
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSpaceLocationFlagBits XrSpaceLocationFlagBits>
--     values
--
-- -   #VUID-XrHandJointLocationEXT-locationFlags-requiredbitmask#
--     @locationFlags@ /must/ not be @0@
--
-- = See Also
--
-- 'HandJointLocationsEXT', 'OpenXR.Core10.Space.Posef',
-- 'OpenXR.Core10.Enums.SpaceLocationFlags.SpaceLocationFlags'
data HandJointLocationEXT = HandJointLocationEXT
  { -- | @locationFlags@ is a bitfield, with bit masks defined in
    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSpaceLocationFlagBits XrSpaceLocationFlagBits>,
    -- to indicate which members contain valid data. If none of the bits are
    -- set, no other fields in this structure /should/ be considered to be
    -- valid or meaningful.
    HandJointLocationEXT -> SpaceLocationFlags
locationFlags :: SpaceLocationFlags
  , -- | @pose@ is an 'OpenXR.Core10.Space.Posef' defining the position and
    -- orientation of the origin of a hand joint within the reference frame of
    -- the corresponding 'HandJointsLocateInfoEXT'::@baseSpace@.
    HandJointLocationEXT -> Posef
pose :: Posef
  , -- | @radius@ is a @float@ value radius of the corresponding joint in units
    -- of meters.
    HandJointLocationEXT -> Float
radius :: Float
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandJointLocationEXT)
#endif
deriving instance Show HandJointLocationEXT

instance ToCStruct HandJointLocationEXT where
  withCStruct :: HandJointLocationEXT -> (Ptr HandJointLocationEXT -> IO b) -> IO b
withCStruct x :: HandJointLocationEXT
x f :: Ptr HandJointLocationEXT -> IO b
f = Int -> Int -> (Ptr HandJointLocationEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 36 4 ((Ptr HandJointLocationEXT -> IO b) -> IO b)
-> (Ptr HandJointLocationEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandJointLocationEXT
p -> Ptr HandJointLocationEXT -> HandJointLocationEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointLocationEXT
p HandJointLocationEXT
x (Ptr HandJointLocationEXT -> IO b
f Ptr HandJointLocationEXT
p)
  pokeCStruct :: Ptr HandJointLocationEXT -> HandJointLocationEXT -> IO b -> IO b
pokeCStruct p :: Ptr HandJointLocationEXT
p HandJointLocationEXT{..} f :: IO b
f = do
    Ptr SpaceLocationFlags -> SpaceLocationFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr SpaceLocationFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceLocationFlags)) (SpaceLocationFlags
locationFlags)
    Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Posef)) (Posef
pose)
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
radius))
    IO b
f
  cStructSize :: Int
cStructSize = 36
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr HandJointLocationEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandJointLocationEXT
p f :: IO b
f = do
    Ptr SpaceLocationFlags -> SpaceLocationFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr SpaceLocationFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceLocationFlags)) (SpaceLocationFlags
forall a. Zero a => a
zero)
    Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Posef)) (Posef
forall a. Zero a => a
zero)
    Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct HandJointLocationEXT where
  peekCStruct :: Ptr HandJointLocationEXT -> IO HandJointLocationEXT
peekCStruct p :: Ptr HandJointLocationEXT
p = do
    SpaceLocationFlags
locationFlags <- Ptr SpaceLocationFlags -> IO SpaceLocationFlags
forall a. Storable a => Ptr a -> IO a
peek @SpaceLocationFlags ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr SpaceLocationFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceLocationFlags))
    Posef
pose <- Ptr Posef -> IO Posef
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Posef ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Posef))
    CFloat
radius <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr HandJointLocationEXT
p Ptr HandJointLocationEXT -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr CFloat))
    HandJointLocationEXT -> IO HandJointLocationEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandJointLocationEXT -> IO HandJointLocationEXT)
-> HandJointLocationEXT -> IO HandJointLocationEXT
forall a b. (a -> b) -> a -> b
$ SpaceLocationFlags -> Posef -> Float -> HandJointLocationEXT
HandJointLocationEXT
             SpaceLocationFlags
locationFlags Posef
pose (CFloat -> Float
forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
radius)

instance Storable HandJointLocationEXT where
  sizeOf :: HandJointLocationEXT -> Int
sizeOf ~HandJointLocationEXT
_ = 36
  alignment :: HandJointLocationEXT -> Int
alignment ~HandJointLocationEXT
_ = 4
  peek :: Ptr HandJointLocationEXT -> IO HandJointLocationEXT
peek = Ptr HandJointLocationEXT -> IO HandJointLocationEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr HandJointLocationEXT -> HandJointLocationEXT -> IO ()
poke ptr :: Ptr HandJointLocationEXT
ptr poked :: HandJointLocationEXT
poked = Ptr HandJointLocationEXT -> HandJointLocationEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointLocationEXT
ptr HandJointLocationEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero HandJointLocationEXT where
  zero :: HandJointLocationEXT
zero = SpaceLocationFlags -> Posef -> Float -> HandJointLocationEXT
HandJointLocationEXT
           SpaceLocationFlags
forall a. Zero a => a
zero
           Posef
forall a. Zero a => a
zero
           Float
forall a. Zero a => a
zero


-- | XrHandJointVelocityEXT - Describes the velocity of a hand joint
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandJointVelocityEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to using 'HandJointVelocityEXT'
--
-- -   #VUID-XrHandJointVelocityEXT-velocityFlags-parameter#
--     @velocityFlags@ /must/ be a valid combination of
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSpaceVelocityFlagBits XrSpaceVelocityFlagBits>
--     values
--
-- -   #VUID-XrHandJointVelocityEXT-velocityFlags-requiredbitmask#
--     @velocityFlags@ /must/ not be @0@
--
-- = See Also
--
-- 'HandJointVelocitiesEXT',
-- 'OpenXR.Core10.Enums.SpaceVelocityFlags.SpaceVelocityFlags',
-- 'OpenXR.Core10.Space.Vector3f'
data HandJointVelocityEXT = HandJointVelocityEXT
  { -- | @velocityFlags@ is a bitfield, with bit masks defined in
    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSpaceVelocityFlagBits XrSpaceVelocityFlagBits>,
    -- to indicate which members contain valid data. If none of the bits are
    -- set, no other fields in this structure /should/ be considered to be
    -- valid or meaningful.
    HandJointVelocityEXT -> SpaceVelocityFlags
velocityFlags :: SpaceVelocityFlags
  , -- | @linearVelocity@ is the relative linear velocity of the hand joint with
    -- respect to and expressed in the reference frame of the corresponding
    -- 'HandJointsLocateInfoEXT'::@baseSpace@, in units of meters per second.
    HandJointVelocityEXT -> Vector3f
linearVelocity :: Vector3f
  , -- | @angularVelocity@ is the relative angular velocity of the hand joint
    -- with respect to the corresponding
    -- 'HandJointsLocateInfoEXT'::@baseSpace@. The vector’s direction is
    -- expressed in the reference frame of the corresponding
    -- 'HandJointsLocateInfoEXT'::@baseSpace@ and is parallel to the rotational
    -- axis of the hand joint. The vector’s magnitude is the relative angular
    -- speed of the hand joint in radians per second. The vector follows the
    -- right-hand rule for torque\/rotation.
    HandJointVelocityEXT -> Vector3f
angularVelocity :: Vector3f
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandJointVelocityEXT)
#endif
deriving instance Show HandJointVelocityEXT

instance ToCStruct HandJointVelocityEXT where
  withCStruct :: HandJointVelocityEXT -> (Ptr HandJointVelocityEXT -> IO b) -> IO b
withCStruct x :: HandJointVelocityEXT
x f :: Ptr HandJointVelocityEXT -> IO b
f = Int -> Int -> (Ptr HandJointVelocityEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 28 4 ((Ptr HandJointVelocityEXT -> IO b) -> IO b)
-> (Ptr HandJointVelocityEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandJointVelocityEXT
p -> Ptr HandJointVelocityEXT -> HandJointVelocityEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointVelocityEXT
p HandJointVelocityEXT
x (Ptr HandJointVelocityEXT -> IO b
f Ptr HandJointVelocityEXT
p)
  pokeCStruct :: Ptr HandJointVelocityEXT -> HandJointVelocityEXT -> IO b -> IO b
pokeCStruct p :: Ptr HandJointVelocityEXT
p HandJointVelocityEXT{..} f :: IO b
f = do
    Ptr SpaceVelocityFlags -> SpaceVelocityFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr SpaceVelocityFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceVelocityFlags)) (SpaceVelocityFlags
velocityFlags)
    Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Vector3f)) (Vector3f
linearVelocity)
    Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Vector3f)) (Vector3f
angularVelocity)
    IO b
f
  cStructSize :: Int
cStructSize = 28
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr HandJointVelocityEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandJointVelocityEXT
p f :: IO b
f = do
    Ptr SpaceVelocityFlags -> SpaceVelocityFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr SpaceVelocityFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceVelocityFlags)) (SpaceVelocityFlags
forall a. Zero a => a
zero)
    Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Vector3f)) (Vector3f
forall a. Zero a => a
zero)
    Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Vector3f)) (Vector3f
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct HandJointVelocityEXT where
  peekCStruct :: Ptr HandJointVelocityEXT -> IO HandJointVelocityEXT
peekCStruct p :: Ptr HandJointVelocityEXT
p = do
    SpaceVelocityFlags
velocityFlags <- Ptr SpaceVelocityFlags -> IO SpaceVelocityFlags
forall a. Storable a => Ptr a -> IO a
peek @SpaceVelocityFlags ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr SpaceVelocityFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr SpaceVelocityFlags))
    Vector3f
linearVelocity <- Ptr Vector3f -> IO Vector3f
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Vector3f ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Vector3f))
    Vector3f
angularVelocity <- Ptr Vector3f -> IO Vector3f
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Vector3f ((Ptr HandJointVelocityEXT
p Ptr HandJointVelocityEXT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Vector3f))
    HandJointVelocityEXT -> IO HandJointVelocityEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandJointVelocityEXT -> IO HandJointVelocityEXT)
-> HandJointVelocityEXT -> IO HandJointVelocityEXT
forall a b. (a -> b) -> a -> b
$ SpaceVelocityFlags -> Vector3f -> Vector3f -> HandJointVelocityEXT
HandJointVelocityEXT
             SpaceVelocityFlags
velocityFlags Vector3f
linearVelocity Vector3f
angularVelocity

instance Storable HandJointVelocityEXT where
  sizeOf :: HandJointVelocityEXT -> Int
sizeOf ~HandJointVelocityEXT
_ = 28
  alignment :: HandJointVelocityEXT -> Int
alignment ~HandJointVelocityEXT
_ = 4
  peek :: Ptr HandJointVelocityEXT -> IO HandJointVelocityEXT
peek = Ptr HandJointVelocityEXT -> IO HandJointVelocityEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr HandJointVelocityEXT -> HandJointVelocityEXT -> IO ()
poke ptr :: Ptr HandJointVelocityEXT
ptr poked :: HandJointVelocityEXT
poked = Ptr HandJointVelocityEXT -> HandJointVelocityEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointVelocityEXT
ptr HandJointVelocityEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero HandJointVelocityEXT where
  zero :: HandJointVelocityEXT
zero = SpaceVelocityFlags -> Vector3f -> Vector3f -> HandJointVelocityEXT
HandJointVelocityEXT
           SpaceVelocityFlags
forall a. Zero a => a
zero
           Vector3f
forall a. Zero a => a
zero
           Vector3f
forall a. Zero a => a
zero


-- | XrHandJointLocationsEXT - Returns the hand joint locations
--
-- == Member Descriptions
--
-- = Description
--
-- The application /must/ allocate the memory for the output array
-- @jointLocations@ that can contain at least @jointCount@ of
-- 'HandJointLocationEXT'.
--
-- The application /must/ set @jointCount@ as described by the
-- 'HandJointSetEXT' when creating the
-- 'OpenXR.Extensions.Handles.HandTrackerEXT' otherwise the runtime /must/
-- return 'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'.
--
-- The runtime /must/ update the @jointLocations@ array ordered so that the
-- application can index elements using the corresponding hand joint enum
-- (e.g. 'HandJointEXT') as described by 'HandJointSetEXT' when creating
-- the 'OpenXR.Extensions.Handles.HandTrackerEXT'. For example, when the
-- 'OpenXR.Extensions.Handles.HandTrackerEXT' is created with
-- 'HAND_JOINT_SET_DEFAULT_EXT', the application /must/ set the
-- @jointCount@ to 'OpenXR.Core10.APIConstants.HAND_JOINT_COUNT_EXT', and
-- the runtime /must/ fill the @jointLocations@ array ordered so that it
-- may be indexed by the 'HandJointEXT' enum.
--
-- If the returned @isActive@ is true, the runtime /must/ return all joint
-- locations with both @XR_SPACE_LOCATION_POSITION_VALID_BIT@ and
-- @XR_SPACE_LOCATION_ORIENTATION_VALID_BIT@ set. Although, in this case,
-- some joint space locations /may/ be untracked (i.e.
-- @XR_SPACE_LOCATION_POSITION_TRACKED_BIT@ or
-- @XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT@ is unset).
--
-- If the returned @isActive@ is false, it indicates the hand tracker did
-- not detect the hand input or the application lost input focus. In this
-- case, the runtime /must/ return all @jointLocations@ with neither
-- @XR_SPACE_LOCATION_POSITION_VALID_BIT@ nor
-- @XR_SPACE_LOCATION_ORIENTATION_VALID_BIT@ set.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandJointLocationsEXT-extension-notenabled# The @@ extension
--     /must/ be enabled prior to using 'HandJointLocationsEXT'
--
-- -   #VUID-XrHandJointLocationsEXT-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_HAND_JOINT_LOCATIONS_EXT'
--
-- -   #VUID-XrHandJointLocationsEXT-next-next# @next@ /must/ be @NULL@ or
--     a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>.
--     See also: 'HandJointVelocitiesEXT'
--
-- -   #VUID-XrHandJointLocationsEXT-jointLocations-parameter#
--     @jointLocations@ /must/ be a pointer to an array of @jointCount@
--     'HandJointLocationEXT' structures
--
-- -   #VUID-XrHandJointLocationsEXT-jointCount-arraylength# The
--     @jointCount@ parameter /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrBool32 >,
-- 'HandJointLocationEXT',
-- 'OpenXR.Core10.Enums.StructureType.StructureType', 'locateHandJointsEXT'
data HandJointLocationsEXT (es :: [Type]) = HandJointLocationsEXT
  { -- | @next@ is @NULL@ or a pointer to the next structure in a structure
    -- chain, such as 'HandJointVelocitiesEXT'.
    HandJointLocationsEXT es -> Chain es
next :: Chain es
  , -- | @isActive@ is a
    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrBool32 >
    -- indicating if the hand tracker is actively tracking.
    HandJointLocationsEXT es -> Bool
isActive :: Bool
  , -- | @jointCount@ is a @uint32_t@ describing the count of elements in
    -- @jointLocations@ array.
    HandJointLocationsEXT es -> Word32
jointCount :: Word32
  , -- | @jointLocations@ is an array of 'HandJointLocationEXT' receiving the
    -- returned hand joint locations.
    HandJointLocationsEXT es -> Ptr HandJointLocationEXT
jointLocations :: Ptr HandJointLocationEXT
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandJointLocationsEXT (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (HandJointLocationsEXT es)

instance Extensible HandJointLocationsEXT where
  extensibleTypeName :: String
extensibleTypeName = "HandJointLocationsEXT"
  setNext :: HandJointLocationsEXT ds -> Chain es -> HandJointLocationsEXT es
setNext x :: HandJointLocationsEXT ds
x next :: Chain es
next = HandJointLocationsEXT ds
x{$sel:next:HandJointLocationsEXT :: Chain es
next = Chain es
next}
  getNext :: HandJointLocationsEXT es -> Chain es
getNext HandJointLocationsEXT{..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends HandJointLocationsEXT e => b) -> Maybe b
  extends :: proxy e -> (Extends HandJointLocationsEXT e => b) -> Maybe b
extends _ f :: Extends HandJointLocationsEXT e => b
f
    | Just Refl <- (Typeable e, Typeable HandJointVelocitiesEXT) =>
Maybe (e :~: HandJointVelocitiesEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @HandJointVelocitiesEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends HandJointLocationsEXT e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance (Extendss HandJointLocationsEXT es, PokeChain es) => ToCStruct (HandJointLocationsEXT es) where
  withCStruct :: HandJointLocationsEXT es
-> (Ptr (HandJointLocationsEXT es) -> IO b) -> IO b
withCStruct x :: HandJointLocationsEXT es
x f :: Ptr (HandJointLocationsEXT es) -> IO b
f = Int -> Int -> (Ptr (HandJointLocationsEXT es) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr (HandJointLocationsEXT es) -> IO b) -> IO b)
-> (Ptr (HandJointLocationsEXT es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr (HandJointLocationsEXT es)
p -> Ptr (HandJointLocationsEXT es)
-> HandJointLocationsEXT es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (HandJointLocationsEXT es)
p HandJointLocationsEXT es
x (Ptr (HandJointLocationsEXT es) -> IO b
f Ptr (HandJointLocationsEXT es)
p)
  pokeCStruct :: Ptr (HandJointLocationsEXT es)
-> HandJointLocationsEXT es -> IO b -> IO b
pokeCStruct p :: Ptr (HandJointLocationsEXT es)
p HandJointLocationsEXT{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINT_LOCATIONS_EXT)
    Ptr ()
next'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
next''
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
isActive))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) (Word32
jointCount)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr HandJointLocationEXT) -> Ptr HandJointLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es)
-> Int -> Ptr (Ptr HandJointLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointLocationEXT))) (Ptr HandJointLocationEXT
jointLocations)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr (HandJointLocationsEXT es) -> IO b -> IO b
pokeZeroCStruct p :: Ptr (HandJointLocationsEXT es)
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINT_LOCATIONS_EXT)
    Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr HandJointLocationEXT) -> Ptr HandJointLocationEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es)
-> Int -> Ptr (Ptr HandJointLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointLocationEXT))) (Ptr HandJointLocationEXT
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance (Extendss HandJointLocationsEXT es, PeekChain es) => FromCStruct (HandJointLocationsEXT es) where
  peekCStruct :: Ptr (HandJointLocationsEXT es) -> IO (HandJointLocationsEXT es)
peekCStruct p :: Ptr (HandJointLocationsEXT es)
p = do
    Ptr ()
next <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ())))
    Chain es
next' <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
next)
    Bool32
isActive <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    Word32
jointCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    Ptr HandJointLocationEXT
jointLocations <- Ptr (Ptr HandJointLocationEXT) -> IO (Ptr HandJointLocationEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr HandJointLocationEXT) ((Ptr (HandJointLocationsEXT es)
p Ptr (HandJointLocationsEXT es)
-> Int -> Ptr (Ptr HandJointLocationEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointLocationEXT)))
    HandJointLocationsEXT es -> IO (HandJointLocationsEXT es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandJointLocationsEXT es -> IO (HandJointLocationsEXT es))
-> HandJointLocationsEXT es -> IO (HandJointLocationsEXT es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> Bool
-> Word32
-> Ptr HandJointLocationEXT
-> HandJointLocationsEXT es
forall (es :: [*]).
Chain es
-> Bool
-> Word32
-> Ptr HandJointLocationEXT
-> HandJointLocationsEXT es
HandJointLocationsEXT
             Chain es
next' (Bool32 -> Bool
bool32ToBool Bool32
isActive) Word32
jointCount Ptr HandJointLocationEXT
jointLocations

instance es ~ '[] => Zero (HandJointLocationsEXT es) where
  zero :: HandJointLocationsEXT es
zero = Chain es
-> Bool
-> Word32
-> Ptr HandJointLocationEXT
-> HandJointLocationsEXT es
forall (es :: [*]).
Chain es
-> Bool
-> Word32
-> Ptr HandJointLocationEXT
-> HandJointLocationsEXT es
HandJointLocationsEXT
           ()
           Bool
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Ptr HandJointLocationEXT
forall a. Zero a => a
zero


-- | XrHandJointVelocitiesEXT - Returns the hand joint velocities
--
-- == Member Descriptions
--
-- = Description
--
-- The application /must/ allocate the memory for the output array
-- @jointVelocities@ that can contain at least @jointCount@ of
-- 'HandJointVelocityEXT'.
--
-- The application /must/ input @jointCount@ as described by the
-- 'HandJointSetEXT' when creating the
-- 'OpenXR.Extensions.Handles.HandTrackerEXT'. Otherwise, the runtime
-- /must/ return 'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'.
--
-- The runtime /must/ update the @jointVelocities@ array in the order so
-- that the application can index elements using the corresponding hand
-- joint enum (e.g. 'HandJointEXT') as described by the 'HandJointSetEXT'
-- when creating the 'OpenXR.Extensions.Handles.HandTrackerEXT'. For
-- example, when the 'OpenXR.Extensions.Handles.HandTrackerEXT' is created
-- with 'HAND_JOINT_SET_DEFAULT_EXT', the application /must/ set the
-- @jointCount@ to 'OpenXR.Core10.APIConstants.HAND_JOINT_COUNT_EXT', and
-- the returned @jointVelocities@ array /must/ be ordered to be indexed by
-- enum 'HandJointEXT' enum.
--
-- If the returned 'HandJointLocationsEXT'::@isActive@ is false, it
-- indicates the hand tracker did not detect a hand input or the
-- application lost input focus. In this case, the runtime /must/ return
-- all @jointVelocities@ with neither @XR_SPACE_VELOCITY_LINEAR_VALID_BIT@
-- nor @XR_SPACE_VELOCITY_ANGULAR_VALID_BIT@ set.
--
-- If an 'HandJointVelocitiesEXT' structure is chained to
-- 'HandJointLocationsEXT'::@next@, the returned
-- 'HandJointLocationsEXT'::@isActive@ is true, and the velocity is
-- observed or can be calculated by the runtime, the runtime /must/ fill in
-- the linear velocity of each hand joint within the reference frame of
-- @baseSpace@ and set the @XR_SPACE_VELOCITY_LINEAR_VALID_BIT@. Similarly,
-- if an 'HandJointVelocitiesEXT' structure is chained to
-- 'HandJointLocationsEXT'::@next@, the returned
-- 'HandJointLocationsEXT'::@isActive@ is true, and the /angular velocity/
-- is observed or can be calculated by the runtime, the runtime /must/ fill
-- in the angular velocity of each joint within the reference frame of
-- @baseSpace@ and set the @XR_SPACE_VELOCITY_ANGULAR_VALID_BIT@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrHandJointVelocitiesEXT-extension-notenabled# The @@
--     extension /must/ be enabled prior to using 'HandJointVelocitiesEXT'
--
-- -   #VUID-XrHandJointVelocitiesEXT-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_HAND_JOINT_VELOCITIES_EXT'
--
-- -   #VUID-XrHandJointVelocitiesEXT-next-next# @next@ /must/ be @NULL@ or
--     a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- -   #VUID-XrHandJointVelocitiesEXT-jointVelocities-parameter#
--     @jointVelocities@ /must/ be a pointer to an array of @jointCount@
--     'HandJointVelocityEXT' structures
--
-- -   #VUID-XrHandJointVelocitiesEXT-jointCount-arraylength# The
--     @jointCount@ parameter /must/ be greater than @0@
--
-- = See Also
--
-- 'HandJointLocationsEXT', 'HandJointVelocityEXT',
-- 'OpenXR.Core10.Enums.StructureType.StructureType'
data HandJointVelocitiesEXT = HandJointVelocitiesEXT
  { -- | @jointCount@ is a @uint32_t@ describing the number of elements in
    -- @jointVelocities@ array.
    HandJointVelocitiesEXT -> Word32
jointCount :: Word32
  , -- | @jointVelocities@ is an array of 'HandJointVelocityEXT' receiving the
    -- returned hand joint velocities.
    HandJointVelocitiesEXT -> Ptr HandJointVelocityEXT
jointVelocities :: Ptr HandJointVelocityEXT
  }
  deriving (Typeable, HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool
(HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool)
-> (HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool)
-> Eq HandJointVelocitiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool
$c/= :: HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool
== :: HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool
$c== :: HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandJointVelocitiesEXT)
#endif
deriving instance Show HandJointVelocitiesEXT

instance ToCStruct HandJointVelocitiesEXT where
  withCStruct :: HandJointVelocitiesEXT
-> (Ptr HandJointVelocitiesEXT -> IO b) -> IO b
withCStruct x :: HandJointVelocitiesEXT
x f :: Ptr HandJointVelocitiesEXT -> IO b
f = Int -> Int -> (Ptr HandJointVelocitiesEXT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr HandJointVelocitiesEXT -> IO b) -> IO b)
-> (Ptr HandJointVelocitiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandJointVelocitiesEXT
p -> Ptr HandJointVelocitiesEXT
-> HandJointVelocitiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointVelocitiesEXT
p HandJointVelocitiesEXT
x (Ptr HandJointVelocitiesEXT -> IO b
f Ptr HandJointVelocitiesEXT
p)
  pokeCStruct :: Ptr HandJointVelocitiesEXT
-> HandJointVelocitiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr HandJointVelocitiesEXT
p HandJointVelocitiesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINT_VELOCITIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
jointCount)
    Ptr (Ptr HandJointVelocityEXT) -> Ptr HandJointVelocityEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr (Ptr HandJointVelocityEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointVelocityEXT))) (Ptr HandJointVelocityEXT
jointVelocities)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr HandJointVelocitiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandJointVelocitiesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_JOINT_VELOCITIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr (Ptr HandJointVelocityEXT) -> Ptr HandJointVelocityEXT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr (Ptr HandJointVelocityEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointVelocityEXT))) (Ptr HandJointVelocityEXT
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct HandJointVelocitiesEXT where
  peekCStruct :: Ptr HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT
peekCStruct p :: Ptr HandJointVelocitiesEXT
p = do
    Word32
jointCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    Ptr HandJointVelocityEXT
jointVelocities <- Ptr (Ptr HandJointVelocityEXT) -> IO (Ptr HandJointVelocityEXT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr HandJointVelocityEXT) ((Ptr HandJointVelocitiesEXT
p Ptr HandJointVelocitiesEXT -> Int -> Ptr (Ptr HandJointVelocityEXT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr HandJointVelocityEXT)))
    HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT)
-> HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT
forall a b. (a -> b) -> a -> b
$ Word32 -> Ptr HandJointVelocityEXT -> HandJointVelocitiesEXT
HandJointVelocitiesEXT
             Word32
jointCount Ptr HandJointVelocityEXT
jointVelocities

instance Storable HandJointVelocitiesEXT where
  sizeOf :: HandJointVelocitiesEXT -> Int
sizeOf ~HandJointVelocitiesEXT
_ = 32
  alignment :: HandJointVelocitiesEXT -> Int
alignment ~HandJointVelocitiesEXT
_ = 8
  peek :: Ptr HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT
peek = Ptr HandJointVelocitiesEXT -> IO HandJointVelocitiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr HandJointVelocitiesEXT -> HandJointVelocitiesEXT -> IO ()
poke ptr :: Ptr HandJointVelocitiesEXT
ptr poked :: HandJointVelocitiesEXT
poked = Ptr HandJointVelocitiesEXT
-> HandJointVelocitiesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandJointVelocitiesEXT
ptr HandJointVelocitiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero HandJointVelocitiesEXT where
  zero :: HandJointVelocitiesEXT
zero = Word32 -> Ptr HandJointVelocityEXT -> HandJointVelocitiesEXT
HandJointVelocitiesEXT
           Word32
forall a. Zero a => a
zero
           Ptr HandJointVelocityEXT
forall a. Zero a => a
zero


-- | XrHandEXT - Describes which hand the tracker is tracking.
--
-- == Enumerant Descriptions
--
-- = See Also
--
-- 'HandTrackerCreateInfoEXT'
newtype HandEXT = HandEXT Int32
  deriving newtype (HandEXT -> HandEXT -> Bool
(HandEXT -> HandEXT -> Bool)
-> (HandEXT -> HandEXT -> Bool) -> Eq HandEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandEXT -> HandEXT -> Bool
$c/= :: HandEXT -> HandEXT -> Bool
== :: HandEXT -> HandEXT -> Bool
$c== :: HandEXT -> HandEXT -> Bool
Eq, Eq HandEXT
Eq HandEXT =>
(HandEXT -> HandEXT -> Ordering)
-> (HandEXT -> HandEXT -> Bool)
-> (HandEXT -> HandEXT -> Bool)
-> (HandEXT -> HandEXT -> Bool)
-> (HandEXT -> HandEXT -> Bool)
-> (HandEXT -> HandEXT -> HandEXT)
-> (HandEXT -> HandEXT -> HandEXT)
-> Ord HandEXT
HandEXT -> HandEXT -> Bool
HandEXT -> HandEXT -> Ordering
HandEXT -> HandEXT -> HandEXT
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 :: HandEXT -> HandEXT -> HandEXT
$cmin :: HandEXT -> HandEXT -> HandEXT
max :: HandEXT -> HandEXT -> HandEXT
$cmax :: HandEXT -> HandEXT -> HandEXT
>= :: HandEXT -> HandEXT -> Bool
$c>= :: HandEXT -> HandEXT -> Bool
> :: HandEXT -> HandEXT -> Bool
$c> :: HandEXT -> HandEXT -> Bool
<= :: HandEXT -> HandEXT -> Bool
$c<= :: HandEXT -> HandEXT -> Bool
< :: HandEXT -> HandEXT -> Bool
$c< :: HandEXT -> HandEXT -> Bool
compare :: HandEXT -> HandEXT -> Ordering
$ccompare :: HandEXT -> HandEXT -> Ordering
$cp1Ord :: Eq HandEXT
Ord, Ptr b -> Int -> IO HandEXT
Ptr b -> Int -> HandEXT -> IO ()
Ptr HandEXT -> IO HandEXT
Ptr HandEXT -> Int -> IO HandEXT
Ptr HandEXT -> Int -> HandEXT -> IO ()
Ptr HandEXT -> HandEXT -> IO ()
HandEXT -> Int
(HandEXT -> Int)
-> (HandEXT -> Int)
-> (Ptr HandEXT -> Int -> IO HandEXT)
-> (Ptr HandEXT -> Int -> HandEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO HandEXT)
-> (forall b. Ptr b -> Int -> HandEXT -> IO ())
-> (Ptr HandEXT -> IO HandEXT)
-> (Ptr HandEXT -> HandEXT -> IO ())
-> Storable HandEXT
forall b. Ptr b -> Int -> IO HandEXT
forall b. Ptr b -> Int -> HandEXT -> 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 HandEXT -> HandEXT -> IO ()
$cpoke :: Ptr HandEXT -> HandEXT -> IO ()
peek :: Ptr HandEXT -> IO HandEXT
$cpeek :: Ptr HandEXT -> IO HandEXT
pokeByteOff :: Ptr b -> Int -> HandEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> HandEXT -> IO ()
peekByteOff :: Ptr b -> Int -> IO HandEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO HandEXT
pokeElemOff :: Ptr HandEXT -> Int -> HandEXT -> IO ()
$cpokeElemOff :: Ptr HandEXT -> Int -> HandEXT -> IO ()
peekElemOff :: Ptr HandEXT -> Int -> IO HandEXT
$cpeekElemOff :: Ptr HandEXT -> Int -> IO HandEXT
alignment :: HandEXT -> Int
$calignment :: HandEXT -> Int
sizeOf :: HandEXT -> Int
$csizeOf :: HandEXT -> Int
Storable, HandEXT
HandEXT -> Zero HandEXT
forall a. a -> Zero a
zero :: HandEXT
$czero :: HandEXT
Zero)
-- Note that the zero instance does not produce a valid value, passing 'zero' to Vulkan will result in an error

-- | 'HAND_LEFT_EXT' specifies the hand tracker will be tracking the user’s
-- left hand.
pattern $bHAND_LEFT_EXT :: HandEXT
$mHAND_LEFT_EXT :: forall r. HandEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_LEFT_EXT  = HandEXT 1
-- | 'HAND_RIGHT_EXT' specifies the hand tracker will be tracking the user’s
-- right hand.
pattern $bHAND_RIGHT_EXT :: HandEXT
$mHAND_RIGHT_EXT :: forall r. HandEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_RIGHT_EXT = HandEXT 2
{-# complete HAND_LEFT_EXT,
             HAND_RIGHT_EXT :: HandEXT #-}

conNameHandEXT :: String
conNameHandEXT :: String
conNameHandEXT = "HandEXT"

enumPrefixHandEXT :: String
enumPrefixHandEXT :: String
enumPrefixHandEXT = "HAND_"

showTableHandEXT :: [(HandEXT, String)]
showTableHandEXT :: [(HandEXT, String)]
showTableHandEXT = [(HandEXT
HAND_LEFT_EXT, "LEFT_EXT"), (HandEXT
HAND_RIGHT_EXT, "RIGHT_EXT")]

instance Show HandEXT where
  showsPrec :: Int -> HandEXT -> ShowS
showsPrec = String
-> [(HandEXT, String)]
-> String
-> (HandEXT -> Int32)
-> (Int32 -> ShowS)
-> Int
-> HandEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixHandEXT [(HandEXT, String)]
showTableHandEXT String
conNameHandEXT (\(HandEXT x :: Int32
x) -> Int32
x) (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read HandEXT where
  readPrec :: ReadPrec HandEXT
readPrec = String
-> [(HandEXT, String)]
-> String
-> (Int32 -> HandEXT)
-> ReadPrec HandEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixHandEXT [(HandEXT, String)]
showTableHandEXT String
conNameHandEXT Int32 -> HandEXT
HandEXT


-- | XrHandJointEXT - The name of hand joints that can be tracked
--
-- = See Also
--
-- No cross-references are available
newtype HandJointEXT = HandJointEXT Int32
  deriving newtype (HandJointEXT -> HandJointEXT -> Bool
(HandJointEXT -> HandJointEXT -> Bool)
-> (HandJointEXT -> HandJointEXT -> Bool) -> Eq HandJointEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandJointEXT -> HandJointEXT -> Bool
$c/= :: HandJointEXT -> HandJointEXT -> Bool
== :: HandJointEXT -> HandJointEXT -> Bool
$c== :: HandJointEXT -> HandJointEXT -> Bool
Eq, Eq HandJointEXT
Eq HandJointEXT =>
(HandJointEXT -> HandJointEXT -> Ordering)
-> (HandJointEXT -> HandJointEXT -> Bool)
-> (HandJointEXT -> HandJointEXT -> Bool)
-> (HandJointEXT -> HandJointEXT -> Bool)
-> (HandJointEXT -> HandJointEXT -> Bool)
-> (HandJointEXT -> HandJointEXT -> HandJointEXT)
-> (HandJointEXT -> HandJointEXT -> HandJointEXT)
-> Ord HandJointEXT
HandJointEXT -> HandJointEXT -> Bool
HandJointEXT -> HandJointEXT -> Ordering
HandJointEXT -> HandJointEXT -> HandJointEXT
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 :: HandJointEXT -> HandJointEXT -> HandJointEXT
$cmin :: HandJointEXT -> HandJointEXT -> HandJointEXT
max :: HandJointEXT -> HandJointEXT -> HandJointEXT
$cmax :: HandJointEXT -> HandJointEXT -> HandJointEXT
>= :: HandJointEXT -> HandJointEXT -> Bool
$c>= :: HandJointEXT -> HandJointEXT -> Bool
> :: HandJointEXT -> HandJointEXT -> Bool
$c> :: HandJointEXT -> HandJointEXT -> Bool
<= :: HandJointEXT -> HandJointEXT -> Bool
$c<= :: HandJointEXT -> HandJointEXT -> Bool
< :: HandJointEXT -> HandJointEXT -> Bool
$c< :: HandJointEXT -> HandJointEXT -> Bool
compare :: HandJointEXT -> HandJointEXT -> Ordering
$ccompare :: HandJointEXT -> HandJointEXT -> Ordering
$cp1Ord :: Eq HandJointEXT
Ord, Ptr b -> Int -> IO HandJointEXT
Ptr b -> Int -> HandJointEXT -> IO ()
Ptr HandJointEXT -> IO HandJointEXT
Ptr HandJointEXT -> Int -> IO HandJointEXT
Ptr HandJointEXT -> Int -> HandJointEXT -> IO ()
Ptr HandJointEXT -> HandJointEXT -> IO ()
HandJointEXT -> Int
(HandJointEXT -> Int)
-> (HandJointEXT -> Int)
-> (Ptr HandJointEXT -> Int -> IO HandJointEXT)
-> (Ptr HandJointEXT -> Int -> HandJointEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO HandJointEXT)
-> (forall b. Ptr b -> Int -> HandJointEXT -> IO ())
-> (Ptr HandJointEXT -> IO HandJointEXT)
-> (Ptr HandJointEXT -> HandJointEXT -> IO ())
-> Storable HandJointEXT
forall b. Ptr b -> Int -> IO HandJointEXT
forall b. Ptr b -> Int -> HandJointEXT -> 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 HandJointEXT -> HandJointEXT -> IO ()
$cpoke :: Ptr HandJointEXT -> HandJointEXT -> IO ()
peek :: Ptr HandJointEXT -> IO HandJointEXT
$cpeek :: Ptr HandJointEXT -> IO HandJointEXT
pokeByteOff :: Ptr b -> Int -> HandJointEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> HandJointEXT -> IO ()
peekByteOff :: Ptr b -> Int -> IO HandJointEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO HandJointEXT
pokeElemOff :: Ptr HandJointEXT -> Int -> HandJointEXT -> IO ()
$cpokeElemOff :: Ptr HandJointEXT -> Int -> HandJointEXT -> IO ()
peekElemOff :: Ptr HandJointEXT -> Int -> IO HandJointEXT
$cpeekElemOff :: Ptr HandJointEXT -> Int -> IO HandJointEXT
alignment :: HandJointEXT -> Int
$calignment :: HandJointEXT -> Int
sizeOf :: HandJointEXT -> Int
$csizeOf :: HandJointEXT -> Int
Storable, HandJointEXT
HandJointEXT -> Zero HandJointEXT
forall a. a -> Zero a
zero :: HandJointEXT
$czero :: HandJointEXT
Zero)

-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_PALM_EXT"
pattern $bHAND_JOINT_PALM_EXT :: HandJointEXT
$mHAND_JOINT_PALM_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_PALM_EXT                = HandJointEXT 0
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_WRIST_EXT"
pattern $bHAND_JOINT_WRIST_EXT :: HandJointEXT
$mHAND_JOINT_WRIST_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_WRIST_EXT               = HandJointEXT 1
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_THUMB_METACARPAL_EXT"
pattern $bHAND_JOINT_THUMB_METACARPAL_EXT :: HandJointEXT
$mHAND_JOINT_THUMB_METACARPAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_THUMB_METACARPAL_EXT    = HandJointEXT 2
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_THUMB_PROXIMAL_EXT"
pattern $bHAND_JOINT_THUMB_PROXIMAL_EXT :: HandJointEXT
$mHAND_JOINT_THUMB_PROXIMAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_THUMB_PROXIMAL_EXT      = HandJointEXT 3
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_THUMB_DISTAL_EXT"
pattern $bHAND_JOINT_THUMB_DISTAL_EXT :: HandJointEXT
$mHAND_JOINT_THUMB_DISTAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_THUMB_DISTAL_EXT        = HandJointEXT 4
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_THUMB_TIP_EXT"
pattern $bHAND_JOINT_THUMB_TIP_EXT :: HandJointEXT
$mHAND_JOINT_THUMB_TIP_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_THUMB_TIP_EXT           = HandJointEXT 5
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_INDEX_METACARPAL_EXT"
pattern $bHAND_JOINT_INDEX_METACARPAL_EXT :: HandJointEXT
$mHAND_JOINT_INDEX_METACARPAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_INDEX_METACARPAL_EXT    = HandJointEXT 6
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_INDEX_PROXIMAL_EXT"
pattern $bHAND_JOINT_INDEX_PROXIMAL_EXT :: HandJointEXT
$mHAND_JOINT_INDEX_PROXIMAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_INDEX_PROXIMAL_EXT      = HandJointEXT 7
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT"
pattern $bHAND_JOINT_INDEX_INTERMEDIATE_EXT :: HandJointEXT
$mHAND_JOINT_INDEX_INTERMEDIATE_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_INDEX_INTERMEDIATE_EXT  = HandJointEXT 8
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_INDEX_DISTAL_EXT"
pattern $bHAND_JOINT_INDEX_DISTAL_EXT :: HandJointEXT
$mHAND_JOINT_INDEX_DISTAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_INDEX_DISTAL_EXT        = HandJointEXT 9
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_INDEX_TIP_EXT"
pattern $bHAND_JOINT_INDEX_TIP_EXT :: HandJointEXT
$mHAND_JOINT_INDEX_TIP_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_INDEX_TIP_EXT           = HandJointEXT 10
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_MIDDLE_METACARPAL_EXT"
pattern $bHAND_JOINT_MIDDLE_METACARPAL_EXT :: HandJointEXT
$mHAND_JOINT_MIDDLE_METACARPAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_MIDDLE_METACARPAL_EXT   = HandJointEXT 11
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT"
pattern $bHAND_JOINT_MIDDLE_PROXIMAL_EXT :: HandJointEXT
$mHAND_JOINT_MIDDLE_PROXIMAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_MIDDLE_PROXIMAL_EXT     = HandJointEXT 12
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT"
pattern $bHAND_JOINT_MIDDLE_INTERMEDIATE_EXT :: HandJointEXT
$mHAND_JOINT_MIDDLE_INTERMEDIATE_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_MIDDLE_INTERMEDIATE_EXT = HandJointEXT 13
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_MIDDLE_DISTAL_EXT"
pattern $bHAND_JOINT_MIDDLE_DISTAL_EXT :: HandJointEXT
$mHAND_JOINT_MIDDLE_DISTAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_MIDDLE_DISTAL_EXT       = HandJointEXT 14
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_MIDDLE_TIP_EXT"
pattern $bHAND_JOINT_MIDDLE_TIP_EXT :: HandJointEXT
$mHAND_JOINT_MIDDLE_TIP_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_MIDDLE_TIP_EXT          = HandJointEXT 15
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_RING_METACARPAL_EXT"
pattern $bHAND_JOINT_RING_METACARPAL_EXT :: HandJointEXT
$mHAND_JOINT_RING_METACARPAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_RING_METACARPAL_EXT     = HandJointEXT 16
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_RING_PROXIMAL_EXT"
pattern $bHAND_JOINT_RING_PROXIMAL_EXT :: HandJointEXT
$mHAND_JOINT_RING_PROXIMAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_RING_PROXIMAL_EXT       = HandJointEXT 17
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_RING_INTERMEDIATE_EXT"
pattern $bHAND_JOINT_RING_INTERMEDIATE_EXT :: HandJointEXT
$mHAND_JOINT_RING_INTERMEDIATE_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_RING_INTERMEDIATE_EXT   = HandJointEXT 18
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_RING_DISTAL_EXT"
pattern $bHAND_JOINT_RING_DISTAL_EXT :: HandJointEXT
$mHAND_JOINT_RING_DISTAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_RING_DISTAL_EXT         = HandJointEXT 19
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_RING_TIP_EXT"
pattern $bHAND_JOINT_RING_TIP_EXT :: HandJointEXT
$mHAND_JOINT_RING_TIP_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_RING_TIP_EXT            = HandJointEXT 20
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_LITTLE_METACARPAL_EXT"
pattern $bHAND_JOINT_LITTLE_METACARPAL_EXT :: HandJointEXT
$mHAND_JOINT_LITTLE_METACARPAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_LITTLE_METACARPAL_EXT   = HandJointEXT 21
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_LITTLE_PROXIMAL_EXT"
pattern $bHAND_JOINT_LITTLE_PROXIMAL_EXT :: HandJointEXT
$mHAND_JOINT_LITTLE_PROXIMAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_LITTLE_PROXIMAL_EXT     = HandJointEXT 22
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT"
pattern $bHAND_JOINT_LITTLE_INTERMEDIATE_EXT :: HandJointEXT
$mHAND_JOINT_LITTLE_INTERMEDIATE_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_LITTLE_INTERMEDIATE_EXT = HandJointEXT 23
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_LITTLE_DISTAL_EXT"
pattern $bHAND_JOINT_LITTLE_DISTAL_EXT :: HandJointEXT
$mHAND_JOINT_LITTLE_DISTAL_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_LITTLE_DISTAL_EXT       = HandJointEXT 24
-- No documentation found for Nested "XrHandJointEXT" "XR_HAND_JOINT_LITTLE_TIP_EXT"
pattern $bHAND_JOINT_LITTLE_TIP_EXT :: HandJointEXT
$mHAND_JOINT_LITTLE_TIP_EXT :: forall r. HandJointEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_LITTLE_TIP_EXT          = HandJointEXT 25
{-# complete HAND_JOINT_PALM_EXT,
             HAND_JOINT_WRIST_EXT,
             HAND_JOINT_THUMB_METACARPAL_EXT,
             HAND_JOINT_THUMB_PROXIMAL_EXT,
             HAND_JOINT_THUMB_DISTAL_EXT,
             HAND_JOINT_THUMB_TIP_EXT,
             HAND_JOINT_INDEX_METACARPAL_EXT,
             HAND_JOINT_INDEX_PROXIMAL_EXT,
             HAND_JOINT_INDEX_INTERMEDIATE_EXT,
             HAND_JOINT_INDEX_DISTAL_EXT,
             HAND_JOINT_INDEX_TIP_EXT,
             HAND_JOINT_MIDDLE_METACARPAL_EXT,
             HAND_JOINT_MIDDLE_PROXIMAL_EXT,
             HAND_JOINT_MIDDLE_INTERMEDIATE_EXT,
             HAND_JOINT_MIDDLE_DISTAL_EXT,
             HAND_JOINT_MIDDLE_TIP_EXT,
             HAND_JOINT_RING_METACARPAL_EXT,
             HAND_JOINT_RING_PROXIMAL_EXT,
             HAND_JOINT_RING_INTERMEDIATE_EXT,
             HAND_JOINT_RING_DISTAL_EXT,
             HAND_JOINT_RING_TIP_EXT,
             HAND_JOINT_LITTLE_METACARPAL_EXT,
             HAND_JOINT_LITTLE_PROXIMAL_EXT,
             HAND_JOINT_LITTLE_INTERMEDIATE_EXT,
             HAND_JOINT_LITTLE_DISTAL_EXT,
             HAND_JOINT_LITTLE_TIP_EXT :: HandJointEXT #-}

conNameHandJointEXT :: String
conNameHandJointEXT :: String
conNameHandJointEXT = "HandJointEXT"

enumPrefixHandJointEXT :: String
enumPrefixHandJointEXT :: String
enumPrefixHandJointEXT = "HAND_JOINT_"

showTableHandJointEXT :: [(HandJointEXT, String)]
showTableHandJointEXT :: [(HandJointEXT, String)]
showTableHandJointEXT =
  [ (HandJointEXT
HAND_JOINT_PALM_EXT               , "PALM_EXT")
  , (HandJointEXT
HAND_JOINT_WRIST_EXT              , "WRIST_EXT")
  , (HandJointEXT
HAND_JOINT_THUMB_METACARPAL_EXT   , "THUMB_METACARPAL_EXT")
  , (HandJointEXT
HAND_JOINT_THUMB_PROXIMAL_EXT     , "THUMB_PROXIMAL_EXT")
  , (HandJointEXT
HAND_JOINT_THUMB_DISTAL_EXT       , "THUMB_DISTAL_EXT")
  , (HandJointEXT
HAND_JOINT_THUMB_TIP_EXT          , "THUMB_TIP_EXT")
  , (HandJointEXT
HAND_JOINT_INDEX_METACARPAL_EXT   , "INDEX_METACARPAL_EXT")
  , (HandJointEXT
HAND_JOINT_INDEX_PROXIMAL_EXT     , "INDEX_PROXIMAL_EXT")
  , (HandJointEXT
HAND_JOINT_INDEX_INTERMEDIATE_EXT , "INDEX_INTERMEDIATE_EXT")
  , (HandJointEXT
HAND_JOINT_INDEX_DISTAL_EXT       , "INDEX_DISTAL_EXT")
  , (HandJointEXT
HAND_JOINT_INDEX_TIP_EXT          , "INDEX_TIP_EXT")
  , (HandJointEXT
HAND_JOINT_MIDDLE_METACARPAL_EXT  , "MIDDLE_METACARPAL_EXT")
  , (HandJointEXT
HAND_JOINT_MIDDLE_PROXIMAL_EXT    , "MIDDLE_PROXIMAL_EXT")
  , (HandJointEXT
HAND_JOINT_MIDDLE_INTERMEDIATE_EXT, "MIDDLE_INTERMEDIATE_EXT")
  , (HandJointEXT
HAND_JOINT_MIDDLE_DISTAL_EXT      , "MIDDLE_DISTAL_EXT")
  , (HandJointEXT
HAND_JOINT_MIDDLE_TIP_EXT         , "MIDDLE_TIP_EXT")
  , (HandJointEXT
HAND_JOINT_RING_METACARPAL_EXT    , "RING_METACARPAL_EXT")
  , (HandJointEXT
HAND_JOINT_RING_PROXIMAL_EXT      , "RING_PROXIMAL_EXT")
  , (HandJointEXT
HAND_JOINT_RING_INTERMEDIATE_EXT  , "RING_INTERMEDIATE_EXT")
  , (HandJointEXT
HAND_JOINT_RING_DISTAL_EXT        , "RING_DISTAL_EXT")
  , (HandJointEXT
HAND_JOINT_RING_TIP_EXT           , "RING_TIP_EXT")
  , (HandJointEXT
HAND_JOINT_LITTLE_METACARPAL_EXT  , "LITTLE_METACARPAL_EXT")
  , (HandJointEXT
HAND_JOINT_LITTLE_PROXIMAL_EXT    , "LITTLE_PROXIMAL_EXT")
  , (HandJointEXT
HAND_JOINT_LITTLE_INTERMEDIATE_EXT, "LITTLE_INTERMEDIATE_EXT")
  , (HandJointEXT
HAND_JOINT_LITTLE_DISTAL_EXT      , "LITTLE_DISTAL_EXT")
  , (HandJointEXT
HAND_JOINT_LITTLE_TIP_EXT         , "LITTLE_TIP_EXT")
  ]

instance Show HandJointEXT where
  showsPrec :: Int -> HandJointEXT -> ShowS
showsPrec = String
-> [(HandJointEXT, String)]
-> String
-> (HandJointEXT -> Int32)
-> (Int32 -> ShowS)
-> Int
-> HandJointEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixHandJointEXT
                            [(HandJointEXT, String)]
showTableHandJointEXT
                            String
conNameHandJointEXT
                            (\(HandJointEXT x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read HandJointEXT where
  readPrec :: ReadPrec HandJointEXT
readPrec = String
-> [(HandJointEXT, String)]
-> String
-> (Int32 -> HandJointEXT)
-> ReadPrec HandJointEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixHandJointEXT [(HandJointEXT, String)]
showTableHandJointEXT String
conNameHandJointEXT Int32 -> HandJointEXT
HandJointEXT


-- | XrHandJointSetEXT - The set of hand joints to track.
--
-- == Enumerant Descriptions
--
-- = See Also
--
-- 'HandTrackerCreateInfoEXT'
newtype HandJointSetEXT = HandJointSetEXT Int32
  deriving newtype (HandJointSetEXT -> HandJointSetEXT -> Bool
(HandJointSetEXT -> HandJointSetEXT -> Bool)
-> (HandJointSetEXT -> HandJointSetEXT -> Bool)
-> Eq HandJointSetEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c/= :: HandJointSetEXT -> HandJointSetEXT -> Bool
== :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c== :: HandJointSetEXT -> HandJointSetEXT -> Bool
Eq, Eq HandJointSetEXT
Eq HandJointSetEXT =>
(HandJointSetEXT -> HandJointSetEXT -> Ordering)
-> (HandJointSetEXT -> HandJointSetEXT -> Bool)
-> (HandJointSetEXT -> HandJointSetEXT -> Bool)
-> (HandJointSetEXT -> HandJointSetEXT -> Bool)
-> (HandJointSetEXT -> HandJointSetEXT -> Bool)
-> (HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT)
-> (HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT)
-> Ord HandJointSetEXT
HandJointSetEXT -> HandJointSetEXT -> Bool
HandJointSetEXT -> HandJointSetEXT -> Ordering
HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT
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 :: HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT
$cmin :: HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT
max :: HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT
$cmax :: HandJointSetEXT -> HandJointSetEXT -> HandJointSetEXT
>= :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c>= :: HandJointSetEXT -> HandJointSetEXT -> Bool
> :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c> :: HandJointSetEXT -> HandJointSetEXT -> Bool
<= :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c<= :: HandJointSetEXT -> HandJointSetEXT -> Bool
< :: HandJointSetEXT -> HandJointSetEXT -> Bool
$c< :: HandJointSetEXT -> HandJointSetEXT -> Bool
compare :: HandJointSetEXT -> HandJointSetEXT -> Ordering
$ccompare :: HandJointSetEXT -> HandJointSetEXT -> Ordering
$cp1Ord :: Eq HandJointSetEXT
Ord, Ptr b -> Int -> IO HandJointSetEXT
Ptr b -> Int -> HandJointSetEXT -> IO ()
Ptr HandJointSetEXT -> IO HandJointSetEXT
Ptr HandJointSetEXT -> Int -> IO HandJointSetEXT
Ptr HandJointSetEXT -> Int -> HandJointSetEXT -> IO ()
Ptr HandJointSetEXT -> HandJointSetEXT -> IO ()
HandJointSetEXT -> Int
(HandJointSetEXT -> Int)
-> (HandJointSetEXT -> Int)
-> (Ptr HandJointSetEXT -> Int -> IO HandJointSetEXT)
-> (Ptr HandJointSetEXT -> Int -> HandJointSetEXT -> IO ())
-> (forall b. Ptr b -> Int -> IO HandJointSetEXT)
-> (forall b. Ptr b -> Int -> HandJointSetEXT -> IO ())
-> (Ptr HandJointSetEXT -> IO HandJointSetEXT)
-> (Ptr HandJointSetEXT -> HandJointSetEXT -> IO ())
-> Storable HandJointSetEXT
forall b. Ptr b -> Int -> IO HandJointSetEXT
forall b. Ptr b -> Int -> HandJointSetEXT -> 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 HandJointSetEXT -> HandJointSetEXT -> IO ()
$cpoke :: Ptr HandJointSetEXT -> HandJointSetEXT -> IO ()
peek :: Ptr HandJointSetEXT -> IO HandJointSetEXT
$cpeek :: Ptr HandJointSetEXT -> IO HandJointSetEXT
pokeByteOff :: Ptr b -> Int -> HandJointSetEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> HandJointSetEXT -> IO ()
peekByteOff :: Ptr b -> Int -> IO HandJointSetEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO HandJointSetEXT
pokeElemOff :: Ptr HandJointSetEXT -> Int -> HandJointSetEXT -> IO ()
$cpokeElemOff :: Ptr HandJointSetEXT -> Int -> HandJointSetEXT -> IO ()
peekElemOff :: Ptr HandJointSetEXT -> Int -> IO HandJointSetEXT
$cpeekElemOff :: Ptr HandJointSetEXT -> Int -> IO HandJointSetEXT
alignment :: HandJointSetEXT -> Int
$calignment :: HandJointSetEXT -> Int
sizeOf :: HandJointSetEXT -> Int
$csizeOf :: HandJointSetEXT -> Int
Storable, HandJointSetEXT
HandJointSetEXT -> Zero HandJointSetEXT
forall a. a -> Zero a
zero :: HandJointSetEXT
$czero :: HandJointSetEXT
Zero)

-- | 'HAND_JOINT_SET_DEFAULT_EXT' indicates that the created
-- 'OpenXR.Extensions.Handles.HandTrackerEXT' tracks the set of hand joints
-- described by 'HandJointEXT' enum, i.e. the 'locateHandJointsEXT'
-- function returns an array of joint locations with the count of
-- 'OpenXR.Core10.APIConstants.HAND_JOINT_COUNT_EXT' and can be indexed
-- using 'HandJointEXT'.
pattern $bHAND_JOINT_SET_DEFAULT_EXT :: HandJointSetEXT
$mHAND_JOINT_SET_DEFAULT_EXT :: forall r. HandJointSetEXT -> (Void# -> r) -> (Void# -> r) -> r
HAND_JOINT_SET_DEFAULT_EXT = HandJointSetEXT 0
{-# complete HAND_JOINT_SET_DEFAULT_EXT :: HandJointSetEXT #-}

conNameHandJointSetEXT :: String
conNameHandJointSetEXT :: String
conNameHandJointSetEXT = "HandJointSetEXT"

enumPrefixHandJointSetEXT :: String
enumPrefixHandJointSetEXT :: String
enumPrefixHandJointSetEXT = "HAND_JOINT_SET_DEFAULT_EXT"

showTableHandJointSetEXT :: [(HandJointSetEXT, String)]
showTableHandJointSetEXT :: [(HandJointSetEXT, String)]
showTableHandJointSetEXT = [(HandJointSetEXT
HAND_JOINT_SET_DEFAULT_EXT, "")]

instance Show HandJointSetEXT where
  showsPrec :: Int -> HandJointSetEXT -> ShowS
showsPrec = String
-> [(HandJointSetEXT, String)]
-> String
-> (HandJointSetEXT -> Int32)
-> (Int32 -> ShowS)
-> Int
-> HandJointSetEXT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixHandJointSetEXT
                            [(HandJointSetEXT, String)]
showTableHandJointSetEXT
                            String
conNameHandJointSetEXT
                            (\(HandJointSetEXT x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read HandJointSetEXT where
  readPrec :: ReadPrec HandJointSetEXT
readPrec = String
-> [(HandJointSetEXT, String)]
-> String
-> (Int32 -> HandJointSetEXT)
-> ReadPrec HandJointSetEXT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixHandJointSetEXT [(HandJointSetEXT, String)]
showTableHandJointSetEXT String
conNameHandJointSetEXT Int32 -> HandJointSetEXT
HandJointSetEXT


type EXT_hand_tracking_SPEC_VERSION = 2

-- No documentation found for TopLevel "XR_EXT_hand_tracking_SPEC_VERSION"
pattern EXT_hand_tracking_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_hand_tracking_SPEC_VERSION :: a
$mEXT_hand_tracking_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_hand_tracking_SPEC_VERSION = 2


type EXT_HAND_TRACKING_EXTENSION_NAME = "XR_EXT_hand_tracking"

-- No documentation found for TopLevel "XR_EXT_HAND_TRACKING_EXTENSION_NAME"
pattern EXT_HAND_TRACKING_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_HAND_TRACKING_EXTENSION_NAME :: a
$mEXT_HAND_TRACKING_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_HAND_TRACKING_EXTENSION_NAME = "XR_EXT_hand_tracking"