app: use GimpRGB as mask color

Instead of passing GimpChannelType as mask color to
gimp_display_shell_set_mask(), change that function to accept a
GimpRGB color.

Adapt GimpForegroundSelectTool, the only user of the display mask
feature, to this change.
This commit is contained in:
Sven Neumann
2010-09-29 00:10:37 +02:00
parent a7413bd784
commit 2ef259cd20
6 changed files with 65 additions and 37 deletions

View File

@ -20,6 +20,8 @@
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "display-types.h"
#include "base/tile-manager.h"
@ -222,26 +224,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
if (shell->mask)
{
/* FIXME: mask_color should be GimpRGB */
switch (shell->mask_color)
{
case GIMP_RED_CHANNEL:
cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
break;
case GIMP_GREEN_CHANNEL:
cairo_set_source_rgba (cr, 0, 1, 0, 0.5);
break;
case GIMP_BLUE_CHANNEL:
cairo_set_source_rgba (cr, 0, 0, 1, 0.5);
break;
default:
g_warn_if_reached ();
return;
}
gimp_cairo_set_source_rgba (cr, &shell->mask_color);
cairo_mask_surface (cr, shell->mask_surface,
x + disp_xoffset, y + disp_yoffset);
}