gi-pango-1.0.25: Pango bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Pango.Structs.GlyphItemIter

Description

A PangoGlyphItemIter is an iterator over the clusters in a PangoGlyphItem.

The *forward direction* 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 glyph_item->item->analysis.level 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 glyphItemIterInitStart or 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:

PangoGlyphItemIter cluster_iter;
gboolean have_cluster;

for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter,
                                                      glyph_item, text);
     have_cluster;
     have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter))
{
  ...
}

Note that text is the start of the text for layout, which is then indexed by glyph_item->item->offset 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 PangoGlyphItemIter should be modified manually.

Since: 1.22

Synopsis

Exported types

newtype GlyphItemIter Source #

Memory-managed wrapper type.

newZeroGlyphItemIter :: MonadIO m => m GlyphItemIter Source #

Construct a GlyphItemIter struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

copy, free, initEnd, initStart, nextCluster, prevCluster.

Getters

None.

Setters

None.

copy

glyphItemIterCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

orig: a PangoGlyphItemIter

-> m (Maybe GlyphItemIter)

Returns: the newly allocated PangoGlyphItemIter

Make a shallow copy of an existing PangoGlyphItemIter structure.

Since: 1.22

free

glyphItemIterFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a PangoGlyphItemIter

-> m () 

Frees a PangoGlyphItemIter.

Since: 1.22

initEnd

glyphItemIterInitEnd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a PangoGlyphItemIter

-> 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 PangoGlyphItemIter structure to point to the last cluster in a glyph item.

See PangoGlyphItemIter for details of cluster orders.

Since: 1.22

initStart

glyphItemIterInitStart Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a PangoGlyphItemIter

-> 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 PangoGlyphItemIter structure to point to the first cluster in a glyph item.

See PangoGlyphItemIter for details of cluster orders.

Since: 1.22

nextCluster

glyphItemIterNextCluster Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a PangoGlyphItemIter

-> 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 PangoGlyphItemIter for details of cluster orders.

Since: 1.22

prevCluster

glyphItemIterPrevCluster Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GlyphItemIter

iter: a PangoGlyphItemIter

-> 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 PangoGlyphItemIter 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 ]