{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_wayland_surface  ( createWaylandSurfaceKHR
                                                 , getPhysicalDeviceWaylandPresentationSupportKHR
                                                 , WaylandSurfaceCreateInfoKHR(..)
                                                 , WaylandSurfaceCreateFlagsKHR(..)
                                                 , KHR_WAYLAND_SURFACE_SPEC_VERSION
                                                 , pattern KHR_WAYLAND_SURFACE_SPEC_VERSION
                                                 , KHR_WAYLAND_SURFACE_EXTENSION_NAME
                                                 , pattern KHR_WAYLAND_SURFACE_EXTENSION_NAME
                                                 , SurfaceKHR(..)
                                                 , Wl_display
                                                 , Wl_surface
                                                 ) where

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.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
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.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Text.Read.Lex (Lexeme(Ident))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.BaseType (bool32ToBool)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.BaseType (Bool32)
import Vulkan.Core10.BaseType (Bool32(..))
import Vulkan.Core10.BaseType (Flags)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Dynamic (InstanceCmds(pVkCreateWaylandSurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceWaylandPresentationSupportKHR))
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.Extensions.WSITypes (Wl_display)
import Vulkan.Extensions.WSITypes (Wl_surface)
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Extensions.WSITypes (Wl_display)
import Vulkan.Extensions.WSITypes (Wl_surface)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateWaylandSurfaceKHR
  :: FunPtr (Ptr Instance_T -> Ptr WaylandSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr WaylandSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result

-- | vkCreateWaylandSurfaceKHR - Create a
-- 'Vulkan.Extensions.Handles.SurfaceKHR' object for a Wayland window
--
-- = Parameters
--
-- -   @instance@ is the instance to associate the surface with.
--
-- -   @pCreateInfo@ is a pointer to a 'WaylandSurfaceCreateInfoKHR'
--     structure containing parameters affecting the creation of the
--     surface object.
--
-- -   @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>).
--
-- -   @pSurface@ is a pointer to a 'Vulkan.Extensions.Handles.SurfaceKHR'
--     handle in which the created surface object is returned.
--
-- == Valid Usage (Implicit)
--
-- -   @instance@ /must/ be a valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   @pCreateInfo@ /must/ be a valid pointer to a valid
--     'WaylandSurfaceCreateInfoKHR' structure
--
-- -   If @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid
--     pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   @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', 'WaylandSurfaceCreateInfoKHR'
createWaylandSurfaceKHR :: forall io . MonadIO io => Instance -> WaylandSurfaceCreateInfoKHR -> ("allocator" ::: Maybe AllocationCallbacks) -> io (SurfaceKHR)
createWaylandSurfaceKHR :: Instance
-> WaylandSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createWaylandSurfaceKHR instance' :: Instance
instance' createInfo :: WaylandSurfaceCreateInfoKHR
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 vkCreateWaylandSurfaceKHRPtr :: FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateWaylandSurfaceKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
pVkCreateWaylandSurfaceKHR (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 WaylandSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateWaylandSurfaceKHRPtr FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> ("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 vkCreateWaylandSurfaceKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateWaylandSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateWaylandSurfaceKHR' = FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateWaylandSurfaceKHR FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateWaylandSurfaceKHRPtr
  "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
pCreateInfo <- ((("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
  -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
   -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT
      SurfaceKHR IO ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR))
-> ((("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
     -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ WaylandSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
    -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (WaylandSurfaceCreateInfoKHR
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
$ Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateWaylandSurfaceKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
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" mkVkGetPhysicalDeviceWaylandPresentationSupportKHR
  :: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr Wl_display -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr Wl_display -> IO Bool32

-- | vkGetPhysicalDeviceWaylandPresentationSupportKHR - Query physical device
-- for presentation to Wayland
--
-- = Parameters
--
-- -   @physicalDevice@ is the physical device.
--
-- -   @queueFamilyIndex@ is the queue family index.
--
-- -   @display@ is a pointer to the @wl_display@ associated with a Wayland
--     compositor.
--
-- = Description
--
-- This platform-specific function /can/ be called prior to creating a
-- surface.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.PhysicalDevice'
getPhysicalDeviceWaylandPresentationSupportKHR :: forall io . MonadIO io => PhysicalDevice -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> io (Bool)
getPhysicalDeviceWaylandPresentationSupportKHR :: PhysicalDevice
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> io Bool
getPhysicalDeviceWaylandPresentationSupportKHR physicalDevice :: PhysicalDevice
physicalDevice queueFamilyIndex :: "queueFamilyIndex" ::: Word32
queueFamilyIndex display :: Ptr Wl_display
display = 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 vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
pVkGetPhysicalDeviceWaylandPresentationSupportKHR (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> 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 vkGetPhysicalDeviceWaylandPresentationSupportKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceWaylandPresentationSupportKHR' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32
vkGetPhysicalDeviceWaylandPresentationSupportKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Wl_display
-> IO Bool32
mkVkGetPhysicalDeviceWaylandPresentationSupportKHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr
  Bool32
r <- Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32
vkGetPhysicalDeviceWaylandPresentationSupportKHR' (PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)) ("queueFamilyIndex" ::: Word32
queueFamilyIndex) (Ptr Wl_display
display)
  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))


-- | VkWaylandSurfaceCreateInfoKHR - Structure specifying parameters of a
-- newly created Wayland surface object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'WaylandSurfaceCreateFlagsKHR', 'createWaylandSurfaceKHR'
data WaylandSurfaceCreateInfoKHR = WaylandSurfaceCreateInfoKHR
  { -- | @flags@ /must/ be @0@
    WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateFlagsKHR
flags :: WaylandSurfaceCreateFlagsKHR
  , -- | @display@ /must/ point to a valid Wayland @wl_display@
    WaylandSurfaceCreateInfoKHR -> Ptr Wl_display
display :: Ptr Wl_display
  , -- | @surface@ /must/ point to a valid Wayland @wl_surface@
    WaylandSurfaceCreateInfoKHR -> Ptr Wl_surface
surface :: Ptr Wl_surface
  }
  deriving (Typeable)
deriving instance Show WaylandSurfaceCreateInfoKHR

instance ToCStruct WaylandSurfaceCreateInfoKHR where
  withCStruct :: WaylandSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct x :: WaylandSurfaceCreateInfoKHR
x f :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p -> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> WaylandSurfaceCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p WaylandSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> WaylandSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p WaylandSurfaceCreateInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr WaylandSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr WaylandSurfaceCreateFlagsKHR)) (WaylandSurfaceCreateFlagsKHR
flags)
    Ptr (Ptr Wl_display) -> Ptr Wl_display -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Wl_display))) (Ptr Wl_display
display)
    Ptr (Ptr Wl_surface) -> Ptr Wl_surface -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_surface)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr Wl_surface))) (Ptr Wl_surface
surface)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Wl_display) -> Ptr Wl_display -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Wl_display))) (Ptr Wl_display
forall a. Zero a => a
zero)
    Ptr (Ptr Wl_surface) -> Ptr Wl_surface -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_surface)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr Wl_surface))) (Ptr Wl_surface
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct WaylandSurfaceCreateInfoKHR where
  peekCStruct :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> IO WaylandSurfaceCreateInfoKHR
peekCStruct p :: "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p = do
    WaylandSurfaceCreateFlagsKHR
flags <- Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
forall a. Storable a => Ptr a -> IO a
peek @WaylandSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr WaylandSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr WaylandSurfaceCreateFlagsKHR))
    Ptr Wl_display
