gi-pango-1.0.16: Pango bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Pango.Structs.AttrIterator

Contents

Description

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

Exported types

Methods

destroy

attrIteratorDestroy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> AttrIterator

iterator: a AttrIterator.

-> m () 

Destroy a AttrIterator and free all associated memory.

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.