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 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
- newtype GlyphItemIter = GlyphItemIter (ManagedPtr GlyphItemIter)
- newZeroGlyphItemIter :: MonadIO m => m GlyphItemIter
- glyphItemIterCopy :: (HasCallStack, MonadIO m) => GlyphItemIter -> m (Maybe GlyphItemIter)
- glyphItemIterFree :: (HasCallStack, MonadIO m) => GlyphItemIter -> m ()
- glyphItemIterInitEnd :: (HasCallStack, MonadIO m) => GlyphItemIter -> GlyphItem -> Text -> m Bool
- glyphItemIterInitStart :: (HasCallStack, MonadIO m) => GlyphItemIter -> GlyphItem -> Text -> m Bool
- glyphItemIterNextCluster :: (HasCallStack, MonadIO m) => GlyphItemIter -> m Bool
- glyphItemIterPrevCluster :: (HasCallStack, MonadIO m) => GlyphItemIter -> m Bool
- getGlyphItemIterEndChar :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterEndChar :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- getGlyphItemIterEndGlyph :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterEndGlyph :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- getGlyphItemIterEndIndex :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterEndIndex :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- clearGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> m ()
- getGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> m (Maybe GlyphItem)
- setGlyphItemIterGlyphItem :: MonadIO m => GlyphItemIter -> Ptr GlyphItem -> m ()
- getGlyphItemIterStartChar :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterStartChar :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- getGlyphItemIterStartGlyph :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterStartGlyph :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- getGlyphItemIterStartIndex :: MonadIO m => GlyphItemIter -> m Int32
- setGlyphItemIterStartIndex :: MonadIO m => GlyphItemIter -> Int32 -> m ()
- clearGlyphItemIterText :: MonadIO m => GlyphItemIter -> m ()
- getGlyphItemIterText :: MonadIO m => GlyphItemIter -> m (Maybe Text)
- setGlyphItemIterText :: MonadIO m => GlyphItemIter -> CString -> m ()
Exported types
newtype GlyphItemIter Source #
Memory-managed wrapper type.
Instances
newZeroGlyphItemIter :: MonadIO m => m GlyphItemIter Source #
Construct a GlyphItemIter
struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
copy
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> m (Maybe GlyphItemIter) | Returns: the newly allocated |
Make a shallow copy of an existing PangoGlyphItemIter
structure.
Since: 1.22
free
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> m () |
Frees a PangoGlyphItem
Iter.
Since: 1.22
initEnd
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> GlyphItem |
|
-> Text |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> GlyphItem |
|
-> Text |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> m Bool | Returns: |
Advances the iterator to the next cluster in the glyph item.
See PangoGlyphItemIter
for details of cluster orders.
Since: 1.22
prevCluster
glyphItemIterPrevCluster Source #
:: (HasCallStack, MonadIO m) | |
=> GlyphItemIter |
|
-> m Bool | Returns: |
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 ]