diff options
author | Havoc Pennington <hp@redhat.com> | 2000-06-07 18:49:25 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-06-07 18:49:25 +0000 |
commit | d6af4115ee4fb2140918d150184758b12325e57c (patch) | |
tree | 48d30fb7d10fc2255d53568ae52fce2ba7a257dc /pango | |
parent | 22595797f8cecf41f44d019e4c42555cfe881c98 (diff) | |
download | pango-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')
-rw-r--r-- | pango/pango-attributes.c | 32 | ||||
-rw-r--r-- | pango/pango-attributes.h | 25 |
2 files changed, 42 insertions, 15 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 diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index a0af8975..13c685cf 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -137,17 +137,20 @@ void pango_attr_list_change (PangoAttrList *list, PangoAttribute *attr); PangoAttrIterator * pango_attr_list_get_iterator (PangoAttrList *list); -void pango_attr_iterator_range (PangoAttrIterator *iterator, - gint *start, - gint *end); -gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); -void pango_attr_iterator_destroy (PangoAttrIterator *iterator); -PangoAttribute *pango_attr_iterator_get (PangoAttrIterator *iterator, - PangoAttrType type); -void pango_attr_iterator_get_font (PangoAttrIterator *iterator, - PangoFontDescription *base, - PangoFontDescription *current, - GSList **extra_attrs); +void pango_attr_iterator_range (PangoAttrIterator *iterator, + gint *start, + gint *end); +gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); +PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator); +void pango_attr_iterator_destroy (PangoAttrIterator *iterator); +PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator, + PangoAttrType type); +void pango_attr_iterator_get_font (PangoAttrIterator *iterator, + PangoFontDescription *base, + PangoFontDescription *current, + GSList **extra_attrs); + + #ifdef __cplusplus } |