{-# language CPP #-}
-- | = Name
--
-- VK_KHR_xlib_surface - instance extension
--
-- == VK_KHR_xlib_surface
--
-- [__Name String__]
--     @VK_KHR_xlib_surface@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     5
--
-- [__Revision__]
--     6
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_KHR_surface@
--
-- [__Contact__]
--
--     -   Jesse Hall
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_xlib_surface:%20&body=@critsec%20 >
--
--     -   Ian Elliott
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_xlib_surface:%20&body=@ianelliottus%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2015-11-28
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Patrick Doane, Blizzard
--
--     -   Jason Ekstrand, Intel
--
--     -   Ian Elliott, LunarG
--
--     -   Courtney Goeltzenleuchter, LunarG
--
--     -   Jesse Hall, Google
--
--     -   James Jones, NVIDIA
--
--     -   Antoine Labour, Google
--
--     -   Jon Leech, Khronos
--
--     -   David Mao, AMD
--
--     -   Norbert Nopper, Freescale
--
--     -   Alon Or-bach, Samsung
--
--     -   Daniel Rakos, AMD
--
--     -   Graham Sellers, AMD
--
--     -   Ray Smith, ARM
--
--     -   Jeff Vigil, Qualcomm
--
--     -   Chia-I Wu, LunarG
--
-- == Description
--
-- The @VK_KHR_xlib_surface@ extension is an instance extension. It
-- provides a mechanism to create a 'Vulkan.Extensions.Handles.SurfaceKHR'
-- object (defined by the @VK_KHR_surface@ extension) that refers to an X11
-- 'Window', using the Xlib client-side library, as well as a query to
-- determine support for rendering via Xlib.
--
-- == New Commands
--
-- -   'createXlibSurfaceKHR'
--
-- -   'getPhysicalDeviceXlibPresentationSupportKHR'
--
-- == New Structures
--
-- -   'XlibSurfaceCreateInfoKHR'
--
-- == New Bitmasks
--
-- -   'XlibSurfaceCreateFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_XLIB_SURFACE_EXTENSION_NAME'
--
-- -   'KHR_XLIB_SURFACE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR'
--
-- == Issues
--
-- 1) Does X11 need a way to query for compatibility between a particular
-- physical device and a specific screen? This would be a more general
-- query than
-- 'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR';
-- if it returned 'Vulkan.Core10.FundamentalTypes.TRUE', then the physical
-- device could be assumed to support presentation to any window on that
-- screen.
--
-- __RESOLVED__: Yes, this is needed for toolkits that want to create a
-- 'Vulkan.Core10.Handles.Device' before creating a window. To ensure the
-- query is reliable, it must be made against a particular X visual rather
-- than the screen in general.
--
-- == Version History
--
-- -   Revision 1, 2015-09-23 (Jesse Hall)
--
--     -   Initial draft, based on the previous contents of
--         VK_EXT_KHR_swapchain (later renamed VK_EXT_KHR_surface).
--
-- -   Revision 2, 2015-10-02 (James Jones)
--
--     -   Added presentation support query for (Display*, VisualID) pair.
--
--     -   Removed \"root\" parameter from CreateXlibSurfaceKHR(), as it is
--         redundant when a window on the same screen is specified as well.
--
--     -   Added appropriate X errors.
--
--     -   Adjusted wording of issue #1 and added agreed upon resolution.
--
-- -   Revision 3, 2015-10-14 (Ian Elliott)
--
--     -   Renamed this extension from VK_EXT_KHR_x11_surface to
--         VK_EXT_KHR_xlib_surface.
--
-- -   Revision 4, 2015-10-26 (Ian Elliott)
--
--     -   Renamed from VK_EXT_KHR_xlib_surface to VK_KHR_xlib_surface.
--
-- -   Revision 5, 2015-11-03 (Daniel Rakos)
--
--     -   Added allocation callbacks to vkCreateXlibSurfaceKHR.
--
-- -   Revision 6, 2015-11-28 (Daniel Rakos)
--
--     -   Updated the surface create function to take a pCreateInfo
--         structure.
--
-- = See Also
--
-- 'XlibSurfaceCreateFlagsKHR', 'XlibSurfaceCreateInfoKHR',
-- 'createXlibSurfaceKHR', 'getPhysicalDeviceXlibPresentationSupportKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_xlib_surface Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_xlib_surface  ( createXlibSurfaceKHR
                                              , getPhysicalDeviceXlibPresentationSupportKHR
                                              , XlibSurfaceCreateInfoKHR(..)
                                              , XlibSurfaceCreateFlagsKHR(..)
                                              , KHR_XLIB_SURFACE_SPEC_VERSION
                                              , pattern KHR_XLIB_SURFACE_SPEC_VERSION
                                              , KHR_XLIB_SURFACE_EXTENSION_NAME
                                              , pattern KHR_XLIB_SURFACE_EXTENSION_NAME
                                              , Display
                                              , VisualID
                                              , Window
                                              , SurfaceKHR(..)
                                              ) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Bool32(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Dynamic (InstanceCmds(pVkCreateXlibSurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceXlibPresentationSupportKHR))
import Vulkan.Core10.Handles (Instance_T)
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (SurfaceKHR)
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateXlibSurfaceKHR
  :: FunPtr (Ptr Instance_T -> Ptr XlibSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr XlibSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result

-- | vkCreateXlibSurfaceKHR - Create a 'Vulkan.Extensions.Handles.SurfaceKHR'
-- object for an X11 window, using the Xlib client-side library
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateXlibSurfaceKHR-instance-parameter# @instance@ /must/
--     be a valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   #VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'XlibSurfaceCreateInfoKHR'
--     structure
--
-- -   #VUID-vkCreateXlibSurfaceKHR-pAllocator-parameter# If @pAllocator@
--     is not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateXlibSurfaceKHR-pSurface-parameter# @pSurface@ /must/
--     be a valid pointer to a 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Instance',
-- 'Vulkan.Extensions.Handles.SurfaceKHR', 'XlibSurfaceCreateInfoKHR'
createXlibSurfaceKHR :: forall io
                      . (MonadIO io)
                     => -- | @instance@ is the instance to associate the surface with.
                        Instance
                     -> -- | @pCreateInfo@ is a pointer to a 'XlibSurfaceCreateInfoKHR' structure
                        -- containing the parameters affecting the creation of the surface object.
                        XlibSurfaceCreateInfoKHR
                     -> -- | @pAllocator@ is the allocator used for host memory allocated for the
                        -- surface object when there is no more specific allocator available (see
                        -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
                        ("allocator" ::: Maybe AllocationCallbacks)
                     -> io (SurfaceKHR)
createXlibSurfaceKHR :: Instance
-> XlibSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createXlibSurfaceKHR instance' :: Instance
instance' createInfo :: XlibSurfaceCreateInfoKHR
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO SurfaceKHR -> io SurfaceKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SurfaceKHR -> io SurfaceKHR)
-> (ContT SurfaceKHR IO SurfaceKHR -> IO SurfaceKHR)
-> ContT SurfaceKHR IO SurfaceKHR
-> io SurfaceKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT SurfaceKHR IO SurfaceKHR -> IO SurfaceKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT SurfaceKHR IO SurfaceKHR -> io SurfaceKHR)
-> ContT SurfaceKHR IO SurfaceKHR -> io SurfaceKHR
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateXlibSurfaceKHRPtr :: FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateXlibSurfaceKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
pVkCreateXlibSurfaceKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT SurfaceKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SurfaceKHR IO ())
-> IO () -> ContT SurfaceKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateXlibSurfaceKHRPtr FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> 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 vkCreateXlibSurfaceKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateXlibSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXlibSurfaceKHR' = FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateXlibSurfaceKHR FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateXlibSurfaceKHRPtr
  "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
