Mercurial > pidgin
diff finch/libgnt/gntstyle.c @ 21738:e3e64d1e4869
Add color to the conversation window to indicate various message attributes
author | Richard Nelson <wabz@pidgin.im> |
---|---|
date | Mon, 03 Dec 2007 07:01:32 +0000 |
parents | 3ed9b027479d |
children | 350c93aa44d3 |
line wrap: on
line diff
--- a/finch/libgnt/gntstyle.c Mon Dec 03 02:01:52 2007 +0000 +++ b/finch/libgnt/gntstyle.c Mon Dec 03 07:01:32 2007 +0000 @@ -59,6 +59,25 @@ #endif } +int +gnt_style_get_color(char *group, char *key) +{ +#if GLIB_CHECK_VERSION(2,6,0) + int fg = 0, bg = 0; + gsize n; + char **vals; + vals = gnt_style_get_string_list(group, key, &n); + if (vals && n == 2) { + fg = gnt_colors_get_color(vals[0]); + bg = gnt_colors_get_color(vals[1]); + return gnt_color_add_pair(fg, bg); + } + return 0; +#else + return 0; +#endif +} + char **gnt_style_get_string_list(const char *group, const char *key, gsize *length) { #if GLIB_CHECK_VERSION(2,6,0)