display <- Ptr (Ptr Wl_display) -> IO (Ptr Wl_display)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Wl_display) (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Wl_display)))
    Ptr Wl_surface
surface <- Ptr (Ptr Wl_surface) -> IO (Ptr Wl_surface)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Wl_surface) (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr Wl_surface)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr Wl_surface)))
    WaylandSurfaceCreateInfoKHR -> IO WaylandSurfaceCreateInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (WaylandSurfaceCreateInfoKHR -> IO WaylandSurfaceCreateInfoKHR)
-> WaylandSurfaceCreateInfoKHR -> IO WaylandSurfaceCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ WaylandSurfaceCreateFlagsKHR
-> Ptr Wl_display -> Ptr Wl_surface -> WaylandSurfaceCreateInfoKHR
WaylandSurfaceCreateInfoKHR
             WaylandSurfaceCreateFlagsKHR
flags Ptr Wl_display
display Ptr Wl_surface
surface

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

instance Zero WaylandSurfaceCreateInfoKHR where
  zero :: WaylandSurfaceCreateInfoKHR
zero = WaylandSurfaceCreateFlagsKHR
-> Ptr Wl_display -> Ptr Wl_surface -> WaylandSurfaceCreateInfoKHR
WaylandSurfaceCreateInfoKHR
           WaylandSurfaceCreateFlagsKHR
