{- | 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 #PangoAttrInt structure is used to represent attributes with an integer or enumeration value. -} module GI.Pango.Structs.AttrInt ( -- * Exported types AttrInt(..) , noAttrInt , -- * Properties -- ** Attr attrIntReadAttr , -- ** Value attrIntReadValue , ) 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 AttrInt = AttrInt (ForeignPtr AttrInt) noAttrInt :: Maybe AttrInt noAttrInt = Nothing attrIntReadAttr :: AttrInt -> IO Attribute attrIntReadAttr s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr Attribute) val' <- (newPtr 16 Attribute) val return val' attrIntReadValue :: AttrInt -> IO Int32 attrIntReadValue s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 16) :: IO Int32 return val