diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-11-23 15:42:44 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-11-23 15:42:44 +0000 |
commit | db50679d56c8ded8a23f239b24a8cd9f1f2061c2 (patch) | |
tree | 8c7bc025eff030673c83214ecd410bf092ff3ceb /pango/pango-attributes.c | |
parent | a0bbc6ef8b7dc902f20a2655cc54082e6acdca84 (diff) | |
download | pango-db50679d56c8ded8a23f239b24a8cd9f1f2061c2.tar.gz |
Add underline_color and strikethrough_color attribute types. (#147616,
Tue Nov 23 10:23:43 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-attributes.[ch]: Add underline_color
and strikethrough_color attribute types. (#147616, Morten
Welinder)
* pango/pango-markup.c docs/pango_markup.sgml: Add
corresponding 'underline_color' and
'strikethrough_color' attributes for <span>.
* pango/pango-renderer.c (pango_renderer_default_prepare_run):
Implement underline and strikethrough colors.
* pango/pango-renderer.c: Fix some bigs with updating
underlines/strikethrough state.
* pango/pango-renderer.c (get_total_matrix): Fix a const
warning.
* docs/pango-sections.txt: Update
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r-- | pango/pango-attributes.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 276f7acd..f4b9b5e2 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -578,6 +578,33 @@ pango_attr_underline_new (PangoUnderline underline) } /** + * pango_attr_underline_color_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new underline color attribute. This attribute + * modifies the color of underlines. If not set, underlines + * will use the foreground color. + * + * Return value: the new #PangoAttribute. + **/ +PangoAttribute * +pango_attr_underline_color_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_UNDERLINE_COLOR, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +/** * pango_attr_strikethrough_new: * @strikethrough: %TRUE if the text should be struck-through. * @@ -599,6 +626,33 @@ pango_attr_strikethrough_new (gboolean strikethrough) } /** + * pango_attr_strikethrough_color_new: + * @red: the red value (ranging from 0 to 65535) + * @green: the green value + * @blue: the blue value + * + * Create a new strikethrough color attribute. This attribute + * modifies the color of strikethrough lines. If not set, strikethrough + * lines will use the foreground color. + * + * Return value: the new #PangoAttribute. + **/ +PangoAttribute * +pango_attr_strikethrough_color_new (guint16 red, + guint16 green, + guint16 blue) +{ + static const PangoAttrClass klass = { + PANGO_ATTR_STRIKETHROUGH_COLOR, + pango_attr_color_copy, + pango_attr_color_destroy, + pango_attr_color_equal + }; + + return pango_attr_color_new (&klass, red, green, blue); +} + +/** * pango_attr_rise_new: * @rise: the amount that the text should be displaced vertically, * in Pango units. Positive values displace the text upwards. |