-- | 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.GdkPixbuf.Enums
    ( 

 -- * Enumerations


-- ** Colorspace #enum:Colorspace#

    Colorspace(..)                          ,


-- ** InterpType #enum:InterpType#

    InterpType(..)                          ,


-- ** PixbufAlphaMode #enum:PixbufAlphaMode#

    PixbufAlphaMode(..)                     ,


-- ** PixbufError #enum:PixbufError#

    PixbufError(..)                         ,
    catchPixbufError                        ,
    handlePixbufError                       ,


-- ** PixbufRotation #enum:PixbufRotation#

    PixbufRotation(..)                      ,




    ) 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.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


-- Enum PixbufRotation
-- | The possible rotations which can be passed to 'GI.GdkPixbuf.Objects.Pixbuf.pixbufRotateSimple'.
-- 
-- To make them easier to use, their numerical values are the actual degrees.
data PixbufRotation = 
      PixbufRotationNone
    -- ^ No rotation.
    | PixbufRotationCounterclockwise
    -- ^ Rotate by 90 degrees.
    | PixbufRotationUpsidedown
    -- ^ Rotate by 180 degrees.
    | PixbufRotationClockwise
    -- ^ Rotate by 270 degrees.
    | AnotherPixbufRotation Int
    -- ^ Catch-all for unknown values
    deriving (Int -> PixbufRotation -> ShowS
[PixbufRotation] -> ShowS
PixbufRotation -> String
(Int -> PixbufRotation -> ShowS)
-> (PixbufRotation -> String)
-> ([PixbufRotation] -> ShowS)
-> Show PixbufRotation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PixbufRotation] -> ShowS
$cshowList :: [PixbufRotation] -> ShowS
show :: PixbufRotation -> String
$cshow :: PixbufRotation -> String
showsPrec :: Int -> PixbufRotation -> ShowS
$cshowsPrec :: Int -> PixbufRotation -> ShowS
Show, PixbufRotation -> PixbufRotation -> Bool
(PixbufRotation -> PixbufRotation -> Bool)
-> (PixbufRotation -> PixbufRotation -> Bool) -> Eq PixbufRotation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufRotation -> PixbufRotation -> Bool
$c/= :: PixbufRotation -> PixbufRotation -> Bool
== :: PixbufRotation -> PixbufRotation -> Bool
$c== :: PixbufRotation -> PixbufRotation -> Bool
Eq)

instance P.Enum PixbufRotation where
    fromEnum :: PixbufRotation -> Int
fromEnum PixbufRotation
PixbufRotationNone = Int
0
    fromEnum PixbufRotation
PixbufRotationCounterclockwise = Int
90
    fromEnum PixbufRotation
PixbufRotationUpsidedown = Int
180
    fromEnum PixbufRotation
PixbufRotationClockwise = Int
270
    fromEnum (AnotherPixbufRotation Int
k) = Int
k

    toEnum :: Int -> PixbufRotation
toEnum Int
0 = PixbufRotation
PixbufRotationNone
    toEnum Int
90 = PixbufRotation
PixbufRotationCounterclockwise
    toEnum Int
180 = PixbufRotation
PixbufRotationUpsidedown
    toEnum Int
270 = PixbufRotation
PixbufRotationClockwise
    toEnum Int
k = Int -> PixbufRotation
AnotherPixbufRotation Int
k

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

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

foreign import ccall "gdk_pixbuf_rotation_get_type" c_gdk_pixbuf_rotation_get_type :: 
    IO GType

instance B.Types.TypedObject PixbufRotation where
    glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_rotation_get_type

instance B.Types.BoxedEnum PixbufRotation

