app/core/gimpimage.[ch] app/core/gimpimage-mask.c

2001-05-31  Dave Neary  <dneary@eircom.net>

	* app/core/gimpimage.[ch]
	* app/core/gimpimage-mask.c
	* app/tools/gimpbycolorselecttool.c
	* app/undo.c: Added a "mask_changed" signal, to allow
	gimpbycolorselect to update it's dialog properly, and take out a
	silly dependency in gimpimage.

	One outstanding issue is that now the dialog doesn't close
	automatically when the tool context changes. Working on it :)
This commit is contained in:
Dave Neary 2001-05-31 19:53:13 +00:00 committed by David Neary
parent 11c2f6caee
commit 109abaeed4
20 changed files with 193 additions and 67 deletions

View File

@ -1,3 +1,15 @@
2001-05-31 Dave Neary <dneary@eircom.net>
* app/core/gimpimage.[ch]
* app/core/gimpimage-mask.c
* app/tools/gimpbycolorselecttool.c
* app/undo.c: Added a "mask_changed" signal, to allow
gimpbycolorselect to update it's dialog properly, and take out a
silly dependency in gimpimage.
One outstanding issue is that now the dialog doesn't close
automatically when the tool context changes. Working on it :)
2001-05-30 Michael Natterer <mitch@gimp.org>
* app/base/Makefile.am

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -159,6 +159,9 @@ gimage_mask_invalidate (GimpImage *gimage)
0, 0,
GIMP_DRAWABLE (layer)->width,
GIMP_DRAWABLE (layer)->height);
/* Issue the MASK_CHANGED signal here */
gimp_image_mask_changed(gimage);
}

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -1114,15 +1114,6 @@ undo_pop_mask (GimpImage *gimage,
/* we know the bounds */
sel_mask->bounds_known = TRUE;
/* if there is a "by color" selection dialog active
* for this gimage's mask, send it an update notice
*
* This should never happen... we should be using a signal to
* do this.
*/
if (gimage->by_color_select)
gimp_by_color_select_tool_initialize_by_image (gimage);
return TRUE;
}

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -166,6 +166,7 @@ enum
ACTIVE_CHANNEL_CHANGED,
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
CLEAN,
DIRTY,
@ -297,6 +298,15 @@ gimp_image_class_init (GimpImageClass *klass)
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
gimp_image_signals[MASK_CHANGED] =
gtk_signal_new ("mask_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpImageClass,
mask_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_image_signals[CLEAN] =
gtk_signal_new ("clean",
GTK_RUN_FIRST,
@ -366,6 +376,7 @@ gimp_image_class_init (GimpImageClass *klass)
klass->active_channel_changed = NULL;
klass->component_visibility_changed = NULL;
klass->component_active_changed = NULL;
klass->mask_changed = NULL;
klass->clean = NULL;
klass->dirty = NULL;
@ -429,8 +440,6 @@ gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
gimage->by_color_select = FALSE;
gimage->qmask_state = FALSE;
gimage->qmask_color.r = 1.0;
gimage->qmask_color.g = 0.0;
@ -1665,6 +1674,14 @@ gimp_image_mode_changed (GimpImage *gimage)
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MODE_CHANGED]);
}
void
gimp_image_mask_changed (GimpImage *gimage)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[MASK_CHANGED]);
}
void
gimp_image_alpha_changed (GimpImage *gimage)
{

View File

@ -110,9 +110,6 @@ struct _GimpImage
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean by_color_select; /* TRUE if there's an active */
/* "by color" selection dialog */
gboolean qmask_state; /* TRUE if qmask is on */
GimpRGB qmask_color; /* rgba triplet of the color */
@ -148,6 +145,7 @@ struct _GimpImageClass
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
@ -281,6 +279,7 @@ void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_size_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
/* layer/channel functions */

View File

@ -88,6 +88,7 @@ static void gimp_by_color_select_tool_class_init (GimpByColorSelectToolClass *
static void gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select);
static void gimp_by_color_select_tool_destroy (GtkObject *object);
static void gimp_by_color_select_tool_initialize_by_image (GimpImage *gimage);
static void by_color_select_color_drop (GtkWidget *widget,
const GimpRGB *color,
@ -116,6 +117,7 @@ static void by_color_select_oper_update (GimpTool *tool,
static void by_color_select_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
static void by_color_select_mask_changed (GimpImage *gimage);
static ByColorDialog * by_color_select_dialog_new (void);
@ -258,11 +260,11 @@ gimp_by_color_select_tool_select (GimpImage *gimage,
void
gimp_by_color_select_tool_initialize_by_image (GimpImage *gimage)
{
/* update the preview window */
if (by_color_dialog)
{
by_color_dialog->gimage = gimage;
gimage->by_color_select = TRUE;
by_color_select_render (by_color_dialog, gimage);
by_color_select_draw (by_color_dialog, gimage);
}
@ -293,6 +295,7 @@ gimp_by_color_select_tool_class_init (GimpByColorSelectToolClass *klass)
tool_class->oper_update = by_color_select_oper_update;
tool_class->control = by_color_select_control;
}
static void
@ -515,8 +518,10 @@ by_color_select_button_press (GimpTool *tool,
gtk_widget_show (by_color_dialog->shell);
/* Update the by_color_dialog's active gdisp pointer */
if (by_color_dialog->gimage)
by_color_dialog->gimage->by_color_select = FALSE;
/* if (by_color_dialog->gimage)
* by_color_dialog->gimage->by_color_select = FALSE;
* Temporarily commented out. Do we need to do something to replace
* this?*/
if (by_color_dialog->gimage != gdisp->gimage)
{
@ -530,7 +535,8 @@ by_color_select_button_press (GimpTool *tool,
}
by_color_dialog->gimage = gdisp->gimage;
gdisp->gimage->by_color_select = TRUE;
/* gdisp->gimage->by_color_select = TRUE;
* Temporarily commented out - do we need something to replace this? */
gdk_pointer_grab (gdisp->canvas->window, FALSE,
GDK_POINTER_MOTION_HINT_MASK |
@ -780,14 +786,27 @@ by_color_select_initialize (GimpTool *tool, GDisplay *gdisp)
{
/* The "by color" dialog */
if (!by_color_dialog)
by_color_dialog = by_color_select_dialog_new ();
{
by_color_dialog = by_color_select_dialog_new ();
/* Catch the "mask_changed" signal and attach a handler that does
* stuff with it. Need to do this somewhere with the relevant
* GimpImage in context */
gtk_signal_connect (GTK_OBJECT (gdisp->gimage), "mask_changed",
by_color_select_mask_changed, NULL);
}
else
if (!GTK_WIDGET_VISIBLE (by_color_dialog->shell))
gtk_widget_show (by_color_dialog->shell);
gimp_by_color_select_tool_initialize_by_image (gdisp->gimage);
}
void by_color_select_mask_changed( GimpImage *gimage)
{
if (by_color_dialog)
gimp_by_color_select_tool_initialize_by_image (gimage );
}
/****************************/
/* Select by Color dialog */
/****************************/
@ -1202,11 +1221,12 @@ by_color_select_close_callback (GtkWidget *widget,
gimp_dialog_hide (bcd->shell);
if (bcd->gimage && gimp_container_have (image_context,
GIMP_OBJECT (bcd->gimage)))
{
bcd->gimage->by_color_select = FALSE;
}
/* if (bcd->gimage && gimp_container_have (image_context,
* GIMP_OBJECT (bcd->gimage)))
* {
* bcd->gimage->by_color_select = FALSE;
* }
* Temporarily commented out. */
bcd->gimage = NULL;
}

View File

@ -55,9 +55,6 @@ void gimp_by_color_select_tool_register (void);
GtkType gimp_by_color_select_tool_get_type (void);
void gimp_by_color_select_tool_initialize_by_image (GimpImage *gimage);
/* Should be a private function */
void gimp_by_color_select_tool_select (GimpImage *gimage,
GimpDrawable *drawable,
guchar *color,

View File

@ -1114,15 +1114,6 @@ undo_pop_mask (GimpImage *gimage,
/* we know the bounds */
sel_mask->bounds_known = TRUE;
/* if there is a "by color" selection dialog active
* for this gimage's mask, send it an update notice
*
* This should never happen... we should be using a signal to
* do this.
*/
if (gimage->by_color_select)
gimp_by_color_select_tool_initialize_by_image (gimage);
return TRUE;
}