forall a. Zero a => a
zero
           Ptr Wl_display
forall a. Zero a => a
zero
           Ptr Wl_surface
forall a. Zero a => a
zero


-- No documentation found for TopLevel "VkWaylandSurfaceCreateFlagsKHR"
newtype WaylandSurfaceCreateFlagsKHR = WaylandSurfaceCreateFlagsKHR Flags
  deriving newtype (WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
(WaylandSurfaceCreateFlagsKHR
 -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> Eq WaylandSurfaceCreateFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c/= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
== :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c== :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
Eq, Eq WaylandSurfaceCreateFlagsKHR
Eq WaylandSurfaceCreateFlagsKHR =>
(WaylandSurfaceCreateFlagsKHR
 -> WaylandSurfaceCreateFlagsKHR -> Ordering)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> Ord WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
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 :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cmin :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
max :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cmax :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
>= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c>= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
> :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c> :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
<= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c<= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
< :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c< :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
compare :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
$ccompare :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
$cp1Ord :: Eq WaylandSurfaceCreateFlagsKHR
Ord, Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
Ptr WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
WaylandSurfaceCreateFlagsKHR -> Int
(WaylandSurfaceCreateFlagsKHR -> Int)
-> (WaylandSurfaceCreateFlagsKHR -> Int)
-> (Ptr WaylandSurfaceCreateFlagsKHR
    -> Int -> IO WaylandSurfaceCreateFlagsKHR)
-> (Ptr WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR)
-> (forall b.
    Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ())
-> (Ptr WaylandSurfaceCreateFlagsKHR
    -> IO WaylandSurfaceCreateFlagsKHR)
-> (Ptr WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> IO ())
-> Storable WaylandSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> 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 WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
$cpeek :: Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
pokeByteOff :: Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
pokeElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
alignment :: WaylandSurfaceCreateFlagsKHR -> Int
$calignment :: WaylandSurfaceCreateFlagsKHR -> Int
sizeOf :: WaylandSurfaceCreateFlagsKHR -> Int
$csizeOf :: WaylandSurfaceCreateFlagsKHR -> Int
Storable, WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Zero WaylandSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: WaylandSurfaceCreateFlagsKHR
$czero :: WaylandSurfaceCreateFlagsKHR
Zero, Eq WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
Eq WaylandSurfaceCreateFlagsKHR =>
(WaylandSurfaceCreateFlagsKHR
 -> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> WaylandSurfaceCreateFlagsKHR
-> (Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR -> Int -> Bool)
-> (WaylandSurfaceCreateFlagsKHR -> Maybe Int)
-> (WaylandSurfaceCreateFlagsKHR -> Int)
-> (WaylandSurfaceCreateFlagsKHR -> Bool)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR
    -> Int -> WaylandSurfaceCreateFlagsKHR)
-> (WaylandSurfaceCreateFlagsKHR -> Int)
-> Bits WaylandSurfaceCreateFlagsKHR
Int -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Bool
WaylandSurfaceCreateFlagsKHR -> Int
WaylandSurfaceCreateFlagsKHR -> Maybe Int
WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Int -> Bool
WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
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 :: WaylandSurfaceCreateFlagsKHR -> Int
$cpopCount :: WaylandSurfaceCreateFlagsKHR -> Int
rotateR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotateR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
rotateL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotateL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
unsafeShiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cunsafeShiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
unsafeShiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cunsafeShiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
isSigned :: WaylandSurfaceCreateFlagsKHR -> Bool
$cisSigned :: WaylandSurfaceCreateFlagsKHR -> Bool
bitSize :: WaylandSurfaceCreateFlagsKHR -> Int
$cbitSize :: WaylandSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: WaylandSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: WaylandSurfaceCreateFlagsKHR -> Maybe Int
testBit :: WaylandSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: WaylandSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$ccomplementBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
clearBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cclearBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
setBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$csetBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
bit :: Int -> WaylandSurfaceCreateFlagsKHR
$cbit :: Int -> WaylandSurfaceCreateFlagsKHR
zeroBits :: WaylandSurfaceCreateFlagsKHR
$czeroBits :: WaylandSurfaceCreateFlagsKHR
rotate :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotate :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shift :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshift :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
complement :: WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$ccomplement :: WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
xor :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cxor :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
.|. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$c.|. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
.&. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$c.&. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cp1Bits :: Eq WaylandSurfaceCreateFlagsKHR
Bits)



instance Show WaylandSurfaceCreateFlagsKHR where
  showsPrec :: Int -> WaylandSurfaceCreateFlagsKHR -> ShowS
showsPrec p :: Int
p = \case
    WaylandSurfaceCreateFlagsKHR x :: "queueFamilyIndex" ::: Word32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "WaylandSurfaceCreateFlagsKHR 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 WaylandSurfaceCreateFlagsKHR where
  readPrec :: ReadPrec WaylandSurfaceCreateFlagsKHR
readPrec = ReadPrec WaylandSurfaceCreateFlagsKHR
-> ReadPrec WaylandSurfaceCreateFlagsKHR
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec WaylandSurfaceCreateFlagsKHR)]
-> ReadPrec WaylandSurfaceCreateFlagsKHR
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose []
                     ReadPrec WaylandSurfaceCreateFlagsKHR