pCreateInfo <- ((("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
  -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
   -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT
      SurfaceKHR IO ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR))
-> ((("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
     -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ XlibSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
    -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (XlibSurfaceCreateInfoKHR
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pSurface" ::: Ptr SurfaceKHR
pPSurface <- ((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR))
-> ((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR)
forall a b. (a -> b) -> a -> b
$ IO ("pSurface" ::: Ptr SurfaceKHR)
-> (("pSurface" ::: Ptr SurfaceKHR) -> IO ())
-> (("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pSurface" ::: Ptr SurfaceKHR)
forall a. Int -> IO (Ptr a)
callocBytes @SurfaceKHR 8) ("pSurface" ::: Ptr SurfaceKHR) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT SurfaceKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT SurfaceKHR IO Result)
-> IO Result -> ContT SurfaceKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateXlibSurfaceKHR" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXlibSurfaceKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pSurface" ::: Ptr SurfaceKHR
pPSurface))
  IO () -> ContT SurfaceKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SurfaceKHR IO ())
-> IO () -> ContT SurfaceKHR 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) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  SurfaceKHR
pSurface <- IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR)
-> IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall a b. (a -> b) -> a -> b
$ ("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR
forall a. Storable a => Ptr a -> IO a
peek @SurfaceKHR "pSurface" ::: Ptr SurfaceKHR
pPSurface
  SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR)
-> SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall a b. (a -> b) -> a -> b
$ (SurfaceKHR
pSurface)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDeviceXlibPresentationSupportKHR
  :: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr Display -> VisualID -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr Display -> VisualID -> IO Bool32

-- | vkGetPhysicalDeviceXlibPresentationSupportKHR - Query physical device
-- for presentation to X11 server using Xlib
--
-- = Description
--
-- This platform-specific function /can/ be called prior to creating a
-- surface.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceXlibPresentationSupportKHR :: forall io
                                             . (MonadIO io)
                                            => -- | @physicalDevice@ is the physical device.
                                               --
                                               -- #VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-physicalDevice-parameter#
                                               -- @physicalDevice@ /must/ be a valid
                                               -- 'Vulkan.Core10.Handles.PhysicalDevice' handle
                                               PhysicalDevice
                                            -> -- | @queueFamilyIndex@ is the queue family index.
                                               --
                                               -- #VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-queueFamilyIndex-01315#
                                               -- @queueFamilyIndex@ /must/ be less than @pQueueFamilyPropertyCount@
                                               -- returned by
                                               -- 'Vulkan.Core10.DeviceInitialization.getPhysicalDeviceQueueFamilyProperties'
                                               -- for the given @physicalDevice@
                                               ("queueFamilyIndex" ::: Word32)
                                            -> -- | @dpy@ is a pointer to an Xlib 'Display' connection to the server.
                                               --
                                               -- #VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter# @dpy@
                                               -- /must/ be a valid pointer to a 'Display' value
                                               ("dpy" ::: Ptr Display)
                                            -> -- No documentation found for Nested "vkGetPhysicalDeviceXlibPresentationSupportKHR" "visualID"
                                               VisualID
                                            -> io (Bool)
getPhysicalDeviceXlibPresentationSupportKHR :: PhysicalDevice
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> io Bool
getPhysicalDeviceXlibPresentationSupportKHR physicalDevice :: PhysicalDevice
physicalDevice queueFamilyIndex :: "queueFamilyIndex" ::: Word32
queueFamilyIndex dpy :: "dpy" ::: Ptr Display
dpy visualID :: VisualID
visualID = IO Bool -> io Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> io Bool) -> IO Bool -> io Bool
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceXlibPresentationSupportKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("queueFamilyIndex" ::: Word32)
      -> ("dpy" ::: Ptr Display)
      -> VisualID
      -> IO Bool32)
pVkGetPhysicalDeviceXlibPresentationSupportKHR (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("queueFamilyIndex" ::: Word32)
      -> ("dpy" ::: Ptr Display)
      -> VisualID
      -> IO Bool32)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
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 vkGetPhysicalDeviceXlibPresentationSupportKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceXlibPresentationSupportKHR' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
vkGetPhysicalDeviceXlibPresentationSupportKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
mkVkGetPhysicalDeviceXlibPresentationSupportKHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32)
   -> ("dpy" ::: Ptr Display)
   -> VisualID
   -> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr
  Bool32
r <- String -> IO Bool32 -> IO Bool32
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPhysicalDeviceXlibPresentationSupportKHR" (Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
vkGetPhysicalDeviceXlibPresentationSupportKHR' (PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)) ("queueFamilyIndex" ::: Word32
queueFamilyIndex) ("dpy" ::: Ptr Display
dpy) (VisualID
visualID))
  Bool -> IO Bool
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Bool -> IO Bool) -> Bool -> IO Bool
forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))


