-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Vips.Flags
    ( 

 -- * Flags


-- ** ArgumentFlags #flag:ArgumentFlags#

    ArgumentFlags(..)                       ,


-- ** ForeignFlags #flag:ForeignFlags#

    ForeignFlags(..)                        ,


-- ** ForeignPngFilter #flag:ForeignPngFilter#

    ForeignPngFilter(..)                    ,


-- ** OperationFlags #flag:OperationFlags#

    OperationFlags(..)                      ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R


-- Flags OperationFlags
-- | Flags we associate with an operation.
-- 
-- /@vIPSOPERATIONSEQUENTIAL@/ means that the operation works like @/vips_conv()/@:
-- it can process images top-to-bottom with only small non-local
-- references.
-- 
-- Every scan-line must be requested, you are not allowed to skip
-- ahead, but as a special case, the very first request can be for a region
-- not at the top of the image. In this case, the first part of the image will
-- be read and discarded
-- 
-- Every scan-line must be requested, you are not allowed to skip
-- ahead, but as a special case, the very first request can be for a region
-- not at the top of the image. In this case, the first part of the image will
-- be read and discarded
-- 
-- /@vIPSOPERATIONNOCACHE@/ means that the operation must not be cached by
-- vips.
-- 
-- /@vIPSOPERATIONDEPRECATED@/ means this is an old operation kept in vips for
-- compatibility only and should be hidden from users.
-- 
-- /@vIPSOPERATIONUNTRUSTED@/ means the operation depends on external libraries
-- which have not been hardened against attack. It should probably not be used
-- on untrusted input. Use 'GI.Vips.Functions.blockUntrustedSet' to block all
-- untrusted operations.
-- 
-- /@vIPSOPERATIONBLOCKED@/ means the operation is prevented from executing. Use
-- 'GI.Vips.Objects.Operation.operationBlockSet' to enable and disable groups of operations.
data OperationFlags = 
      OperationFlagsNone
    -- ^ no flags
    | OperationFlagsSequential
    -- ^ can work sequentially with a small buffer
    | OperationFlagsSequentialUnbuffered
    -- ^ /No description available in the introspection data./
    | OperationFlagsNocache
    -- ^ must not be cached
    | OperationFlagsDeprecated
    -- ^ a compatibility thing
    | OperationFlagsUntrusted
    -- ^ not hardened for untrusted input
    | OperationFlagsBlocked
    -- ^ prevent this operation from running
    | AnotherOperationFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> OperationFlags -> ShowS
[OperationFlags] -> ShowS
OperationFlags -> String
(Int -> OperationFlags -> ShowS)
-> (OperationFlags -> String)
-> ([OperationFlags] -> ShowS)
-> Show OperationFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OperationFlags -> ShowS
showsPrec :: Int -> OperationFlags -> ShowS
$cshow :: OperationFlags -> String
show :: OperationFlags -> String
$cshowList :: [OperationFlags] -> ShowS
showList :: [OperationFlags] -> ShowS
Show, OperationFlags -> OperationFlags -> Bool
(OperationFlags -> OperationFlags -> Bool)
-> (OperationFlags -> OperationFlags -> Bool) -> Eq OperationFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OperationFlags -> OperationFlags -> Bool
== :: OperationFlags -> OperationFlags -> Bool
$c/= :: OperationFlags -> OperationFlags -> Bool
/= :: OperationFlags -> OperationFlags -> Bool
Eq)

instance P.Enum OperationFlags where
    fromEnum :: OperationFlags -> Int
fromEnum OperationFlags
OperationFlagsNone = Int
0
    fromEnum OperationFlags
OperationFlagsSequential = Int
1
    fromEnum OperationFlags
OperationFlagsSequentialUnbuffered = Int
2
    fromEnum OperationFlags
OperationFlagsNocache = Int
4
    fromEnum OperationFlags
OperationFlagsDeprecated = Int
8
    fromEnum OperationFlags
OperationFlagsUntrusted = Int
16
    fromEnum OperationFlags
OperationFlagsBlocked = Int
32
    fromEnum (AnotherOperationFlags Int
k) = Int
k

    toEnum :: Int -> OperationFlags
toEnum Int
0 = OperationFlags
OperationFlagsNone
    toEnum Int
1 = OperationFlags
OperationFlagsSequential
    toEnum Int
2 = OperationFlags
OperationFlagsSequentialUnbuffered
    toEnum Int
4 = OperationFlags
OperationFlagsNocache
    toEnum Int
8 = OperationFlags
OperationFlagsDeprecated
    toEnum Int
16 = OperationFlags
OperationFlagsUntrusted
    toEnum Int
32 = OperationFlags
OperationFlagsBlocked
    toEnum Int
k = Int -> OperationFlags
AnotherOperationFlags Int
k

instance P.Ord OperationFlags where
    compare :: OperationFlags -> OperationFlags -> Ordering
compare OperationFlags
a OperationFlags
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (OperationFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum OperationFlags
a) (OperationFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum OperationFlags
b)

type instance O.ParentTypes OperationFlags = '[]
instance O.HasParentTypes OperationFlags

foreign import ccall "vips_operation_flags_get_type" c_vips_operation_flags_get_type :: 
    IO GType

instance B.Types.TypedObject OperationFlags where
    glibType :: IO GType
glibType = IO GType
c_vips_operation_flags_get_type

instance B.Types.BoxedFlags OperationFlags

instance IsGFlag OperationFlags

-- Flags ForeignPngFilter
-- | http:\/\/www.w3.org\/TR\/PNG-Filters.html
-- The values mirror those of png.h in libpng.
data ForeignPngFilter = 
      ForeignPngFilterNone
    -- ^ no filtering
    | ForeignPngFilterSub
    -- ^ difference to the left
    | ForeignPngFilterUp
    -- ^ difference up
    | ForeignPngFilterAvg
    -- ^ average of left and up
    | ForeignPngFilterPaeth
    -- ^ pick best neighbor predictor automatically
    | ForeignPngFilterAll
    -- ^ adaptive
    | AnotherForeignPngFilter Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ForeignPngFilter -> ShowS
[ForeignPngFilter] -> ShowS
ForeignPngFilter -> String
(Int -> ForeignPngFilter -> ShowS)
-> (ForeignPngFilter -> String)
-> ([ForeignPngFilter] -> ShowS)
-> Show ForeignPngFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForeignPngFilter -> ShowS
showsPrec :: Int -> ForeignPngFilter -> ShowS
$cshow :: ForeignPngFilter -> String
show :: ForeignPngFilter -> String
$cshowList :: [ForeignPngFilter] -> ShowS
showList :: [ForeignPngFilter] -> ShowS
Show, ForeignPngFilter -> ForeignPngFilter -> Bool
(ForeignPngFilter -> ForeignPngFilter -> Bool)
-> (ForeignPngFilter -> ForeignPngFilter -> Bool)
-> Eq ForeignPngFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ForeignPngFilter -> ForeignPngFilter -> Bool
== :: ForeignPngFilter -> ForeignPngFilter -> Bool
$c/= :: ForeignPngFilter -> ForeignPngFilter -> Bool
/= :: ForeignPngFilter -> ForeignPngFilter -> Bool
Eq)

instance P.Enum ForeignPngFilter where
    fromEnum :: ForeignPngFilter -> Int
fromEnum ForeignPngFilter
ForeignPngFilterNone = Int
8
    fromEnum ForeignPngFilter
ForeignPngFilterSub = Int
16
    fromEnum ForeignPngFilter
ForeignPngFilterUp = Int
32
    fromEnum ForeignPngFilter
ForeignPngFilterAvg = Int
64
    fromEnum ForeignPngFilter
ForeignPngFilterPaeth = Int
128
    fromEnum ForeignPngFilter
ForeignPngFilterAll = Int
248
    fromEnum (AnotherForeignPngFilter Int
k) = Int
k

    toEnum :: Int -> ForeignPngFilter
toEnum Int
8 = ForeignPngFilter
ForeignPngFilterNone
    toEnum Int
16 = ForeignPngFilter
ForeignPngFilterSub
    toEnum Int
32 = ForeignPngFilter
ForeignPngFilterUp
    toEnum Int
64 = ForeignPngFilter
ForeignPngFilterAvg
    toEnum Int
128 = ForeignPngFilter
ForeignPngFilterPaeth
    toEnum Int
248 = ForeignPngFilter
ForeignPngFilterAll
    toEnum Int
k = Int -> ForeignPngFilter
AnotherForeignPngFilter Int
k

instance P.Ord ForeignPngFilter where
    compare :: ForeignPngFilter -> ForeignPngFilter -> Ordering
compare ForeignPngFilter
a ForeignPngFilter
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ForeignPngFilter -> Int
forall a. Enum a => a -> Int
P.fromEnum ForeignPngFilter
a) (ForeignPngFilter -> Int
forall a. Enum a => a -> Int
P.fromEnum ForeignPngFilter
b)

type instance O.ParentTypes ForeignPngFilter = '[]
instance O.HasParentTypes ForeignPngFilter

foreign import ccall "vips_foreign_png_filter_get_type" c_vips_foreign_png_filter_get_type :: 
    IO GType

instance B.Types.TypedObject ForeignPngFilter where
    glibType :: IO GType
glibType = IO GType
c_vips_foreign_png_filter_get_type

instance B.Types.BoxedFlags ForeignPngFilter

instance IsGFlag ForeignPngFilter

-- Flags ForeignFlags
-- | Some hints about the image loader.
-- 
-- @/VIPS_FOREIGN_PARTIAL/@ means that the image can be read directly from the
-- file without needing to be unpacked to a temporary image first.
-- 
-- @/VIPS_FOREIGN_SEQUENTIAL/@ means that the loader supports lazy reading, but
-- only top-to-bottom (sequential) access. Formats like PNG can read sets of
-- scanlines, for example, but only in order.
-- 
-- If neither PARTIAL or SEQUENTIAL is set, the loader only supports whole
-- image read. Setting both PARTIAL and SEQUENTIAL is an error.
-- 
-- @/VIPS_FOREIGN_BIGENDIAN/@ means that image pixels are most-significant byte
-- first. Depending on the native byte order of the host machine, you may
-- need to swap bytes. See @/vips_copy()/@.
data ForeignFlags = 
      ForeignFlagsNone
    -- ^ no flags set
    | ForeignFlagsPartial
    -- ^ the image may be read lazilly
    | ForeignFlagsBigendian
    -- ^ image pixels are most-significant byte first
    | ForeignFlagsSequential
    -- ^ top-to-bottom lazy reading
    | ForeignFlagsAll
    -- ^ /No description available in the introspection data./
    | AnotherForeignFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ForeignFlags -> ShowS
[ForeignFlags] -> ShowS
ForeignFlags -> String
(Int -> ForeignFlags -> ShowS)
-> (ForeignFlags -> String)
-> ([ForeignFlags] -> ShowS)
-> Show ForeignFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForeignFlags -> ShowS
showsPrec :: Int -> ForeignFlags -> ShowS
$cshow :: ForeignFlags -> String
show :: ForeignFlags -> String
$cshowList :: [ForeignFlags] -> ShowS
showList :: [ForeignFlags] -> ShowS
Show, ForeignFlags -> ForeignFlags -> Bool
(ForeignFlags -> ForeignFlags -> Bool)
-> (ForeignFlags -> ForeignFlags -> Bool) -> Eq ForeignFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ForeignFlags -> ForeignFlags -> Bool
== :: ForeignFlags -> ForeignFlags -> Bool
$c/= :: ForeignFlags -> ForeignFlags -> Bool
/= :: ForeignFlags -> ForeignFlags -> Bool
Eq)

instance P.Enum ForeignFlags where
    fromEnum :: ForeignFlags -> Int
fromEnum ForeignFlags
ForeignFlagsNone = Int
0
    fromEnum ForeignFlags
ForeignFlagsPartial = Int
1
    fromEnum ForeignFlags
ForeignFlagsBigendian = Int
2
    fromEnum ForeignFlags
ForeignFlagsSequential = Int
4
    fromEnum ForeignFlags
ForeignFlagsAll = Int
7
    fromEnum (AnotherForeignFlags Int
k) = Int
k

    toEnum :: Int -> ForeignFlags
toEnum Int
0 = ForeignFlags
ForeignFlagsNone
    toEnum Int
1 = ForeignFlags
ForeignFlagsPartial
    toEnum Int
2 = ForeignFlags
ForeignFlagsBigendian
    toEnum Int
4 = ForeignFlags
ForeignFlagsSequential
    toEnum Int
7 = ForeignFlags
ForeignFlagsAll
    toEnum Int
k = Int -> ForeignFlags
AnotherForeignFlags Int
k

instance P.Ord ForeignFlags where
    compare :: ForeignFlags -> ForeignFlags -> Ordering
compare ForeignFlags
a ForeignFlags
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ForeignFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ForeignFlags
a) (ForeignFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ForeignFlags
b)

type instance O.ParentTypes ForeignFlags = '[]
instance O.HasParentTypes ForeignFlags

foreign import ccall "vips_foreign_flags_get_type" c_vips_foreign_flags_get_type :: 
    IO GType

instance B.Types.TypedObject ForeignFlags where
    glibType :: IO GType
glibType = IO GType
c_vips_foreign_flags_get_type

instance B.Types.BoxedFlags ForeignFlags

instance IsGFlag ForeignFlags

-- Flags ArgumentFlags
-- | Flags we associate with each object argument.
-- 
-- Have separate input & output flags. Both set is an error; neither set is OK.
-- 
-- Input gobjects are automatically reffed, output gobjects automatically ref
-- us. We also automatically watch for \"destroy\" and unlink.
-- 
-- /@vIPSARGUMENTSETALWAYS@/ is handy for arguments which are set from C. For
-- example, VipsImage[width](#g:signal:width) is a property that gives access to the Xsize
-- member of struct _VipsImage. We default its \'assigned\' to TRUE
-- since the field is always set directly by C.
-- 
-- /@vIPSARGUMENTDEPRECATED@/ arguments are not shown in help text, are not
-- looked for if required, are not checked for \"have-been-set\". You can
-- deprecate a required argument, but you must obviously add a new required
-- argument if you do.
-- 
-- Input args with /@vIPSARGUMENTMODIFY@/ will be modified by the operation.
-- This is used for things like the in-place drawing operations.
data ArgumentFlags = 
      ArgumentFlagsNone
    -- ^ no flags
    | ArgumentFlagsRequired
    -- ^ must be set in the constructor
    | ArgumentFlagsConstruct
    -- ^ can only be set in the constructor
    | ArgumentFlagsSetOnce
    -- ^ can only be set once
    | ArgumentFlagsSetAlways
    -- ^ don\'t do use-before-set checks
    | ArgumentFlagsInput
    -- ^ is an input argument (one we depend on)
    | ArgumentFlagsOutput
    -- ^ is an output argument (depends on us)
    | ArgumentFlagsDeprecated
    -- ^ just there for back-compat, hide
    | ArgumentFlagsModify
    -- ^ the input argument will be modified
    | AnotherArgumentFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ArgumentFlags -> ShowS
[ArgumentFlags] -> ShowS
ArgumentFlags -> String
(Int -> ArgumentFlags -> ShowS)
-> (ArgumentFlags -> String)
-> ([ArgumentFlags] -> ShowS)
-> Show ArgumentFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ArgumentFlags -> ShowS
showsPrec :: Int -> ArgumentFlags -> ShowS
$cshow :: ArgumentFlags -> String
show :: ArgumentFlags -> String
$cshowList :: [ArgumentFlags] -> ShowS
showList :: [ArgumentFlags] -> ShowS
Show, ArgumentFlags -> ArgumentFlags -> Bool
(ArgumentFlags -> ArgumentFlags -> Bool)
-> (ArgumentFlags -> ArgumentFlags -> Bool) -> Eq ArgumentFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ArgumentFlags -> ArgumentFlags -> Bool
== :: ArgumentFlags -> ArgumentFlags -> Bool
$c/= :: ArgumentFlags -> ArgumentFlags -> Bool
/= :: ArgumentFlags -> ArgumentFlags -> Bool
Eq)

instance P.Enum ArgumentFlags where
    fromEnum :: ArgumentFlags -> Int
fromEnum ArgumentFlags
ArgumentFlagsNone = Int
0
    fromEnum ArgumentFlags
ArgumentFlagsRequired = Int
1
    fromEnum ArgumentFlags
ArgumentFlagsConstruct = Int
2
    fromEnum ArgumentFlags
ArgumentFlagsSetOnce = Int
4
    fromEnum ArgumentFlags
ArgumentFlagsSetAlways = Int
8
    fromEnum ArgumentFlags
ArgumentFlagsInput = Int
16
    fromEnum ArgumentFlags
ArgumentFlagsOutput = Int
32
    fromEnum ArgumentFlags
ArgumentFlagsDeprecated = Int
64
    fromEnum ArgumentFlags
ArgumentFlagsModify = Int
128
    fromEnum (AnotherArgumentFlags Int
k) = Int
k

    toEnum :: Int -> ArgumentFlags
toEnum Int
0 = ArgumentFlags
ArgumentFlagsNone
    toEnum Int
1 = ArgumentFlags
ArgumentFlagsRequired
    toEnum Int
2 = ArgumentFlags
ArgumentFlagsConstruct
    toEnum Int
4 = ArgumentFlags
ArgumentFlagsSetOnce
    toEnum Int
8 = ArgumentFlags
ArgumentFlagsSetAlways
    toEnum Int
16 = ArgumentFlags
ArgumentFlagsInput
    toEnum Int
32 = ArgumentFlags
ArgumentFlagsOutput
    toEnum Int
64 = ArgumentFlags
ArgumentFlagsDeprecated
    toEnum Int
128 = ArgumentFlags
ArgumentFlagsModify
    toEnum Int
k = Int -> ArgumentFlags
AnotherArgumentFlags Int
k

instance P.Ord ArgumentFlags where
    compare :: ArgumentFlags -> ArgumentFlags -> Ordering
compare ArgumentFlags
a ArgumentFlags
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ArgumentFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ArgumentFlags
a) (ArgumentFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ArgumentFlags
b)

type instance O.ParentTypes ArgumentFlags = '[]
instance O.HasParentTypes ArgumentFlags

foreign import ccall "vips_argument_flags_get_type" c_vips_argument_flags_get_type :: 
    IO GType

instance B.Types.TypedObject ArgumentFlags where
    glibType :: IO GType
glibType = IO GType
c_vips_argument_flags_get_type

instance B.Types.BoxedFlags ArgumentFlags

instance IsGFlag ArgumentFlags