diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | docs/pango-sections.txt | 3 | ||||
-rw-r--r-- | docs/tmpl/text-attributes.sgml | 21 | ||||
-rw-r--r-- | pango/pango-attributes.h | 2 | ||||
-rw-r--r-- | pango/pango-color.c | 21 | ||||
-rw-r--r-- | pango/pango.def | 1 |
6 files changed, 53 insertions, 7 deletions
@@ -1,5 +1,17 @@ 2006-12-06 Behdad Esfahbod <behdad@gnome.org> + Bug 373856 – Wish: Function to convert a GdkColor to a string + Patch from Matthew Barnes + + * docs/pango-sections.txt: + * docs/tmpl/text-attributes.sgml: + * pango/pango-attributes.h: + * pango/pango.def: + * pango/pango-color.c (pango_color_to_string): + New public function pango_color_to_string(). + +2006-12-06 Behdad Esfahbod <behdad@gnome.org> + Red Hat Bug 216850: Issue in combination with vowels (ml_IN) Patch from LingNing Zhang diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index 956c7696..afa6afe2 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -351,9 +351,10 @@ pango_attr_rise_new pango_attr_letter_spacing_new PangoColor PANGO_TYPE_COLOR -pango_color_free pango_color_parse pango_color_copy +pango_color_free +pango_color_to_string PangoLanguage PANGO_TYPE_LANGUAGE pango_language_from_string diff --git a/docs/tmpl/text-attributes.sgml b/docs/tmpl/text-attributes.sgml index 871494fb..b0872b0c 100644 --- a/docs/tmpl/text-attributes.sgml +++ b/docs/tmpl/text-attributes.sgml @@ -530,30 +530,39 @@ The #GObject type for #PangoColor. -<!-- ##### FUNCTION pango_color_free ##### --> +<!-- ##### FUNCTION pango_color_parse ##### --> <para> </para> @color: +@spec: +@Returns: -<!-- ##### FUNCTION pango_color_parse ##### --> +<!-- ##### FUNCTION pango_color_copy ##### --> <para> </para> -@color: -@spec: +@src: @Returns: -<!-- ##### FUNCTION pango_color_copy ##### --> +<!-- ##### FUNCTION pango_color_free ##### --> <para> </para> -@src: +@color: + + +<!-- ##### FUNCTION pango_color_to_string ##### --> +<para> + +</para> + +@color: @Returns: diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index 65b69b1e..4dc31af6 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -45,6 +45,8 @@ PangoColor *pango_color_copy (const PangoColor *src); void pango_color_free (PangoColor *color); gboolean pango_color_parse (PangoColor *color, const char *spec); +gchar *pango_color_to_string(const PangoColor *color); + /* Attributes */ diff --git a/pango/pango-color.c b/pango/pango-color.c index a471b4ce..13e38ff2 100644 --- a/pango/pango-color.c +++ b/pango/pango-color.c @@ -80,6 +80,27 @@ pango_color_free (PangoColor *color) g_slice_free (PangoColor, color); } +/** + * pango_color_to_string: + * @color: a #PangoColor + * + * Returns a textual specification of @color in the hexadecimal form + * <literal>#rrrrggggbbbb</literal>, where <literal>r</literal>, + * <literal>g</literal> and <literal>b</literal> are hex digits representing + * the red, green, and blue components respectively. + * + * Return value: a newly-allocated text string that must be freed with g_free(). + * + * Since: 1.16 + **/ +gchar * +pango_color_to_string (const PangoColor *color) +{ + g_return_val_if_fail (color != NULL, NULL); + + return g_strdup_printf ("#%04x%04x%04x", color->red, color->green, color->blue); +} + /* Color parsing */ diff --git a/pango/pango.def b/pango/pango.def index c3815182..a8430f9c 100644 --- a/pango/pango.def +++ b/pango/pango.def @@ -49,6 +49,7 @@ EXPORTS pango_color_free pango_color_get_type pango_color_parse + pango_color_to_string pango_config_key_get pango_context_get_base_dir pango_context_get_base_gravity |