-- | VkXlibSurfaceCreateInfoKHR - Structure specifying parameters of a newly
-- created Xlib surface object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'XlibSurfaceCreateFlagsKHR', 'createXlibSurfaceKHR'
data XlibSurfaceCreateInfoKHR = XlibSurfaceCreateInfoKHR
  { -- | @flags@ is reserved for future use.
    --
    -- #VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask# @flags@ /must/ be
    -- @0@
    XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateFlagsKHR
flags :: XlibSurfaceCreateFlagsKHR
  , -- | @dpy@ is a pointer to an Xlib 'Display' connection to the X server.
    --
    -- #VUID-VkXlibSurfaceCreateInfoKHR-dpy-01313# @dpy@ /must/ point to a
    -- valid Xlib 'Display'
    XlibSurfaceCreateInfoKHR -> "dpy" ::: Ptr Display
dpy :: Ptr Display
  , -- | @window@ is an Xlib 'Window' to associate the surface with.
    --
    -- #VUID-VkXlibSurfaceCreateInfoKHR-window-01314# @window@ /must/ be a
    -- valid Xlib 'Window'
    XlibSurfaceCreateInfoKHR -> VisualID
window :: Window
  }
  deriving (Typeable, XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
(XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool)
-> (XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool)
-> Eq XlibSurfaceCreateInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
$c/= :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
== :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
$c== :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (XlibSurfaceCreateInfoKHR)
#endif
deriving instance Show XlibSurfaceCreateInfoKHR

instance ToCStruct XlibSurfaceCreateInfoKHR where
  withCStruct :: XlibSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct x :: XlibSurfaceCreateInfoKHR
x f :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p -> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> XlibSurfaceCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p XlibSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> XlibSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p XlibSurfaceCreateInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR)
    ("dpy" ::: Ptr Display) -> Display -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> "dpy" ::: Ptr Display
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Display
forall a. Ptr a
nullPtr)
    Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr XlibSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr XlibSurfaceCreateFlagsKHR)) (XlibSurfaceCreateFlagsKHR
flags)
    Ptr ("dpy" ::: Ptr Display) -> ("dpy" ::: Ptr Display) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr ("dpy" ::: Ptr Display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Display))) ("dpy" ::: Ptr Display
dpy)
    Ptr VisualID -> VisualID -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr VisualID
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Window)) (VisualID
window)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR)
    ("dpy" ::: Ptr Display) -> Display -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> "dpy" ::: Ptr Display
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Display
forall a. Ptr a
nullPtr)
    Ptr ("dpy" ::: Ptr Display) -> ("dpy" ::: Ptr Display) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr ("dpy" ::: Ptr Display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Display))) ("dpy" ::: Ptr Display
forall a. Zero a => a
zero)
    Ptr VisualID -> VisualID -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr VisualID
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Window)) (VisualID
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct XlibSurfaceCreateInfoKHR where
  peekCStruct :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> IO XlibSurfaceCreateInfoKHR
peekCStruct p :: "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p = do
    XlibSurfaceCreateFlagsKHR
flags <- Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
forall a. Storable a => Ptr a -> IO a
peek @XlibSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr XlibSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr XlibSurfaceCreateFlagsKHR))
    "dpy" ::: Ptr Display
dpy <- Ptr ("dpy" ::: Ptr Display) -> IO ("dpy" ::: Ptr Display)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Display) (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr ("dpy" ::: Ptr Display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Display)))
    VisualID
window <- Ptr VisualID -> IO VisualID
forall a. Storable a => Ptr a -> IO a
peek @Window (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> Int -> Ptr VisualID
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Window))
    XlibSurfaceCreateInfoKHR -> IO XlibSurfaceCreateInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (XlibSurfaceCreateInfoKHR -> IO XlibSurfaceCreateInfoKHR)
-> XlibSurfaceCreateInfoKHR -> IO XlibSurfaceCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ XlibSurfaceCreateFlagsKHR
-> ("dpy" ::: Ptr Display) -> VisualID -> XlibSurfaceCreateInfoKHR
XlibSurfaceCreateInfoKHR
             XlibSurfaceCreateFlagsKHR
flags "dpy" ::: Ptr Display
dpy VisualID
window

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

