Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.Pango.Structs.LayoutIter
Contents
Description
A LayoutIter
structure can be used to
iterate over the visual extents of a Layout
.
The LayoutIter
structure is opaque, and
has no user-visible fields.
- newtype LayoutIter = LayoutIter (ManagedPtr LayoutIter)
- noLayoutIter :: Maybe LayoutIter
- data LayoutIterAtLastLineMethodInfo
- layoutIterAtLastLine :: (HasCallStack, MonadIO m) => LayoutIter -> m Bool
- data LayoutIterCopyMethodInfo
- layoutIterCopy :: (HasCallStack, MonadIO m) => LayoutIter -> m (Maybe LayoutIter)
- data LayoutIterFreeMethodInfo
- layoutIterFree :: (HasCallStack, MonadIO m) => LayoutIter -> m ()
- data LayoutIterGetBaselineMethodInfo
- layoutIterGetBaseline :: (HasCallStack, MonadIO m) => LayoutIter -> m Int32
- data LayoutIterGetCharExtentsMethodInfo
- layoutIterGetCharExtents :: (HasCallStack, MonadIO m) => LayoutIter -> m Rectangle
- data LayoutIterGetClusterExtentsMethodInfo
- layoutIterGetClusterExtents :: (HasCallStack, MonadIO m) => LayoutIter -> m (Rectangle, Rectangle)
- data LayoutIterGetIndexMethodInfo
- layoutIterGetIndex :: (HasCallStack, MonadIO m) => LayoutIter -> m Int32
- data LayoutIterGetLayoutMethodInfo
- layoutIterGetLayout :: (HasCallStack, MonadIO m) => LayoutIter -> m Layout
- data LayoutIterGetLayoutExtentsMethodInfo
- layoutIterGetLayoutExtents :: (HasCallStack, MonadIO m) => LayoutIter -> m (Rectangle, Rectangle)
- data LayoutIterGetLineMethodInfo
- layoutIterGetLine :: (HasCallStack, MonadIO m) => LayoutIter -> m LayoutLine
- data LayoutIterGetLineExtentsMethodInfo
- layoutIterGetLineExtents :: (HasCallStack, MonadIO m) => LayoutIter -> m (Rectangle, Rectangle)
- data LayoutIterGetLineReadonlyMethodInfo
- layoutIterGetLineReadonly :: (HasCallStack, MonadIO m) => LayoutIter -> m LayoutLine
- data LayoutIterGetLineYrangeMethodInfo
- layoutIterGetLineYrange :: (HasCallStack, MonadIO m) => LayoutIter -> m (Int32, Int32)
- data LayoutIterGetRunMethodInfo
- layoutIterGetRun :: (HasCallStack, MonadIO m) => LayoutIter -> m (Maybe GlyphItem)
- data LayoutIterGetRunExtentsMethodInfo
- layoutIterGetRunExtents :: (HasCallStack, MonadIO m) => LayoutIter -> m (Rectangle, Rectangle)
- data LayoutIterGetRunReadonlyMethodInfo
- layoutIterGetRunReadonly :: (HasCallStack, MonadIO m) => LayoutIter -> m (Maybe GlyphItem)
- data LayoutIterNextCharMethodInfo
- layoutIterNextChar :: (HasCallStack, MonadIO m) => LayoutIter -> m Bool
- data LayoutIterNextClusterMethodInfo
- layoutIterNextCluster :: (HasCallStack, MonadIO m) => LayoutIter -> m Bool
- data LayoutIterNextLineMethodInfo
- layoutIterNextLine :: (HasCallStack, MonadIO m) => LayoutIter -> m Bool
- data LayoutIterNextRunMethodInfo
- layoutIterNextRun :: (HasCallStack, MonadIO m) => LayoutIter -> m Bool
Exported types
newtype LayoutIter Source #
Constructors
LayoutIter (ManagedPtr LayoutIter) |
Instances
Methods
atLastLine
data LayoutIterAtLastLineMethodInfo Source #
Instances
((~) * signature (m Bool), MonadIO m) => MethodInfo * LayoutIterAtLastLineMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Bool | Returns: |
Determines whether iter
is on the last line of the layout.
copy
data LayoutIterCopyMethodInfo Source #
Instances
((~) * signature (m (Maybe LayoutIter)), MonadIO m) => MethodInfo * LayoutIterCopyMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Maybe LayoutIter) | Returns: the newly allocated |
Copies a LayoutIter
.
Since: 1.20
free
data LayoutIterFreeMethodInfo Source #
Instances
((~) * signature (m ()), MonadIO m) => MethodInfo * LayoutIterFreeMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m () |
Frees an iterator that's no longer in use.
getBaseline
data LayoutIterGetBaselineMethodInfo Source #
Instances
((~) * signature (m Int32), MonadIO m) => MethodInfo * LayoutIterGetBaselineMethodInfo LayoutIter signature Source # | |
layoutIterGetBaseline Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Int32 | Returns: baseline of current line. |
Gets the Y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).
getCharExtents
data LayoutIterGetCharExtentsMethodInfo Source #
Instances
((~) * signature (m Rectangle), MonadIO m) => MethodInfo * LayoutIterGetCharExtentsMethodInfo LayoutIter signature Source # | |
layoutIterGetCharExtents Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Rectangle |
Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout). Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.
getClusterExtents
data LayoutIterGetClusterExtentsMethodInfo Source #
Instances
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutIterGetClusterExtentsMethodInfo LayoutIter signature Source # | |
layoutIterGetClusterExtents Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Rectangle, Rectangle) |
Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).
getIndex
data LayoutIterGetIndexMethodInfo Source #
Instances
((~) * signature (m Int32), MonadIO m) => MethodInfo * LayoutIterGetIndexMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Int32 | Returns: current byte index. |
Gets the current byte index. Note that iterating forward by char
moves in visual order, not logical order, so indexes may not be
sequential. Also, the index may be equal to the length of the text
in the layout, if on the Nothing
run (see layoutIterGetRun
).
getLayout
data LayoutIterGetLayoutMethodInfo Source #
Instances
((~) * signature (m Layout), MonadIO m) => MethodInfo * LayoutIterGetLayoutMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Layout | Returns: the layout associated with |
Gets the layout associated with a LayoutIter
.
Since: 1.20
getLayoutExtents
data LayoutIterGetLayoutExtentsMethodInfo Source #
Instances
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutIterGetLayoutExtentsMethodInfo LayoutIter signature Source # | |
layoutIterGetLayoutExtents Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Rectangle, Rectangle) |
getLine
data LayoutIterGetLineMethodInfo Source #
Instances
((~) * signature (m LayoutLine), MonadIO m) => MethodInfo * LayoutIterGetLineMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m LayoutLine | Returns: the current line. |
Gets the current line.
Use the faster layoutIterGetLineReadonly
if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).
getLineExtents
data LayoutIterGetLineExtentsMethodInfo Source #
Instances
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutIterGetLineExtentsMethodInfo LayoutIter signature Source # | |
layoutIterGetLineExtents Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Rectangle, Rectangle) |
Obtains the extents of the current line. inkRect
or logicalRect
can be Nothing
if you aren't interested in them. Extents are in layout
coordinates (origin is the top-left corner of the entire
Layout
). Thus the extents returned by this function will be
the same width/height but not at the same x/y as the extents
returned from layoutLineGetExtents
.
getLineReadonly
data LayoutIterGetLineReadonlyMethodInfo Source #
Instances
((~) * signature (m LayoutLine), MonadIO m) => MethodInfo * LayoutIterGetLineReadonlyMethodInfo LayoutIter signature Source # | |
layoutIterGetLineReadonly Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m LayoutLine | Returns: the current line, that should not be modified. |
Gets the current line for read-only access.
This is a faster alternative to layoutIterGetLine
,
but the user is not expected
to modify the contents of the line (glyphs, glyph widths, etc.).
Since: 1.16
getLineYrange
data LayoutIterGetLineYrangeMethodInfo Source #
Instances
((~) * signature (m (Int32, Int32)), MonadIO m) => MethodInfo * LayoutIterGetLineYrangeMethodInfo LayoutIter signature Source # | |
layoutIterGetLineYrange Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Int32, Int32) |
Divides the vertical space in the Layout
being iterated over
between the lines in the layout, and returns the space belonging to
the current line. A line's range includes the line's logical
extents, plus half of the spacing above and below the line, if
layoutSetSpacing
has been called to set layout spacing.
The Y positions are in layout coordinates (origin at top left of the
entire layout).
getRun
data LayoutIterGetRunMethodInfo Source #
Instances
((~) * signature (m (Maybe GlyphItem)), MonadIO m) => MethodInfo * LayoutIterGetRunMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Maybe GlyphItem) | Returns: the current run. |
Gets the current run. When iterating by run, at the end of each
line, there's a position with a Nothing
run, so this function can return
Nothing
. The Nothing
run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
Use the faster layoutIterGetRunReadonly
if you do not plan
to modify the contents of the run (glyphs, glyph widths, etc.).
getRunExtents
data LayoutIterGetRunExtentsMethodInfo Source #
Instances
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutIterGetRunExtentsMethodInfo LayoutIter signature Source # | |
layoutIterGetRunExtents Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Rectangle, Rectangle) |
Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).
getRunReadonly
data LayoutIterGetRunReadonlyMethodInfo Source #
Instances
((~) * signature (m (Maybe GlyphItem)), MonadIO m) => MethodInfo * LayoutIterGetRunReadonlyMethodInfo LayoutIter signature Source # | |
layoutIterGetRunReadonly Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m (Maybe GlyphItem) | Returns: the current run, that should not be modified. |
Gets the current run. When iterating by run, at the end of each
line, there's a position with a Nothing
run, so this function can return
Nothing
. The Nothing
run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
This is a faster alternative to layoutIterGetRun
,
but the user is not expected
to modify the contents of the run (glyphs, glyph widths, etc.).
Since: 1.16
nextChar
data LayoutIterNextCharMethodInfo Source #
Instances
((~) * signature (m Bool), MonadIO m) => MethodInfo * LayoutIterNextCharMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Bool | Returns: whether motion was possible. |
Moves iter
forward to the next character in visual order. If iter
was already at
the end of the layout, returns False
.
nextCluster
data LayoutIterNextClusterMethodInfo Source #
Instances
((~) * signature (m Bool), MonadIO m) => MethodInfo * LayoutIterNextClusterMethodInfo LayoutIter signature Source # | |
layoutIterNextCluster Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Bool | Returns: whether motion was possible. |
Moves iter
forward to the next cluster in visual order. If iter
was already at the end of the layout, returns False
.
nextLine
data LayoutIterNextLineMethodInfo Source #
Instances
((~) * signature (m Bool), MonadIO m) => MethodInfo * LayoutIterNextLineMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Bool | Returns: whether motion was possible. |
Moves iter
forward to the start of the next line. If iter
is
already on the last line, returns False
.
nextRun
data LayoutIterNextRunMethodInfo Source #
Instances
((~) * signature (m Bool), MonadIO m) => MethodInfo * LayoutIterNextRunMethodInfo LayoutIter signature Source # | |
Arguments
:: (HasCallStack, MonadIO m) | |
=> LayoutIter |
|
-> m Bool | Returns: whether motion was possible. |
Moves iter
forward to the next run in visual order. If iter
was
already at the end of the layout, returns False
.