summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.h
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2020-02-12 11:45:57 +0100
committerJonas Dreßler <verdre@v0yd.nl>2020-06-07 18:23:18 +0200
commitf1ad230857df4a9d34f2230ecff41fe03ec89800 (patch)
treed946a017fca6626f30230586865a0a33404aaaa9 /pango/pango-attributes.h
parent9774cb24ea7d049abdc0d9fd5da2e8e3170f1a05 (diff)
downloadpango-f1ad230857df4a9d34f2230ecff41fe03ec89800.tar.gz
Add API to compare PangoAttrLists
Add a new `pango_attr_list_equal` API that allows comparing the attributes included in two PangoAttrLists and returns TRUE if the lists contain the same attributes and apply to the same ranges. The function avoids any copying of attributes or lists and applies a minor optimization of skipping the equality check for attributes that were already found in both lists. Other possible optimizations that could be added if necessary would be storing the length of the attributes list in the PangoAttrList class to avoid the `g_slist_length` calls or reusing the `other_iter` pointer in case all attributes from 0 to n were already found.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r--pango/pango-attributes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index 09d1a69a..6f6622ab 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -633,6 +633,10 @@ PangoAttrList *pango_attr_list_filter (PangoAttrList *list,
PANGO_AVAILABLE_IN_1_44
GSList *pango_attr_list_get_attributes (PangoAttrList *list);
+PANGO_AVAILABLE_IN_1_46
+gboolean pango_attr_list_equal (PangoAttrList *list,
+ PangoAttrList *other_list);
+
PANGO_AVAILABLE_IN_1_44
GType pango_attr_iterator_get_type (void) G_GNUC_CONST;