Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
The AttrIterator
structure is used to represent an
iterator through a AttrList
. A new iterator is created
with attrListGetIterator
. 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)
- attrIteratorCopy :: (HasCallStack, MonadIO m) => AttrIterator -> m AttrIterator
- attrIteratorDestroy :: (HasCallStack, MonadIO m) => AttrIterator -> m ()
- attrIteratorGet :: (HasCallStack, MonadIO m) => AttrIterator -> AttrType -> m (Maybe Attribute)
- 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
Eq AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator (==) :: AttrIterator -> AttrIterator -> Bool # (/=) :: AttrIterator -> AttrIterator -> Bool # | |
IsGValue AttrIterator Source # | Convert |
Defined in GI.Pango.Structs.AttrIterator toGValue :: AttrIterator -> IO GValue # fromGValue :: GValue -> IO AttrIterator # | |
ManagedPtrNewtype AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
TypedObject AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
GBoxed AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
HasParentTypes AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
type ParentTypes AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator |
Methods
Overloaded methods
copy
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m AttrIterator | Returns: the newly allocated
|
Copy a AttrIterator
destroy
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m () |
Destroy a AttrIterator
and free all associated memory.
get
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> AttrType |
|
-> m (Maybe Attribute) | Returns: the current attribute of the given type,
or |
Find the current attribute of a particular type at the iterator location. When multiple attributes of the same type overlap, the attribute whose range starts closest to the current location is used.
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
.