[pango/pango2: 61/201] Rename pango_itemize_with_base_dir




commit 0d3fbb8e2d0eb641859577ecea32c42366fb6d65
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 17 14:35:38 2022 -0600

    Rename pango_itemize_with_base_dir
    
    Call it just pango_itemize.

 docs/pango_rendering.md |  3 +--
 pango/ellipsize.c       |  2 +-
 pango/itemize.c         | 27 +++++++++++++++------------
 pango/pango-direction.h |  2 +-
 pango/pango-item.h      | 14 +++++++-------
 pango/pango-layout.c    |  6 +++---
 tests/test-font.c       |  2 +-
 tests/test-itemize.c    |  2 +-
 tests/test-shape.c      |  2 +-
 tests/testmisc.c        |  6 +++---
 10 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/docs/pango_rendering.md b/docs/pango_rendering.md
index 4bec5176..fe80ef3f 100644
--- a/docs/pango_rendering.md
+++ b/docs/pango_rendering.md
@@ -16,8 +16,7 @@ various stages of this pipeline and the APIs that implement them.
 Itemization
 : breaks a piece of text into segments with consistent direction and shaping
   properties. Among other things, this determines which font to use for each
-  character. Use [func@Pango.itemize] or [func@Pango.itemize_with_base_dir]
-  to itemize text.
+  character. Use [func@Pango.itemize] to itemize text.
 
 Shaping
 : converts characters into glyphs. Use [func@Pango.shape],
diff --git a/pango/ellipsize.c b/pango/ellipsize.c
index a1798f58..5714ccce 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);
+  items = pango_itemize (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 0eeb2b15..05ad5ba5 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -1534,8 +1534,8 @@ post_process_items (PangoContext *context,
 /* }}} */
 /* {{{ Private API */
 
-/* Like pango_itemize_with_base_dir, but takes a font description.
- * In contrast to pango_itemize_with_base_dir, this function does
+/* Like pango_itemize, but takes a font description.
+ * In contrast to pango_itemize, this function does
  * not call pango_itemize_post_process_items, so you need to do that
  * separately, after applying attributes that affect segmentation and
  * computing the log attrs.
@@ -1584,7 +1584,7 @@ pango_itemize_post_process_items (PangoContext *context,
 /* {{{ Public API */
 
 /**
- * pango_itemize_with_base_dir:
+ * pango_itemize:
  * @context: a structure holding information that affects
  *   the itemization process.
  * @base_dir: base direction to use for bidirectional processing
@@ -1594,7 +1594,12 @@ pango_itemize_post_process_items (PangoContext *context,
  *   after @start_index. This must be >= 0.
  * @attrs: the set of attributes that apply to @text.
  *
- * Like `pango_itemize()`, but with an explicitly specified base direction.
+ * 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).
  *
  * The base direction is used when computing bidirectional levels.
  * [func@itemize] gets the base direction from the `PangoContext`
@@ -1603,16 +1608,14 @@ pango_itemize_post_process_items (PangoContext *context,
  * 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] probably in combination with [func GLib List.free_full].
- *
- * Since: 1.4
  */
 GList *
-pango_itemize_with_base_dir (PangoContext      *context,
-                             PangoDirection     base_dir,
-                             const char        *text,
-                             int                start_index,
-                             int                length,
-                             PangoAttrList     *attrs)
+pango_itemize (PangoContext      *context,
+               PangoDirection     base_dir,
+               const char        *text,
+               int                start_index,
+               int                length,
+               PangoAttrList     *attrs)
 {
   GList *items;
 
diff --git a/pango/pango-direction.h b/pango/pango-direction.h
index c74e7f66..fca94778 100644
--- a/pango/pango-direction.h
+++ b/pango/pango-direction.h
@@ -42,7 +42,7 @@ G_BEGIN_DECLS
  * and [func@find_base_dir] cannot be `PANGO_DIRECTION_WEAK_LTR` or
  * `PANGO_DIRECTION_WEAK_RTL`, since every character is either neutral
  * or has a strong direction; on the other hand `PANGO_DIRECTION_NEUTRAL`
- * doesn't make sense to pass to [func@itemize_with_base_dir].
+ * doesn't make sense to pass to [func@itemize].
  *
  * See `PangoGravity` for how vertical text is handled in Pango.
  *
diff --git a/pango/pango-item.h b/pango/pango-item.h
index f98e6d62..d04de33d 100644
--- a/pango/pango-item.h
+++ b/pango/pango-item.h
@@ -136,13 +136,13 @@ GList *                 pango_reorder_items          (GList             *items);
 
 /* Itemization */
 
-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);
+PANGO_AVAILABLE_IN_ALL
+GList *                 pango_itemize (PangoContext      *context,
+                                       PangoDirection     base_dir,
+                                       const char        *text,
+                                       int                start_index,
+                                       int                length,
+                                       PangoAttrList     *attrs);
 
 
 G_END_DECLS
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 9f7aa58b..43906c02 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3349,9 +3349,9 @@ ensure_tab_width (PangoLayout *layout)
           pango_attr_list_insert_before (&tmp_attrs, attr);
         }
 
-      items = pango_itemize_with_base_dir (layout->context,
-                                           pango_context_get_base_dir (layout->context),
-                                           " ", 0, 1, &tmp_attrs);
+      items = pango_itemize (layout->context,
+                             pango_context_get_base_dir (layout->context),
+                             " ", 0, 1, &tmp_attrs);
 
       if (layout_attrs != layout->attrs)
         {
diff --git a/tests/test-font.c b/tests/test-font.c
index 25589655..4aa2fc58 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);
+  items = pango_itemize (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 f917520f..80e02cc9 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);
+  items = pango_itemize (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 2f8ab015..6b90acb1 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);
+  items = pango_itemize (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 93fc3cec..ce5f2b05 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);
+  pango_itemize (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);
+  result = pango_itemize (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);
+  items = pango_itemize (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]