diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-07-09 23:35:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-01 23:25:13 -0400 |
commit | 6735e96058a007da315670aef1bc770e816e5d98 (patch) | |
tree | c3208461598ee959ca2e7e294b574e784b5e8081 /pango/pango-layout.c | |
parent | 626c131eaf3c040cf01da573e4c265144aeaa78d (diff) | |
download | pango-6735e96058a007da315670aef1bc770e816e5d98.tar.gz |
layout: Add some api for introspection
Add accessors for PangoLayoutLine fields.
Fixes: #553
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index f5175552..8303be2c 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4517,6 +4517,71 @@ G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, pango_layout_line_unref); /** + * pango_layout_line_get_start_index: + * @line: a `PangoLayoutLine` + * + * Returns the start index of the line, as byte index + * into the text of the layout. + * + * Returns: the start index of the line + * + * Since: 1.50 + */ +int +pango_layout_line_get_start_index (PangoLayoutLine *line) +{ + return line->start_index; +} + +/** + * pango_layout_line_get_length: + * @line: a `PangoLayoutLine` + * + * Returns the length of the line, in bytes. + * + * Returns: the length of the line + * + * Since: 1.50 + */ +int +pango_layout_line_get_length (PangoLayoutLine *line) +{ + return line->length; +} + +/** + * pango_layout_line_is_paragraph_start: + * @line: a `PangoLayoutLine` + * + * Returns whether this is the first line of the paragraph. + * + * Returns: %TRUE if this is the first line + * + * Since: 1.50 + */ +gboolean +pango_layout_line_is_paragraph_start (PangoLayoutLine *line) +{ + return line->is_paragraph_start; +} + +/** + * pango_layout_line_get_resolved_direction: + * @line: a `PangoLayoutLine` + * + * Returns the resolved direction of the line. + * + * Returns: the resolved direction of the line + * + * Since: 1.50 + */ +PangoDirection +pango_layout_line_get_resolved_direction (PangoLayoutLine *line) +{ + return (PangoDirection) line->resolved_dir; +} + +/** * pango_layout_line_x_to_index: * @line: a `PangoLayoutLine` * @x_pos: the X offset (in Pango units) from the left edge of the line. |