diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-06-10 21:49:09 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-06-22 11:33:20 -0400 |
commit | 9d8a43596145936f99b562dda053d5ce4c8e1b7a (patch) | |
tree | 6f3d48a7e5f4a3d8a372541a3801088bbb1d6ecb /pango/ellipsize.c | |
parent | cb9ab2375f1b1a6539128f0e2e4e3fe8677a0625 (diff) | |
download | pango-9d8a43596145936f99b562dda053d5ce4c8e1b7a.tar.gz |
Replace PangoLayout
This commit replaces the old PangoLayout implementation
with PangoSimpleLayout, and does all the necessary
cleanups.
Diffstat (limited to 'pango/ellipsize.c')
-rw-r--r-- | pango/ellipsize.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c index 7f121a80..ebe8a684 100644 --- a/pango/ellipsize.c +++ b/pango/ellipsize.c @@ -23,7 +23,6 @@ #include <string.h> #include "pango-glyph-item.h" -#include "pango-layout-private.h" #include "pango-font-private.h" #include "pango-attributes-private.h" #include "pango-impl-utils.h" @@ -744,58 +743,6 @@ current_width (EllipsizeState *state) return state->total_width - (state->gap_end_x - state->gap_start_x) + state->ellipsis_width; } -/** - * _pango_layout_line_ellipsize: - * @line: a `PangoLayoutLine` - * @attrs: Attributes being used for itemization/shaping - * @shape_flags: Flags to use when shaping - * - * Given a `PangoLayoutLine` with the runs still in logical order, ellipsize - * it according the layout's policy to fit within the set width of the layout. - * - * Return value: whether the line had to be ellipsized - **/ -gboolean -_pango_layout_line_ellipsize (PangoLayoutLine *line, - PangoAttrList *attrs, - PangoShapeFlags shape_flags, - int goal_width) -{ - PangoLayout *layout = line->layout; - PangoContext *context = layout->context; - const char *text = layout->text; - PangoLogAttr *log_attrs = layout->log_attrs; - PangoEllipsizeMode ellipsize = layout->ellipsize; - EllipsizeState state; - gboolean is_ellipsized = FALSE; - - g_return_val_if_fail (ellipsize != PANGO_ELLIPSIZE_NONE && goal_width >= 0, is_ellipsized); - - init_state (&state, context, text, line->start_index, log_attrs, ellipsize, line->runs, attrs, shape_flags); - - if (state.total_width <= goal_width) - goto out; - - find_initial_span (&state); - - while (current_width (&state) > goal_width) - { - if (!remove_one_span (&state)) - break; - } - - fixup_ellipsis_run (&state, MAX (goal_width - current_width (&state), 0)); - - g_slist_free (line->runs); - line->runs = get_run_list (&state); - is_ellipsized = TRUE; - - out: - free_state (&state); - - return is_ellipsized; -} - void pango_line_ellipsize (PangoLine *line, PangoContext *context, |