gi-pango-1.0.23: Pango bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Pango.Structs.AttrIterator

Description

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

Exported types

Methods

Overloaded methods

copy

attrIteratorCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator.

-> m AttrIterator

Returns: the newly allocated AttrIterator, which should be freed with attrIteratorDestroy.

destroy

attrIteratorDestroy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator.

-> m () 

Destroy a AttrIterator and free all associated memory.

get

attrIteratorGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator

-> AttrType

type: the type of attribute to find.

-> m (Maybe Attribute)

Returns: the current attribute of the given type, or Nothing if no attribute of that type applies to the current location.

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

attrIteratorGetAttrs Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator

-> m [Attribute]

Returns: a list of all attributes for the current range. To free this value, call attributeDestroy on each value and g_slist_free() on the list.

Gets a list of all attributes at the current position of the iterator.

Since: 1.2

getFont

attrIteratorGetFont Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator

-> FontDescription

desc: a FontDescription to fill in with the current values. The family name in this structure will be set using fontDescriptionSetFamilyStatic using values from an attribute in the AttrList associated with the iterator, so if you plan to keep it around, you must call: <literal>pango_font_description_set_family (desc, pango_font_description_get_family (desc))</literal>.

-> Maybe Language

language: if non-Nothing, location to store language tag for item, or Nothing if none is found.

-> [Attribute]

extraAttrs: if non-Nothing, location in which to store a list of non-font attributes at the the current position; only the highest priority value of each attribute will be added to this list. In order to free this value, you must call attributeDestroy on each member.

-> m () 

Get the font and other attributes at the current iterator position.

next

attrIteratorNext Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator

-> m Bool

Returns: False if the iterator is at the end of the list, otherwise True

Advance the iterator until the next change of style.

range

attrIteratorRange Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a 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.