{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
-}

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

module GI.Pango.Flags
    (

 -- * Flags
-- ** FontMask #flag:FontMask#

    FontMask(..)                            ,




    ) 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.ManagedPtr as B.ManagedPtr
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.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


-- Flags FontMask
{- |
The bits in a 'GI.Pango.Flags.FontMask' correspond to fields in a
'GI.Pango.Structs.FontDescription.FontDescription' that have been set.
-}
data FontMask =
      FontMaskFamily
    {- ^
    the font family is specified.
    -}
    | FontMaskStyle
    {- ^
    the font style is specified.
    -}
    | FontMaskVariant
    {- ^
    the font variant is specified.
    -}
    | FontMaskWeight
    {- ^
    the font weight is specified.
    -}
    | FontMaskStretch
    {- ^
    the font stretch is specified.
    -}
    | FontMaskSize
    {- ^
    the font size is specified.
    -}
    | FontMaskGravity
    {- ^
    the font gravity is specified (Since: 1.16.)
    -}
    | FontMaskVariations
    {- ^
    OpenType font variations are specified (Since: 1.42)
    -}
    | AnotherFontMask Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum FontMask where
    fromEnum FontMaskFamily = 1
    fromEnum FontMaskStyle = 2
    fromEnum FontMaskVariant = 4
    fromEnum FontMaskWeight = 8
    fromEnum FontMaskStretch = 16
    fromEnum FontMaskSize = 32
    fromEnum FontMaskGravity = 64
    fromEnum FontMaskVariations = 128
    fromEnum (AnotherFontMask k) = k

    toEnum 1 = FontMaskFamily
    toEnum 2 = FontMaskStyle
    toEnum 4 = FontMaskVariant
    toEnum 8 = FontMaskWeight
    toEnum 16 = FontMaskStretch
    toEnum 32 = FontMaskSize
    toEnum 64 = FontMaskGravity
    toEnum 128 = FontMaskVariations
    toEnum k = AnotherFontMask k

instance P.Ord FontMask where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "pango_font_mask_get_type" c_pango_font_mask_get_type ::
    IO GType

instance BoxedFlags FontMask where
    boxedFlagsType _ = c_pango_font_mask_get_type

instance IsGFlag FontMask