-- | 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.Flags
    ( 

 -- * Flags


-- ** PixbufFormatFlags #flag:PixbufFormatFlags#

    PixbufFormatFlags(..)                   ,




    ) 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.Kind as DK
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 PixbufFormatFlags
-- | Flags which allow a module to specify further details about the supported
-- operations.
-- 
-- /Since: 2.2/
data PixbufFormatFlags = 
      PixbufFormatFlagsWritable
    -- ^ the module can write out images in the format.
    | PixbufFormatFlagsScalable
    -- ^ the image format is scalable
    | PixbufFormatFlagsThreadsafe
    -- ^ the module is threadsafe. gdk-pixbuf
    --     ignores modules that are not marked as threadsafe. (Since 2.28).
    | AnotherPixbufFormatFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> PixbufFormatFlags -> ShowS
[PixbufFormatFlags] -> ShowS
PixbufFormatFlags -> String
(Int -> PixbufFormatFlags -> ShowS)
-> (PixbufFormatFlags -> String)
-> ([PixbufFormatFlags] -> ShowS)
-> Show PixbufFormatFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PixbufFormatFlags -> ShowS
showsPrec :: Int -> PixbufFormatFlags -> ShowS
$cshow :: PixbufFormatFlags -> String
show :: PixbufFormatFlags -> String
$cshowList :: [PixbufFormatFlags] -> ShowS
showList :: [PixbufFormatFlags] -> ShowS
Show, PixbufFormatFlags -> PixbufFormatFlags -> Bool
(PixbufFormatFlags -> PixbufFormatFlags -> Bool)
-> (PixbufFormatFlags -> PixbufFormatFlags -> Bool)
-> Eq PixbufFormatFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PixbufFormatFlags -> PixbufFormatFlags -> Bool
== :: PixbufFormatFlags -> PixbufFormatFlags -> Bool
$c/= :: PixbufFormatFlags -> PixbufFormatFlags -> Bool
/= :: PixbufFormatFlags -> PixbufFormatFlags -> Bool
Eq)

instance P.Enum PixbufFormatFlags where
    fromEnum :: PixbufFormatFlags -> Int
fromEnum PixbufFormatFlags
PixbufFormatFlagsWritable = Int
1
    fromEnum PixbufFormatFlags
PixbufFormatFlagsScalable = Int
2
    fromEnum PixbufFormatFlags
PixbufFormatFlagsThreadsafe = Int
4
    fromEnum (AnotherPixbufFormatFlags Int
k) = Int
k

    toEnum :: Int -> PixbufFormatFlags
toEnum Int
1 = PixbufFormatFlags
PixbufFormatFlagsWritable
    toEnum Int
2 = PixbufFormatFlags
PixbufFormatFlagsScalable
    toEnum Int
4 = PixbufFormatFlags
PixbufFormatFlagsThreadsafe
    toEnum Int
k = Int -> PixbufFormatFlags
AnotherPixbufFormatFlags Int
k

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

instance IsGFlag PixbufFormatFlags