Commit b3c20ed2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

prefix with GIMP_TOOL_ACTION_

2006-05-21  Michael Natterer  <mitch@gimp.org>

	* app/tools/tools-enums.h (enum GimpToolAction): prefix with
	GIMP_TOOL_ACTION_

	* app/display/gimpdisplay.c
	* app/display/gimpdisplayshell.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimpnewrectselecttool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c
	* app/tools/tool_manager.c: changed accordingly. Introduce a
	common style for GimpTool::control()'s switch() block. Some
	minor cleanups.
parent 57df85fa
2006-05-21 Michael Natterer <mitch@gimp.org>
* app/tools/tools-enums.h (enum GimpToolAction): prefix with
GIMP_TOOL_ACTION_
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell.c
* app/tools/gimpaligntool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpcolortool.c
* app/tools/gimpcroptool.c
* app/tools/gimpdrawtool.c
* app/tools/gimpforegroundselecttool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpimagemaptool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/tools/gimpnewrectselecttool.c
* app/tools/gimppainttool.c
* app/tools/gimpselectiontool.c
* app/tools/gimptexttool.c
* app/tools/gimptool.c
* app/tools/gimptransformtool.c
* app/tools/gimpvectortool.c
* app/tools/tool_manager.c: changed accordingly. Introduce a
common style for GimpTool::control()'s switch() block. Some
minor cleanups.
2006-05-21 Michael Natterer <mitch@gimp.org>
 
