Package ch.bailu.gtk.pango
Class LayoutIter
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.pango.LayoutIter
- All Implemented Interfaces:
PointerInterface
A `PangoLayoutIter` can be used to iterate over the visual
extents of a `PangoLayout`.
To obtain a `PangoLayoutIter`, use [method@Pango.Layout.get_iter].
The `PangoLayoutIter` structure is opaque, and has no user-visible fields.
extents of a `PangoLayout`.
To obtain a `PangoLayoutIter`, use [method@Pango.Layout.get_iter].
The `PangoLayoutIter` structure is opaque, and has no user-visible fields.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether @iter is on the last line of the layout.copy()
Copies a `PangoLayoutIter`.void
free()
Frees an iterator that's no longer in use.int
Gets the Y position of the current line's baseline, in layout
coordinates.void
getCharExtents
(Rectangle logical_rect) Gets the extents of the current character, in layout coordinates.static ClassHandler
void
getClusterExtents
(Rectangle ink_rect, Rectangle logical_rect) Gets the extents of the current cluster, in layout coordinates.int
getIndex()
Gets the current byte index.static int
Gets the layout associated with a `PangoLayoutIter`.void
getLayoutExtents
(Rectangle ink_rect, Rectangle logical_rect) Obtains the extents of the `PangoLayout` being iterated over.getLine()
Gets the current line.void
getLineExtents
(Rectangle ink_rect, Rectangle logical_rect) Obtains the extents of the current line.Gets the current line for read-only access.void
getLineYrange
(Int y0_, Int y1_) Divides the vertical space in the `PangoLayout` being iterated over
between the lines in the layout, and returns the space belonging to
the current line.static long
static TypeSystem.TypeSize
getRun()
Gets the current run.int
Gets the Y position of the current run's baseline, in layout
coordinates.void
getRunExtents
(Rectangle ink_rect, Rectangle logical_rect) Gets the extents of the current run in layout coordinates.Gets the current run for read-only access.static long
static TypeSystem.TypeSize
boolean
nextChar()
Moves @iter forward to the next character in visual order.boolean
Moves @iter forward to the next cluster in visual order.boolean
nextLine()
Moves @iter forward to the start of the next line.boolean
nextRun()
Moves @iter forward to the next run in visual order.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
LayoutIter
-
-
Method Details
-
getClassHandler
-
atLastLine
public boolean atLastLine()Determines whether @iter is on the last line of the layout.- Returns:
- %TRUE if @iter is on the last line
-
copy
Copies a `PangoLayoutIter`.- Returns:
- the newly allocated `PangoLayoutIter`
-
free
public void free()Frees an iterator that's no longer in use. -
getBaseline
public int getBaseline()Gets the Y position of the current line's baseline, in layout
coordinates.
Layout coordinates have the origin at the top left of the entire layout.- Returns:
- baseline of current line
-
getCharExtents
Gets the extents of the current character, in layout coordinates.
Layout coordinates have the origin at 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.- Parameters:
logical_rect
- rectangle to fill with logical extents
-
getClusterExtents
Gets the extents of the current cluster, in layout coordinates.
Layout coordinates have the origin at the top left of the entire layout.- Parameters:
ink_rect
- rectangle to fill with ink extentslogical_rect
- rectangle to fill with logical extents
-
getIndex
public int getIndex()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 %NULL run (see [method@Pango.LayoutIter.get_run]).- Returns:
- current byte index
-
getLayout
Gets the layout associated with a `PangoLayoutIter`.- Returns:
- the layout associated with @iter
-
getLayoutExtents
Obtains the extents of the `PangoLayout` being iterated over.- Parameters:
ink_rect
- rectangle to fill with ink extentslogical_rect
- rectangle to fill with logical extents
-
getLine
Gets the current line.
Use the faster [method@Pango.LayoutIter.get_line_readonly] if
you do not plan to modify the contents of the line (glyphs,
glyph widths, etc.).- Returns:
- the current line
-
getLineExtents
Obtains the extents of the current line.
Extents are in layout coordinates (origin is the top-left corner
of the entire `PangoLayout`). 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 [method@Pango.LayoutLine.get_extents].- Parameters:
ink_rect
- rectangle to fill with ink extentslogical_rect
- rectangle to fill with logical extents
-
getLineReadonly
Gets the current line for read-only access.
This is a faster alternative to [method@Pango.LayoutIter.get_line],
but the user is not expected to modify the contents of the line
(glyphs, glyph widths, etc.).- Returns:
- the current line, that should not be modified
-
getLineYrange
Divides the vertical space in the `PangoLayout` 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 [method@Pango.Layout.set_spacing]
has been called to set layout spacing. The Y positions are in layout
coordinates (origin at top left of the entire layout).
Note: Since 1.44, Pango uses line heights for placing lines, and there
may be gaps between the ranges returned by this function.- Parameters:
y0_
- start of liney1_
- end of line
-
getRun
Gets the current run.
When iterating by run, at the end of each line, there's a position
with a %NULL run, so this function can return %NULL. The %NULL 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 [method@Pango.LayoutIter.get_run_readonly] if you do not
plan to modify the contents of the run (glyphs, glyph widths, etc.).- Returns:
- the current run
-
getRunBaseline
public int getRunBaseline()Gets the Y position of the current run's baseline, in layout
coordinates.
Layout coordinates have the origin at the top left of the entire layout.
The run baseline can be different from the line baseline, for
example due to superscript or subscript positioning.- Returns:
-
getRunExtents
Gets the extents of the current run in layout coordinates.
Layout coordinates have the origin at the top left of the entire layout.- Parameters:
ink_rect
- rectangle to fill with ink extentslogical_rect
- rectangle to fill with logical extents
-
getRunReadonly
Gets the current run for read-only access.
When iterating by run, at the end of each line, there's a position
with a %NULL run, so this function can return %NULL. The %NULL 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 [method@Pango.LayoutIter.get_run],
but the user is not expected to modify the contents of the run (glyphs,
glyph widths, etc.).- Returns:
- the current run, that should not be modified
-
nextChar
public boolean nextChar()Moves @iter forward to the next character in visual order.
If @iter was already at the end of the layout, returns %FALSE.- Returns:
- whether motion was possible
-
nextCluster
public boolean nextCluster()Moves @iter forward to the next cluster in visual order.
If @iter was already at the end of the layout, returns %FALSE.- Returns:
- whether motion was possible
-
nextLine
public boolean nextLine()Moves @iter forward to the start of the next line.
If @iter is already on the last line, returns %FALSE.- Returns:
- whether motion was possible
-
nextRun
public boolean nextRun()Moves @iter forward to the next run in visual order.
If @iter was already at the end of the layout, returns %FALSE.- Returns:
- whether motion was possible
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-