Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The AttrIterator
structure is used to represent an
iterator through a AttrList
. A new iterator is created
with pango_attr_list_get_iterator()
. Once the iterator
is created, it can be advanced through the style changes
in the text using attrIteratorNext
. At each
style change, the range of the current style segment and the
attributes currently in effect can be queried.
Synopsis
- newtype AttrIterator = AttrIterator (ManagedPtr AttrIterator)
- noAttrIterator :: Maybe AttrIterator
- attrIteratorDestroy :: (HasCallStack, MonadIO m) => AttrIterator -> m ()
- attrIteratorGetAttrs :: (HasCallStack, MonadIO m) => AttrIterator -> m [Attribute]
- attrIteratorGetFont :: (HasCallStack, MonadIO m) => AttrIterator -> FontDescription -> Maybe Language -> [Attribute] -> m ()
- attrIteratorNext :: (HasCallStack, MonadIO m) => AttrIterator -> m Bool
- attrIteratorRange :: (HasCallStack, MonadIO m) => AttrIterator -> m (Int32, Int32)
Exported types
newtype AttrIterator Source #
Memory-managed wrapper type.
Instances
WrappedPtr AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator wrappedPtrCalloc :: IO (Ptr AttrIterator) # wrappedPtrCopy :: AttrIterator -> IO AttrIterator # wrappedPtrFree :: Maybe (FunPtr (Ptr AttrIterator -> IO ())) # |
noAttrIterator :: Maybe AttrIterator Source #
A convenience alias for Nothing
:: Maybe
AttrIterator
.
Methods
destroy
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m () |
Destroy a AttrIterator
and free all associated memory.
getAttrs
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m [Attribute] | Returns: a list of
all attributes for the current range.
To free this value, call |
Gets a list of all attributes at the current position of the iterator.
Since: 1.2
getFont
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> FontDescription |
|
-> Maybe Language |
|
-> [Attribute] |
|
-> m () |
Get the font and other attributes at the current iterator position.
next
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m Bool | Returns: |
Advance the iterator until the next change of style.
range
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m (Int32, Int32) |
Get the range of the current segment. Note that the
stored return values are signed, not unsigned like
the values in Attribute
. To deal with this API
oversight, stored return values that wouldn't fit into
a signed integer are clamped to G_MAXINT
.