-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- 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.Pango.Flags
    ( 

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

    FontMask(..)                            ,


-- ** ShapeFlags #flag:ShapeFlags#

    ShapeFlags(..)                          ,


-- ** ShowFlags #flag:ShowFlags#

    ShowFlags(..)                           ,




    ) 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.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.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 ShowFlags
-- | These flags affect how Pango treats characters that are normally
-- not visible in the output.
data ShowFlags = 
      ShowFlagsNone
    -- ^ No special treatment for invisible characters
    | ShowFlagsSpaces
    -- ^ Render spaces, tabs and newlines visibly
    | ShowFlagsLineBreaks
    -- ^ Render line breaks visibly
    | ShowFlagsIgnorables
    -- ^ Render default-ignorable Unicode
    --      characters visibly
    | AnotherShowFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ShowFlags -> ShowS
[ShowFlags] -> ShowS
ShowFlags -> String
(Int -> ShowFlags -> ShowS)
-> (ShowFlags -> String)
-> ([ShowFlags] -> ShowS)
-> Show ShowFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShowFlags] -> ShowS
$cshowList :: [ShowFlags] -> ShowS
show :: ShowFlags -> String
$cshow :: ShowFlags -> String
showsPrec :: Int -> ShowFlags -> ShowS
$cshowsPrec :: Int -> ShowFlags -> ShowS
Show, ShowFlags -> ShowFlags -> Bool
(ShowFlags -> ShowFlags -> Bool)
-> (ShowFlags -> ShowFlags -> Bool) -> Eq ShowFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShowFlags -> ShowFlags -> Bool
$c/= :: ShowFlags -> ShowFlags -> Bool
== :: ShowFlags -> ShowFlags -> Bool
$c== :: ShowFlags -> ShowFlags -> Bool
Eq)

instance P.Enum ShowFlags where
    fromEnum :: ShowFlags -> Int
fromEnum ShowFlags
ShowFlagsNone = Int
0
    fromEnum ShowFlags
ShowFlagsSpaces = Int
1
    fromEnum ShowFlags
ShowFlagsLineBreaks = Int
2
    fromEnum ShowFlags
ShowFlagsIgnorables = Int
4
    fromEnum (AnotherShowFlags Int
k) = Int
k

    toEnum :: Int -> ShowFlags
toEnum Int
0 = ShowFlags
ShowFlagsNone
    toEnum Int
1 = ShowFlags
ShowFlagsSpaces
    toEnum Int
2 = ShowFlags
ShowFlagsLineBreaks
    toEnum Int
4 = ShowFlags
ShowFlagsIgnorables
    toEnum Int
k = Int -> ShowFlags
AnotherShowFlags Int
k

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

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

foreign import ccall "pango_show_flags_get_type" c_pango_show_flags_get_type :: 
    IO GType

instance B.Types.TypedObject ShowFlags where
    glibType :: IO GType
glibType = IO GType
c_pango_show_flags_get_type

instance B.Types.BoxedFlags ShowFlags

instance IsGFlag ShowFlags

-- Flags ShapeFlags
-- | Flags influencing the shaping process.
-- These can be passed to 'GI.Pango.Functions.shapeWithFlags'.
data ShapeFlags = 
      ShapeFlagsNone
    -- ^ Default value.
    | ShapeFlagsRoundPositions
    -- ^ Round glyph positions
    --     and widths to whole device units. This option should
    --     be set if the target renderer can\'t do subpixel
    --     positioning of glyphs.
    | AnotherShapeFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ShapeFlags -> ShowS
[ShapeFlags] -> ShowS
ShapeFlags -> String
(Int -> ShapeFlags -> ShowS)
-> (ShapeFlags -> String)
-> ([ShapeFlags] -> ShowS)
-> Show ShapeFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShapeFlags] -> ShowS
$cshowList :: [ShapeFlags] -> ShowS
show :: ShapeFlags -> String
$cshow :: ShapeFlags -> String
showsPrec :: Int -> ShapeFlags -> ShowS
$cshowsPrec :: Int -> ShapeFlags -> ShowS
Show, ShapeFlags -> ShapeFlags -> Bool
(ShapeFlags -> ShapeFlags -> Bool)
-> (ShapeFlags -> ShapeFlags -> Bool) -> Eq ShapeFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShapeFlags -> ShapeFlags -> Bool
$c/= :: ShapeFlags -> ShapeFlags -> Bool
== :: ShapeFlags -> ShapeFlags -> Bool
$c== :: ShapeFlags -> ShapeFlags -> Bool
Eq)

instance P.Enum ShapeFlags where
    fromEnum :: ShapeFlags -> Int
fromEnum ShapeFlags
ShapeFlagsNone = Int
0
    fromEnum ShapeFlags
ShapeFlagsRoundPositions = Int
1
    fromEnum (AnotherShapeFlags Int
k) = Int
k

    toEnum :: Int -> ShapeFlags
toEnum Int
0 = ShapeFlags
ShapeFlagsNone
    toEnum Int
1 = ShapeFlags
ShapeFlagsRoundPositions
    toEnum Int
k = Int -> ShapeFlags
AnotherShapeFlags Int
k

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

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

foreign import ccall "pango_shape_flags_get_type" c_pango_shape_flags_get_type :: 
    IO GType

instance B.Types.TypedObject ShapeFlags where
    glibType :: IO GType
glibType = IO GType
c_pango_shape_flags_get_type

instance B.Types.BoxedFlags ShapeFlags

instance IsGFlag ShapeFlags

-- Flags FontMask
-- | The bits in a t'GI.Pango.Flags.FontMask' correspond to fields in a
-- t'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 (Int -> FontMask -> ShowS
[FontMask] -> ShowS
FontMask -> String
(Int -> FontMask -> ShowS)
-> (FontMask -> String) -> ([FontMask] -> ShowS) -> Show FontMask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FontMask] -> ShowS
$cshowList :: [FontMask] -> ShowS
show :: FontMask -> String
$cshow :: FontMask -> String
showsPrec :: Int -> FontMask -> ShowS
$cshowsPrec :: Int -> FontMask -> ShowS
Show, FontMask -> FontMask -> Bool
(FontMask -> FontMask -> Bool)
-> (FontMask -> FontMask -> Bool) -> Eq FontMask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FontMask -> FontMask -> Bool
$c/= :: FontMask -> FontMask -> Bool
== :: FontMask -> FontMask -> Bool
$c== :: FontMask -> FontMask -> Bool
Eq)

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

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

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

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

foreign import ccall "pango_font_mask_get_type" c_pango_font_mask_get_type :: 
    IO GType

instance B.Types.TypedObject FontMask where
    glibType :: IO GType
glibType = IO GType
c_pango_font_mask_get_type

instance B.Types.BoxedFlags FontMask

instance IsGFlag FontMask