{-# LINE 2 "./Graphics/Rendering/Pango/Enums.chs" #-}
-- -*-haskell-*-
-- GIMP Toolkit (GTK) Enumerations for Pango.
--
-- Author : Axel Simon
--
-- Created: 12 September 2004
--
-- Copyright (C) 1999-2005 Axel Simon
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- |
-- Maintainer : gtk2hs-users@lists.sourceforge.net
-- Stability : provisional
-- Portability : portable (depends on GHC)
--
-- Enumerations for describing font characteristics.
--
module Graphics.Rendering.Pango.Enums (
  PangoUnit,
  pangoScale,
  Color(..),
  Rectangle(..),
  PangoRectangle(..),
  FontMetrics(..),
  Size(..),
  FontStyle(..),
  Weight(..),
  Variant(..),
  Stretch(..),
  Underline(..),
  PangoDirection(..),
  PangoAttribute(..),

  EllipsizeMode(..),


  PangoGravity(..),
  PangoGravityHint(..),


  -- these will not be exported from this module in the future
  Language,
  emptyLanguage,
  languageFromString,
  ) where

import Graphics.Rendering.Pango.Types
{-# LINE 58 "./Graphics/Rendering/Pango/Enums.chs" #-}
import Graphics.Rendering.Pango.BasicTypes
{-# LINE 59 "./Graphics/Rendering/Pango/Enums.chs" #-}
import Graphics.Rendering.Pango.Structs


{-# LINE 62 "./Graphics/Rendering/Pango/Enums.chs" #-}

-- | Define attributes for 'FontSize'.
--
data Size
  = SizePoint Double
  | SizeUnreadable
  | SizeTiny
  | SizeSmall
  | SizeMedium
  | SizeLarge
  | SizeHuge
  | SizeGiant
  | SizeSmaller
  | SizeLarger

instance Show Size where
  showsPrec :: Int -> Size -> ShowS
showsPrec Int
_ (SizePoint Double
v) = String -> ShowS
forall a. Show a => a -> ShowS
shows (String -> ShowS) -> String -> ShowS
forall a b. (a -> b) -> a -> b
$ Integer -> String
forall a. Show a => a -> String
show (Double -> Integer
forall b. Integral b => Double -> b
forall a b. (RealFrac a, Integral b) => a -> b
round (Double
vDouble -> Double -> Double
forall a. Num a => a -> a -> a
*Double
1000))
  showsPrec Int
_ (Size
SizeUnreadable) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"xx-small"
  showsPrec Int
_ (Size
SizeTiny) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"x-small"
  showsPrec Int
_ (Size
SizeSmall) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"small"
  showsPrec Int
_ (Size
SizeMedium) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"medium"
  showsPrec Int
_ (Size
SizeLarge) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"large"
  showsPrec Int
_ (Size
SizeHuge) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"x-large"
  showsPrec Int
_ (Size
SizeGiant) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"xx-large"
  showsPrec Int
_ (Size
SizeSmaller) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"smaller"
  showsPrec Int
_ (Size
SizeLarger) = String -> ShowS
forall a. Show a => a -> ShowS
shows String
"larger"




-- | The 'EllipsizeMode' type describes what sort of (if any) ellipsization
-- should be applied to a line of text. In the ellipsization process characters
-- are removed from the text in order to make it fit to a given width and
-- replaced with an ellipsis.
--
data EllipsizeMode = EllipsizeNone
                   | EllipsizeStart
                   | EllipsizeMiddle
                   | EllipsizeEnd
                   deriving (Int -> EllipsizeMode
EllipsizeMode -> Int
EllipsizeMode -> [EllipsizeMode]
EllipsizeMode -> EllipsizeMode
EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
EllipsizeMode -> EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
(EllipsizeMode -> EllipsizeMode)
-> (EllipsizeMode -> EllipsizeMode)
-> (Int -> EllipsizeMode)
-> (EllipsizeMode -> Int)
-> (EllipsizeMode -> [EllipsizeMode])
-> (EllipsizeMode -> EllipsizeMode -> [EllipsizeMode])
-> (EllipsizeMode -> EllipsizeMode -> [EllipsizeMode])
-> (EllipsizeMode
    -> EllipsizeMode -> EllipsizeMode -> [EllipsizeMode])
-> Enum EllipsizeMode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: EllipsizeMode -> EllipsizeMode
succ :: EllipsizeMode -> EllipsizeMode
$cpred :: EllipsizeMode -> EllipsizeMode
pred :: EllipsizeMode -> EllipsizeMode
$ctoEnum :: Int -> EllipsizeMode
toEnum :: Int -> EllipsizeMode
$cfromEnum :: EllipsizeMode -> Int
fromEnum :: EllipsizeMode -> Int
$cenumFrom :: EllipsizeMode -> [EllipsizeMode]
enumFrom :: EllipsizeMode -> [EllipsizeMode]
$cenumFromThen :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
enumFromThen :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
$cenumFromTo :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
enumFromTo :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
$cenumFromThenTo :: EllipsizeMode -> EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
enumFromThenTo :: EllipsizeMode -> EllipsizeMode -> EllipsizeMode -> [EllipsizeMode]
Enum,EllipsizeMode -> EllipsizeMode -> Bool
(EllipsizeMode -> EllipsizeMode -> Bool)
-> (EllipsizeMode -> EllipsizeMode -> Bool) -> Eq EllipsizeMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EllipsizeMode -> EllipsizeMode -> Bool
== :: EllipsizeMode -> EllipsizeMode -> Bool
$c/= :: EllipsizeMode -> EllipsizeMode -> Bool
/= :: EllipsizeMode -> EllipsizeMode -> Bool
Eq)

{-# LINE 98 "./Graphics/Rendering/Pango/Enums.chs" #-}



-- | The characteristic measurements of a font.
--
-- * All values are measured in pixels.
--
-- * In Pango versions before 1.6 only 'ascent', 'descent',
-- 'approximateCharWidth' and 'approximateDigitWidth' are available.
--
data FontMetrics = FontMetrics {
  -- | The ascent is the distance from the baseline to the logical top
  -- of a line of text. (The logical top may be above or below the
  -- top of the actual drawn ink. It is necessary to lay out the
  -- text to figure where the ink will be.)
  FontMetrics -> Double
ascent :: Double,
  -- | The descent is the distance from the baseline to the logical
  -- bottom of a line of text. (The logical bottom may be above or
  -- below the bottom of the actual drawn ink. It is necessary to
  -- lay out the text to figure where the ink will be.)
  FontMetrics -> Double
descent :: Double,
  -- | The approximate character width. This is merely a
  -- representative value useful, for example, for determining the
  -- initial size for a window. Actual characters in text will be
  -- wider and narrower than this.
  FontMetrics -> Double
approximateCharWidth :: Double,
  -- | The approximate digit width. This is merely a representative
  -- value useful, for example, for determining the initial size for
  -- a window. Actual digits in text can be wider and narrower than
  -- this, though this value is generally somewhat more accurate
  -- than 'approximateCharWidth'.
  FontMetrics -> Double
approximateDigitWidth :: Double

  ,
  -- | The suggested thickness to draw an underline.
  FontMetrics -> Double
underlineThickness :: Double,
  -- | The suggested position to draw the underline. The value returned is
  -- the distance above the baseline of the top of the underline. Since
  -- most fonts have underline positions beneath the baseline, this value
  -- is typically negative.
  FontMetrics -> Double
underlinePosition :: Double,
  -- | The suggested thickness to draw for the strikethrough.
  FontMetrics -> Double
strikethroughThickness :: Double,
  -- | The suggested position to draw the strikethrough. The value
  -- returned is the distance above the baseline of the top of the
  -- strikethrough.
  FontMetrics -> Double
strikethroughPosition :: Double

  } deriving Int -> FontMetrics -> ShowS
[FontMetrics] -> ShowS
FontMetrics -> String
(Int -> FontMetrics -> ShowS)
-> (FontMetrics -> String)
-> ([FontMetrics] -> ShowS)
-> Show FontMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FontMetrics -> ShowS
showsPrec :: Int -> FontMetrics -> ShowS
$cshow :: FontMetrics -> String
show :: FontMetrics -> String
$cshowList :: [FontMetrics] -> ShowS
showList :: [FontMetrics] -> ShowS
Show