Package ch.bailu.gtk.pango
Class LayoutLine
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.pango.LayoutLine
- All Implemented Interfaces:
PointerInterface
A `PangoLayoutLine` represents one of the lines resulting from laying
out a paragraph via `PangoLayout`.
`PangoLayoutLine` structures are obtained by calling
[method@Pango.Layout.get_line] and are only valid until the text,
attributes, or settings of the parent `PangoLayout` are modified.
out a paragraph via `PangoLayout`.
`PangoLayoutLine` structures are obtained by calling
[method@Pango.Layout.get_line] and are only valid until the text,
attributes, or settings of the parent `PangoLayout` are modified.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
#TRUE if this is the first line of the paragraphstatic final String
the layout this line belongs to, might be %NULLstatic final String
length of line in bytesstatic final String
#Resolved PangoDirection of linestatic final String
list of runs in the
line, from left to rightstatic final String
start of line as byte index into layout->text -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
void
getExtents
(Rectangle ink_rect, Rectangle logical_rect) Computes the logical and ink extents of a layout line.int
#TRUE if this is the first line of the paragraphthe layout this line belongs to, might be %NULLint
length of line in bytesint
#Resolved PangoDirection of linelist of runs in the
line, from left to rightint
start of line as byte index into layout->textvoid
Computes the height of the line, as the maximum of the heights
of fonts used in this line.static int
int
Returns the length of the line, in bytes.static long
static TypeSystem.TypeSize
void
getPixelExtents
(Rectangle ink_rect, Rectangle logical_rect) Computes the logical and ink extents of @layout_line in device units.int
Returns the resolved direction of the line.int
Returns the start index of the line, as byte index
into the text of the layout.static long
static TypeSystem.TypeSize
void
Converts an index within a line to a X position.boolean
Returns whether this is the first line of the paragraph.ref()
Increase the reference count of a `PangoLayoutLine` by one.void
setFieldIsParagraphStart
(int is_paragraph_start) #TRUE if this is the first line of the paragraphvoid
setFieldLayout
(Layout layout) the layout this line belongs to, might be %NULLvoid
setFieldLength
(int length) length of line in bytesvoid
setFieldResolvedDir
(int resolved_dir) #Resolved PangoDirection of linevoid
setFieldRuns
(SList runs) list of runs in the
line, from left to rightvoid
setFieldStartIndex
(int start_index) start of line as byte index into layout->textvoid
unref()
Decrease the reference count of a `PangoLayoutLine` by one.boolean
Converts from x offset to the byte index of the corresponding character
within the text of the layout.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
-
Field Details
-
LAYOUT
the layout this line belongs to, might be %NULL- See Also:
-
START_INDEX
start of line as byte index into layout->text- See Also:
-
LENGTH
length of line in bytes- See Also:
-
RUNS
list of runs in the
line, from left to right- See Also:
-
IS_PARAGRAPH_START
#TRUE if this is the first line of the paragraph- See Also:
-
RESOLVED_DIR
#Resolved PangoDirection of line- See Also:
-
-
Constructor Details
-
LayoutLine
-
LayoutLine
public LayoutLine()
-
-
Method Details
-
getClassHandler
-
setFieldLayout
the layout this line belongs to, might be %NULL -
getFieldLayout
the layout this line belongs to, might be %NULL -
setFieldStartIndex
public void setFieldStartIndex(int start_index) start of line as byte index into layout->text -
getFieldStartIndex
public int getFieldStartIndex()start of line as byte index into layout->text -
setFieldLength
public void setFieldLength(int length) length of line in bytes -
getFieldLength
public int getFieldLength()length of line in bytes -
setFieldRuns
list of runs in the
line, from left to right -
getFieldRuns
list of runs in the
line, from left to right -
setFieldIsParagraphStart
public void setFieldIsParagraphStart(int is_paragraph_start) #TRUE if this is the first line of the paragraph -
getFieldIsParagraphStart
public int getFieldIsParagraphStart()#TRUE if this is the first line of the paragraph -
setFieldResolvedDir
public void setFieldResolvedDir(int resolved_dir) #Resolved PangoDirection of line -
getFieldResolvedDir
public int getFieldResolvedDir()#Resolved PangoDirection of line -
getExtents
Computes the logical and ink extents of a layout line.
See [method@Pango.Font.get_glyph_extents] for details
about the interpretation of the rectangles.- Parameters:
ink_rect
- rectangle used to store the extents of the glyph string as drawnlogical_rect
- rectangle used to store the logical extents of the glyph string
-
getHeight
Computes the height of the line, as the maximum of the heights
of fonts used in this line.
Note that the actual baseline-to-baseline distance between lines
of text is influenced by other factors, such as
[method@Pango.Layout.set_spacing] and
[method@Pango.Layout.set_line_spacing].- Parameters:
height
- return location for the line height
-
getLength
public int getLength()Returns the length of the line, in bytes.- Returns:
- the length of the line
-
getPixelExtents
Computes the logical and ink extents of @layout_line in device units.
This function just calls [method@Pango.LayoutLine.get_extents] followed by
two [func@extents_to_pixels] calls, rounding @ink_rect and @logical_rect
such that the rounded rectangles fully contain the unrounded one (that is,
passes them as first argument to [func@extents_to_pixels]).- Parameters:
ink_rect
- rectangle used to store the extents of the glyph string as drawnlogical_rect
- rectangle used to store the logical extents of the glyph string
-
getResolvedDirection
public int getResolvedDirection()Returns the resolved direction of the line.- Returns:
- the resolved direction of the line
-
getStartIndex
public int getStartIndex()Returns the start index of the line, as byte index
into the text of the layout.- Returns:
- the start index of the line
-
indexToX
Converts an index within a line to a X position.- Parameters:
index_
- byte offset of a grapheme within the layouttrailing
- an integer indicating the edge of the grapheme to retrieve the position of. If > 0, the trailing edge of the grapheme, if 0, the leading of the graphemex_pos
- location to store the x_offset (in Pango units)
-
isParagraphStart
public boolean isParagraphStart()Returns whether this is the first line of the paragraph.- Returns:
- %TRUE if this is the first line
-
ref
Increase the reference count of a `PangoLayoutLine` by one.- Returns:
- the line passed in.
-
unref
public void unref()Decrease the reference count of a `PangoLayoutLine` by one.
If the result is zero, the line and all associated memory
will be freed. -
xToIndex
Converts from x offset to the byte index of the corresponding character
within the text of the layout.
If @x_pos is outside the line, @index_ and @trailing will point to the very
first or very last position in the line. This determination is based on the
resolved direction of the paragraph; for example, if the resolved direction
is right-to-left, then an X position to the right of the line (after it)
results in 0 being stored in @index_ and @trailing. An X position to the
left of the line results in @index_ pointing to the (logical) last grapheme
in the line and @trailing being set to the number of characters in that
grapheme. The reverse is true for a left-to-right line.- Parameters:
x_pos
- the X offset (in Pango units) from the left edge of the line.index_
- location to store calculated byte index for the grapheme in which the user clickedtrailing
- location to store an integer indicating where in the grapheme the user clicked. It will either be zero, or the number of characters in the grapheme. 0 represents the leading edge of the grapheme.- Returns:
- %FALSE if @x_pos was outside the line, %TRUE if inside
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-