diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-02-17 14:28:03 -0600 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-02-17 14:28:03 -0600 |
commit | 6e6f2d674630b9ebe2d2c70a37d436d5fc1a1258 (patch) | |
tree | 46f75d004ec7ef2b04b536e2d10b44959e12439c | |
parent | 0669a7c946bce99dac2c084af81b1c3ed421f19c (diff) | |
download | pango-6e6f2d674630b9ebe2d2c70a37d436d5fc1a1258.tar.gz |
Drop cached_iter argument
All callers of pango_itemize_with_base_dir were passing
NULL, so just drop it.
-rw-r--r-- | pango/ellipsize.c | 2 | ||||
-rw-r--r-- | pango/itemize.c | 53 | ||||
-rw-r--r-- | pango/pango-item.h | 11 | ||||
-rw-r--r-- | pango/pango-layout.c | 2 | ||||
-rw-r--r-- | tests/test-font.c | 2 | ||||
-rw-r--r-- | tests/test-itemize.c | 2 | ||||
-rw-r--r-- | tests/test-shape.c | 2 | ||||
-rw-r--r-- | tests/testmisc.c | 6 |
8 files changed, 11 insertions, 69 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c index 6d79e0a7..a1798f58 100644 --- a/pango/ellipsize.c +++ b/pango/ellipsize.c @@ -287,7 +287,7 @@ itemize_text (EllipsizeState *state, PangoDirection dir; dir = pango_context_get_base_dir (state->layout->context); - items = pango_itemize_with_base_dir (state->layout->context, dir, text, 0, strlen (text), attrs, NULL); + items = pango_itemize_with_base_dir (state->layout->context, dir, text, 0, strlen (text), attrs); g_assert (g_list_length (items) == 1); item = items->data; diff --git a/pango/itemize.c b/pango/itemize.c index eeb1d01b..a6fa955f 100644 --- a/pango/itemize.c +++ b/pango/itemize.c @@ -1587,7 +1587,6 @@ pango_itemize_post_process_items (PangoContext *context, * @length: the number of bytes (not characters) to process * after @start_index. This must be >= 0. * @attrs: the set of attributes that apply to @text. - * @cached_iter: (nullable): Cached attribute iterator * * Like `pango_itemize()`, but with an explicitly specified base direction. * @@ -1607,8 +1606,7 @@ pango_itemize_with_base_dir (PangoContext *context, const char *text, int start_index, int length, - PangoAttrList *attrs, - PangoAttrIterator *cached_iter) + PangoAttrList *attrs) { GList *items; @@ -1619,58 +1617,11 @@ pango_itemize_with_base_dir (PangoContext *context, items = pango_itemize_with_font (context, base_dir, text, start_index, length, - attrs, cached_iter, - NULL); + attrs, NULL, NULL); return pango_itemize_post_process_items (context, text, NULL, items); } -/** - * pango_itemize: - * @context: a structure holding information that affects - * the itemization process. - * @text: the text to itemize. Must be valid UTF-8 - * @start_index: first byte in @text to process - * @length: the number of bytes (not characters) to process - * after @start_index. This must be >= 0. - * @attrs: the set of attributes that apply to @text. - * @cached_iter: (nullable): Cached attribute iterator - * - * Breaks a piece of text into segments with consistent directional - * level and font. - * - * Each byte of @text will be contained in exactly one of the items in the - * returned list; the generated list of items will be in logical order (the - * start offsets of the items are ascending). - * - * @cached_iter should be an iterator over @attrs currently positioned - * at a range before or containing @start_index; @cached_iter will be - * advanced to the range covering the position just after - * @start_index + @length. (i.e. if itemizing in a loop, just keep passing - * in the same @cached_iter). - * - * Return value: (transfer full) (element-type Pango.Item): a `GList` of - * [struct@Pango.Item] structures. The items should be freed using - * [method@Pango.Item.free] in combination with [func@GLib.List.free_full]. - */ -GList * -pango_itemize (PangoContext *context, - const char *text, - int start_index, - int length, - PangoAttrList *attrs, - PangoAttrIterator *cached_iter) -{ - g_return_val_if_fail (context != NULL, NULL); - g_return_val_if_fail (start_index >= 0, NULL); - g_return_val_if_fail (length >= 0, NULL); - g_return_val_if_fail (length == 0 || text != NULL, NULL); - - return pango_itemize_with_base_dir (context, context->base_dir, - text, start_index, length, - attrs, cached_iter); -} - /* }}} */ /* vim:set foldmethod=marker expandtab: */ diff --git a/pango/pango-item.h b/pango/pango-item.h index a67434ad..f98e6d62 100644 --- a/pango/pango-item.h +++ b/pango/pango-item.h @@ -136,22 +136,13 @@ GList * pango_reorder_items (GList *items); /* Itemization */ -PANGO_AVAILABLE_IN_ALL -GList * pango_itemize (PangoContext *context, - const char *text, - int start_index, - int length, - PangoAttrList *attrs, - PangoAttrIterator *cached_iter); - PANGO_AVAILABLE_IN_1_4 GList * pango_itemize_with_base_dir (PangoContext *context, PangoDirection base_dir, const char *text, int start_index, int length, - PangoAttrList *attrs, - PangoAttrIterator *cached_iter); + PangoAttrList *attrs); G_END_DECLS diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 277c592a..295e30b9 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3353,7 +3353,7 @@ ensure_tab_width (PangoLayout *layout) items = pango_itemize_with_base_dir (layout->context, pango_context_get_base_dir (layout->context), - " ", 0, 1, &tmp_attrs, NULL); + " ", 0, 1, &tmp_attrs); if (layout_attrs != layout->attrs) { diff --git a/tests/test-font.c b/tests/test-font.c index 4dcbd819..25589655 100644 --- a/tests/test-font.c +++ b/tests/test-font.c @@ -202,7 +202,7 @@ test_extents (void) pango_font_description_free (desc); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, str, 0, strlen (str), NULL, NULL); + items = pango_itemize_with_base_dir (context, dir, str, 0, strlen (str), NULL); glyphs = pango_glyph_string_new (); item = items->data; pango_shape (str, strlen (str), NULL, 0, &item->analysis, glyphs, PANGO_SHAPE_NONE); diff --git a/tests/test-itemize.c b/tests/test-itemize.c index d58bdbc7..f917520f 100644 --- a/tests/test-itemize.c +++ b/tests/test-itemize.c @@ -156,7 +156,7 @@ test_file (const gchar *filename, GString *string) itemize_attrs = pango_attr_list_filter (attrs, affects_itemization, NULL); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs, NULL); + items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs); apply_attributes_to_items (items, attrs); pango_attr_list_unref (itemize_attrs); diff --git a/tests/test-shape.c b/tests/test-shape.c index e5e5b07b..2f8ab015 100644 --- a/tests/test-shape.c +++ b/tests/test-shape.c @@ -185,7 +185,7 @@ test_file (const gchar *filename, GString *string) shape_attrs = pango_attr_list_filter (attrs, affects_break_or_shape, NULL); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs, NULL); + items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs); apply_attributes_to_items (items, shape_attrs); pango_attr_list_unref (itemize_attrs); diff --git a/tests/testmisc.c b/tests/testmisc.c index 5d503f0d..93fc3cec 100644 --- a/tests/testmisc.c +++ b/tests/testmisc.c @@ -49,7 +49,7 @@ test_itemize_empty_crash (void) PangoContext *context; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "", 0, 1, NULL, NULL); + pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "", 0, 1, NULL); g_object_unref (context); } @@ -61,7 +61,7 @@ test_itemize_utf8 (void) GList *result = NULL; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - result = pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "\xc3\xa1\na", 3, 1, NULL, NULL); + result = pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "\xc3\xa1\na", 3, 1, NULL); g_assert (result != NULL); g_list_free_full (result, (GDestroyNotify)pango_item_free); @@ -396,7 +396,7 @@ test_fallback_shape (void) dir = pango_context_get_base_dir (context); text = "Some text to shape ﺄﻧﺍ ﻕﺍﺩﺭ ﻊﻟﻯ ﺄﻜﻟ ﺎﻟﺰﺟﺎﺟ ﻭ ﻩﺫﺍ ﻻ ﻱﺆﻠﻤﻨﻳ"; - items = pango_itemize_with_base_dir (context, dir, text, 0, strlen (text), NULL, NULL); + items = pango_itemize_with_base_dir (context, dir, text, 0, strlen (text), NULL); for (l = items; l; l = l->next) { PangoItem *item = l->data; |