[pango/pango2: 84/195] Drop cached_iter argument




commit cea5809ee9c2e51dc02bafdb484315f217e75dcb
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 17 14:28:03 2022 -0600

    Drop cached_iter argument
    
    All callers of pango_itemize_with_base_dir were passing
    NULL, so just drop it.

 pango/ellipsize.c    |  2 +-
 pango/itemize.c      | 53 ++--------------------------------------------------
 pango/pango-item.h   | 11 +----------
 pango/pango-layout.c |  2 +-
 tests/test-font.c    |  2 +-
 tests/test-itemize.c |  2 +-
 tests/test-shape.c   |  2 +-
 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 49820626..0eeb2b15 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -1593,7 +1593,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.
  *
@@ -1613,8 +1612,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;
 
@@ -1625,58 +1623,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 b4ab7e3a..9e0a393c 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 sha​pe ﺄﻧﺍ ﻕﺍﺩﺭ ﻊﻟﻯ ﺄﻜﻟ ﺎﻟﺰﺟﺎﺟ ﻭ ﻩﺫﺍ ﻻ ﻱﺆﻠﻤﻨﻳ";
-  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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]