{- | 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 #PangoAttrShape structure is used to represent attributes which impose shape restrictions. -} module GI.Pango.Structs.AttrShape ( -- * Exported types AttrShape(..) , noAttrShape , -- * Properties -- ** Attr attrShapeReadAttr , -- ** Data attrShapeReadData , -- ** InkRect attrShapeReadInkRect , -- ** LogicalRect attrShapeReadLogicalRect , ) 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 AttrShape = AttrShape (ForeignPtr AttrShape) noAttrShape :: Maybe AttrShape noAttrShape = Nothing attrShapeReadAttr :: AttrShape -> IO Attribute attrShapeReadAttr s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr Attribute) val' <- (newPtr 16 Attribute) val return val' attrShapeReadInkRect :: AttrShape -> IO Rectangle attrShapeReadInkRect s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 16) :: IO (Ptr Rectangle) val' <- (newPtr 16 Rectangle) val return val' attrShapeReadLogicalRect :: AttrShape -> IO Rectangle attrShapeReadLogicalRect s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 32) :: IO (Ptr Rectangle) val' <- (newPtr 16 Rectangle) val return val' attrShapeReadData :: AttrShape -> IO (Ptr ()) attrShapeReadData s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 48) :: IO (Ptr ()) return val -- XXX Skipped getter for "AttrShape:destroy_func" :: Not implemented: "Wrapping foreign callbacks is not supported yet"