Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A PangoAttrIterator
is used to iterate through a PangoAttrList
.
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 -> m (Maybe Language, [Attribute])
- 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 # | |
GBoxed AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
ManagedPtrNewtype AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
TypedObject AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
HasParentTypes AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator | |
IsGValue (Maybe AttrIterator) Source # | Convert |
Defined in GI.Pango.Structs.AttrIterator gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe AttrIterator -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe AttrIterator) # | |
type ParentTypes AttrIterator Source # | |
Defined in GI.Pango.Structs.AttrIterator |
Methods
Click to display all available methods, including inherited ones
copy
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m AttrIterator | Returns: the newly allocated
|
Copy a PangoAttrIterator
.
destroy
:: (HasCallStack, MonadIO m) | |
=> AttrIterator |
|
-> m () |
Destroy a PangoAttrIterator
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 |
|
-> m (Maybe Language, [Attribute]) |
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 PangoAttribute
. To deal with this API
oversight, stored return values that wouldn't fit into
a signed integer are clamped to G_MAXINT
.