diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-19 08:12:08 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-19 08:37:26 -0700 |
commit | bf5876e0aba41d6843bc1ec0d1d78b4769e0a86c (patch) | |
tree | 5483702e038e093f2eb3d95d4ee3a8210b4add81 /pango/pango-attributes.c | |
parent | 5f11d2e1f76931199fd4322659ca1df40a23e629 (diff) | |
download | pango-bf5876e0aba41d6843bc1ec0d1d78b4769e0a86c.tar.gz |
Add pango_attr_list_get_attributes
This was a gap in the attribute api - no way
to get attributes back out of a list.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r-- | pango/pango-attributes.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 54b13795..ac27251d 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1682,6 +1682,27 @@ pango_attr_list_splice (PangoAttrList *list, } /** + * pango_attr_list_get_attributes: + * @list: a #PangoAttrList + * + * Gets a list of all attributes in @list. + * + * Return value: (element-type Pango.Attribute) (transfer full): + * a list of all attributes in @list. To free this value, call + * pango_attribute_destroy() on each value and g_slist_free() + * on the list. + * + * Since: 1.44 + */ +GSList * +pango_attr_list_get_attributes (PangoAttrList *list) +{ + g_return_val_if_fail (list != NULL, NULL); + + return g_slist_copy_deep (list->attributes, (GCopyFunc)pango_attribute_copy, NULL); +} + +/** * pango_attr_list_get_iterator: * @list: a #PangoAttrList * |