{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) The #PangoGlyphInfo structure represents a single glyph together with positioning information and visual attributes. It contains the following fields. -} module GI.Pango.Structs.GlyphInfo ( -- * Exported types GlyphInfo(..) , noGlyphInfo , -- * Properties -- ** Attr glyphInfoReadAttr , -- ** Geometry glyphInfoReadGeometry , -- ** Glyph glyphInfoReadGlyph , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Pango.Types import GI.Pango.Callbacks newtype GlyphInfo = GlyphInfo (ForeignPtr GlyphInfo) noGlyphInfo :: Maybe GlyphInfo noGlyphInfo = Nothing glyphInfoReadGlyph :: GlyphInfo -> IO Word32 glyphInfoReadGlyph s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO Word32 return val glyphInfoReadGeometry :: GlyphInfo -> IO GlyphGeometry glyphInfoReadGeometry s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 4) :: IO (Ptr GlyphGeometry) val' <- (newPtr 12 GlyphGeometry) val return val' glyphInfoReadAttr :: GlyphInfo -> IO GlyphVisAttr glyphInfoReadAttr s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 16) :: IO (Ptr GlyphVisAttr) val' <- (newPtr 4 GlyphVisAttr) val return val'