{-# language CPP #-}
-- | = Name
--
-- XR_EXT_thermal_query - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_thermal_query  XR_EXT_thermal_query>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 17
--
-- = Revision
--
-- 1
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsDomainEXT',
-- 'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsNotificationLevelEXT',
-- 'thermalGetTemperatureTrendEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_thermal_query 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_thermal_query  ( thermalGetTemperatureTrendEXT
                                               , EXT_thermal_query_SPEC_VERSION
                                               , pattern EXT_thermal_query_SPEC_VERSION
                                               , EXT_THERMAL_QUERY_EXTENSION_NAME
                                               , pattern EXT_THERMAL_QUERY_EXTENSION_NAME
                                               , PerfSettingsDomainEXT(..)
                                               , PerfSettingsNotificationLevelEXT(..)
                                               ) where

import OpenXR.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Foreign.C.Types (CFloat(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(..))
import Foreign.Storable (Storable(peek))
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.NamedType ((:::))
import OpenXR.Dynamic (InstanceCmds(pXrThermalGetTemperatureTrendEXT))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsDomainEXT)
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsDomainEXT(..))
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsNotificationLevelEXT)
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsNotificationLevelEXT(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Handles (Session)
import OpenXR.Core10.Handles (Session(..))
import OpenXR.Core10.Handles (Session_T)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsDomainEXT(..))
import OpenXR.Extensions.XR_EXT_performance_settings (PerfSettingsNotificationLevelEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrThermalGetTemperatureTrendEXT
  :: FunPtr (Ptr Session_T -> PerfSettingsDomainEXT -> Ptr PerfSettingsNotificationLevelEXT -> Ptr CFloat -> Ptr CFloat -> IO Result) -> Ptr Session_T -> PerfSettingsDomainEXT -> Ptr PerfSettingsNotificationLevelEXT -> Ptr CFloat -> Ptr CFloat -> IO Result

-- | xrThermalGetTemperatureTrendEXT - xrThermalGetTemperatureTrendEXT
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-extension-notenabled# The @@
--     extension /must/ be enabled prior to calling
--     'thermalGetTemperatureTrendEXT'
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-session-parameter# @session@
--     /must/ be a valid 'OpenXR.Core10.Handles.Session' handle
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-domain-parameter# @domain@
--     /must/ be a valid
--     'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsDomainEXT'
--     value
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-notificationLevel-parameter#
--     @notificationLevel@ /must/ be a pointer to an
--     'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsNotificationLevelEXT'
--     value
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-tempHeadroom-parameter#
--     @tempHeadroom@ /must/ be a pointer to a @float@ value
--
-- -   #VUID-xrThermalGetTemperatureTrendEXT-tempSlope-parameter#
--     @tempSlope@ /must/ be a pointer to a @float@ value
--
-- == 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_SESSION_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsDomainEXT',
-- 'OpenXR.Extensions.XR_EXT_performance_settings.PerfSettingsNotificationLevelEXT',
-- 'OpenXR.Core10.Handles.Session'
thermalGetTemperatureTrendEXT :: forall io
                               . (MonadIO io)
                              => -- | @session@ is a valid 'OpenXR.Core10.Handles.Session' handle.
                                 Session
                              -> -- | @domain@ : the processing domain
                                 PerfSettingsDomainEXT
                              -> io (Result, PerfSettingsNotificationLevelEXT, ("tempHeadroom" ::: Float), ("tempSlope" ::: Float))
thermalGetTemperatureTrendEXT :: Session
-> PerfSettingsDomainEXT
-> io
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
thermalGetTemperatureTrendEXT session :: Session
session domain :: PerfSettingsDomainEXT
domain = IO
  (Result, PerfSettingsNotificationLevelEXT,
   "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> io
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO
   (Result, PerfSettingsNotificationLevelEXT,
    "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
 -> io
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> (ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> io
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result, PerfSettingsNotificationLevelEXT,
   "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
  IO
  (Result, PerfSettingsNotificationLevelEXT,
   "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result, PerfSettingsNotificationLevelEXT,
    "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
   IO
   (Result, PerfSettingsNotificationLevelEXT,
    "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
 -> io
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> io
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall a b. (a -> b) -> a -> b
$ do
  let xrThermalGetTemperatureTrendEXTPtr :: FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> IO Result)
xrThermalGetTemperatureTrendEXTPtr = InstanceCmds
-> FunPtr
     (Ptr Session_T
      -> PerfSettingsDomainEXT
      -> Ptr PerfSettingsNotificationLevelEXT
      -> ("tempHeadroom" ::: Ptr CFloat)
      -> ("tempHeadroom" ::: Ptr CFloat)
      -> IO Result)
pXrThermalGetTemperatureTrendEXT (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
  IO ()
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      ())
-> IO ()
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> IO Result)
xrThermalGetTemperatureTrendEXTPtr FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> IO Result)
-> FunPtr
     (Ptr Session_T
      -> PerfSettingsDomainEXT
      -> Ptr PerfSettingsNotificationLevelEXT
      -> ("tempHeadroom" ::: Ptr CFloat)
      -> ("tempHeadroom" ::: Ptr CFloat)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> 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 xrThermalGetTemperatureTrendEXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrThermalGetTemperatureTrendEXT' :: Ptr Session_T
-> PerfSettingsDomainEXT
-> Ptr PerfSettingsNotificationLevelEXT
-> ("tempHeadroom" ::: Ptr CFloat)
-> ("tempHeadroom" ::: Ptr CFloat)
-> IO Result
xrThermalGetTemperatureTrendEXT' = FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> IO Result)
-> Ptr Session_T
-> PerfSettingsDomainEXT
-> Ptr PerfSettingsNotificationLevelEXT
-> ("tempHeadroom" ::: Ptr CFloat)
-> ("tempHeadroom" ::: Ptr CFloat)
-> IO Result
mkXrThermalGetTemperatureTrendEXT FunPtr
  (Ptr Session_T
   -> PerfSettingsDomainEXT
   -> Ptr PerfSettingsNotificationLevelEXT
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> ("tempHeadroom" ::: Ptr CFloat)
   -> IO Result)
xrThermalGetTemperatureTrendEXTPtr
  Ptr PerfSettingsNotificationLevelEXT
pNotificationLevel <- ((Ptr PerfSettingsNotificationLevelEXT
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> IO
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Ptr PerfSettingsNotificationLevelEXT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PerfSettingsNotificationLevelEXT
   -> IO
        (Result, PerfSettingsNotificationLevelEXT,
         "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      (Ptr PerfSettingsNotificationLevelEXT))
-> ((Ptr PerfSettingsNotificationLevelEXT
     -> IO
          (Result, PerfSettingsNotificationLevelEXT,
           "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Ptr PerfSettingsNotificationLevelEXT)
forall a b. (a -> b) -> a -> b
$ IO (Ptr PerfSettingsNotificationLevelEXT)
-> (Ptr PerfSettingsNotificationLevelEXT -> IO ())
-> (Ptr PerfSettingsNotificationLevelEXT
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO (Ptr PerfSettingsNotificationLevelEXT)
forall a. Int -> IO (Ptr a)
callocBytes @PerfSettingsNotificationLevelEXT 4) Ptr PerfSettingsNotificationLevelEXT -> IO ()
forall a. Ptr a -> IO ()
free
  "tempHeadroom" ::: Ptr CFloat
pTempHeadroom <- ((("tempHeadroom" ::: Ptr CFloat)
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> IO
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ("tempHeadroom" ::: Ptr CFloat)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("tempHeadroom" ::: Ptr CFloat)
   -> IO
        (Result, PerfSettingsNotificationLevelEXT,
         "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      ("tempHeadroom" ::: Ptr CFloat))
-> ((("tempHeadroom" ::: Ptr CFloat)
     -> IO
          (Result, PerfSettingsNotificationLevelEXT,
           "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ("tempHeadroom" ::: Ptr CFloat)
forall a b. (a -> b) -> a -> b
$ IO ("tempHeadroom" ::: Ptr CFloat)
-> (("tempHeadroom" ::: Ptr CFloat) -> IO ())
-> (("tempHeadroom" ::: Ptr CFloat)
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("tempHeadroom" ::: Ptr CFloat)
forall a. Int -> IO (Ptr a)
callocBytes @CFloat 4) ("tempHeadroom" ::: Ptr CFloat) -> IO ()
forall a. Ptr a -> IO ()
free
  "tempHeadroom" ::: Ptr CFloat
pTempSlope <- ((("tempHeadroom" ::: Ptr CFloat)
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> IO
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ("tempHeadroom" ::: Ptr CFloat)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("tempHeadroom" ::: Ptr CFloat)
   -> IO
        (Result, PerfSettingsNotificationLevelEXT,
         "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
  -> IO
       (Result, PerfSettingsNotificationLevelEXT,
        "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      ("tempHeadroom" ::: Ptr CFloat))
-> ((("tempHeadroom" ::: Ptr CFloat)
     -> IO
          (Result, PerfSettingsNotificationLevelEXT,
           "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ("tempHeadroom" ::: Ptr CFloat)
forall a b. (a -> b) -> a -> b
$ IO ("tempHeadroom" ::: Ptr CFloat)
-> (("tempHeadroom" ::: Ptr CFloat) -> IO ())
-> (("tempHeadroom" ::: Ptr CFloat)
    -> IO
         (Result, PerfSettingsNotificationLevelEXT,
          "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("tempHeadroom" ::: Ptr CFloat)
forall a. Int -> IO (Ptr a)
callocBytes @CFloat 4) ("tempHeadroom" ::: Ptr CFloat) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      Result)
-> IO Result
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrThermalGetTemperatureTrendEXT" (Ptr Session_T
-> PerfSettingsDomainEXT
-> Ptr PerfSettingsNotificationLevelEXT
-> ("tempHeadroom" ::: Ptr CFloat)
-> ("tempHeadroom" ::: Ptr CFloat)
-> IO Result
xrThermalGetTemperatureTrendEXT' (Session -> Ptr Session_T
sessionHandle (Session
session)) (PerfSettingsDomainEXT
domain) (Ptr PerfSettingsNotificationLevelEXT
pNotificationLevel) ("tempHeadroom" ::: Ptr CFloat
pTempHeadroom) ("tempHeadroom" ::: Ptr CFloat
pTempSlope))
  IO ()
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      ())
-> IO ()
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     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))
  PerfSettingsNotificationLevelEXT
notificationLevel <- IO PerfSettingsNotificationLevelEXT
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     PerfSettingsNotificationLevelEXT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO PerfSettingsNotificationLevelEXT
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      PerfSettingsNotificationLevelEXT)
-> IO PerfSettingsNotificationLevelEXT
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     PerfSettingsNotificationLevelEXT
forall a b. (a -> b) -> a -> b
$ Ptr PerfSettingsNotificationLevelEXT
-> IO PerfSettingsNotificationLevelEXT
forall a. Storable a => Ptr a -> IO a
peek @PerfSettingsNotificationLevelEXT Ptr PerfSettingsNotificationLevelEXT
pNotificationLevel
  CFloat
tempHeadroom <- IO CFloat
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     CFloat
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CFloat
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      CFloat)
-> IO CFloat
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     CFloat
forall a b. (a -> b) -> a -> b
$ ("tempHeadroom" ::: Ptr CFloat) -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat "tempHeadroom" ::: Ptr CFloat
pTempHeadroom
  CFloat
tempSlope <- IO CFloat
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     CFloat
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO CFloat
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      CFloat)
-> IO CFloat
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     CFloat
forall a b. (a -> b) -> a -> b
$ ("tempHeadroom" ::: Ptr CFloat) -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat "tempHeadroom" ::: Ptr CFloat
pTempSlope
  (Result, PerfSettingsNotificationLevelEXT,
 "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, PerfSettingsNotificationLevelEXT,
  "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
 -> ContT
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
      IO
      (Result, PerfSettingsNotificationLevelEXT,
       "tempHeadroom" ::: Float, "tempHeadroom" ::: Float))
-> (Result, PerfSettingsNotificationLevelEXT,
    "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
-> ContT
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
     IO
     (Result, PerfSettingsNotificationLevelEXT,
      "tempHeadroom" ::: Float, "tempHeadroom" ::: Float)
forall a b. (a -> b) -> a -> b
$ (Result
r, PerfSettingsNotificationLevelEXT
notificationLevel, (CFloat -> "tempHeadroom" ::: Float
forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
tempHeadroom), (CFloat -> "tempHeadroom" ::: Float
forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
tempSlope))


type EXT_thermal_query_SPEC_VERSION = 1

-- No documentation found for TopLevel "XR_EXT_thermal_query_SPEC_VERSION"
pattern EXT_thermal_query_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_thermal_query_SPEC_VERSION :: a
$mEXT_thermal_query_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_thermal_query_SPEC_VERSION = 1


type EXT_THERMAL_QUERY_EXTENSION_NAME = "XR_EXT_thermal_query"

-- No documentation found for TopLevel "XR_EXT_THERMAL_QUERY_EXTENSION_NAME"
pattern EXT_THERMAL_QUERY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_THERMAL_QUERY_EXTENSION_NAME :: a
$mEXT_THERMAL_QUERY_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_THERMAL_QUERY_EXTENSION_NAME = "XR_EXT_thermal_query"