* app/tools/tool_manager.c (tool_manager_image_clean_dirty): don't
......
......@@ -382,7 +382,8 @@ gimp_display_delete (GimpDisplay *display)
GIMP_OBJECT (display));
/* stop any active tool */
tool_manager_control_active (display->image->gimp, HALT, display);
tool_manager_control_active (display->image->gimp, GIMP_TOOL_ACTION_HALT,
display);
active_tool = tool_manager_get_active (display->image->gimp);
......@@ -459,7 +460,8 @@ gimp_display_reconnect (GimpDisplay *display,
g_return_if_fail (GIMP_IS_IMAGE (image));
/* stop any active tool */
tool_manager_control_active (display->image->gimp, HALT, display);
tool_manager_control_active (display->image->gimp, GIMP_TOOL_ACTION_HALT,
display);
gimp_display_shell_disconnect (GIMP_DISPLAY_SHELL (display->shell));
......
......@@ -1400,7 +1400,8 @@ gimp_display_shell_pause (GimpDisplayShell *shell)
if (shell->paused_count == 1)
{
/* pause the currently active tool */
tool_manager_control_active (shell->display->image->gimp, PAUSE,
tool_manager_control_active (shell->display->image->gimp,
GIMP_TOOL_ACTION_PAUSE,
shell->display);
gimp_display_shell_draw_vectors (shell);
......@@ -1429,7 +1430,8 @@ gimp_display_shell_resume (GimpDisplayShell *shell)
gimp_display_shell_draw_vectors (shell);
/* start the currently active tool */
tool_manager_control_active (shell->display->image->gimp, RESUME,
tool_manager_control_active (shell->display->image->gimp,
GIMP_TOOL_ACTION_RESUME,
shell->display);
}
}
......
......@@ -224,19 +224,14 @@ gimp_align_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case RESUME:
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
clear_selected_items (align_tool);
gimp_tool_pop_status (tool, display);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -276,7 +276,11 @@ gimp_paint_tool_control (GimpTool *tool,
switch (action)
{
case HALT:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
gimp_paint_core_paint (paint_tool->core,
drawable,
GIMP_PAINT_OPTIONS (tool->tool_info->tool_options),
......@@ -306,9 +310,6 @@ gimp_paint_tool_control (GimpTool *tool,
}
#endif
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -174,14 +174,15 @@ gimp_color_picker_tool_control (GimpTool *tool,
switch (action)
{
case HALT:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
if (picker_tool->dialog)
gimp_color_picker_tool_info_response (NULL, GTK_RESPONSE_CLOSE,
picker_tool);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -187,25 +187,22 @@ gimp_color_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
if (color_tool->sample_point &&
gimp_display_shell_get_show_sample_points (GIMP_DISPLAY_SHELL (shell)))
gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (shell),
color_tool->sample_point, TRUE);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
if (color_tool->sample_point &&
gimp_display_shell_get_show_sample_points (GIMP_DISPLAY_SHELL (shell)))
gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (shell),
color_tool->sample_point, FALSE);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -171,20 +171,17 @@ gimp_crop_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
gimp_rectangle_tool_configure (rectangle);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_rectangle_tool_response (NULL, GTK_RESPONSE_CANCEL,
rectangle);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -127,20 +127,17 @@ gimp_draw_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
gimp_draw_tool_pause (draw_tool);
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
gimp_draw_tool_resume (draw_tool);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_draw_tool_stop (draw_tool);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -241,7 +241,11 @@ gimp_foreground_select_tool_control (GimpTool *tool,
switch (action)
{
case HALT:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
{
GList *list;
......@@ -265,9 +269,6 @@ gimp_foreground_select_tool_control (GimpTool *tool,
}
}
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......@@ -402,7 +403,7 @@ gimp_foreground_select_tool_key_press (GimpTool *tool,
return TRUE;
case GDK_Escape:
gimp_tool_control (tool, HALT, display);
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
return TRUE;
default:
......@@ -756,7 +757,7 @@ gimp_foreground_select_tool_apply (GimpForegroundSelectTool *fg_select,
options->feather_radius,
options->feather_radius);
gimp_tool_control (tool, HALT, display);
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
gimp_image_flush (display->image);
}
......
......@@ -155,11 +155,12 @@ gimp_free_select_tool_control (GimpTool *tool,
{
switch (action)
{
case HALT:
GIMP_FREE_SELECT_TOOL (tool)->num_points = 0;
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
default:
case GIMP_TOOL_ACTION_HALT:
GIMP_FREE_SELECT_TOOL (tool)->num_points = 0;
break;
}
......
......@@ -330,14 +330,15 @@ gimp_image_map_tool_control (GimpTool *tool,
switch (action)
{
case HALT:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
if (image_map_tool->shell)
gtk_dialog_response (GTK_DIALOG (image_map_tool->shell),
GTK_RESPONSE_CANCEL);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -365,18 +365,13 @@ gimp_iscissors_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case RESUME:
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_iscissors_tool_reset (iscissors);
break;
default:
break;
}
}
......
......@@ -155,16 +155,13 @@ gimp_measure_tool_control (GimpTool *tool,
{
switch (action)
{
case PAUSE:
case RESUME:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_measure_tool_halt (GIMP_MEASURE_TOOL (tool));
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -172,25 +172,22 @@ gimp_move_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
if (move->guide &&
gimp_display_shell_get_show_guides (GIMP_DISPLAY_SHELL (shell)))
gimp_display_shell_draw_guide (GIMP_DISPLAY_SHELL (shell),
move->guide, TRUE);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
if (move->guide &&
gimp_display_shell_get_show_guides (GIMP_DISPLAY_SHELL (shell)))
gimp_display_shell_draw_guide (GIMP_DISPLAY_SHELL (shell),
move->guide, FALSE);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -195,20 +195,17 @@ gimp_new_rect_select_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
gimp_rectangle_tool_configure (rectangle);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_rectangle_tool_response (NULL, GIMP_RECTANGLE_MODE_EXECUTE,
rectangle);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -276,7 +276,11 @@ gimp_paint_tool_control (GimpTool *tool,
switch (action)
{
case HALT:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
gimp_paint_core_paint (paint_tool->core,
drawable,
GIMP_PAINT_OPTIONS (tool->tool_info->tool_options),
......@@ -306,9 +310,6 @@ gimp_paint_tool_control (GimpTool *tool,
}
#endif
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -195,20 +195,17 @@ gimp_new_rect_select_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case GIMP_TOOL_ACTION_PAUSE:
break;
case RESUME:
case GIMP_TOOL_ACTION_RESUME:
gimp_rectangle_tool_configure (rectangle);
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_rectangle_tool_response (NULL, GIMP_RECTANGLE_MODE_EXECUTE,
rectangle);
break;
default:
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
......
......@@ -89,8 +89,16 @@ gimp_selection_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *display)
{
if (action == HALT)
gimp_tool_pop_status (tool, display);
switch (action)
{
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case GIMP_TOOL_ACTION_HALT:
gimp_tool_pop_status (tool, display);
break;
}
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
}
......
......@@ -242,11 +242,11 @@ gimp_text_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
case RESUME:
case GIMP_TOOL_ACTION_PAUSE:
case GIMP_TOOL_ACTION_RESUME:
break;
case HALT:
case GIMP_TOOL_ACTION_HALT:
gimp_text_tool_set_drawable (text_tool, NULL, FALSE);
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment