{-# language CPP #-}
module Vulkan.Core10.Enums.CompareOp  (CompareOp( COMPARE_OP_NEVER
                                                , COMPARE_OP_LESS
                                                , COMPARE_OP_EQUAL
                                                , COMPARE_OP_LESS_OR_EQUAL
                                                , COMPARE_OP_GREATER
                                                , COMPARE_OP_NOT_EQUAL
                                                , COMPARE_OP_GREATER_OR_EQUAL
                                                , COMPARE_OP_ALWAYS
                                                , ..
                                                )) 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)
-- | VkCompareOp - Stencil comparison function
--
-- = See Also
--
-- 'Vulkan.Core10.Pipeline.PipelineDepthStencilStateCreateInfo',
-- 'Vulkan.Core10.Sampler.SamplerCreateInfo',
-- 'Vulkan.Core10.Pipeline.StencilOpState'
newtype CompareOp = CompareOp Int32
  deriving newtype (CompareOp -> CompareOp -> Bool
(CompareOp -> CompareOp -> Bool)
-> (CompareOp -> CompareOp -> Bool) -> Eq CompareOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompareOp -> CompareOp -> Bool
$c/= :: CompareOp -> CompareOp -> Bool
== :: CompareOp -> CompareOp -> Bool
$c== :: CompareOp -> CompareOp -> Bool
Eq, Eq CompareOp
Eq CompareOp =>
(CompareOp -> CompareOp -> Ordering)
-> (CompareOp -> CompareOp -> Bool)
-> (CompareOp -> CompareOp -> Bool)
-> (CompareOp -> CompareOp -> Bool)
-> (CompareOp -> CompareOp -> Bool)
-> (CompareOp -> CompareOp -> CompareOp)
-> (CompareOp -> CompareOp -> CompareOp)
-> Ord CompareOp
CompareOp -> CompareOp -> Bool
CompareOp -> CompareOp -> Ordering
CompareOp -> CompareOp -> CompareOp
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 :: CompareOp -> CompareOp -> CompareOp
$cmin :: CompareOp -> CompareOp -> CompareOp
max :: CompareOp -> CompareOp -> CompareOp
$cmax :: CompareOp -> CompareOp -> CompareOp
>= :: CompareOp -> CompareOp -> Bool
$c>= :: CompareOp -> CompareOp -> Bool
> :: CompareOp -> CompareOp -> Bool
$c> :: CompareOp -> CompareOp -> Bool
<= :: CompareOp -> CompareOp -> Bool
$c<= :: CompareOp -> CompareOp -> Bool
< :: CompareOp -> CompareOp -> Bool
$c< :: CompareOp -> CompareOp -> Bool
compare :: CompareOp -> CompareOp -> Ordering
$ccompare :: CompareOp -> CompareOp -> Ordering
$cp1Ord :: Eq CompareOp
Ord, Ptr b -> Int -> IO CompareOp
Ptr b -> Int -> CompareOp -> IO ()
Ptr CompareOp -> IO CompareOp
Ptr CompareOp -> Int -> IO CompareOp
Ptr CompareOp -> Int -> CompareOp -> IO ()
Ptr CompareOp -> CompareOp -> IO ()
CompareOp -> Int
(CompareOp -> Int)
-> (CompareOp -> Int)
-> (Ptr CompareOp -> Int -> IO CompareOp)
-> (Ptr CompareOp -> Int -> CompareOp -> IO ())
-> (forall b. Ptr b -> Int -> IO CompareOp)
-> (forall b. Ptr b -> Int -> CompareOp -> IO ())
-> (Ptr CompareOp -> IO CompareOp)
-> (Ptr CompareOp -> CompareOp -> IO ())
-> Storable CompareOp
forall b. Ptr b -> Int -> IO CompareOp
forall b. Ptr b -> Int -> CompareOp -> 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 CompareOp -> CompareOp -> IO ()
$cpoke :: Ptr CompareOp -> CompareOp -> IO ()
peek :: Ptr CompareOp -> IO CompareOp
$cpeek :: Ptr CompareOp -> IO CompareOp
pokeByteOff :: Ptr b -> Int -> CompareOp -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> CompareOp -> IO ()
peekByteOff :: Ptr b -> Int -> IO CompareOp
$cpeekByteOff :: forall b. Ptr b -> Int -> IO CompareOp
pokeElemOff :: Ptr CompareOp -> Int -> CompareOp -> IO ()
$cpokeElemOff :: Ptr CompareOp -> Int -> CompareOp -> IO ()
peekElemOff :: Ptr CompareOp -> Int -> IO CompareOp
$cpeekElemOff :: Ptr CompareOp -> Int -> IO CompareOp
alignment :: CompareOp -> Int
$calignment :: CompareOp -> Int
sizeOf :: CompareOp -> Int
$csizeOf :: CompareOp -> Int
Storable, CompareOp
CompareOp -> Zero CompareOp
forall a. a -> Zero a
zero :: CompareOp
$czero :: CompareOp
Zero)

-- | 'COMPARE_OP_NEVER' specifies that the test evaluates to false.
pattern $bCOMPARE_OP_NEVER :: CompareOp
$mCOMPARE_OP_NEVER :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_NEVER = CompareOp 0
-- | 'COMPARE_OP_LESS' specifies that the test evaluates A \< B.
pattern $bCOMPARE_OP_LESS :: CompareOp
$mCOMPARE_OP_LESS :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_LESS = CompareOp 1
-- | 'COMPARE_OP_EQUAL' specifies that the test evaluates A = B.
pattern $bCOMPARE_OP_EQUAL :: CompareOp
$mCOMPARE_OP_EQUAL :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_EQUAL = CompareOp 2
-- | 'COMPARE_OP_LESS_OR_EQUAL' specifies that the test evaluates A ≤ B.
pattern $bCOMPARE_OP_LESS_OR_EQUAL :: CompareOp
$mCOMPARE_OP_LESS_OR_EQUAL :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_LESS_OR_EQUAL = CompareOp 3
-- | 'COMPARE_OP_GREATER' specifies that the test evaluates A > B.
pattern $bCOMPARE_OP_GREATER :: CompareOp
$mCOMPARE_OP_GREATER :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_GREATER = CompareOp 4
-- | 'COMPARE_OP_NOT_EQUAL' specifies that the test evaluates A ≠ B.
pattern $bCOMPARE_OP_NOT_EQUAL :: CompareOp
$mCOMPARE_OP_NOT_EQUAL :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_NOT_EQUAL = CompareOp 5
-- | 'COMPARE_OP_GREATER_OR_EQUAL' specifies that the test evaluates A ≥ B.
pattern $bCOMPARE_OP_GREATER_OR_EQUAL :: CompareOp
$mCOMPARE_OP_GREATER_OR_EQUAL :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_GREATER_OR_EQUAL = CompareOp 6
-- | 'COMPARE_OP_ALWAYS' specifies that the test evaluates to true.
pattern $bCOMPARE_OP_ALWAYS :: CompareOp
$mCOMPARE_OP_ALWAYS :: forall r. CompareOp -> (Void# -> r) -> (Void# -> r) -> r
COMPARE_OP_ALWAYS = CompareOp 7
{-# complete COMPARE_OP_NEVER,
             COMPARE_OP_LESS,
             COMPARE_OP_EQUAL,
             COMPARE_OP_LESS_OR_EQUAL,
             COMPARE_OP_GREATER,
             COMPARE_OP_NOT_EQUAL,
             COMPARE_OP_GREATER_OR_EQUAL,
             COMPARE_OP_ALWAYS :: CompareOp #-}

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