-> ReadPrec WaylandSurfaceCreateFlagsKHR
-> ReadPrec WaylandSurfaceCreateFlagsKHR
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int
-> ReadPrec WaylandSurfaceCreateFlagsKHR
-> ReadPrec WaylandSurfaceCreateFlagsKHR
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "WaylandSurfaceCreateFlagsKHR")
                       "queueFamilyIndex" ::: Word32
v <- ReadPrec ("queueFamilyIndex" ::: Word32)
-> ReadPrec ("queueFamilyIndex" ::: Word32)
forall a. ReadPrec a -> ReadPrec a
step ReadPrec ("queueFamilyIndex" ::: Word32)
forall a. Read a => ReadPrec a
readPrec
                       WaylandSurfaceCreateFlagsKHR
-> ReadPrec WaylandSurfaceCreateFlagsKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("queueFamilyIndex" ::: Word32) -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR "queueFamilyIndex" ::: Word32
v)))


type KHR_WAYLAND_SURFACE_SPEC_VERSION = 6

-- No documentation found for TopLevel "VK_KHR_WAYLAND_SURFACE_SPEC_VERSION"
pattern KHR_WAYLAND_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_WAYLAND_SURFACE_SPEC_VERSION :: a
$mKHR_WAYLAND_SURFACE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_WAYLAND_SURFACE_SPEC_VERSION = 6


type KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface"

-- No documentation found for TopLevel "VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME"
pattern KHR_WAYLAND_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_WAYLAND_SURFACE_EXTENSION_NAME :: a
$mKHR_WAYLAND_SURFACE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface"