Sun Apr 5 17:43:50 EDT 1998 Matthew Wilson <msw@gimp.org

* app/bezier_select.c: Destroy the tool when changing displays.
	* app/command.c: initialize pointers to drawables when selecting
	tools
	* app/disp_callbacks.c: initialize pointers to drawables on first
	click of a gdisplay
	* app/gimage.c: removed extra tool destruction
	* app/tools.c: make a fallback case when starting tools so that
	you'll always have an active tool.

--Matt
This commit is contained in:
Matt Wilson 1998-04-05 22:49:16 +00:00
parent 6c4fd5c2f3
commit e43fc9027c
13 changed files with 229 additions and 48 deletions

View File

@ -1,3 +1,14 @@
Sun Apr 5 17:43:50 EDT 1998 Matthew Wilson <msw@gimp.org
* app/bezier_select.c: Destroy the tool when changing displays.
* app/command.c: initialize pointers to drawables when selecting
tools
* app/disp_callbacks.c: initialize pointers to drawables on first
click of a gdisplay
* app/gimage.c: removed extra tool destruction
* app/tools.c: make a fallback case when starting tools so that
you'll always have an active tool.
Sat Apr 4 15:43:28 MEST 1998 Sven Neumann <sven@gimp.org>
* app/ops_buttons.[c|h]

View File

@ -1710,6 +1710,10 @@ select_by_color_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BY_COLOR_SELECT].toolbar_position]);
by_color_select_initialize ((void *) gdisp->gimage);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1964,6 +1968,10 @@ image_posterize_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) POSTERIZE].toolbar_position]);
posterize_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1975,6 +1983,10 @@ image_threshold_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) THRESHOLD].toolbar_position]);
threshold_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1986,6 +1998,11 @@ image_color_balance_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) COLOR_BALANCE].toolbar_position]);
color_balance_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1997,6 +2014,10 @@ image_brightness_contrast_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BRIGHTNESS_CONTRAST].toolbar_position]);
brightness_contrast_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2008,6 +2029,10 @@ image_hue_saturation_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HUE_SATURATION].toolbar_position]);
hue_saturation_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2019,6 +2044,10 @@ image_curves_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) CURVES].toolbar_position]);
curves_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2030,6 +2059,10 @@ image_levels_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) LEVELS].toolbar_position]);
levels_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2196,6 +2229,10 @@ image_histogram_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HISTOGRAM].toolbar_position]);
histogram_tool_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2312,8 +2349,14 @@ void
tools_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
/* Activate the approriate widget */
gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void

View File

@ -139,7 +139,7 @@ tools_new_bezier_select ()
tool->arrow_keys_func = standard_arrow_keys_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = bezier_select_control;
tool->preserve = TRUE;
tool->preserve = FALSE;
return tool;
}

View File

@ -1710,6 +1710,10 @@ select_by_color_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BY_COLOR_SELECT].toolbar_position]);
by_color_select_initialize ((void *) gdisp->gimage);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1964,6 +1968,10 @@ image_posterize_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) POSTERIZE].toolbar_position]);
posterize_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1975,6 +1983,10 @@ image_threshold_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) THRESHOLD].toolbar_position]);
threshold_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1986,6 +1998,11 @@ image_color_balance_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) COLOR_BALANCE].toolbar_position]);
color_balance_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1997,6 +2014,10 @@ image_brightness_contrast_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BRIGHTNESS_CONTRAST].toolbar_position]);
brightness_contrast_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2008,6 +2029,10 @@ image_hue_saturation_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HUE_SATURATION].toolbar_position]);
hue_saturation_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2019,6 +2044,10 @@ image_curves_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) CURVES].toolbar_position]);
curves_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2030,6 +2059,10 @@ image_levels_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) LEVELS].toolbar_position]);
levels_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2196,6 +2229,10 @@ image_histogram_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HISTOGRAM].toolbar_position]);
histogram_tool_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2312,8 +2349,14 @@ void
tools_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
/* Activate the approriate widget */
gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void

View File

@ -149,11 +149,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
/* Reset the current tool if we're changing drawables... */
if (active_tool->drawable)
if (active_tool->drawable) {
if ((drawable_ID(gimage_active_drawable(gdisp->gimage)) !=
drawable_ID(GIMP_DRAWABLE(active_tool->drawable))) &&
!active_tool->preserve)
!active_tool->preserve) {
tools_initialize (active_tool->type, gdisp);
}
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;

View File

@ -149,11 +149,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
/* Reset the current tool if we're changing drawables... */
if (active_tool->drawable)
if (active_tool->drawable) {
if ((drawable_ID(gimage_active_drawable(gdisp->gimage)) !=
drawable_ID(GIMP_DRAWABLE(active_tool->drawable))) &&
!active_tool->preserve)
!active_tool->preserve) {
tools_initialize (active_tool->type, gdisp);
}
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;

View File

@ -149,11 +149,15 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
/* Reset the current tool if we're changing drawables... */
if (active_tool->drawable)
if (active_tool->drawable) {
if ((drawable_ID(gimage_active_drawable(gdisp->gimage)) !=
drawable_ID(GIMP_DRAWABLE(active_tool->drawable))) &&
!active_tool->preserve)
!active_tool->preserve) {
tools_initialize (active_tool->type, gdisp);
}
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;

View File

@ -2637,8 +2637,6 @@ gimage_dirty (GImage *gimage)
tools_initialize (active_tool->type, gdisp);
else
tools_initialize (active_tool->type, NULL);
else
tools_initialize (active_tool->type, NULL);
}
return gimage->dirty;
}

