summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-06-07 18:49:25 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-06-07 18:49:25 +0000
commitd6af4115ee4fb2140918d150184758b12325e57c (patch)
tree48d30fb7d10fc2255d53568ae52fce2ba7a257dc /pango/pango-attributes.c
parent22595797f8cecf41f44d019e4c42555cfe881c98 (diff)
downloadpango-d6af4115ee4fb2140918d150184758b12325e57c.tar.gz
New function to copy a PangoAttrIterator.
2000-06-07 Havoc Pennington <hp@redhat.com> * pango/pango-attributes.c (pango_attr_iterator_copy): New function to copy a PangoAttrIterator.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 905c71c8..47171e01 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -880,9 +880,33 @@ pango_attr_iterator_next (PangoAttrIterator *iterator)
/**
* pango_attr_iterator_destroy:
- * @iterator: a #PangoIterator.
+ * @iterator: a #PangoAttrIterator.
*
- * Destroy a #PangoIterator and free all associated memory.
+ * Copy a #PangoAttrIterator
+ *
+ * Return value: Copy of @iterator
+ **/
+PangoAttrIterator *
+pango_attr_iterator_copy (PangoAttrIterator *iterator)
+{
+ PangoAttrIterator *copy;
+
+ g_return_val_if_fail (iterator != NULL, NULL);
+
+ copy = g_new (PangoAttrIterator, 1);
+
+ *copy = *iterator;
+
+ copy->attribute_stack = g_list_copy (iterator->attribute_stack);
+
+ return copy;
+}
+
+/**
+ * pango_attr_iterator_destroy:
+ * @iterator: a #PangoAttrIterator.
+ *
+ * Destroy a #PangoAttrIterator and free all associated memory.
**/
void
pango_attr_iterator_destroy (PangoAttrIterator *iterator)
@@ -895,7 +919,7 @@ pango_attr_iterator_destroy (PangoAttrIterator *iterator)
/**
* pango_attr_iterator_get:
- * @iterator: a #PangoIterator
+ * @iterator: a #PangoAttrIterator
* @type: the type of attribute to find.
*
* Find the current attribute of a particular type at the iterator
@@ -931,7 +955,7 @@ pango_attr_iterator_get (PangoAttrIterator *iterator,
/**
* pango_attr_iterator_get_font:
- * @iterator: a #PangoIterator
+ * @iterator: a #PangoAttrIterator
* @base: the default values to use for fields not currently overridden.
* @current: a #PangoFontDescription to fill in with the current values. This
* #PangoFontDescription structure cannot be freed with