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.GlyphItemIter

Description

A GlyphItemIter is an iterator over the clusters in a GlyphItem. The <firstterm>forward direction</firstterm> of the iterator is the logical direction of text. That is, with increasing startIndex and startChar values. If glyphItem is right-to-left (that is, if <literal>glyphItem->item->analysis.level</literal> is odd), then startGlyph decreases as the iterator moves forward. Moreover, in right-to-left cases, startGlyph is greater than endGlyph.

An iterator should be initialized using either of glyphItemIterInitStart and glyphItemIterInitEnd, for forward and backward iteration respectively, and walked over using any desired mixture of glyphItemIterNextCluster and glyphItemIterPrevCluster. A common idiom for doing a forward iteration over the clusters is: <programlisting> PangoGlyphItemIter cluster_iter; gboolean have_cluster;

for (have_cluster = pango_glyph_item_iter_init_start (&amp;cluster_iter, glyph_item, text); have_cluster; have_cluster = pango_glyph_item_iter_next_cluster (&amp;cluster_iter)) { ... } </programlisting>

Note that text is the start of the text for layout, which is then indexed by <literal>glyphItem->item->offset</literal> to get to the text of glyphItem. The startIndex and endIndex values can directly index into text. The startGlyph, endGlyph, startChar, and endChar values however are zero-based for the glyphItem. For each cluster, the item pointed at by the start variables is included in the cluster while the one pointed at by end variables is not.

None of the members of a GlyphItemIter should be modified manually.

Since: 1.22

Synopsis

Exported types

newZeroGlyphItemIter :: MonadIO m => m GlyphItemIter Source #

Construct a GlyphItemIter struct initialized to zero.

Methods

Overloaded methods

copy

glyphItemIterCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

orig: a GlyphItemIter, may be Nothing

-> m (Maybe GlyphItemIter)

Returns: the newly allocated GlyphItemIter, which should be freed with glyphItemIterFree, or Nothing if orig was Nothing.

Make a shallow copy of an existing GlyphItemIter structure.

Since: 1.22

free

glyphItemIterFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a GlyphItemIter, may be Nothing

-> m () 

Frees a GlyphItemIter created by glyphItemIterCopy.

Since: 1.22

initEnd

glyphItemIterInitEnd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a GlyphItemIter

-> GlyphItem

glyphItem: the glyph item to iterate over

-> Text

text: text corresponding to the glyph item

-> m Bool

Returns: False if there are no clusters in the glyph item

Initializes a GlyphItemIter structure to point to the last cluster in a glyph item. See GlyphItemIter for details of cluster orders.

Since: 1.22

initStart

glyphItemIterInitStart Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a GlyphItemIter

-> GlyphItem

glyphItem: the glyph item to iterate over

-> Text

text: text corresponding to the glyph item

-> m Bool

Returns: False if there are no clusters in the glyph item

Initializes a GlyphItemIter structure to point to the first cluster in a glyph item. See GlyphItemIter for details of cluster orders.

Since: 1.22

nextCluster

glyphItemIterNextCluster Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a GlyphItemIter

-> m Bool

Returns: True if the iterator was advanced, False if we were already on the last cluster.

Advances the iterator to the next cluster in the glyph item. See GlyphItemIter for details of cluster orders.

Since: 1.22

prevCluster

glyphItemIterPrevCluster Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a GlyphItemIter

-> m Bool

Returns: True if the iterator was moved, False if we were already on the first cluster.

Moves the iterator to the preceding cluster in the glyph item. See GlyphItemIter for details of cluster orders.

Since: 1.22

Properties

endChar

No description available in the introspection data.

getGlyphItemIterEndChar :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “end_char” field. When overloading is enabled, this is equivalent to

get glyphItemIter #endChar

setGlyphItemIterEndChar :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “end_char” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #endChar := value ]

endGlyph

No description available in the introspection data.

getGlyphItemIterEndGlyph :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “end_glyph” field. When overloading is enabled, this is equivalent to

get glyphItemIter #endGlyph

setGlyphItemIterEndGlyph :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “end_glyph” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #endGlyph := value ]

endIndex

No description available in the introspection data.

getGlyphItemIterEndIndex :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “end_index” field. When overloading is enabled, this is equivalent to

get glyphItemIter #endIndex

setGlyphItemIterEndIndex :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “end_index” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #endIndex := value ]

glyphItem

No description available in the introspection data.

clearGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> m () Source #

Set the value of the “glyph_item” field to Nothing. When overloading is enabled, this is equivalent to

clear #glyphItem

getGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> m (Maybe GlyphItem) Source #

Get the value of the “glyph_item” field. When overloading is enabled, this is equivalent to

get glyphItemIter #glyphItem

setGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> Ptr GlyphItem -> m () Source #

Set the value of the “glyph_item” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #glyphItem := value ]

startChar

No description available in the introspection data.

getGlyphItemIterStartChar :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “start_char” field. When overloading is enabled, this is equivalent to

get glyphItemIter #startChar

setGlyphItemIterStartChar :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “start_char” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #startChar := value ]

startGlyph

No description available in the introspection data.

getGlyphItemIterStartGlyph :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “start_glyph” field. When overloading is enabled, this is equivalent to

get glyphItemIter #startGlyph

setGlyphItemIterStartGlyph :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “start_glyph” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #startGlyph := value ]

startIndex

No description available in the introspection data.

getGlyphItemIterStartIndex :: MonadIO m => GlyphItemIter -> m Int32 Source #

Get the value of the “start_index” field. When overloading is enabled, this is equivalent to

get glyphItemIter #startIndex

setGlyphItemIterStartIndex :: MonadIO m => GlyphItemIter -> Int32 -> m () Source #

Set the value of the “start_index” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #startIndex := value ]

text

No description available in the introspection data.

clearGlyphItemIterText :: MonadIO m => GlyphItemIter -> m () Source #

Set the value of the “text” field to Nothing. When overloading is enabled, this is equivalent to

clear #text

getGlyphItemIterText :: MonadIO m => GlyphItemIter -> m (Maybe Text) Source #

Get the value of the “text” field. When overloading is enabled, this is equivalent to

get glyphItemIter #text

setGlyphItemIterText :: MonadIO m => GlyphItemIter -> CString -> m () Source #

Set the value of the “text” field. When overloading is enabled, this is equivalent to

set glyphItemIter [ #text := value ]