-- Enum PixbufError
-- | An error code in the @GDK_PIXBUF_ERROR@ domain.
-- 
-- Many gdk-pixbuf operations can cause errors in this domain, or in
-- the @G_FILE_ERROR@ domain.
data PixbufError = 
      PixbufErrorCorruptImage
    -- ^ An image file was broken somehow.
    | PixbufErrorInsufficientMemory
    -- ^ Not enough memory.
    | PixbufErrorBadOption
    -- ^ A bad option was passed to a pixbuf save module.
    | PixbufErrorUnknownType
    -- ^ Unknown image type.
    | PixbufErrorUnsupportedOperation
    -- ^ Don\'t know how to perform the
    --  given operation on the type of image at hand.
    | PixbufErrorFailed
    -- ^ Generic failure code, something went wrong.
    | PixbufErrorIncompleteAnimation
    -- ^ Only part of the animation was loaded.
    | AnotherPixbufError Int
    -- ^ Catch-all for unknown values
    deriving (Int -> PixbufError -> ShowS
[PixbufError] -> ShowS
PixbufError -> String
(Int -> PixbufError -> ShowS)
-> (PixbufError -> String)
-> ([PixbufError] -> ShowS)
-> Show PixbufError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PixbufError] -> ShowS
$cshowList :: [PixbufError] -> ShowS
show :: PixbufError -> String
$cshow :: PixbufError -> String
showsPrec :: Int -> PixbufError -> ShowS
$cshowsPrec :: Int -> PixbufError -> ShowS
Show, PixbufError -> PixbufError -> Bool
(PixbufError -> PixbufError -> Bool)
-> (PixbufError -> PixbufError -> Bool) -> Eq PixbufError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufError -> PixbufError -> Bool
$c/= :: PixbufError -> PixbufError -> Bool
== :: PixbufError -> PixbufError -> Bool
$c== :: PixbufError -> PixbufError -> Bool
Eq)

instance P.Enum PixbufError where
    fromEnum :: PixbufError -> Int
fromEnum PixbufError
PixbufErrorCorruptImage = Int
0
    fromEnum PixbufError
PixbufErrorInsufficientMemory = Int
1
    fromEnum PixbufError
PixbufErrorBadOption = Int
2
    fromEnum PixbufError
PixbufErrorUnknownType = Int
3
    fromEnum PixbufError
PixbufErrorUnsupportedOperation = Int
4
    fromEnum PixbufError
PixbufErrorFailed = Int
5
    fromEnum PixbufError
PixbufErrorIncompleteAnimation = Int
6
    fromEnum (AnotherPixbufError Int
k) = Int
k

    toEnum :: Int -> PixbufError
toEnum Int
0 = PixbufError
PixbufErrorCorruptImage
    toEnum Int
1 = PixbufError
PixbufErrorInsufficientMemory
    toEnum Int
2 = PixbufError
PixbufErrorBadOption
    toEnum Int
3 = PixbufError
PixbufErrorUnknownType
    toEnum Int
4 = PixbufError
PixbufErrorUnsupportedOperation
    toEnum Int
5 = PixbufError
PixbufErrorFailed
    toEnum Int
6 = PixbufError
PixbufErrorIncompleteAnimation
    toEnum Int
k = Int -> PixbufError
AnotherPixbufError Int
k

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

instance GErrorClass PixbufError where
    gerrorClassDomain :: PixbufError -> Text
gerrorClassDomain PixbufError
_ = Text
"gdk-pixbuf-error-quark"

-- | Catch exceptions of type `PixbufError`. This is a specialized version of `Data.GI.Base.GError.catchGErrorJustDomain`.
catchPixbufError ::
    IO a ->
    (PixbufError -> GErrorMessage -> IO a) ->
    IO a
catchPixbufError :: forall a. IO a -> (PixbufError -> Text -> IO a) -> IO a
catchPixbufError = IO a -> (PixbufError -> Text -> IO a) -> IO a
forall err a.
GErrorClass err =>
IO a -> (err -> Text -> IO a) -> IO a
catchGErrorJustDomain

-- | Handle exceptions of type `PixbufError`. This is a specialized version of `Data.GI.Base.GError.handleGErrorJustDomain`.
handlePixbufError ::
    (PixbufError -> GErrorMessage -> IO a) ->
    IO a ->
    IO a
handlePixbufError :: forall a. (PixbufError -> Text -> IO a) -> IO a -> IO a
handlePixbufError = (PixbufError -> Text -> IO a) -> IO a -> IO a
forall err a.
GErrorClass err =>
(err -> Text -> IO a) -> IO a -> IO a
handleGErrorJustDomain

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

foreign import ccall "gdk_pixbuf_error_get_type" c_gdk_pixbuf_error_get_type :: 
    IO GType

instance B.Types.TypedObject PixbufError where
    glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_error_get_type

instance B.Types.BoxedEnum PixbufError