View File

@ -1710,6 +1710,10 @@ select_by_color_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BY_COLOR_SELECT].toolbar_position]);
by_color_select_initialize ((void *) gdisp->gimage);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1964,6 +1968,10 @@ image_posterize_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) POSTERIZE].toolbar_position]);
posterize_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1975,6 +1983,10 @@ image_threshold_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) THRESHOLD].toolbar_position]);
threshold_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1986,6 +1998,11 @@ image_color_balance_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) COLOR_BALANCE].toolbar_position]);
color_balance_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1997,6 +2014,10 @@ image_brightness_contrast_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BRIGHTNESS_CONTRAST].toolbar_position]);
brightness_contrast_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2008,6 +2029,10 @@ image_hue_saturation_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HUE_SATURATION].toolbar_position]);
hue_saturation_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2019,6 +2044,10 @@ image_curves_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) CURVES].toolbar_position]);
curves_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2030,6 +2059,10 @@ image_levels_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) LEVELS].toolbar_position]);
levels_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2196,6 +2229,10 @@ image_histogram_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HISTOGRAM].toolbar_position]);
histogram_tool_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2312,8 +2349,14 @@ void
tools_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
/* Activate the approriate widget */
gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void

View File

@ -1710,6 +1710,10 @@ select_by_color_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BY_COLOR_SELECT].toolbar_position]);
by_color_select_initialize ((void *) gdisp->gimage);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1964,6 +1968,10 @@ image_posterize_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) POSTERIZE].toolbar_position]);
posterize_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1975,6 +1983,10 @@ image_threshold_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) THRESHOLD].toolbar_position]);
threshold_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1986,6 +1998,11 @@ image_color_balance_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) COLOR_BALANCE].toolbar_position]);
color_balance_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -1997,6 +2014,10 @@ image_brightness_contrast_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) BRIGHTNESS_CONTRAST].toolbar_position]);
brightness_contrast_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2008,6 +2029,10 @@ image_hue_saturation_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HUE_SATURATION].toolbar_position]);
hue_saturation_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2019,6 +2044,10 @@ image_curves_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) CURVES].toolbar_position]);
curves_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2030,6 +2059,10 @@ image_levels_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) LEVELS].toolbar_position]);
levels_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2196,6 +2229,10 @@ image_histogram_cmd_callback (GtkWidget *widget,
gdisp = gdisplay_active ();
gtk_widget_activate (tool_widgets[tool_info[(int) HISTOGRAM].toolbar_position]);
histogram_tool_initialize ((void *) gdisp);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void
@ -2312,8 +2349,14 @@ void
tools_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
/* Activate the approriate widget */
gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]);
gdisp = gdisplay_active ();
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
void

View File

@ -121,6 +121,9 @@ active_tool_free (void)
{
gtk_container_disable_resize (GTK_CONTAINER (options_shell));
if (!active_tool)
return;
if (tool_info[(int) active_tool->type].tool_options)
gtk_widget_hide (tool_info[(int) active_tool->type].tool_options);
@ -461,8 +464,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_by_color_select ();
by_color_select_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case COLOR_BALANCE:
@ -470,8 +472,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_color_balance ();
color_balance_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case BRIGHTNESS_CONTRAST:
@ -479,8 +480,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_brightness_contrast ();
brightness_contrast_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case HUE_SATURATION:
@ -488,8 +488,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_hue_saturation ();
hue_saturation_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case POSTERIZE:
@ -497,8 +496,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_posterize ();
posterize_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case THRESHOLD:
@ -506,8 +504,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_threshold ();
threshold_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case CURVES:
@ -515,8 +512,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_curves ();
curves_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case LEVELS:
@ -524,8 +520,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_levels ();
levels_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case HISTOGRAM:
@ -533,12 +528,11 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_histogram_tool ();
histogram_tool_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
default:
return;
break;
}
/* Show the options for the active tool

View File

@ -139,7 +139,7 @@ tools_new_bezier_select ()
tool->arrow_keys_func = standard_arrow_keys_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = bezier_select_control;
tool->preserve = TRUE;
tool->preserve = FALSE;
return tool;
}

View File

@ -121,6 +121,9 @@ active_tool_free (void)
{
gtk_container_disable_resize (GTK_CONTAINER (options_shell));
if (!active_tool)
return;
if (tool_info[(int) active_tool->type].tool_options)
gtk_widget_hide (tool_info[(int) active_tool->type].tool_options);
@ -461,8 +464,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_by_color_select ();
by_color_select_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case COLOR_BALANCE:
@ -470,8 +472,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_color_balance ();
color_balance_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case BRIGHTNESS_CONTRAST:
@ -479,8 +480,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_brightness_contrast ();
brightness_contrast_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case HUE_SATURATION:
@ -488,8 +488,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_hue_saturation ();
hue_saturation_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case POSTERIZE:
@ -497,8 +496,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_posterize ();
posterize_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case THRESHOLD:
@ -506,8 +504,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_threshold ();
threshold_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case CURVES:
@ -515,8 +512,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_curves ();
curves_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case LEVELS:
@ -524,8 +520,7 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_levels ();
levels_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
case HISTOGRAM:
@ -533,12 +528,11 @@ tools_initialize (ToolType type, GDisplay *gdisp_ptr)
active_tool = tools_new_histogram_tool ();
histogram_tool_initialize (gdisp);
} else {
active_tool_free();
gtk_widget_hide (options_shell);
active_tool = tools_new_rect_select ();
}
break;
default:
return;
break;
}
/* Show the options for the active tool