diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-01-25 01:57:43 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-01-25 15:31:25 -0500 |
commit | 342a0265b3992925105d04b1ef22cda6a7fa8786 (patch) | |
tree | a994c22dcf7ecd6402d390ddad599f821428c7b6 | |
parent | 61e192f6c1edcec694c38ef07f4ec9ff9af01cdc (diff) | |
download | pango-342a0265b3992925105d04b1ef22cda6a7fa8786.tar.gz |
Rename PangoLayoutIter to PangoLineIter
-rw-r--r-- | pango/meson.build | 4 | ||||
-rw-r--r-- | pango/pango-attributes.c | 6 | ||||
-rw-r--r-- | pango/pango-layout-iter-private.h | 5 | ||||
-rw-r--r-- | pango/pango-layout-iter.h | 84 | ||||
-rw-r--r-- | pango/pango-layout.c | 6 | ||||
-rw-r--r-- | pango/pango-layout.h | 2 | ||||
-rw-r--r-- | pango/pango-line-iter-private.h | 5 | ||||
-rw-r--r-- | pango/pango-line-iter.c (renamed from pango/pango-layout-iter.c) | 208 | ||||
-rw-r--r-- | pango/pango-line-iter.h | 84 | ||||
-rw-r--r-- | pango/pango-line.c | 2 | ||||
-rw-r--r-- | pango/pango-lines.c | 10 | ||||
-rw-r--r-- | pango/pango-lines.h | 4 | ||||
-rw-r--r-- | pango/pango-types.h | 2 | ||||
-rw-r--r-- | pango/pango.h | 2 | ||||
-rw-r--r-- | pango/pangowin32.c | 2 | ||||
-rw-r--r-- | tests/test-bidi.c | 18 | ||||
-rw-r--r-- | tests/testiter.c | 32 | ||||
-rw-r--r-- | tests/testmisc.c | 26 | ||||
-rw-r--r-- | utils/viewer-pangocairo.c | 56 |
19 files changed, 278 insertions, 280 deletions
diff --git a/pango/meson.build b/pango/meson.build index 4f603dc9..9cfc0400 100644 --- a/pango/meson.build +++ b/pango/meson.build @@ -35,7 +35,7 @@ pango_sources = [ 'pango-run.c', 'pango-line-breaker.c', 'pango-lines.c', - 'pango-layout-iter.c', + 'pango-line-iter.c', ] pango_headers = [ @@ -60,7 +60,7 @@ pango_headers = [ 'pango-line.h', 'pango-run.h', 'pango-line-breaker.h', - 'pango-layout-iter.h', + 'pango-line-iter.h', 'pango-lines.h', 'pango-layout.h', 'pango-matrix.h', diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index e3d5191f..6f50d3fe 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1511,7 +1511,7 @@ pango_attr_overline_color_new (guint16 red, * * This affects the values returned by * [method@Pango.Line.get_extents] and - * [method@Pango.LayoutIter.get_line_extents]. + * [method@Pango.LineIter.get_line_extents]. * * * Since: 1.50 @@ -1537,7 +1537,7 @@ pango_attr_line_height_new (double factor) * * This affects the values returned by * [method@Pango.Line.get_extents], - * [method@Pango.LayoutIter.get_line_extents]. + * [method@Pango.LineIter.get_line_extents]. * * Since: 1.50 */ @@ -1563,7 +1563,7 @@ pango_attr_line_height_new_absolute (int height) * * This affects the values returned by * [method@Pango.Line.get_extents], - * [method@Pango.LayoutIter.get_line_extents]. + * [method@Pango.LineIter.get_line_extents]. */ PangoAttribute * pango_attr_line_spacing_new (int spacing) diff --git a/pango/pango-layout-iter-private.h b/pango/pango-layout-iter-private.h deleted file mode 100644 index 7cf69b30..00000000 --- a/pango/pango-layout-iter-private.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "pango-layout-iter.h" - -PangoLayoutIter * pango_layout_iter_new (PangoLines *lines); diff --git a/pango/pango-layout-iter.h b/pango/pango-layout-iter.h deleted file mode 100644 index b5d1db0d..00000000 --- a/pango/pango-layout-iter.h +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -#include <glib-object.h> - -#include <pango/pango-types.h> -#include <pango/pango-lines.h> -#include <pango/pango-glyph-item.h> - -G_BEGIN_DECLS - -PANGO_AVAILABLE_IN_ALL -GType pango_layout_iter_get_type (void) G_GNUC_CONST; - -PANGO_AVAILABLE_IN_ALL -PangoLayoutIter * pango_layout_iter_copy (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_free (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -PangoLines * pango_layout_iter_get_lines (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -PangoLine * pango_layout_iter_get_line (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -PangoRun * pango_layout_iter_get_run (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -int pango_layout_iter_get_index (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -gboolean pango_layout_iter_next_line (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -gboolean pango_layout_iter_next_run (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -gboolean pango_layout_iter_next_char (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_trimmed_line_extents - (PangoLayoutIter *iter, - PangoLeadingTrim trim, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, - PangoRectangle *logical_rect); - -PANGO_AVAILABLE_IN_ALL -int pango_layout_iter_get_line_baseline (PangoLayoutIter *iter); - -PANGO_AVAILABLE_IN_ALL -int pango_layout_iter_get_run_baseline (PangoLayoutIter *iter); - - -G_END_DECLS diff --git a/pango/pango-layout.c b/pango/pango-layout.c index bdae079b..83fa94e2 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -27,7 +27,7 @@ * of the resulting glyphs can be made. * * The most convenient way to access the visual extents and components - * of a formatted layout is via a [struct@Pango.LayoutIter] iterator. + * of a formatted layout is via a [struct@Pango.LineIter] iterator. * * There are a number of parameters to adjust the formatting of a * `PangoLayout`. The following image shows adjustable parameters @@ -1711,9 +1711,9 @@ pango_layout_get_log_attrs (PangoLayout *layout, * * This is a convenience wrapper for [method@Pango.Lines.get_iter]. * - * Returns: the new `PangoLayoutIter` + * Returns: the new `PangoLineIter` */ -PangoLayoutIter * +PangoLineIter * pango_layout_get_iter (PangoLayout *layout) { g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); diff --git a/pango/pango-layout.h b/pango/pango-layout.h index c183716d..95a2f302 100644 --- a/pango/pango-layout.h +++ b/pango/pango-layout.h @@ -145,7 +145,7 @@ PANGO_AVAILABLE_IN_ALL PangoLines * pango_layout_get_lines (PangoLayout *layout); PANGO_AVAILABLE_IN_ALL -PangoLayoutIter * pango_layout_get_iter (PangoLayout *layout); +PangoLineIter * pango_layout_get_iter (PangoLayout *layout); PANGO_AVAILABLE_IN_ALL const PangoLogAttr * pango_layout_get_log_attrs (PangoLayout *layout, diff --git a/pango/pango-line-iter-private.h b/pango/pango-line-iter-private.h new file mode 100644 index 00000000..e9ca3799 --- /dev/null +++ b/pango/pango-line-iter-private.h @@ -0,0 +1,5 @@ +#pragma once + +#include "pango-line-iter.h" + +PangoLineIter * pango_line_iter_new (PangoLines *lines); diff --git a/pango/pango-layout-iter.c b/pango/pango-line-iter.c index 87b4ab77..e3eb9368 100644 --- a/pango/pango-layout-iter.c +++ b/pango/pango-line-iter.c @@ -1,27 +1,27 @@ #include "config.h" -#include "pango-layout-iter-private.h" +#include "pango-line-iter-private.h" #include "pango-lines-private.h" #include "pango-line-private.h" #include "pango-run-private.h" /** - * PangoLayoutIter: + * PangoLineIter: * - * A `PangoLayoutIter` can be used to iterate over the visual + * A `PangoLineIter` can be used to iterate over the visual * extents of a `PangoLayout` or `PangoLines`. * - * To obtain a `PangoLayoutIter`, use [method@Pango.Layout.get_iter] + * To obtain a `PangoLineIter`, use [method@Pango.Layout.get_iter] * or [method@Pango.Lines.get_iter]. * - * The `PangoLayoutIter` structure is opaque, and has no user-visible + * The `PangoLineIter` structure is opaque, and has no user-visible * fields. */ -/* {{{ PangoLayoutIter implementation */ +/* {{{ PangoLineIter implementation */ -struct _PangoLayoutIter +struct _PangoLineIter { PangoLines *lines; guint serial; @@ -50,8 +50,8 @@ struct _PangoLayoutIter int character_position; }; -G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, - pango_layout_iter_copy, pango_layout_iter_free); +G_DEFINE_BOXED_TYPE (PangoLineIter, pango_line_iter, + pango_line_iter_copy, pango_line_iter_free); /* }}} */ @@ -60,7 +60,7 @@ G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, #define ITER_IS_VALID(iter) ((iter)->serial == (iter)->lines->serial) static gboolean -line_is_terminated (PangoLayoutIter *iter) +line_is_terminated (PangoLineIter *iter) { if (iter->line_no + 1 < pango_lines_get_line_count (iter->lines)) return pango_line_is_paragraph_end (iter->line); @@ -112,7 +112,7 @@ cluster_width (PangoGlyphString *glyphs, * is the byte index of the cluster start relative to the run. */ static void -update_cluster (PangoLayoutIter *iter, +update_cluster (PangoLineIter *iter, int cluster_start_index) { PangoGlyphItem *glyph_item; @@ -165,14 +165,14 @@ update_cluster (PangoLayoutIter *iter, * is considered non-empty. */ static gboolean -next_nonempty_line (PangoLayoutIter *iter, - gboolean include_terminators) +next_nonempty_line (PangoLineIter *iter, + gboolean include_terminators) { gboolean result; while (TRUE) { - result = pango_layout_iter_next_line (iter); + result = pango_line_iter_next_line (iter); if (!result) break; @@ -191,14 +191,14 @@ next_nonempty_line (PangoLayoutIter *iter, * paragraph separator is considered non-empty. */ static gboolean -next_nonempty_run (PangoLayoutIter *iter, +next_nonempty_run (PangoLineIter *iter, gboolean include_terminators) { gboolean result; while (TRUE) { - result = pango_layout_iter_next_run (iter); + result = pango_line_iter_next_run (iter); if (!result) break; @@ -217,7 +217,7 @@ next_nonempty_run (PangoLayoutIter *iter, * (But not positions introduced by line wrapping). */ static gboolean -next_cluster_internal (PangoLayoutIter *iter, +next_cluster_internal (PangoLineIter *iter, gboolean include_terminators) { PangoGlyphItem *glyph_item; @@ -242,8 +242,8 @@ next_cluster_internal (PangoLayoutIter *iter, } static void -update_run (PangoLayoutIter *iter, - int start_index) +update_run (PangoLineIter *iter, + int start_index) { PangoGlyphItem *glyph_item; @@ -293,7 +293,7 @@ update_run (PangoLayoutIter *iter, } static inline void -offset_line (PangoLayoutIter *iter, +offset_line (PangoLineIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { @@ -310,7 +310,7 @@ offset_line (PangoLayoutIter *iter, } static inline void -offset_run (PangoLayoutIter *iter, +offset_run (PangoLineIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { @@ -323,15 +323,15 @@ offset_run (PangoLayoutIter *iter, /* }}} */ /* {{{ Private API */ -PangoLayoutIter * -pango_layout_iter_new (PangoLines *lines) +PangoLineIter * +pango_line_iter_new (PangoLines *lines) { - PangoLayoutIter *iter; + PangoLineIter *iter; int run_start_index; g_return_val_if_fail (PANGO_IS_LINES (lines), NULL); - iter = g_new0 (PangoLayoutIter, 1); + iter = g_new0 (PangoLineIter, 1); iter->lines = g_object_ref (lines); iter->serial = pango_lines_get_serial (lines); @@ -359,36 +359,36 @@ pango_layout_iter_new (PangoLines *lines) /* {{{ Public API */ /** - * pango_layout_iter_copy: - * @iter: (nullable): a `PangoLayoutIter` + * pango_line_iter_copy: + * @iter: (nullable): a `PangoLineIter` * - * Copies a `PangoLayoutIter`. + * Copies a `PangoLineIter`. * - * Return value: (nullable): the newly allocated `PangoLayoutIter` + * Return value: (nullable): the newly allocated `PangoLineIter` */ -PangoLayoutIter * -pango_layout_iter_copy (PangoLayoutIter *iter) +PangoLineIter * +pango_line_iter_copy (PangoLineIter *iter) { - PangoLayoutIter *copy; + PangoLineIter *copy; if (iter == NULL) return NULL; - copy = g_new0 (PangoLayoutIter, 1); - memcpy (iter, copy, sizeof (PangoLayoutIter)); + copy = g_new0 (PangoLineIter, 1); + memcpy (iter, copy, sizeof (PangoLineIter)); g_object_ref (copy->lines); return copy; } /** - * pango_layout_iter_free: - * @iter: (nullable): a `PangoLayoutIter` + * pango_line_iter_free: + * @iter: (nullable): a `PangoLineIter` * * Frees an iterator that's no longer in use. */ void -pango_layout_iter_free (PangoLayoutIter *iter) +pango_line_iter_free (PangoLineIter *iter) { if (iter == NULL) return; @@ -398,29 +398,29 @@ pango_layout_iter_free (PangoLayoutIter *iter) } /** - * pango_layout_iter_get_lines: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_lines: + * @iter: a `PangoLineIter` * - * Gets the `PangoLines` object associated with a `PangoLayoutIter`. + * Gets the `PangoLines` object associated with a `PangoLineIter`. * * Return value: (transfer none): the lines associated with @iter */ PangoLines * -pango_layout_iter_get_lines (PangoLayoutIter *iter) +pango_line_iter_get_lines (PangoLineIter *iter) { return iter->lines; } /** - * pango_layout_iter_get_line: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_line: + * @iter: a `PangoLineIter` * * Gets the current line. * * Return value: (transfer none): the current line */ PangoLine * -pango_layout_iter_get_line (PangoLayoutIter *iter) +pango_line_iter_get_line (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), NULL); @@ -428,15 +428,15 @@ pango_layout_iter_get_line (PangoLayoutIter *iter) } /** - * pango_layout_iter_at_last_line: - * @iter: a `PangoLayoutIter` + * pango_line_iter_at_last_line: + * @iter: a `PangoLineIter` * * Determines whether @iter is on the last line. * * Return value: %TRUE if @iter is on the last line */ gboolean -pango_layout_iter_at_last_line (PangoLayoutIter *iter) +pango_line_iter_at_last_line (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), FALSE); @@ -444,8 +444,8 @@ pango_layout_iter_at_last_line (PangoLayoutIter *iter) } /** - * pango_layout_iter_get_run: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_run: + * @iter: a `PangoLineIter` * * Gets the current run. * @@ -457,7 +457,7 @@ pango_layout_iter_at_last_line (PangoLayoutIter *iter) * Return value: (transfer none) (nullable): the current run */ PangoRun * -pango_layout_iter_get_run (PangoLayoutIter *iter) +pango_line_iter_get_run (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), NULL); @@ -465,8 +465,8 @@ pango_layout_iter_get_run (PangoLayoutIter *iter) } /** - * pango_layout_iter_get_index: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_index: + * @iter: a `PangoLineIter` * * Gets the current byte index. * @@ -476,12 +476,12 @@ pango_layout_iter_get_run (PangoLayoutIter *iter) * 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]). + * layout, if on the %NULL run (see [method@Pango.LineIter.get_run]). * * Return value: current byte index */ int -pango_layout_iter_get_index (PangoLayoutIter *iter) +pango_line_iter_get_index (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), 0); @@ -489,8 +489,8 @@ pango_layout_iter_get_index (PangoLayoutIter *iter) } /** - * pango_layout_iter_next_line: - * @iter: a `PangoLayoutIter` + * pango_line_iter_next_line: + * @iter: a `PangoLineIter` * * Moves @iter forward to the start of the next line. * @@ -499,7 +499,7 @@ pango_layout_iter_get_index (PangoLayoutIter *iter) * Return value: whether motion was possible */ gboolean -pango_layout_iter_next_line (PangoLayoutIter *iter) +pango_line_iter_next_line (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), FALSE); @@ -520,8 +520,8 @@ pango_layout_iter_next_line (PangoLayoutIter *iter) } /** - * pango_layout_iter_next_run: - * @iter: a `PangoLayoutIter` + * pango_line_iter_next_run: + * @iter: a `PangoLineIter` * * Moves @iter forward to the next run in visual order. * @@ -530,14 +530,14 @@ pango_layout_iter_next_line (PangoLayoutIter *iter) * Return value: whether motion was possible */ gboolean -pango_layout_iter_next_run (PangoLayoutIter *iter) +pango_line_iter_next_run (PangoLineIter *iter) { int run_start_index; g_return_val_if_fail (ITER_IS_VALID (iter), FALSE); if (iter->run == NULL) - return pango_layout_iter_next_line (iter); + return pango_line_iter_next_line (iter); iter->run_link = iter->run_link->next; if (iter->run_link == NULL) @@ -558,8 +558,8 @@ pango_layout_iter_next_run (PangoLayoutIter *iter) } /** - * pango_layout_iter_next_cluster: - * @iter: a `PangoLayoutIter` + * pango_line_iter_next_cluster: + * @iter: a `PangoLineIter` * * Moves @iter forward to the next cluster in visual order. * @@ -568,7 +568,7 @@ pango_layout_iter_next_run (PangoLayoutIter *iter) * Return value: whether motion was possible */ gboolean -pango_layout_iter_next_cluster (PangoLayoutIter *iter) +pango_line_iter_next_cluster (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), FALSE); @@ -576,8 +576,8 @@ pango_layout_iter_next_cluster (PangoLayoutIter *iter) } /** - * pango_layout_iter_next_char: - * @iter: a `PangoLayoutIter` + * pango_line_iter_next_char: + * @iter: a `PangoLineIter` * * Moves @iter forward to the next character in visual order. * @@ -586,7 +586,7 @@ pango_layout_iter_next_cluster (PangoLayoutIter *iter) * Return value: whether motion was possible */ gboolean -pango_layout_iter_next_char (PangoLayoutIter *iter) +pango_line_iter_next_char (PangoLineIter *iter) { const char *text; @@ -622,17 +622,17 @@ pango_layout_iter_next_char (PangoLayoutIter *iter) } /** - * pango_layout_iter_get_layout_extents: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_layout_extents: + * @iter: a `PangoLineIter` * @ink_rect: (out) (optional): rectangle to fill with ink extents * @logical_rect: (out) (optional): rectangle to fill with logical extents * * Obtains the extents of the `PangoLines` being iterated over. */ void -pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) +pango_line_iter_get_layout_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { g_return_if_fail (ITER_IS_VALID (iter)); @@ -640,8 +640,8 @@ pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, } /** - * pango_layout_iter_get_line_extents: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_line_extents: + * @iter: a `PangoLineIter` * @ink_rect: (out) (optional): rectangle to fill with ink extents * @logical_rect: (out) (optional): rectangle to fill with logical extents * @@ -659,9 +659,9 @@ pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, * [method@Pango.Line.get_trimmed_extents]. */ void -pango_layout_iter_get_line_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) +pango_line_iter_get_line_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { g_return_if_fail (ITER_IS_VALID (iter)); @@ -670,9 +670,9 @@ pango_layout_iter_get_line_extents (PangoLayoutIter *iter, } void -pango_layout_iter_get_trimmed_line_extents (PangoLayoutIter *iter, - PangoLeadingTrim trim, - PangoRectangle *logical_rect) +pango_line_iter_get_trimmed_line_extents (PangoLineIter *iter, + PangoLeadingTrim trim, + PangoRectangle *logical_rect) { g_return_if_fail (ITER_IS_VALID (iter)); @@ -681,8 +681,8 @@ pango_layout_iter_get_trimmed_line_extents (PangoLayoutIter *iter, } /** - * pango_layout_iter_get_run_extents: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_run_extents: + * @iter: a `PangoLineIter` * @ink_rect: (out) (optional): rectangle to fill with ink extents * @logical_rect: (out) (optional): rectangle to fill with logical extents * @@ -695,9 +695,9 @@ pango_layout_iter_get_trimmed_line_extents (PangoLayoutIter *iter, * [method@Pango.Run.get_extents]. */ void -pango_layout_iter_get_run_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) +pango_line_iter_get_run_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { g_return_if_fail (ITER_IS_VALID (iter)); @@ -739,8 +739,8 @@ pango_layout_iter_get_run_extents (PangoLayoutIter *iter, } /** - * pango_layout_iter_get_cluster_extents: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_cluster_extents: + * @iter: a `PangoLineIter` * @ink_rect: (out) (optional): rectangle to fill with ink extents * @logical_rect: (out) (optional): rectangle to fill with logical extents * @@ -749,9 +749,9 @@ pango_layout_iter_get_run_extents (PangoLayoutIter *iter, * Layout coordinates have the origin at the top left of the entire `PangoLines`. */ void -pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) +pango_line_iter_get_cluster_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { PangoGlyphItem *glyph_item; @@ -760,7 +760,7 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, if (iter->run == NULL) { /* When on the NULL run, all extents are the same */ - pango_layout_iter_get_run_extents (iter, ink_rect, logical_rect); + pango_line_iter_get_run_extents (iter, ink_rect, logical_rect); return; } @@ -789,8 +789,8 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, } /** - * pango_layout_iter_get_char_extents: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_char_extents: + * @iter: a `PangoLineIter` * @logical_rect: (out caller-allocates): rectangle to fill with logical extents * * Gets the extents of the current character, in layout coordinates. @@ -801,8 +801,8 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, * ink extents make sense only down to the level of clusters. */ void -pango_layout_iter_get_char_extents (PangoLayoutIter *iter, - PangoRectangle *logical_rect) +pango_line_iter_get_char_extents (PangoLineIter *iter, + PangoRectangle *logical_rect) { PangoRectangle cluster_rect; int x0, x1; @@ -812,7 +812,7 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter, if (logical_rect == NULL) return; - pango_layout_iter_get_cluster_extents (iter, NULL, &cluster_rect); + pango_line_iter_get_cluster_extents (iter, NULL, &cluster_rect); if (iter->run == NULL) { @@ -838,8 +838,8 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter, } /** - * pango_layout_iter_get_line_baseline: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_line_baseline: + * @iter: a `PangoLineIter` * * Gets the Y position of the current line's baseline, in layout * coordinates. @@ -849,7 +849,7 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter, * Return value: baseline of current line */ int -pango_layout_iter_get_line_baseline (PangoLayoutIter *iter) +pango_line_iter_get_line_baseline (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), 0); @@ -857,8 +857,8 @@ pango_layout_iter_get_line_baseline (PangoLayoutIter *iter) } /** - * pango_layout_iter_get_run_baseline: - * @iter: a `PangoLayoutIter` + * pango_line_iter_get_run_baseline: + * @iter: a `PangoLineIter` * * Gets the Y position of the current run's baseline, in layout * coordinates. @@ -869,14 +869,14 @@ pango_layout_iter_get_line_baseline (PangoLayoutIter *iter) * example due to superscript or subscript positioning. */ int -pango_layout_iter_get_run_baseline (PangoLayoutIter *iter) +pango_line_iter_get_run_baseline (PangoLineIter *iter) { g_return_val_if_fail (ITER_IS_VALID (iter), 0); if (iter->run) - return pango_layout_iter_get_line_baseline (iter) - pango_run_get_glyph_item (iter->run)->y_offset; + return pango_line_iter_get_line_baseline (iter) - pango_run_get_glyph_item (iter->run)->y_offset; else - return pango_layout_iter_get_line_baseline (iter); + return pango_line_iter_get_line_baseline (iter); } /* }}} */ diff --git a/pango/pango-line-iter.h b/pango/pango-line-iter.h new file mode 100644 index 00000000..2d61e478 --- /dev/null +++ b/pango/pango-line-iter.h @@ -0,0 +1,84 @@ +#pragma once + +#include <glib-object.h> + +#include <pango/pango-types.h> +#include <pango/pango-lines.h> +#include <pango/pango-glyph-item.h> + +G_BEGIN_DECLS + +PANGO_AVAILABLE_IN_ALL +GType pango_line_iter_get_type (void) G_GNUC_CONST; + +PANGO_AVAILABLE_IN_ALL +PangoLineIter * pango_line_iter_copy (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_free (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +PangoLines * pango_line_iter_get_lines (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +PangoLine * pango_line_iter_get_line (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_line_iter_at_last_line (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +PangoRun * pango_line_iter_get_run (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +int pango_line_iter_get_index (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_line_iter_next_line (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_line_iter_next_run (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_line_iter_next_cluster (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +gboolean pango_line_iter_next_char (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_layout_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_line_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_trimmed_line_extents + (PangoLineIter *iter, + PangoLeadingTrim trim, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_run_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_cluster_extents (PangoLineIter *iter, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +void pango_line_iter_get_char_extents (PangoLineIter *iter, + PangoRectangle *logical_rect); + +PANGO_AVAILABLE_IN_ALL +int pango_line_iter_get_line_baseline (PangoLineIter *iter); + +PANGO_AVAILABLE_IN_ALL +int pango_line_iter_get_run_baseline (PangoLineIter *iter); + + +G_END_DECLS diff --git a/pango/pango-line.c b/pango/pango-line.c index 61258956..04b01a43 100644 --- a/pango/pango-line.c +++ b/pango/pango-line.c @@ -27,7 +27,7 @@ * offset each line to. * * The most convenient way to access the visual extents and components - * of a `PangoLine` is via a [struct@Pango.LayoutIter] iterator. + * of a `PangoLine` is via a [struct@Pango.LineIter] iterator. */ /* {{{ LineData */ diff --git a/pango/pango-lines.c b/pango/pango-lines.c index 26b408ed..2d5fea44 100644 --- a/pango/pango-lines.c +++ b/pango/pango-lines.c @@ -3,7 +3,7 @@ #include "pango-lines-private.h" #include "pango-line-private.h" #include "pango-item-private.h" -#include "pango-layout-iter-private.h" +#include "pango-line-iter-private.h" /** * PangoLines: @@ -35,7 +35,7 @@ * for the `PangoLines*`. * * The most convenient way to access the visual extents and components - * of a `PangoLines` is via a [struct@Pango.LayoutIter] iterator. + * of a `PangoLines` is via a [struct@Pango.LineIter] iterator. */ /* {{{ PangoLines implementation */ @@ -242,12 +242,12 @@ pango_lines_add_line (PangoLines *lines, * * Note that the iter holds a reference to @lines. * - * Return value: the new `PangoLayoutIter` + * Return value: the new `PangoLineIter` */ -PangoLayoutIter * +PangoLineIter * pango_lines_get_iter (PangoLines *lines) { - return pango_layout_iter_new (lines); + return pango_line_iter_new (lines); } /** diff --git a/pango/pango-lines.h b/pango/pango-lines.h index 1e3ec82f..1326b35b 100644 --- a/pango/pango-lines.h +++ b/pango/pango-lines.h @@ -12,8 +12,6 @@ G_BEGIN_DECLS PANGO_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (PangoLines, pango_lines, PANGO, LINES, GObject); -typedef struct _PangoLayoutIter PangoLayoutIter; - PANGO_AVAILABLE_IN_ALL PangoLines * pango_lines_new (void); @@ -36,7 +34,7 @@ PangoLine * pango_lines_get_line (PangoLines *lines, int *line_y); PANGO_AVAILABLE_IN_ALL -PangoLayoutIter * pango_lines_get_iter (PangoLines *lines); +PangoLineIter * pango_lines_get_iter (PangoLines *lines); PANGO_AVAILABLE_IN_ALL void pango_lines_get_extents (PangoLines *lines, diff --git a/pango/pango-types.h b/pango/pango-types.h index 6c44314e..0420698b 100644 --- a/pango/pango-types.h +++ b/pango/pango-types.h @@ -56,7 +56,7 @@ typedef guint32 PangoGlyph; typedef struct _PangoRun PangoRun; typedef struct _PangoLine PangoLine; typedef struct _PangoLines PangoLines; -typedef struct _PangoLayoutIter PangoLayoutIter; +typedef struct _PangoLineIter PangoLineIter; /** * PANGO_SCALE: diff --git a/pango/pango.h b/pango/pango.h index 4f4782d0..878b2d14 100644 --- a/pango/pango.h +++ b/pango/pango.h @@ -45,7 +45,7 @@ #include <pango/pango-line.h> #include <pango/pango-run.h> #include <pango/pango-line-breaker.h> -#include <pango/pango-layout-iter.h> +#include <pango/pango-line-iter.h> #include <pango/pango-lines.h> #include <pango/pango-matrix.h> #include <pango/pango-markup.h> diff --git a/pango/pangowin32.c b/pango/pangowin32.c index eed92dde..3b426ab4 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -1084,7 +1084,7 @@ pango_win32_render_layout (HDC hdc, int x, int y) { - PangoLayoutIter *iter; + PangoLineIter *iter; g_return_if_fail (hdc != NULL); g_return_if_fail (PANGO_IS_LAYOUT (layout)); diff --git a/tests/test-bidi.c b/tests/test-bidi.c index fe74cac2..dadad5b1 100644 --- a/tests/test-bidi.c +++ b/tests/test-bidi.c @@ -362,7 +362,7 @@ test_move_cursor_para (void) PangoLine *line; PangoRectangle ext; PangoLines *lines; - PangoLayoutIter *iter; + PangoLineIter *iter; PangoLine *new_line; layout = pango_layout_new (context); @@ -389,10 +389,10 @@ test_move_cursor_para (void) break; iter = pango_lines_get_iter (lines); - while (pango_layout_iter_get_line (iter) != line) - pango_layout_iter_next_line (iter); - pango_layout_iter_get_line_extents (iter, NULL, &ext); - pango_layout_iter_free (iter); + while (pango_line_iter_get_line (iter) != line) + pango_line_iter_next_line (iter); + pango_line_iter_get_line_extents (iter, NULL, &ext); + pango_line_iter_free (iter); pango_lines_move_cursor(lines, TRUE, NULL, @@ -433,10 +433,10 @@ test_move_cursor_para (void) pango_lines_index_to_line (lines, index, &line, NULL, NULL, NULL); g_assert_nonnull (line); iter = pango_lines_get_iter (lines); - while (pango_layout_iter_get_line (iter) != line) - pango_layout_iter_next_line (iter); - pango_layout_iter_get_line_extents (iter, NULL, &ext); - pango_layout_iter_free (iter); + while (pango_line_iter_get_line (iter) != line) + pango_line_iter_next_line (iter); + pango_line_iter_get_line_extents (iter, NULL, &ext); + pango_line_iter_free (iter); pango_lines_move_cursor (lines, TRUE, NULL, diff --git a/tests/testiter.c b/tests/testiter.c index 062cd3b9..a966342e 100644 --- a/tests/testiter.c +++ b/tests/testiter.c @@ -80,7 +80,7 @@ static void iter_char_test (PangoLayout *layout) { PangoRectangle extents, run_extents; - PangoLayoutIter *iter; + PangoLineIter *iter; PangoRun *run; int num_chars; int i, index, offset; @@ -99,19 +99,19 @@ iter_char_test (PangoLayout *layout) gchar *char_str; g_assert (iter_next_ok); - index = pango_layout_iter_get_index (iter); + index = pango_line_iter_get_index (iter); ptr = text + index; char_str = g_strndup (ptr, g_utf8_next_char (ptr) - ptr); verbose ("i=%d (visual), index = %d '%s':\n", i, index, char_str); g_free (char_str); - pango_layout_iter_get_char_extents (iter, &extents); + pango_line_iter_get_char_extents (iter, &extents); verbose (" char extents: x=%d,y=%d w=%d,h=%d\n", extents.x, extents.y, extents.width, extents.height); - run = pango_layout_iter_get_run (iter); + run = pango_line_iter_get_run (iter); if (run) { @@ -124,7 +124,7 @@ iter_char_test (PangoLayout *layout) glyphs = pango_run_get_glyphs (run); /* Get needed data for the GlyphString */ - pango_layout_iter_get_run_extents (iter, NULL, &run_extents); + pango_line_iter_get_run_extents (iter, NULL, &run_extents); offset = item->offset; rtl = item->analysis.level%2; desc = pango_font_describe (item->analysis.font); @@ -158,7 +158,7 @@ iter_char_test (PangoLayout *layout) /* We're on a line terminator */ } - iter_next_ok = pango_layout_iter_next_char (iter); + iter_next_ok = pango_line_iter_next_char (iter); verbose ("more to go? %d\n", iter_next_ok); } @@ -166,14 +166,14 @@ iter_char_test (PangoLayout *layout) * input string */ g_assert (!iter_next_ok); - pango_layout_iter_free (iter); + pango_line_iter_free (iter); } static void iter_cluster_test (PangoLayout *layout) { PangoRectangle extents; - PangoLayoutIter *iter; + PangoLineIter *iter; int index; gboolean iter_next_ok; PangoLine *last_line = NULL; @@ -184,16 +184,16 @@ iter_cluster_test (PangoLayout *layout) while (iter_next_ok) { - PangoLine *line = pango_layout_iter_get_line (iter); + PangoLine *line = pango_line_iter_get_line (iter); /* Every cluster is part of a run */ - g_assert (pango_layout_iter_get_run (iter)); + g_assert (pango_line_iter_get_run (iter)); - index = pango_layout_iter_get_index (iter); + index = pango_line_iter_get_index (iter); - pango_layout_iter_get_cluster_extents (iter, NULL, &extents); + pango_line_iter_get_cluster_extents (iter, NULL, &extents); - iter_next_ok = pango_layout_iter_next_cluster (iter); + iter_next_ok = pango_line_iter_next_cluster (iter); verbose ("index = %d:\n", index); verbose (" cluster extents: x=%d,y=%d w=%d,h=%d\n", @@ -215,11 +215,11 @@ iter_cluster_test (PangoLayout *layout) g_assert (!iter_next_ok); - pango_layout_iter_free (iter); + pango_line_iter_free (iter); } static void -test_layout_iter (void) +test_line_iter (void) { const char **ptext; PangoFontMap *fontmap; @@ -320,7 +320,7 @@ main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - g_test_add_func ("/layout/iter", test_layout_iter); + g_test_add_func ("/layout/iter", test_line_iter); g_test_add_func ("/layout/glyphitem-iter", test_glyphitem_iter); return g_test_run (); diff --git a/tests/testmisc.c b/tests/testmisc.c index f1e892e8..a4183478 100644 --- a/tests/testmisc.c +++ b/tests/testmisc.c @@ -178,7 +178,7 @@ test_run_height (void) { PangoContext *context; PangoLayout *layout; - PangoLayoutIter *iter; + PangoLineIter *iter; PangoRectangle logical1, logical2; if (strcmp (G_OBJECT_TYPE_NAME (pango_cairo_font_map_get_default ()), "PangoCairoCoreTextFontMap") == 0) @@ -192,14 +192,14 @@ test_run_height (void) pango_layout_set_text (layout, "one", -1); iter = pango_lines_get_iter (pango_layout_get_lines (layout)); - pango_layout_iter_get_run_extents (iter, NULL, &logical1); - pango_layout_iter_free (iter); + pango_line_iter_get_run_extents (iter, NULL, &logical1); + pango_line_iter_free (iter); pango_layout_set_text (layout, "", -1); iter = pango_lines_get_iter (pango_layout_get_lines (layout)); - pango_layout_iter_get_run_extents (iter, NULL, &logical2); - pango_layout_iter_free (iter); + pango_line_iter_get_run_extents (iter, NULL, &logical2); + pango_line_iter_free (iter); g_assert_cmpint (logical1.height, ==, logical2.height); @@ -581,7 +581,7 @@ test_extents (void) { PangoLayout *layout; PangoLines *lines; - PangoLayoutIter *iter; + PangoLineIter *iter; PangoRectangle layout_extents; PangoRectangle line_extents; PangoRectangle run_extents; @@ -602,11 +602,11 @@ test_extents (void) do { - pango_layout_iter_get_line_extents (iter, NULL, &line_extents); - pango_layout_iter_get_run_extents (iter, NULL, &run_extents); - pango_layout_iter_get_cluster_extents (iter, NULL, &cluster_extents); - pango_layout_iter_get_char_extents (iter, &char_extents); - index = pango_layout_iter_get_index (iter); + pango_line_iter_get_line_extents (iter, NULL, &line_extents); + pango_line_iter_get_run_extents (iter, NULL, &run_extents); + pango_line_iter_get_cluster_extents (iter, NULL, &cluster_extents); + pango_line_iter_get_char_extents (iter, &char_extents); + index = pango_line_iter_get_index (iter); pango_lines_index_to_pos (lines, NULL, index, &pos); if (pos.width < 0) { @@ -624,9 +624,9 @@ test_extents (void) g_assert_true (pango_rectangle_contains (&line_extents, &strong)); g_assert_true (pango_rectangle_contains (&line_extents, &weak)); } - while (pango_layout_iter_next_char (iter)); + while (pango_line_iter_next_char (iter)); - pango_layout_iter_free (iter); + pango_line_iter_free (iter); g_object_unref (layout); } diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c index 631c2a7d..6293e086 100644 --- a/utils/viewer-pangocairo.c +++ b/utils/viewer-pangocairo.c @@ -202,7 +202,7 @@ render_callback (PangoLayout *layout, cairo_pattern_t *pattern; PangoRectangle ink, logical; double lw = cairo_get_line_width (cr); - PangoLayoutIter *iter; + PangoLineIter *iter; pango_lines_get_extents (pango_layout_get_lines (layout), &ink, &logical); @@ -282,10 +282,10 @@ render_callback (PangoLayout *layout, iter = pango_layout_get_iter (layout); do { - PangoLine *line = pango_layout_iter_get_line (iter); + PangoLine *line = pango_line_iter_get_line (iter); double width = (double)logical.width / PANGO_SCALE; - y = pango_layout_iter_get_line_baseline (iter); + y = pango_line_iter_get_line_baseline (iter); cairo_save (cr); cairo_translate (cr, (double)logical.x / PANGO_SCALE + width * 0.5, @@ -303,8 +303,8 @@ render_callback (PangoLayout *layout, cairo_fill (cr); cairo_restore (cr); } - while (pango_layout_iter_next_line (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_line (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -345,7 +345,7 @@ render_callback (PangoLayout *layout, { PangoRectangle rect; - pango_layout_iter_get_line_extents (iter, NULL, &rect); + pango_line_iter_get_line_extents (iter, NULL, &rect); cairo_rectangle (cr, (double)rect.x / PANGO_SCALE - lw / 2, (double)rect.y / PANGO_SCALE - lw / 2, @@ -353,8 +353,8 @@ render_callback (PangoLayout *layout, (double)rect.height / PANGO_SCALE + lw); cairo_stroke (cr); } - while (pango_layout_iter_next_line (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_line (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -370,11 +370,11 @@ render_callback (PangoLayout *layout, PangoRun *run; PangoRectangle rect; - run = pango_layout_iter_get_run (iter); + run = pango_line_iter_get_run (iter); if (!run) continue; - pango_layout_iter_get_run_extents (iter, NULL, &rect); + pango_line_iter_get_run_extents (iter, NULL, &rect); cairo_rectangle (cr, (double)rect.x / PANGO_SCALE - lw / 2, (double)rect.y / PANGO_SCALE - lw / 2, @@ -382,8 +382,8 @@ render_callback (PangoLayout *layout, (double)rect.height / PANGO_SCALE + lw); cairo_stroke (cr); } - while (pango_layout_iter_next_run (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_run (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -398,7 +398,7 @@ render_callback (PangoLayout *layout, { PangoRectangle rect; - pango_layout_iter_get_cluster_extents (iter, NULL, &rect); + pango_line_iter_get_cluster_extents (iter, NULL, &rect); cairo_rectangle (cr, (double)rect.x / PANGO_SCALE - lw / 2, (double)rect.y / PANGO_SCALE - lw / 2, @@ -406,8 +406,8 @@ render_callback (PangoLayout *layout, (double)rect.height / PANGO_SCALE + lw); cairo_stroke (cr); } - while (pango_layout_iter_next_cluster (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_cluster (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -422,7 +422,7 @@ render_callback (PangoLayout *layout, { PangoRectangle rect; - pango_layout_iter_get_char_extents (iter, &rect); + pango_line_iter_get_char_extents (iter, &rect); cairo_rectangle (cr, (double)rect.x / PANGO_SCALE - lw / 2, (double)rect.y / PANGO_SCALE - lw / 2, @@ -430,8 +430,8 @@ render_callback (PangoLayout *layout, (double)rect.height / PANGO_SCALE + lw); cairo_stroke (cr); } - while (pango_layout_iter_next_cluster (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_cluster (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -450,17 +450,17 @@ render_callback (PangoLayout *layout, PangoRectangle rect; int x_pos, y_pos; - run = pango_layout_iter_get_run (iter); + run = pango_line_iter_get_run (iter); if (!run) continue; item = pango_run_get_item (run); glyphs = pango_run_get_glyphs (run); - pango_layout_iter_get_run_extents (iter, NULL, &rect); + pango_line_iter_get_run_extents (iter, NULL, &rect); x_pos = rect.x; - y_pos = pango_layout_iter_get_run_baseline (iter); + y_pos = pango_line_iter_get_run_baseline (iter); for (int i = 0; i < glyphs->num_glyphs; i++) { @@ -491,8 +491,8 @@ render_callback (PangoLayout *layout, x_pos += glyphs->glyphs[i].geometry.width; } } - while (pango_layout_iter_next_run (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_run (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } @@ -520,8 +520,8 @@ render_callback (PangoLayout *layout, int x, y; gboolean trailing; - pango_layout_iter_get_run_extents (iter, NULL, &rect); - run = pango_layout_iter_get_run (iter); + pango_line_iter_get_run_extents (iter, NULL, &rect); + run = pango_line_iter_get_run (iter); if (!run) continue; @@ -534,7 +534,7 @@ render_callback (PangoLayout *layout, offset = g_utf8_strlen (text, start - text); - y = pango_layout_iter_get_run_baseline (iter); + y = pango_line_iter_get_run_baseline (iter); trailing = FALSE; p = start; @@ -574,8 +574,8 @@ render_callback (PangoLayout *layout, } } - while (pango_layout_iter_next_run (iter)); - pango_layout_iter_free (iter); + while (pango_line_iter_next_run (iter)); + pango_line_iter_free (iter); cairo_restore (cr); } |