-- Enum PixbufAlphaMode
{-# DEPRECATED PixbufAlphaMode ["(Since version 2.42)","There is no user of GdkPixbufAlphaMode in GdkPixbuf,","  and the Xlib utility functions have been split out to their own","  library, gdk-pixbuf-xlib"] #-}
-- | Control the alpha channel for drawables.
-- 
-- These values can be passed to @/gdk_pixbuf_xlib_render_to_drawable_alpha()/@
-- in gdk-pixbuf-xlib to control how the alpha channel of an image should
-- be handled.
-- 
-- This function can create a bilevel clipping mask (black and white) and use
-- it while painting the image.
-- 
-- In the future, when the X Window System gets an alpha channel extension,
-- it will be possible to do full alpha compositing onto arbitrary drawables.
-- For now both cases fall back to a bilevel clipping mask.
data PixbufAlphaMode = 
      PixbufAlphaModeBilevel
    -- ^ A bilevel clipping mask (black and white)
    --  will be created and used to draw the image.  Pixels below 0.5 opacity
    --  will be considered fully transparent, and all others will be
    --  considered fully opaque.
    | PixbufAlphaModeFull
    -- ^ For now falls back to @/GDK_PIXBUF_ALPHA_BILEVEL/@.
    --  In the future it will do full alpha compositing.
    | AnotherPixbufAlphaMode Int
    -- ^ Catch-all for unknown values
    deriving (Int -> PixbufAlphaMode -> ShowS
[PixbufAlphaMode] -> ShowS
PixbufAlphaMode -> String
(Int -> PixbufAlphaMode -> ShowS)
-> (PixbufAlphaMode -> String)
-> ([PixbufAlphaMode] -> ShowS)
-> Show PixbufAlphaMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PixbufAlphaMode] -> ShowS
$cshowList :: [PixbufAlphaMode] -> ShowS
show :: PixbufAlphaMode -> String
$cshow :: PixbufAlphaMode -> String
showsPrec :: Int -> PixbufAlphaMode -> ShowS
$cshowsPrec :: Int -> PixbufAlphaMode -> ShowS
Show, PixbufAlphaMode -> PixbufAlphaMode -> Bool
(PixbufAlphaMode -> PixbufAlphaMode -> Bool)
-> (PixbufAlphaMode -> PixbufAlphaMode -> Bool)
-> Eq PixbufAlphaMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PixbufAlphaMode -> PixbufAlphaMode -> Bool
$c/= :: PixbufAlphaMode -> PixbufAlphaMode -> Bool
== :: PixbufAlphaMode -> PixbufAlphaMode -> Bool
$c== :: PixbufAlphaMode -> PixbufAlphaMode -> Bool
Eq)

instance P.Enum PixbufAlphaMode where
    fromEnum :: PixbufAlphaMode -> Int
fromEnum PixbufAlphaMode
PixbufAlphaModeBilevel = Int
0
    fromEnum PixbufAlphaMode
PixbufAlphaModeFull = Int
1
    fromEnum (AnotherPixbufAlphaMode Int
k) = Int
k

    toEnum :: Int -> PixbufAlphaMode
toEnum Int
0 = PixbufAlphaMode
PixbufAlphaModeBilevel
    toEnum Int
1 = PixbufAlphaMode
PixbufAlphaModeFull
    toEnum Int
k = Int -> PixbufAlphaMode
AnotherPixbufAlphaMode Int
k

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

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

foreign import ccall "gdk_pixbuf_alpha_mode_get_type" c_gdk_pixbuf_alpha_mode_get_type :: 
    IO GType

instance B.Types.TypedObject PixbufAlphaMode where
    glibType :: IO GType
glibType = IO GType
c_gdk_pixbuf_alpha_mode_get_type

instance B.Types.BoxedEnum PixbufAlphaMode

