{-# language CPP #-}
module Vulkan.Core10.Enums.StencilOp  (StencilOp( STENCIL_OP_KEEP
                                                , STENCIL_OP_ZERO
                                                , STENCIL_OP_REPLACE
                                                , STENCIL_OP_INCREMENT_AND_CLAMP
                                                , STENCIL_OP_DECREMENT_AND_CLAMP
                                                , STENCIL_OP_INVERT
                                                , STENCIL_OP_INCREMENT_AND_WRAP
                                                , STENCIL_OP_DECREMENT_AND_WRAP
                                                , ..
                                                )) where

import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Zero (Zero)
-- | VkStencilOp - Stencil comparison function
--
-- = Description
--
-- For purposes of increment and decrement, the stencil bits are considered
-- as an unsigned integer.
--
-- = See Also
--
-- 'Vulkan.Core10.Pipeline.StencilOpState'
newtype StencilOp = StencilOp Int32
  deriving newtype (StencilOp -> StencilOp -> Bool
(StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool) -> Eq StencilOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StencilOp -> StencilOp -> Bool
$c/= :: StencilOp -> StencilOp -> Bool
== :: StencilOp -> StencilOp -> Bool
$c== :: StencilOp -> StencilOp -> Bool
Eq, Eq StencilOp
Eq StencilOp =>
(StencilOp -> StencilOp -> Ordering)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> StencilOp)
-> (StencilOp -> StencilOp -> StencilOp)
-> Ord StencilOp
StencilOp -> StencilOp -> Bool
StencilOp -> StencilOp -> Ordering
StencilOp -> StencilOp -> StencilOp
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 :: StencilOp -> StencilOp -> StencilOp
$cmin :: StencilOp -> StencilOp -> StencilOp
max :: StencilOp -> StencilOp -> StencilOp
$cmax :: StencilOp -> StencilOp -> StencilOp
>= :: StencilOp -> StencilOp -> Bool
$c>= :: StencilOp -> StencilOp -> Bool
> :: StencilOp -> StencilOp -> Bool
$c> :: StencilOp -> StencilOp -> Bool
<= :: StencilOp -> StencilOp -> Bool
$c<= :: StencilOp -> StencilOp -> Bool
< :: StencilOp -> StencilOp -> Bool
$c< :: StencilOp -> StencilOp -> Bool
compare :: StencilOp -> StencilOp -> Ordering
$ccompare :: StencilOp -> StencilOp -> Ordering
$cp1Ord :: Eq StencilOp
Ord, Ptr b -> Int -> IO StencilOp
Ptr b -> Int -> StencilOp -> IO ()
Ptr StencilOp -> IO StencilOp
Ptr StencilOp -> Int -> IO StencilOp
Ptr StencilOp -> Int -> StencilOp -> IO ()
Ptr StencilOp -> StencilOp -> IO ()
StencilOp -> Int
(StencilOp -> Int)
-> (StencilOp -> Int)
-> (Ptr StencilOp -> Int -> IO StencilOp)
-> (Ptr StencilOp -> Int -> StencilOp -> IO ())
-> (forall b. Ptr b -> Int -> IO StencilOp)
-> (forall b. Ptr b -> Int -> StencilOp -> IO ())
-> (Ptr StencilOp -> IO StencilOp)
-> (Ptr StencilOp -> StencilOp -> IO ())
-> Storable StencilOp
forall b. Ptr b -> Int -> IO StencilOp
forall b. Ptr b -> Int -> StencilOp -> 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 StencilOp -> StencilOp -> IO ()
$cpoke :: Ptr StencilOp -> StencilOp -> IO ()
peek :: Ptr StencilOp -> IO StencilOp
$cpeek :: Ptr StencilOp -> IO StencilOp
pokeByteOff :: Ptr b -> Int -> StencilOp -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> StencilOp -> IO ()
peekByteOff :: Ptr b -> Int -> IO StencilOp
$cpeekByteOff :: forall b. Ptr b -> Int -> IO StencilOp
pokeElemOff :: Ptr StencilOp -> Int -> StencilOp -> IO ()
$cpokeElemOff :: Ptr StencilOp -> Int -> StencilOp -> IO ()
peekElemOff :: Ptr StencilOp -> Int -> IO StencilOp
$cpeekElemOff :: Ptr StencilOp -> Int -> IO StencilOp
alignment :: StencilOp -> Int
$calignment :: StencilOp -> Int
sizeOf :: StencilOp -> Int
$csizeOf :: StencilOp -> Int
Storable, StencilOp
StencilOp -> Zero StencilOp
forall a. a -> Zero a
zero :: StencilOp
$czero :: StencilOp
Zero)

