-- | 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.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.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 ShowFlagsNone = 0
    fromEnum ShowFlagsSpaces = 1
    fromEnum ShowFlagsLineBreaks = 2
    fromEnum ShowFlagsIgnorables = 4
    fromEnum (AnotherShowFlags k :: Int
k) = Int
k

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

instance P.Ord ShowFlags where
    compare :: ShowFlags -> ShowFlags -> Ordering
compare a :: ShowFlags
a b :: 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 ShapeFlagsNone = 0
    fromEnum ShapeFlagsRoundPositions = 1
    fromEnum (AnotherShapeFlags k :: Int
k) = Int
k

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

instance P.Ord ShapeFlags where
    compare :: ShapeFlags -> ShapeFlags -> Ordering
compare a :: ShapeFlags
a b :: 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 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 :: Int
k) = Int
k

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

instance P.Ord FontMask where
    compare :: FontMask -> FontMask -> Ordering
compare a :: FontMask
a b :: 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