gi-pango-1.0.30: Pango bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Pango.Structs.GlyphItemIter

Contents

- Exported types
- Methods
  - copy
  - free
  - initEnd
  - initStart
  - nextCluster
  - prevCluster
- Properties
  - endChar
  - endGlyph
  - endIndex
  - glyphItem
  - startChar
  - startGlyph
  - startIndex
  - text

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

- newtype GlyphItemIter = GlyphItemIter (ManagedPtr GlyphItemIter)
- newZeroGlyphItemIter :: MonadIO m => m GlyphItemIter
- glyphItemIterCopy :: (HasCallStack, MonadIO m) => Maybe GlyphItemIter -> m (Maybe GlyphItemIter)
- glyphItemIterFree :: (HasCallStack, MonadIO m) => Maybe 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.

Constructors

GlyphItemIter (ManagedPtr GlyphItemIter) |

#### Instances

Instances details

Eq GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter Methods (==) :: GlyphItemIter -> GlyphItemIter -> Bool Source # (/=) :: GlyphItemIter -> GlyphItemIter -> Bool Source #
GBoxed GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter
ManagedPtrNewtype GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter Methods toManagedPtr :: GlyphItemIter -> ManagedPtr GlyphItemIter Source #
TypedObject GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter Methods glibType :: IO GType Source #
HasParentTypes GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter
tag ~ 'AttrSet => Constructible GlyphItemIter tag Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter Methods new :: MonadIO m => (ManagedPtr GlyphItemIter -> GlyphItemIter) -> [AttrOp GlyphItemIter tag] -> m GlyphItemIter Source #
IsGValue (Maybe GlyphItemIter) Source # | Convert `GlyphItemIter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Pango.Structs.GlyphItemIter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe GlyphItemIter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GlyphItemIter) Source #
type ParentTypes GlyphItemIter Source # |
Instance details Defined in GI.Pango.Structs.GlyphItemIter type ParentTypes GlyphItemIter = '[] :: [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) |
=> Maybe GlyphItemIter | `orig`: a `PangoGlyphItem`Iter
-> 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) |
=> Maybe GlyphItemIter | `iter`: a `PangoGlyphItemIter`
-> m () |

Frees a `PangoGlyphItem`Iter.

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 ]