diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2009-12-23 12:18:32 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2009-12-23 12:18:32 -0500 |
commit | 021e4a5082c46ffdf6998beaacca948749079b15 (patch) | |
tree | ebac529cb33f6d2a98edf2be6d2001dd326cfc53 | |
parent | 0edf9e87b374488c502c9c8157f07fcf64692593 (diff) |
Pass rgba as doubles to _vte_draw_set_background_solid()
-rw-r--r-- | src/vte.c | 27 | ||||
-rw-r--r-- | src/vtedraw.c | 14 | ||||
-rw-r--r-- | src/vtedraw.h | 6 |
3 files changed, 22 insertions, 25 deletions
@@ -12494,9 +12494,9 @@ vte_terminal_im_append_menuitems(VteTerminal *terminal, GtkMenuShell *menushell) static gboolean vte_terminal_background_update(VteTerminal *terminal) { - GdkColormap *colormap; GdkColor bgcolor; double saturation; + struct vte_palette_entry *entry; /* If we're not realized yet, don't worry about it, because we get * called when we realize. */ @@ -12510,23 +12510,16 @@ vte_terminal_background_update(VteTerminal *terminal) _vte_debug_print(VTE_DEBUG_MISC|VTE_DEBUG_EVENTS, "Updating background image.\n"); - /* Set the default background color. */ - bgcolor.red = terminal->pvt->palette[VTE_DEF_BG].red; - bgcolor.green = terminal->pvt->palette[VTE_DEF_BG].green; - bgcolor.blue = terminal->pvt->palette[VTE_DEF_BG].blue; - bgcolor.pixel = 0; - gtk_widget_ensure_style(&terminal->widget); - /*colormap = gdk_gc_get_colormap(terminal->widget.style->fg_gc[GTK_WIDGET_STATE(terminal)]);*/ - colormap = gtk_widget_get_colormap (&terminal->widget); - if (colormap) { - gdk_rgb_find_color(colormap, &bgcolor); - } + entry = &terminal->pvt->palette[VTE_DEF_BG]; _vte_debug_print(VTE_DEBUG_MISC, - "Setting background color to (%d, %d, %d) cmap index=%d.\n", - bgcolor.red, bgcolor.green, bgcolor.blue, - bgcolor.pixel); - gdk_window_set_background(terminal->widget.window, &bgcolor); - _vte_draw_set_background_solid (terminal->pvt->draw, &bgcolor, terminal->pvt->bg_opacity); + "Setting background color to (%d, %d, %d).\n", + bgcolor.red, bgcolor.green, bgcolor.blue); + + _vte_draw_set_background_solid (terminal->pvt->draw, + entry->red / 65535., + entry->green / 65535., + entry->blue / 65535., + terminal->pvt->bg_opacity / 65535.); /* If we're transparent, and either have no root image or are being * told to update it, get a new copy of the root window. */ diff --git a/src/vtedraw.c b/src/vtedraw.c index ac51e76..f796b3c 100644 --- a/src/vtedraw.c +++ b/src/vtedraw.c @@ -866,18 +866,20 @@ _vte_draw_end (struct _vte_draw *draw) void _vte_draw_set_background_solid(struct _vte_draw *draw, - GdkColor *color, - guint16 opacity) + double red, + double green, + double blue, + double opacity) { draw->requires_clear = opacity != 0xFFFF; if (draw->bg_pattern) cairo_pattern_destroy (draw->bg_pattern); - draw->bg_pattern = cairo_pattern_create_rgba (color->red / 65535., - color->green / 65535., - color->blue / 65535., - opacity / 65535.); + draw->bg_pattern = cairo_pattern_create_rgba (red, + green, + blue, + opacity); } void diff --git a/src/vtedraw.h b/src/vtedraw.h index bea1023..56ef310 100644 --- a/src/vtedraw.h +++ b/src/vtedraw.h @@ -69,8 +69,10 @@ void _vte_draw_start(struct _vte_draw *draw); void _vte_draw_end(struct _vte_draw *draw); void _vte_draw_set_background_solid(struct _vte_draw *draw, - GdkColor *color, - guint16 opacity); + double red, + double green, + double blue, + double opacity); void _vte_draw_set_background_image(struct _vte_draw *draw, enum VteBgSourceType type, GdkPixbuf *pixbuf, |