-- | 'STENCIL_OP_KEEP' keeps the current value.
pattern $bSTENCIL_OP_KEEP :: StencilOp
$mSTENCIL_OP_KEEP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_KEEP = StencilOp 0
-- | 'STENCIL_OP_ZERO' sets the value to 0.
pattern $bSTENCIL_OP_ZERO :: StencilOp
$mSTENCIL_OP_ZERO :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_ZERO = StencilOp 1
-- | 'STENCIL_OP_REPLACE' sets the value to @reference@.
pattern $bSTENCIL_OP_REPLACE :: StencilOp
$mSTENCIL_OP_REPLACE :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_REPLACE = StencilOp 2
-- | 'STENCIL_OP_INCREMENT_AND_CLAMP' increments the current value and clamps
-- to the maximum representable unsigned value.
pattern $bSTENCIL_OP_INCREMENT_AND_CLAMP :: StencilOp
$mSTENCIL_OP_INCREMENT_AND_CLAMP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INCREMENT_AND_CLAMP = StencilOp 3
-- | 'STENCIL_OP_DECREMENT_AND_CLAMP' decrements the current value and clamps
-- to 0.
pattern $bSTENCIL_OP_DECREMENT_AND_CLAMP :: StencilOp
$mSTENCIL_OP_DECREMENT_AND_CLAMP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_DECREMENT_AND_CLAMP = StencilOp 4
-- | 'STENCIL_OP_INVERT' bitwise-inverts the current value.
pattern $bSTENCIL_OP_INVERT :: StencilOp
$mSTENCIL_OP_INVERT :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INVERT = StencilOp 5
-- | 'STENCIL_OP_INCREMENT_AND_WRAP' increments the current value and wraps
-- to 0 when the maximum value would have been exceeded.
pattern $bSTENCIL_OP_INCREMENT_AND_WRAP :: StencilOp
$mSTENCIL_OP_INCREMENT_AND_WRAP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INCREMENT_AND_WRAP = StencilOp 6
-- | 'STENCIL_OP_DECREMENT_AND_WRAP' decrements the current value and wraps
-- to the maximum possible value when the value would go below 0.
pattern $bSTENCIL_OP_DECREMENT_AND_WRAP :: StencilOp
$mSTENCIL_OP_DECREMENT_AND_WRAP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_DECREMENT_AND_WRAP = StencilOp 7
{-# complete STENCIL_OP_KEEP,
             STENCIL_OP_ZERO,
             STENCIL_OP_REPLACE,
             STENCIL_OP_INCREMENT_AND_CLAMP,
             STENCIL_OP_DECREMENT_AND_CLAMP,
             STENCIL_OP_INVERT,
             STENCIL_OP_INCREMENT_AND_WRAP,
             STENCIL_OP_DECREMENT_AND_WRAP :: StencilOp #-}

instance Show StencilOp where
  showsPrec :: Int -> StencilOp -> ShowS
showsPrec p :: Int
p = \case
    STENCIL_OP_KEEP -> String -> ShowS
showString "STENCIL_OP_KEEP"
    STENCIL_OP_ZERO -> String -> ShowS
showString "STENCIL_OP_ZERO"
    STENCIL_OP_REPLACE -> String -> ShowS
showString "STENCIL_OP_REPLACE"
    STENCIL_OP_INCREMENT_AND_CLAMP -> String -> ShowS
showString "STENCIL_OP_INCREMENT_AND_CLAMP"
    STENCIL_OP_DECREMENT_AND_CLAMP -> String -> ShowS
showString "STENCIL_OP_DECREMENT_AND_CLAMP"
    STENCIL_OP_INVERT -> String -> ShowS
showString "STENCIL_OP_INVERT"
    STENCIL_OP_INCREMENT_AND_WRAP -> String -> ShowS
showString "STENCIL_OP_INCREMENT_AND_WRAP"
    STENCIL_OP_DECREMENT_AND_WRAP -> String -> ShowS
showString "STENCIL_OP_DECREMENT_AND_WRAP"
    StencilOp x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "StencilOp " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read StencilOp where
  readPrec :: ReadPrec StencilOp
readPrec = ReadPrec StencilOp -> ReadPrec StencilOp
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec StencilOp)] -> ReadPrec StencilOp
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("STENCIL_OP_KEEP", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_KEEP)
                            , ("STENCIL_OP_ZERO", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_ZERO)
                            , ("STENCIL_OP_REPLACE", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_REPLACE)
                            , ("STENCIL_OP_INCREMENT_AND_CLAMP", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_INCREMENT_AND_CLAMP)
                            , ("STENCIL_OP_DECREMENT_AND_CLAMP", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_DECREMENT_AND_CLAMP)
                            , ("STENCIL_OP_INVERT", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_INVERT)
                            , ("STENCIL_OP_INCREMENT_AND_WRAP", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_INCREMENT_AND_WRAP)
                            , ("STENCIL_OP_DECREMENT_AND_WRAP", StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure StencilOp
STENCIL_OP_DECREMENT_AND_WRAP)]
                     ReadPrec StencilOp -> ReadPrec StencilOp -> ReadPrec StencilOp
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec StencilOp -> ReadPrec StencilOp
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "StencilOp")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       StencilOp -> ReadPrec StencilOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> StencilOp
StencilOp Int32
v)))