{-# LINE 1 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LANGUAGE CPP, ScopedTypeVariables #-}
{-# LINE 2 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# OPTIONS_HADDOCK hide #-}
{-# LINE 25 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 26 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 27 "Graphics/Rendering/Pango/Structs.hsc" #-}
module Graphics.Rendering.Pango.Structs (
PangoUnit,
Color(..),
Rectangle(..),
PangoRectangle(..),
peekIntPangoRectangle,
PangoDirection(..),
pangoScale,
puToInt, puToUInt,
intToPu, uIntToPu,
pangodirToLevel,
PangoAttribute(..),
setAttrPos,
pangoItemGetFont,
pangoItemGetLanguage,
pangoItemRawGetOffset,
pangoItemRawGetLength,
pangoItemRawAnalysis,
pangoItemRawGetLevel,
readAttr
) where
import Control.Monad (liftM)
import Data.IORef
import Control.Exception
import System.Glib.FFI
import System.Glib.UTFString ( peekUTFString, UTFCorrection,
ofsToUTF, ofsFromUTF, DefaultGlibString )
import System.Glib.GObject (makeNewGObject)
import Graphics.Rendering.Pango.Types
import Graphics.Rendering.Pango.BasicTypes
type PangoUnit = Double
data Color = Color (Word16) (Word16) (Word16)
{-# LINE 80 "Graphics/Rendering/Pango/Structs.hsc" #-}
deriving (Eq,Show)
peekPangoColor :: Ptr Color -> IO Color
peekPangoColor ptr = do
red <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 88 "Graphics/Rendering/Pango/Structs.hsc" #-}
green <- (\hsc_ptr -> peekByteOff hsc_ptr 2) ptr
{-# LINE 89 "Graphics/Rendering/Pango/Structs.hsc" #-}
blue <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
{-# LINE 90 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ Color red green blue
data Rectangle = Rectangle Int Int Int Int deriving (Eq,Show)
data PangoRectangle = PangoRectangle Double Double Double Double
deriving Show
instance Storable PangoRectangle where
sizeOf _ = 16
{-# LINE 107 "Graphics/Rendering/Pango/Structs.hsc" #-}
alignment _ = alignment (undefined:: Int32)
{-# LINE 108 "Graphics/Rendering/Pango/Structs.hsc" #-}
peek ptr = do
(Rectangle x_ y_ w_ h_) <- peekIntPangoRectangle ptr
return $ PangoRectangle (fromIntegral x_/pangoScale) (fromIntegral y_/pangoScale)
(fromIntegral w_/pangoScale) (fromIntegral h_/pangoScale)
poke ptr (PangoRectangle x y w h) = do
(\hsc_ptr -> pokeByteOff hsc_ptr 0) ptr ((truncate (x*pangoScale))::Int32)
{-# LINE 114 "Graphics/Rendering/Pango/Structs.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr ((truncate (y*pangoScale))::Int32)
{-# LINE 115 "Graphics/Rendering/Pango/Structs.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr ((truncate (w*pangoScale))::Int32)
{-# LINE 116 "Graphics/Rendering/Pango/Structs.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 12) ptr ((truncate (h*pangoScale))::Int32)
{-# LINE 117 "Graphics/Rendering/Pango/Structs.hsc" #-}
peekIntPangoRectangle :: Ptr PangoRectangle -> IO Rectangle
peekIntPangoRectangle ptr = do
(x_ ::Int32) <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 121 "Graphics/Rendering/Pango/Structs.hsc" #-}
(y_ ::Int32) <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
{-# LINE 122 "Graphics/Rendering/Pango/Structs.hsc" #-}
(w_ ::Int32) <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
{-# LINE 123 "Graphics/Rendering/Pango/Structs.hsc" #-}
(h_ ::Int32) <- (\hsc_ptr -> peekByteOff hsc_ptr 12) ptr
{-# LINE 124 "Graphics/Rendering/Pango/Structs.hsc" #-}
return (Rectangle (fromIntegral x_) (fromIntegral y_)
(fromIntegral w_) (fromIntegral h_))
data PangoDirection = PangoDirectionLtr
| PangoDirectionRtl
{-# LINE 147 "Graphics/Rendering/Pango/Structs.hsc" #-}
| PangoDirectionWeakLtr
| PangoDirectionWeakRtl
| PangoDirectionNeutral
{-# LINE 151 "Graphics/Rendering/Pango/Structs.hsc" #-}
deriving (Eq,Ord)
pangoScale :: Double
pangoScale = 1024
{-# LINE 167 "Graphics/Rendering/Pango/Structs.hsc" #-}
puToInt :: Double -> GInt
puToInt u = truncate (u*pangoScale)
puToUInt :: Double -> GInt
puToUInt u = let u' = u*pangoScale in if u'<0 then 0 else truncate u'
intToPu :: GInt -> Double
intToPu i = fromIntegral i/pangoScale
uIntToPu :: GInt -> Double
uIntToPu i = fromIntegral i/pangoScale
instance Enum PangoDirection where
fromEnum PangoDirectionLtr = 0
{-# LINE 182 "Graphics/Rendering/Pango/Structs.hsc" #-}
fromEnum PangoDirectionRtl = 1
{-# LINE 183 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 184 "Graphics/Rendering/Pango/Structs.hsc" #-}
fromEnum PangoDirectionWeakLtr = 4
{-# LINE 185 "Graphics/Rendering/Pango/Structs.hsc" #-}
fromEnum PangoDirectionWeakRtl = 5
{-# LINE 186 "Graphics/Rendering/Pango/Structs.hsc" #-}
fromEnum PangoDirectionNeutral = 6
{-# LINE 187 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 188 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 0 = PangoDirectionLtr
{-# LINE 189 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 1 = PangoDirectionRtl
{-# LINE 190 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 2 = PangoDirectionLtr
{-# LINE 191 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 3 = PangoDirectionRtl
{-# LINE 192 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 193 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 4 = PangoDirectionWeakLtr
{-# LINE 194 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 5 = PangoDirectionWeakRtl
{-# LINE 195 "Graphics/Rendering/Pango/Structs.hsc" #-}
toEnum 6 = PangoDirectionNeutral
{-# LINE 196 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 197 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangodirToLevel :: PangoDirection -> Int
pangodirToLevel PangoDirectionLtr = 1
pangodirToLevel PangoDirectionRtl = -1
{-# LINE 203 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangodirToLevel PangoDirectionWeakLtr = 1
pangodirToLevel PangoDirectionWeakRtl = -1
pangodirToLevel PangoDirectionNeutral = 0
{-# LINE 207 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemGetFont :: PangoItem -> IO Font
pangoItemGetFont (PangoItem _ (PangoItemRaw pir)) =
withForeignPtr pir pangoItemRawGetFont
pangoItemGetLanguage :: PangoItem -> IO Language
pangoItemGetLanguage (PangoItem _ (PangoItemRaw pir)) =
liftM (Language . castPtr) $ withForeignPtr pir pangoItemRawGetLanguage
pangoItemRawGetFont :: Ptr pangoItem -> IO Font
pangoItemRawGetFont ptr =
makeNewGObject mkFont ((\hsc_ptr -> peekByteOff hsc_ptr 32) ptr)
{-# LINE 224 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetLanguage :: Ptr pangoItem -> IO (Ptr CChar)
pangoItemRawGetLanguage ptr =
(\hsc_ptr -> peekByteOff hsc_ptr 48) ptr
{-# LINE 229 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetOffset :: Ptr pangoItem -> IO Int32
{-# LINE 232 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetOffset = (\hsc_ptr -> peekByteOff hsc_ptr 0)
{-# LINE 233 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetLength :: Ptr pangoItem -> IO Int32
{-# LINE 236 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetLength = (\hsc_ptr -> peekByteOff hsc_ptr 4)
{-# LINE 237 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawAnalysis :: Ptr pangoItem -> Ptr pangoAnalysis
pangoItemRawAnalysis = (\hsc_ptr -> hsc_ptr `plusPtr` 16)
{-# LINE 241 "Graphics/Rendering/Pango/Structs.hsc" #-}
pangoItemRawGetLevel :: Ptr pangoItem -> IO Bool
pangoItemRawGetLevel ptr = do
level <- (\hsc_ptr -> peekByteOff hsc_ptr 40) ptr
{-# LINE 246 "Graphics/Rendering/Pango/Structs.hsc" #-}
return (toBool (level :: Word8))
{-# LINE 247 "Graphics/Rendering/Pango/Structs.hsc" #-}
setAttrPos :: UTFCorrection -> Int -> Int -> IO (Ptr ()) -> IO (Ptr ())
setAttrPos correct start end act = do
atPtr <- act
(\hsc_ptr -> pokeByteOff hsc_ptr 8) atPtr
{-# LINE 253 "Graphics/Rendering/Pango/Structs.hsc" #-}
(fromIntegral (ofsToUTF start correct) :: Word32)
{-# LINE 254 "Graphics/Rendering/Pango/Structs.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 12) atPtr
{-# LINE 255 "Graphics/Rendering/Pango/Structs.hsc" #-}
(fromIntegral (ofsToUTF end correct) :: Word32)
{-# LINE 256 "Graphics/Rendering/Pango/Structs.hsc" #-}
return atPtr
data PangoAttribute
= AttrLanguage { paStart :: Int, paEnd :: Int, paLang :: Language }
| AttrFamily { paStart :: Int, paEnd :: Int, paFamily :: DefaultGlibString }
| AttrStyle { paStart :: Int, paEnd :: Int, paStyle :: FontStyle }
| AttrWeight { paStart :: Int, paEnd :: Int, paWeight :: Weight }
| AttrVariant { paStart :: Int, paEnd :: Int, paVariant :: Variant }
| AttrStretch { paStart :: Int, paEnd :: Int, paStretch :: Stretch }
| AttrSize { paStart :: Int, paEnd :: Int, paSize :: Double }
{-# LINE 280 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrAbsSize { paStart :: Int, paEnd :: Int, paSize :: Double }
{-# LINE 286 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrFontDescription { paStart :: Int, paEnd :: Int,
paFontDescription :: FontDescription }
| AttrForeground { paStart :: Int, paEnd :: Int, paColor :: Color }
| AttrBackground { paStart :: Int, paEnd :: Int, paColor :: Color }
| AttrUnderline { paStart :: Int, paEnd :: Int, paUnderline :: Underline }
{-# LINE 299 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrUnderlineColor { paStart :: Int, paEnd :: Int, paColor :: Color }
{-# LINE 305 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrStrikethrough { paStart :: Int, paEnd :: Int, paStrikethrough :: Bool }
{-# LINE 309 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrStrikethroughColor { paStart :: Int, paEnd :: Int, paColor :: Color }
{-# LINE 315 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrRise { paStart :: Int, paEnd :: Int, paRise :: Double }
{-# LINE 318 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrShape { paStart :: Int, paEnd :: Int, paInk :: PangoRectangle,
paLogical :: PangoRectangle }
{-# LINE 325 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrScale { paStart :: Int, paEnd :: Int, paScale :: Double }
{-# LINE 328 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrFallback { paStart :: Int, paEnd :: Int, paFallback :: Bool }
{-# LINE 332 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 333 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrLetterSpacing { paStart :: Int, paEnd :: Int,
paLetterSpacing :: Double }
{-# LINE 340 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 341 "Graphics/Rendering/Pango/Structs.hsc" #-}
| AttrGravity { paStart :: Int, paEnd :: Int,
paGravity :: PangoGravity }
| AttrGravityHint { paStart :: Int, paEnd :: Int,
paGravityHint :: PangoGravityHint }
{-# LINE 360 "Graphics/Rendering/Pango/Structs.hsc" #-}
deriving Show
readAttr :: UTFCorrection -> CPangoAttribute -> IO PangoAttribute
readAttr correct attrPtr = do
klassPtr <- (\hsc_ptr -> peekByteOff hsc_ptr 0) attrPtr
{-# LINE 366 "Graphics/Rendering/Pango/Structs.hsc" #-}
startByte <- (\hsc_ptr -> peekByteOff hsc_ptr 8) attrPtr
{-# LINE 367 "Graphics/Rendering/Pango/Structs.hsc" #-}
endByte <- (\hsc_ptr -> peekByteOff hsc_ptr 12) attrPtr
{-# LINE 368 "Graphics/Rendering/Pango/Structs.hsc" #-}
ty <- (\hsc_ptr -> peekByteOff hsc_ptr 0) klassPtr
{-# LINE 369 "Graphics/Rendering/Pango/Structs.hsc" #-}
let b :: Int
b = ofsFromUTF (fromIntegral (startByte :: Word32)) correct
{-# LINE 371 "Graphics/Rendering/Pango/Structs.hsc" #-}
e :: Int
e = ofsFromUTF (fromIntegral (endByte :: Word32)) correct
{-# LINE 373 "Graphics/Rendering/Pango/Structs.hsc" #-}
case ty :: Word32 of
{-# LINE 374 "Graphics/Rendering/Pango/Structs.hsc" #-}
1 -> do
{-# LINE 375 "Graphics/Rendering/Pango/Structs.hsc" #-}
lang <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 376 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrLanguage b e (Language lang)
2 -> do
{-# LINE 378 "Graphics/Rendering/Pango/Structs.hsc" #-}
strPtr <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 379 "Graphics/Rendering/Pango/Structs.hsc" #-}
str <- peekUTFString strPtr
return $ AttrFamily b e str
3 -> do
{-# LINE 382 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 383 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrStyle b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 384 "Graphics/Rendering/Pango/Structs.hsc" #-}
4 -> do
{-# LINE 385 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 386 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrWeight b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 387 "Graphics/Rendering/Pango/Structs.hsc" #-}
5 -> do
{-# LINE 388 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 389 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrVariant b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 390 "Graphics/Rendering/Pango/Structs.hsc" #-}
6 -> do
{-# LINE 391 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 392 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrStretch b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 393 "Graphics/Rendering/Pango/Structs.hsc" #-}
7 -> do
{-# LINE 394 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 395 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrSize b e (realToFrac (v::Double))
{-# LINE 396 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 397 "Graphics/Rendering/Pango/Structs.hsc" #-}
20 -> do
{-# LINE 398 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 399 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrAbsSize b e (realToFrac (v::Double))
{-# LINE 400 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 401 "Graphics/Rendering/Pango/Structs.hsc" #-}
8 -> do
{-# LINE 402 "Graphics/Rendering/Pango/Structs.hsc" #-}
fdPtr <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 403 "Graphics/Rendering/Pango/Structs.hsc" #-}
fd <- makeNewFontDescription fdPtr
return $ AttrFontDescription b e fd
9 -> do
{-# LINE 406 "Graphics/Rendering/Pango/Structs.hsc" #-}
col <- peekPangoColor ((\hsc_ptr -> hsc_ptr `plusPtr` 16) attrPtr)
{-# LINE 407 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrForeground b e col
10 -> do
{-# LINE 409 "Graphics/Rendering/Pango/Structs.hsc" #-}
col <- peekPangoColor ((\hsc_ptr -> hsc_ptr `plusPtr` 16) attrPtr)
{-# LINE 410 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrBackground b e col
11 -> do
{-# LINE 412 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 413 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrUnderline b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 414 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 416 "Graphics/Rendering/Pango/Structs.hsc" #-}
18 -> do
{-# LINE 417 "Graphics/Rendering/Pango/Structs.hsc" #-}
col <- peekPangoColor ((\hsc_ptr -> hsc_ptr `plusPtr` 16) attrPtr)
{-# LINE 418 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrUnderlineColor b e col
{-# LINE 420 "Graphics/Rendering/Pango/Structs.hsc" #-}
12 -> do
{-# LINE 421 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 422 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrStrikethrough b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 423 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 425 "Graphics/Rendering/Pango/Structs.hsc" #-}
19 -> do
{-# LINE 426 "Graphics/Rendering/Pango/Structs.hsc" #-}
col <- peekPangoColor ((\hsc_ptr -> hsc_ptr `plusPtr` 16) attrPtr)
{-# LINE 427 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrStrikethroughColor b e col
{-# LINE 429 "Graphics/Rendering/Pango/Structs.hsc" #-}
13 -> do
{-# LINE 430 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 431 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrRise b e (realToFrac (v::Double))
{-# LINE 432 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 433 "Graphics/Rendering/Pango/Structs.hsc" #-}
14 -> do
{-# LINE 434 "Graphics/Rendering/Pango/Structs.hsc" #-}
rect1 <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 435 "Graphics/Rendering/Pango/Structs.hsc" #-}
rect2 <- (\hsc_ptr -> peekByteOff hsc_ptr 32) attrPtr
{-# LINE 436 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrShape b e rect1 rect2
{-# LINE 438 "Graphics/Rendering/Pango/Structs.hsc" #-}
15 -> do
{-# LINE 439 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 440 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrScale b e (realToFrac (v::Double))
{-# LINE 441 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 442 "Graphics/Rendering/Pango/Structs.hsc" #-}
16 -> do
{-# LINE 443 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 444 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrFallback b e (toBool (v::Int32))
{-# LINE 445 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 446 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 447 "Graphics/Rendering/Pango/Structs.hsc" #-}
17 -> do
{-# LINE 448 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 449 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrLetterSpacing b e (realToFrac (v::Double))
{-# LINE 450 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 451 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 452 "Graphics/Rendering/Pango/Structs.hsc" #-}
21 -> do
{-# LINE 453 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 454 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrGravity b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 455 "Graphics/Rendering/Pango/Structs.hsc" #-}
22 -> do
{-# LINE 456 "Graphics/Rendering/Pango/Structs.hsc" #-}
v <- (\hsc_ptr -> peekByteOff hsc_ptr 16) attrPtr
{-# LINE 457 "Graphics/Rendering/Pango/Structs.hsc" #-}
return $ AttrGravityHint b e (toEnum (fromIntegral (v::Int32)))
{-# LINE 458 "Graphics/Rendering/Pango/Structs.hsc" #-}
{-# LINE 459 "Graphics/Rendering/Pango/Structs.hsc" #-}
_ -> error "extracting pango attributes: unknown attribute type"