Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A ScriptIter
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.
Instances
Eq ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter (==) :: ScriptIter -> ScriptIter -> Bool # (/=) :: ScriptIter -> ScriptIter -> Bool # | |
IsGValue ScriptIter Source # | Convert |
Defined in GI.Pango.Structs.ScriptIter toGValue :: ScriptIter -> IO GValue # fromGValue :: GValue -> IO ScriptIter # | |
ManagedPtrNewtype ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter | |
TypedObject ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter | |
GBoxed ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter | |
HasParentTypes ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter | |
type ParentTypes ScriptIter Source # | |
Defined in GI.Pango.Structs.ScriptIter |
Methods
Overloaded methods
free
:: (HasCallStack, MonadIO m) | |
=> ScriptIter |
|
-> m () |
Frees a ScriptIter
created with scriptIterNew
.
Since: 1.4
getRange
:: (HasCallStack, MonadIO m) | |
=> ScriptIter |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> m ScriptIter | Returns: the new script iterator, initialized
to point at the first range in the text, which should be
freed with |
Create a new ScriptIter
, 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
:: (HasCallStack, MonadIO m) | |
=> ScriptIter |
|
-> m Bool | Returns: |
Advances a ScriptIter
to the next range. If iter
is already at the end, it is left unchanged and False
is returned.
Since: 1.4