gi-atk-0.2.18.12: GI/Atk/Structs/Attribute.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
AtkAttribute is a string name/value pair representing a generic
attribute. This can be used to expose additional information from
an accessible object as a whole (see atk_object_get_attributes())
or an document (see atk_document_get_attributes()). In the case of
text attributes (see atk_text_get_default_attributes()),
#AtkTextAttribute enum defines all the possible text attribute
names. You can use atk_text_attribute_get_name() to get the string
name from the enum value. See also atk_text_attribute_for_name()
and atk_text_attribute_get_value() for more information.
A string name/value pair representing a generic attribute.
-}
module GI.Atk.Structs.Attribute
(
-- * Exported types
Attribute(..) ,
noAttribute ,
-- * Properties
-- ** Name
attributeReadName ,
-- ** Value
attributeReadValue ,
) 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.Atk.Types
import GI.Atk.Callbacks
newtype Attribute = Attribute (ForeignPtr Attribute)
noAttribute :: Maybe Attribute
noAttribute = Nothing
attributeReadName :: Attribute -> IO T.Text
attributeReadName s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CString
val' <- cstringToText val
return val'
attributeReadValue :: Attribute -> IO T.Text
attributeReadValue s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
val' <- cstringToText val
return val'