diff options
author | Paolo Borelli <pborelli@gnome.org> | 2015-07-05 22:48:16 +0200 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2015-07-06 00:04:05 +0200 |
commit | b92c530a61420fc039048aff4feb3f019dc7cdfe (patch) | |
tree | abbf06f2d4348d6091c4030a9f81b52345df1a7c /gtk/gtkpango.c | |
parent | 3175d0fcf0c1da7d5b0d7307772b991222d08a33 (diff) | |
download | gtk+-b92c530a61420fc039048aff4feb3f019dc7cdfe.tar.gz |
pango: move an utility function from gtklabel
This will be used both by gtklabel and gtkentry
Diffstat (limited to 'gtk/gtkpango.c')
-rw-r--r-- | gtk/gtkpango.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c index 416bf6e250..261fac7c3d 100644 --- a/gtk/gtkpango.c +++ b/gtk/gtkpango.c @@ -1289,3 +1289,25 @@ _gtk_pango_get_text_at (PangoLayout *layout, return g_utf8_substring (text, start, end); } + +static gboolean +attr_list_merge_filter (PangoAttribute *attribute, + gpointer list) +{ + pango_attr_list_change (list, pango_attribute_copy (attribute)); + return FALSE; +} + +/* + * _gtk_pango_attr_list_merge: + * @into: a #PangoAttrList where attributes are merged. + * @from: a #PangoAttrList with the attributes to merge + * + * Merges attributes from @from into @into. + */ +void +_gtk_pango_attr_list_merge (PangoAttrList *into, + PangoAttrList *from) +{ + pango_attr_list_filter (from, attr_list_merge_filter, into); +} |