{-# language CPP #-}
module Vulkan.Core10.Enums.StencilFaceFlagBits  ( StencilFaceFlagBits( STENCIL_FACE_FRONT_BIT
                                                                     , STENCIL_FACE_BACK_BIT
                                                                     , STENCIL_FACE_FRONT_AND_BACK
                                                                     , ..
                                                                     )
                                                , StencilFaceFlags
                                                ) where

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 Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Core10.BaseType (Flags)
import Vulkan.Zero (Zero)
-- | VkStencilFaceFlagBits - Bitmask specifying sets of stencil state for
-- which to update the compare mask
--
-- = See Also
--
-- 'StencilFaceFlags'
newtype StencilFaceFlagBits = StencilFaceFlagBits Flags
  deriving newtype (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
(StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> Eq StencilFaceFlagBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c/= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
== :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c== :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
Eq, Eq StencilFaceFlagBits
Eq StencilFaceFlagBits =>
(StencilFaceFlagBits -> StencilFaceFlagBits -> Ordering)
-> (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits -> StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits
    -> StencilFaceFlagBits -> StencilFaceFlagBits)
-> (StencilFaceFlagBits
    -> StencilFaceFlagBits -> StencilFaceFlagBits)
-> Ord StencilFaceFlagBits
StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
StencilFaceFlagBits -> StencilFaceFlagBits -> Ordering
StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
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 :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$cmin :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
max :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$cmax :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
>= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c>= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
> :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c> :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
<= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c<= :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
< :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
$c< :: StencilFaceFlagBits -> StencilFaceFlagBits -> Bool
compare :: StencilFaceFlagBits -> StencilFaceFlagBits -> Ordering
$ccompare :: StencilFaceFlagBits -> StencilFaceFlagBits -> Ordering
$cp1Ord :: Eq StencilFaceFlagBits
Ord, Ptr b -> Int -> IO StencilFaceFlagBits
Ptr b -> Int -> StencilFaceFlagBits -> IO ()
Ptr StencilFaceFlagBits -> IO StencilFaceFlagBits
Ptr StencilFaceFlagBits -> Int -> IO StencilFaceFlagBits
Ptr StencilFaceFlagBits -> Int -> StencilFaceFlagBits -> IO ()
Ptr StencilFaceFlagBits -> StencilFaceFlagBits -> IO ()
StencilFaceFlagBits -> Int
(StencilFaceFlagBits -> Int)
-> (StencilFaceFlagBits -> Int)
-> (Ptr StencilFaceFlagBits -> Int -> IO StencilFaceFlagBits)
-> (Ptr StencilFaceFlagBits -> Int -> StencilFaceFlagBits -> IO ())
-> (forall b. Ptr b -> Int -> IO StencilFaceFlagBits)
-> (forall b. Ptr b -> Int -> StencilFaceFlagBits -> IO ())
-> (Ptr StencilFaceFlagBits -> IO StencilFaceFlagBits)
-> (Ptr StencilFaceFlagBits -> StencilFaceFlagBits -> IO ())
-> Storable StencilFaceFlagBits
forall b. Ptr b -> Int -> IO StencilFaceFlagBits
forall b. Ptr b -> Int -> StencilFaceFlagBits -> 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 StencilFaceFlagBits -> StencilFaceFlagBits -> IO ()
$cpoke :: Ptr StencilFaceFlagBits -> StencilFaceFlagBits -> IO ()
peek :: Ptr StencilFaceFlagBits -> IO StencilFaceFlagBits
$cpeek :: Ptr StencilFaceFlagBits -> IO StencilFaceFlagBits
pokeByteOff :: Ptr b -> Int -> StencilFaceFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> StencilFaceFlagBits -> IO ()
peekByteOff :: Ptr b -> Int -> IO StencilFaceFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO StencilFaceFlagBits
pokeElemOff :: Ptr StencilFaceFlagBits -> Int -> StencilFaceFlagBits -> IO ()
$cpokeElemOff :: Ptr StencilFaceFlagBits -> Int -> StencilFaceFlagBits -> IO ()
peekElemOff :: Ptr StencilFaceFlagBits -> Int -> IO StencilFaceFlagBits
$cpeekElemOff :: Ptr StencilFaceFlagBits -> Int -> IO StencilFaceFlagBits
alignment :: StencilFaceFlagBits -> Int
$calignment :: StencilFaceFlagBits -> Int
sizeOf :: StencilFaceFlagBits -> Int
$csizeOf :: StencilFaceFlagBits -> Int
Storable, StencilFaceFlagBits
StencilFaceFlagBits -> Zero StencilFaceFlagBits
forall a. a -> Zero a
zero :: StencilFaceFlagBits
$czero :: StencilFaceFlagBits
Zero, Eq StencilFaceFlagBits
StencilFaceFlagBits
Eq StencilFaceFlagBits =>
(StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits)
-> (StencilFaceFlagBits
    -> StencilFaceFlagBits -> StencilFaceFlagBits)
-> (StencilFaceFlagBits
    -> StencilFaceFlagBits -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> StencilFaceFlagBits
-> (Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> Bool)
-> (StencilFaceFlagBits -> Maybe Int)
-> (StencilFaceFlagBits -> Int)
-> (StencilFaceFlagBits -> Bool)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int -> StencilFaceFlagBits)
-> (StencilFaceFlagBits -> Int)
-> Bits StencilFaceFlagBits
Int -> StencilFaceFlagBits
StencilFaceFlagBits -> Bool
StencilFaceFlagBits -> Int
StencilFaceFlagBits -> Maybe Int
StencilFaceFlagBits -> StencilFaceFlagBits
StencilFaceFlagBits -> Int -> Bool
StencilFaceFlagBits -> Int -> StencilFaceFlagBits
StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
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 :: StencilFaceFlagBits -> Int
$cpopCount :: StencilFaceFlagBits -> Int
rotateR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$crotateR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
rotateL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$crotateL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
unsafeShiftR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cunsafeShiftR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
shiftR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cshiftR :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
unsafeShiftL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cunsafeShiftL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
shiftL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cshiftL :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
isSigned :: StencilFaceFlagBits -> Bool
$cisSigned :: StencilFaceFlagBits -> Bool
bitSize :: StencilFaceFlagBits -> Int
$cbitSize :: StencilFaceFlagBits -> Int
bitSizeMaybe :: StencilFaceFlagBits -> Maybe Int
$cbitSizeMaybe :: StencilFaceFlagBits -> Maybe Int
testBit :: StencilFaceFlagBits -> Int -> Bool
$ctestBit :: StencilFaceFlagBits -> Int -> Bool
complementBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$ccomplementBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
clearBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cclearBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
setBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$csetBit :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
bit :: Int -> StencilFaceFlagBits
$cbit :: Int -> StencilFaceFlagBits
zeroBits :: StencilFaceFlagBits
$czeroBits :: StencilFaceFlagBits
rotate :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$crotate :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
shift :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
$cshift :: StencilFaceFlagBits -> Int -> StencilFaceFlagBits
complement :: StencilFaceFlagBits -> StencilFaceFlagBits
$ccomplement :: StencilFaceFlagBits -> StencilFaceFlagBits
xor :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$cxor :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
.|. :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$c.|. :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
.&. :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$c.&. :: StencilFaceFlagBits -> StencilFaceFlagBits -> StencilFaceFlagBits
$cp1Bits :: Eq StencilFaceFlagBits
Bits)

-- | 'STENCIL_FACE_FRONT_BIT' specifies that only the front set of stencil
-- state is updated.
pattern $bSTENCIL_FACE_FRONT_BIT :: StencilFaceFlagBits
$mSTENCIL_FACE_FRONT_BIT :: forall r. StencilFaceFlagBits -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_FACE_FRONT_BIT = StencilFaceFlagBits 0x00000001
-- | 'STENCIL_FACE_BACK_BIT' specifies that only the back set of stencil
-- state is updated.
pattern $bSTENCIL_FACE_BACK_BIT :: StencilFaceFlagBits
$mSTENCIL_FACE_BACK_BIT :: forall r. StencilFaceFlagBits -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_FACE_BACK_BIT = StencilFaceFlagBits 0x00000002
-- | 'STENCIL_FACE_FRONT_AND_BACK' is the combination of
-- 'STENCIL_FACE_FRONT_BIT' and 'STENCIL_FACE_BACK_BIT', and specifies that
-- both sets of stencil state are updated.
pattern $bSTENCIL_FACE_FRONT_AND_BACK :: StencilFaceFlagBits
$mSTENCIL_FACE_FRONT_AND_BACK :: forall r. StencilFaceFlagBits -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_FACE_FRONT_AND_BACK = StencilFaceFlagBits 0x00000003

type StencilFaceFlags = StencilFaceFlagBits

instance Show StencilFaceFlagBits where
  showsPrec :: Int -> StencilFaceFlagBits -> ShowS
showsPrec p :: Int
p = \case
    STENCIL_FACE_FRONT_BIT -> String -> ShowS
showString "STENCIL_FACE_FRONT_BIT"
    STENCIL_FACE_BACK_BIT -> String -> ShowS
showString "STENCIL_FACE_BACK_BIT"
    STENCIL_FACE_FRONT_AND_BACK -> String -> ShowS
showString "STENCIL_FACE_FRONT_AND_BACK"
    StencilFaceFlagBits x :: Flags
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "StencilFaceFlagBits 0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flags -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read StencilFaceFlagBits where
  readPrec :: ReadPrec StencilFaceFlagBits
readPrec = ReadPrec StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec StencilFaceFlagBits)]
-> ReadPrec StencilFaceFlagBits
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("STENCIL_FACE_FRONT_BIT", StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilFaceFlagBits
STENCIL_FACE_FRONT_BIT)
                            , ("STENCIL_FACE_BACK_BIT", StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilFaceFlagBits
STENCIL_FACE_BACK_BIT)
                            , ("STENCIL_FACE_FRONT_AND_BACK", StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilFaceFlagBits
STENCIL_FACE_FRONT_AND_BACK)]
                     ReadPrec StencilFaceFlagBits
-> ReadPrec StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "StencilFaceFlagBits")
                       Flags
v <- ReadPrec Flags -> ReadPrec Flags
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Flags
forall a. Read a => ReadPrec a
readPrec
                       StencilFaceFlagBits -> ReadPrec StencilFaceFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Flags -> StencilFaceFlagBits
StencilFaceFlagBits Flags
v)))