diff options
author | Anders Carlsson <andersca@gnu.org> | 2002-02-07 03:43:13 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2002-02-07 03:43:13 +0000 |
commit | f33a46072b2bcfed59e26f42356175d0f3a62c9a (patch) | |
tree | 11818db2c0e9a10c58ea68cae9db0ae3df8a77e2 /src/theme-parser.c | |
parent | 7279f2a9cd7c33f911ef107e8a21575e97ab4779 (diff) | |
download | metacity-f33a46072b2bcfed59e26f42356175d0f3a62c9a.tar.gz |
Add support for "colorize" image attribute.
2002-02-07 Anders Carlsson <andersca@gnu.org>
* src/theme-parser.c: (parse_draw_op_element):
Add support for "colorize" image attribute.
* src/theme.c: (colorize_pixbuf):
New function that colorizes a pixbuf.
(pos_tokenize): Allow "\n" as a whitespace character.
(meta_draw_op_free): Free colorize_spec;
(draw_op_as_pixbuf): Colorize image if needed.
* src/theme.h: Add colorize_spec to struct.
Diffstat (limited to 'src/theme-parser.c')
-rw-r--r-- | src/theme-parser.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/theme-parser.c b/src/theme-parser.c index bc7805c6..74a076f3 100644 --- a/src/theme-parser.c +++ b/src/theme-parser.c @@ -1991,14 +1991,17 @@ parse_draw_op_element (GMarkupParseContext *context, const char *width; const char *height; const char *alpha; + const char *colorize; double alpha_val; GdkPixbuf *pixbuf; + MetaColorSpec *colorize_spec = NULL; if (!locate_attributes (context, element_name, attribute_names, attribute_values, error, "x", &x, "y", &y, "width", &width, "height", &height, "alpha", &alpha, "filename", &filename, + "colorize", &colorize, NULL)) return; @@ -2063,10 +2066,22 @@ parse_draw_op_element (GMarkupParseContext *context, add_context_to_error (error, context); return; } + + if (colorize) + { + colorize_spec = meta_color_spec_new_from_string (colorize, error); + + if (colorize == NULL) + { + add_context_to_error (error, context); + return; + } + } op = meta_draw_op_new (META_DRAW_IMAGE); op->data.image.pixbuf = pixbuf; + op->data.image.colorize_spec = colorize_spec; op->data.image.x = optimize_expression (info->theme, x); op->data.image.y = optimize_expression (info->theme, y); op->data.image.width = optimize_expression (info->theme, width); |