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

Contents

- Exported types
- Methods
  - free
  - getRange
  - new
  - next

Description

A `PangoScriptIter` is used to iterate through a string and identify ranges in different scripts.

Synopsis

- newtype ScriptIter = ScriptIter (ManagedPtr ScriptIter)
- scriptIterFree :: (HasCallStack, MonadIO m) => ScriptIter -> m ()
- scriptIterGetRange :: (HasCallStack, MonadIO m) => ScriptIter -> m (Text, Text, Script)
- scriptIterNew :: (HasCallStack, MonadIO m) => Text -> Int32 -> m ScriptIter
- scriptIterNext :: (HasCallStack, MonadIO m) => ScriptIter -> m Bool

# Exported types

newtype ScriptIter Source #

Memory-managed wrapper type.

Constructors

ScriptIter (ManagedPtr ScriptIter) |

#### Instances

Instances details

Eq ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter Methods (==) :: ScriptIter -> ScriptIter -> Bool Source # (/=) :: ScriptIter -> ScriptIter -> Bool Source #
GBoxed ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter
ManagedPtrNewtype ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter Methods toManagedPtr :: ScriptIter -> ManagedPtr ScriptIter Source #
TypedObject ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter Methods glibType :: IO GType Source #
HasParentTypes ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter
IsGValue (Maybe ScriptIter) Source # | Convert `ScriptIter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Pango.Structs.ScriptIter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ScriptIter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ScriptIter) Source #
type ParentTypes ScriptIter Source # |
Instance details Defined in GI.Pango.Structs.ScriptIter type ParentTypes ScriptIter = '[] :: [Type]

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

free, next.

#### Getters

getRange.

#### Setters

None.

## free

scriptIterFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> ScriptIter | `iter`: a `PangoScriptIter`
-> m () |

Frees a `PangoScriptIter`.

Since: 1.4

## getRange

scriptIterGetRange Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> ScriptIter | `iter`: a `PangoScriptIter`
-> m (Text, Text, Script) |

Gets information about the range to which `iter` currently points.

The range is the set of locations p where *start <= p < *end. (That is, it doesn't include the character stored at *end)

Note that while the type of the `script` argument is declared as `PangoScript`, as of Pango 1.18, this function simply returns `GUnicodeScript` values. Callers must be prepared to handle unknown values.

Since: 1.4

## new

scriptIterNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `text`: a UTF-8 string
-> Int32 | `length`: length of `text`, or -1 if `text` is nul-terminated
-> m ScriptIter | Returns: the new script iterator, initialized to point at the first range in the text, which should be freed with `scriptIterFree`. If the string is empty, it will point at an empty range.

Create a new `PangoScriptIter`, used to break a string of Unicode text into runs by Unicode script.

No copy is made of `text`, so the caller needs to make sure it remains valid until the iterator is freed with `scriptIterFree`.

Since: 1.4

## next

scriptIterNext Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> ScriptIter | `iter`: a `PangoScriptIter`
-> m Bool | Returns: `True` if `iter` was successfully advanced

Advances a `PangoScriptIter` to the next range.

If `iter` is already at the end, it is left unchanged and `False` is returned.

Since: 1.4