instance Zero XlibSurfaceCreateInfoKHR where
  zero :: XlibSurfaceCreateInfoKHR
zero = XlibSurfaceCreateFlagsKHR
-> ("dpy" ::: Ptr Display) -> VisualID -> XlibSurfaceCreateInfoKHR
XlibSurfaceCreateInfoKHR
           XlibSurfaceCreateFlagsKHR
forall a. Zero a => a
zero
           "dpy" ::: Ptr Display
forall a. Zero a => a
zero
           VisualID
forall a. Zero a => a
zero


-- | VkXlibSurfaceCreateFlagsKHR - Reserved for future use
--
-- = Description
--
-- 'XlibSurfaceCreateFlagsKHR' is a bitmask type for setting a mask, but is
-- currently reserved for future use.
--
-- = See Also
--
-- 'XlibSurfaceCreateInfoKHR'
newtype XlibSurfaceCreateFlagsKHR = XlibSurfaceCreateFlagsKHR Flags
  deriving newtype (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
(XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> Eq XlibSurfaceCreateFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c/= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
== :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c== :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
Eq, Eq XlibSurfaceCreateFlagsKHR
Eq XlibSurfaceCreateFlagsKHR =>
(XlibSurfaceCreateFlagsKHR
 -> XlibSurfaceCreateFlagsKHR -> Ordering)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR
    -> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR
    -> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> Ord XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
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 :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cmin :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
max :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cmax :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
>= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c>= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
> :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c> :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
<= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c<= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
< :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c< :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
compare :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
$ccompare :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
$cp1Ord :: Eq XlibSurfaceCreateFlagsKHR
Ord, Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
XlibSurfaceCreateFlagsKHR -> Int
(XlibSurfaceCreateFlagsKHR -> Int)
-> (XlibSurfaceCreateFlagsKHR -> Int)
-> (Ptr XlibSurfaceCreateFlagsKHR
    -> Int -> IO XlibSurfaceCreateFlagsKHR)
-> (Ptr XlibSurfaceCreateFlagsKHR
    -> Int -> XlibSurfaceCreateFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR)
-> (forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ())
-> (Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR)
-> (Ptr XlibSurfaceCreateFlagsKHR
    -> XlibSurfaceCreateFlagsKHR -> IO ())
-> Storable XlibSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> 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 XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
$cpeek :: Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
pokeByteOff :: Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
pokeElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
alignment :: XlibSurfaceCreateFlagsKHR -> Int
$calignment :: XlibSurfaceCreateFlagsKHR -> Int
sizeOf :: XlibSurfaceCreateFlagsKHR -> Int
$csizeOf :: XlibSurfaceCreateFlagsKHR -> Int
Storable, XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Zero XlibSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: XlibSurfaceCreateFlagsKHR
$czero :: XlibSurfaceCreateFlagsKHR
Zero, Eq XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR
Eq XlibSurfaceCreateFlagsKHR =>
(XlibSurfaceCreateFlagsKHR
 -> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR
    -> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR
    -> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> XlibSurfaceCreateFlagsKHR
-> (Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> Maybe Int)
-> (XlibSurfaceCreateFlagsKHR -> Int)
-> (XlibSurfaceCreateFlagsKHR -> Bool)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR)
-> (XlibSurfaceCreateFlagsKHR -> Int)
-> Bits XlibSurfaceCreateFlagsKHR
Int -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Bool
XlibSurfaceCreateFlagsKHR -> Int
XlibSurfaceCreateFlagsKHR -> Maybe Int
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Int -> Bool
XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: XlibSurfaceCreateFlagsKHR -> Int
$cpopCount :: XlibSurfaceCreateFlagsKHR -> Int
rotateR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotateR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
rotateL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotateL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
unsafeShiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cunsafeShiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
unsafeShiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cunsafeShiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
isSigned :: XlibSurfaceCreateFlagsKHR -> Bool
$cisSigned :: XlibSurfaceCreateFlagsKHR -> Bool
bitSize :: XlibSurfaceCreateFlagsKHR -> Int
$cbitSize :: XlibSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: XlibSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: XlibSurfaceCreateFlagsKHR -> Maybe Int
testBit :: XlibSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: XlibSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$ccomplementBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
clearBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cclearBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
setBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$csetBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
bit :: Int -> XlibSurfaceCreateFlagsKHR
$cbit :: Int -> XlibSurfaceCreateFlagsKHR
zeroBits :: XlibSurfaceCreateFlagsKHR
$czeroBits :: XlibSurfaceCreateFlagsKHR
rotate :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotate :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shift :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshift :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
complement :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$ccomplement :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
xor :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cxor :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
.|. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$c.|. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
.&. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$c.&. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cp1Bits :: Eq XlibSurfaceCreateFlagsKHR
Bits, Bits XlibSurfaceCreateFlagsKHR
Bits XlibSurfaceCreateFlagsKHR =>
(XlibSurfaceCreateFlagsKHR -> Int)
-> (XlibSurfaceCreateFlagsKHR -> Int)
-> (XlibSurfaceCreateFlagsKHR -> Int)
-> FiniteBits XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: XlibSurfaceCreateFlagsKHR -> Int
$ccountTrailingZeros :: XlibSurfaceCreateFlagsKHR -> Int
countLeadingZeros :: XlibSurfaceCreateFlagsKHR -> Int
$ccountLeadingZeros :: XlibSurfaceCreateFlagsKHR -> Int
finiteBitSize :: XlibSurfaceCreateFlagsKHR -> Int
$cfiniteBitSize :: XlibSurfaceCreateFlagsKHR -> Int
$cp1FiniteBits :: Bits XlibSurfaceCreateFlagsKHR
FiniteBits)



conNameXlibSurfaceCreateFlagsKHR :: String
conNameXlibSurfaceCreateFlagsKHR :: String
conNameXlibSurfaceCreateFlagsKHR = "XlibSurfaceCreateFlagsKHR"

enumPrefixXlibSurfaceCreateFlagsKHR :: String
enumPrefixXlibSurfaceCreateFlagsKHR :: String
enumPrefixXlibSurfaceCreateFlagsKHR = ""

showTableXlibSurfaceCreateFlagsKHR :: [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR :: [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR = []

instance Show XlibSurfaceCreateFlagsKHR where
  showsPrec :: Int -> XlibSurfaceCreateFlagsKHR -> ShowS
showsPrec = String
-> [(XlibSurfaceCreateFlagsKHR, String)]
-> String
-> (XlibSurfaceCreateFlagsKHR -> "queueFamilyIndex" ::: Word32)
-> (("queueFamilyIndex" ::: Word32) -> ShowS)
-> Int
-> XlibSurfaceCreateFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixXlibSurfaceCreateFlagsKHR
                            [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR
                            String
conNameXlibSurfaceCreateFlagsKHR
                            (\(XlibSurfaceCreateFlagsKHR x :: "queueFamilyIndex" ::: Word32
x) -> "queueFamilyIndex" ::: Word32
x)
                            (\x :: "queueFamilyIndex" ::: Word32
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("queueFamilyIndex" ::: Word32) -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex "queueFamilyIndex" ::: Word32
x)

instance Read XlibSurfaceCreateFlagsKHR where
  readPrec :: ReadPrec XlibSurfaceCreateFlagsKHR
readPrec = String
-> [(XlibSurfaceCreateFlagsKHR, String)]
-> String
-> (("queueFamilyIndex" ::: Word32) -> XlibSurfaceCreateFlagsKHR)
-> ReadPrec XlibSurfaceCreateFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixXlibSurfaceCreateFlagsKHR
                          [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR
                          String
conNameXlibSurfaceCreateFlagsKHR
                          ("queueFamilyIndex" ::: Word32) -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR


type KHR_XLIB_SURFACE_SPEC_VERSION = 6

-- No documentation found for TopLevel "VK_KHR_XLIB_SURFACE_SPEC_VERSION"
pattern KHR_XLIB_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_XLIB_SURFACE_SPEC_VERSION :: a
$mKHR_XLIB_SURFACE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_XLIB_SURFACE_SPEC_VERSION = 6


type KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface"

-- No documentation found for TopLevel "VK_KHR_XLIB_SURFACE_EXTENSION_NAME"
pattern KHR_XLIB_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_XLIB_SURFACE_EXTENSION_NAME :: a
$mKHR_XLIB_SURFACE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface"


type Display = Ptr ()


type VisualID = Word64


type Window = Word64