-- Enum InterpType
-- | Interpolation modes for scaling functions.
-- 
-- The @GDK_INTERP_NEAREST@ mode is the fastest scaling method, but has
-- horrible quality when scaling down; @GDK_INTERP_BILINEAR@ is the best
-- choice if you aren\'t sure what to choose, it has a good speed\/quality
-- balance.
-- 
-- **Note**: Cubic filtering is missing from the list; hyperbolic
-- interpolation is just as fast and results in higher quality.
data InterpType = 
      InterpTypeNearest
    -- ^ Nearest neighbor sampling; this is the fastest
    --  and lowest quality mode. Quality is normally unacceptable when scaling
    --  down, but may be OK when scaling up.
    | InterpTypeTiles
    -- ^ This is an accurate simulation of the PostScript
    --  image operator without any interpolation enabled.  Each pixel is
    --  rendered as a tiny parallelogram of solid color, the edges of which
    --  are implemented with antialiasing.  It resembles nearest neighbor for
    --  enlargement, and bilinear for reduction.
    | InterpTypeBilinear
    -- ^ Best quality\/speed balance; use this mode by
    --  default. Bilinear interpolation.  For enlargement, it is
    --  equivalent to point-sampling the ideal bilinear-interpolated image.
    --  For reduction, it is equivalent to laying down small tiles and
    --  integrating over the coverage area.
    | InterpTypeHyper
    -- ^ This is the slowest and highest quality
    --  reconstruction function. It is derived from the hyperbolic filters in
    --  Wolberg\'s \"Digital Image Warping\", and is formally defined as the
    --  hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
    --  image (the filter is designed to be idempotent for 1:1 pixel mapping).
    --  **Deprecated**: this interpolation filter is deprecated, as in reality
    --  it has a lower quality than the /@gDKINTERPBILINEAR@/ filter
    --  (Since: 2.38)
    | AnotherInterpType Int
    -- ^ Catch-all for unknown values
    deriving (Int -> InterpType -> ShowS
[InterpType] -> ShowS
InterpType -> String
(Int -> InterpType -> ShowS)
-> (InterpType -> String)
-> ([InterpType] -> ShowS)
-> Show InterpType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InterpType] -> ShowS
$cshowList :: [InterpType] -> ShowS
show :: InterpType -> String
$cshow :: InterpType -> String
showsPrec :: Int -> InterpType -> ShowS
$cshowsPrec :: Int -> InterpType -> ShowS
Show, InterpType -> InterpType -> Bool
(InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> Bool) -> Eq InterpType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InterpType -> InterpType -> Bool
$c/= :: InterpType -> InterpType -> Bool
== :: InterpType -> InterpType -> Bool
$c== :: InterpType -> InterpType -> Bool
Eq)

instance P.Enum InterpType where
    fromEnum :: InterpType -> Int
fromEnum InterpType
InterpTypeNearest = Int
0
    fromEnum InterpType
InterpTypeTiles = Int
1
    fromEnum InterpType
InterpTypeBilinear = Int
2
    fromEnum InterpType
InterpTypeHyper = Int
3
    fromEnum (AnotherInterpType Int
k) = Int
k

    toEnum :: Int -> InterpType
toEnum Int
0 = InterpType
InterpTypeNearest
    toEnum Int
1 = InterpType
InterpTypeTiles
    toEnum Int
2 = InterpType
InterpTypeBilinear
    toEnum Int
3 = InterpType
InterpTypeHyper
    toEnum Int
k = Int -> InterpType
AnotherInterpType Int
k

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

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

foreign import ccall "gdk_interp_type_get_type" c_gdk_interp_type_get_type :: 
    IO GType

instance B.Types.TypedObject InterpType where
    glibType :: IO GType
glibType = IO GType
c_gdk_interp_type_get_type

instance B.Types.BoxedEnum InterpType

-- Enum Colorspace
-- | This enumeration defines the color spaces that are supported by
-- the gdk-pixbuf library.
-- 
-- Currently only RGB is supported.
data Colorspace = 
      ColorspaceRgb
    -- ^ Indicates a red\/green\/blue additive color space.
    | AnotherColorspace Int
    -- ^ Catch-all for unknown values
    deriving (Int -> Colorspace -> ShowS
[Colorspace] -> ShowS
Colorspace -> String
(Int -> Colorspace -> ShowS)
-> (Colorspace -> String)
-> ([Colorspace] -> ShowS)
-> Show Colorspace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Colorspace] -> ShowS
$cshowList :: [Colorspace] -> ShowS
show :: Colorspace -> String
$cshow :: Colorspace -> String
showsPrec :: Int -> Colorspace -> ShowS
$cshowsPrec :: Int -> Colorspace -> ShowS
Show, Colorspace -> Colorspace -> Bool
(Colorspace -> Colorspace -> Bool)
-> (Colorspace -> Colorspace -> Bool) -> Eq Colorspace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Colorspace -> Colorspace -> Bool
$c/= :: Colorspace -> Colorspace -> Bool
== :: Colorspace -> Colorspace -> Bool
$c== :: Colorspace -> Colorspace -> Bool
Eq)

instance P.Enum Colorspace where
    fromEnum :: Colorspace -> Int
fromEnum Colorspace
ColorspaceRgb = Int
0
    fromEnum (AnotherColorspace Int
k) = Int
k

    toEnum :: Int -> Colorspace
toEnum Int
0 = Colorspace
ColorspaceRgb
    toEnum Int
k = Int -> Colorspace
AnotherColorspace Int
k

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

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

foreign import ccall "gdk_colorspace_get_type" c_gdk_colorspace_get_type :: 
    IO GType

instance B.Types.TypedObject Colorspace where
    glibType :: IO GType
glibType = IO GType
c_gdk_colorspace_get_type

instance B.Types.BoxedEnum Colorspace