Commit 714d63fc authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

cursors/Makefile.am cursors/cursor-none.png new empty cursor images.

2004-06-05  Michael Natterer  <mitch@gimp.org>

	* cursors/Makefile.am
	* cursors/cursor-none.png
	* cursors/xbm/cursor-none.xbm: new empty cursor images.

	* app/config/gimpdisplayconfig.[ch]
	* app/config/gimprc-blurbs.h
	* app/widgets/widgets-enums.h
	* app/widgets/gimpcursor.c
	* app/display/gimpdisplayshell-cursor.c
	* app/tools/gimppainttool.[ch]
	* app/tools/gimpinktool.c
	* app/gui/preferences-dialog.c: applied patches from Philip
	Lafleur which implement hiding the cursor completely for paint
	tools. Changed the name of the config option from
	"hide-paint-tool-cursor" to "show-paint-tool-cursor" and default
	to TRUE because this needs the brush outline being visible while
	painting to be really usable. Fixes bug #132163.

	* app/widgets/widgets-enums.h: renamed all GimpCursorType and
	GimpToolCursorType enum values to GIMP_CURSOR_* and
	GIMP_TOOL_CURSOR_*.

	* app/widgets/gimpcursor.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-cursor.c
	* app/tools/gimp*tool.c; changed accordingly.
parent d0f9de48
2004-06-05 Michael Natterer <mitch@gimp.org>
* cursors/Makefile.am
* cursors/cursor-none.png
* cursors/xbm/cursor-none.xbm: new empty cursor images.
* app/config/gimpdisplayconfig.[ch]
* app/config/gimprc-blurbs.h
* app/widgets/widgets-enums.h
* app/widgets/gimpcursor.c
* app/display/gimpdisplayshell-cursor.c
* app/tools/gimppainttool.[ch]
* app/tools/gimpinktool.c
* app/gui/preferences-dialog.c: applied patches from Philip
Lafleur which implement hiding the cursor completely for paint
tools. Changed the name of the config option from
"hide-paint-tool-cursor" to "show-paint-tool-cursor" and default
to TRUE because this needs the brush outline being visible while
painting to be really usable. Fixes bug #132163.
* app/widgets/widgets-enums.h: renamed all GimpCursorType and
GimpToolCursorType enum values to GIMP_CURSOR_* and
GIMP_TOOL_CURSOR_*.
* app/widgets/gimpcursor.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-cursor.c
* app/tools/gimp*tool.c; changed accordingly.
2004-06-04 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcursor.c: changed create_cursor_foo() utility
......
......@@ -79,6 +79,7 @@ enum
PROP_CURSOR_MODE,
PROP_CURSOR_UPDATING,
PROP_SHOW_BRUSH_OUTLINE,
PROP_SHOW_PAINT_TOOL_CURSOR,
PROP_IMAGE_TITLE_FORMAT,
PROP_IMAGE_STATUS_FORMAT,
PROP_CONFIRM_ON_CLOSE,
......@@ -183,6 +184,11 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
SHOW_BRUSH_OUTLINE_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_PAINT_TOOL_CURSOR,
"show-paint-tool-cursor",
SHOW_PAINT_TOOL_CURSOR_BLURB,
TRUE,
0);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
"image-title-format",
IMAGE_TITLE_FORMAT_BLURB,
......@@ -308,6 +314,9 @@ gimp_display_config_set_property (GObject *object,
case PROP_SHOW_BRUSH_OUTLINE:
display_config->show_brush_outline = g_value_get_boolean (value);
break;
case PROP_SHOW_PAINT_TOOL_CURSOR:
display_config->show_paint_tool_cursor = g_value_get_boolean (value);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_free (display_config->image_title_format);
display_config->image_title_format = g_value_dup_string (value);
......@@ -389,6 +398,9 @@ gimp_display_config_get_property (GObject *object,
case PROP_SHOW_BRUSH_OUTLINE:
g_value_set_boolean (value, display_config->show_brush_outline);
break;
case PROP_SHOW_PAINT_TOOL_CURSOR:
g_value_set_boolean (value, display_config->show_paint_tool_cursor);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_value_set_string (value, display_config->image_title_format);
break;
......
......@@ -49,6 +49,7 @@ struct _GimpDisplayConfig
GimpCursorMode cursor_mode;
gboolean cursor_updating;
gboolean show_brush_outline;
gboolean show_paint_tool_cursor;
gchar *image_title_format;
gchar *image_status_format;
gboolean confirm_on_close;
......
......@@ -263,6 +263,10 @@ N_("Save the positions and sizes of the main dialogs when the GIMP exits.")
N_("When enabled, all paint tools will show a preview of the current " \
"brush's outline.")
#define SHOW_PAINT_TOOL_CURSOR_BLURB \
N_("When enabled, the cursor will be shown over the image while " \
"using a paint tool.")
#define SHOW_MENUBAR_BLURB \
N_("When enabled, the menubar is visible by default. This can also be " \
"toggled with the \"View->Show Menubar\" command.")
......
......@@ -1494,6 +1494,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_check_button_add (object, "show-brush-outline",
_("Show _Brush Outline"),
GTK_BOX (vbox2));
prefs_check_button_add (object, "show-paint-tool-cursor",
_("Show Paint _Tool Cursor"),
GTK_BOX (vbox2));
prefs_check_button_add (object, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2));
......
......@@ -632,7 +632,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else if (gimp_image_is_empty (gimage))
{
gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR,
GIMP_CURSOR_BAD,
gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE);
}
......@@ -640,7 +640,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else
{
gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR,
GIMP_CURSOR_BAD,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
......@@ -1263,7 +1263,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else if (gimp_image_is_empty (gimage))
{
gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR,
GIMP_CURSOR_BAD,
gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE);
}
......@@ -1271,7 +1271,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else
{
gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR,
GIMP_CURSOR_BAD,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
......
......@@ -191,7 +191,8 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
if (cursor_type != GIMP_BAD_CURSOR)
if (cursor_type != GIMP_CURSOR_NONE &&
cursor_type != GIMP_CURSOR_BAD)
{
switch (config->cursor_mode)
{
......@@ -199,11 +200,11 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
break;
case GIMP_CURSOR_MODE_TOOL_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_SMALL_CURSOR;
cursor_type = GIMP_CURSOR_CROSSHAIR_SMALL;
break;
case GIMP_CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
cursor_type = GIMP_CURSOR_CROSSHAIR;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
......
......@@ -1494,6 +1494,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_check_button_add (object, "show-brush-outline",
_("Show _Brush Outline"),
GTK_BOX (vbox2));
prefs_check_button_add (object, "show-paint-tool-cursor",
_("Show Paint _Tool Cursor"),
GTK_BOX (vbox2));
prefs_check_button_add (object, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2));
......
......@@ -92,7 +92,7 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
{
GimpTool *tool = GIMP_TOOL (airbrush);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_AIRBRUSH_TOOL_CURSOR);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_AIRBRUSH);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (airbrush),
GIMP_COLOR_PICK_MODE_FOREGROUND);
......
......@@ -165,7 +165,7 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
tool = GIMP_TOOL (blend_tool);
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_BLEND_TOOL_CURSOR);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_BLEND);
}
......@@ -347,10 +347,10 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
{
case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE:
gimp_tool_control_set_cursor (tool->control, GIMP_BAD_CURSOR);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD);
break;
default:
gimp_tool_control_set_cursor (tool->control, GIMP_MOUSE_CURSOR);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
break;
}
......
......@@ -69,23 +69,23 @@ static GObject * gimp_paint_tool_constructor (GType type,
static void gimp_paint_tool_finalize (GObject *object);
static void gimp_paint_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp);
GimpToolAction action,
GimpDisplay *gdisp);
static void gimp_paint_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_paint_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_paint_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_paint_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp);
......@@ -96,8 +96,12 @@ static void gimp_paint_tool_modifier_key (GimpTool *tool,
GimpDisplay *gdisp);
static void gimp_paint_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_paint_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_paint_tool_draw (GimpDrawTool *draw_tool);
......@@ -162,6 +166,7 @@ gimp_paint_tool_class_init (GimpPaintToolClass *klass)
tool_class->arrow_key = gimp_paint_tool_arrow_key;
tool_class->modifier_key = gimp_paint_tool_modifier_key;
tool_class->oper_update = gimp_paint_tool_oper_update;
tool_class->cursor_update = gimp_paint_tool_cursor_update;
draw_tool_class->draw = gimp_paint_tool_draw;
......@@ -178,6 +183,7 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->show_cursor = TRUE;
paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
......@@ -201,9 +207,15 @@ gimp_paint_tool_constructor (GType type,
g_assert (GIMP_IS_TOOL_INFO (tool->tool_info));
paint_tool->show_cursor =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_paint_tool_cursor;
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-paint-tool-cursor",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
......@@ -850,6 +862,26 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}
static void
gimp_paint_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
if (! paint_tool->show_cursor)
{
gimp_tool_set_cursor (tool, gdisp,
GIMP_CURSOR_NONE,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
return;
}
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
}
static void
gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpImageType sample_type,
......@@ -887,7 +919,8 @@ gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (paint_tool));
paint_tool->draw_brush = config->show_brush_outline;
paint_tool->show_cursor = config->show_paint_tool_cursor;
paint_tool->draw_brush = config->show_brush_outline;
gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
}
......@@ -40,6 +40,7 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line;
gboolean show_cursor;
gboolean draw_brush;
gdouble brush_x;
gdouble brush_y;
......
......@@ -151,7 +151,7 @@ gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_fill_tool)
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_BUCKET_FILL_TOOL_CURSOR);
GIMP_TOOL_CURSOR_BUCKET_FILL);
}
static void
......
......@@ -141,7 +141,7 @@ gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select)
tool = GIMP_TOOL (by_color_select);
gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_tool_control_set_preserve (tool->control, GIMP_RECT_SELECT_TOOL_CURSOR);
gimp_tool_control_set_preserve (tool->control, GIMP_TOOL_CURSOR_RECT_SELECT);
by_color_select->x = 0;
by_color_select->y = 0;
......@@ -297,11 +297,11 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool,
if (! options->sample_merged &&
layer && layer != gdisp->gimage->active_layer)
{
gimp_tool_control_set_cursor (tool->control, GIMP_BAD_CURSOR);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD);
}
else
{
gimp_tool_control_set_cursor (tool->control, GIMP_MOUSE_CURSOR);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
}
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
......
......@@ -155,7 +155,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
{
GimpTool *tool = GIMP_TOOL (clone);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_CLONE_TOOL_CURSOR);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CLONE);
}
static GObject *
......@@ -224,7 +224,7 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
GimpDisplay *gdisp)
{
GimpCloneOptions *options;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
GdkCursorType ctype = GIMP_CURSOR_MOUSE;
options = (GimpCloneOptions *) tool->tool_info->tool_options;
......@@ -236,17 +236,17 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
* if so, is cursor inside?
*/
if (gimp_channel_is_empty (selection))
ctype = GIMP_MOUSE_CURSOR;
ctype = GIMP_CURSOR_MOUSE;
else if (gimp_channel_value (selection, coords->x, coords->y))
ctype = GIMP_MOUSE_CURSOR;
ctype = GIMP_CURSOR_MOUSE;
}
if (options->clone_type == GIMP_IMAGE_CLONE)
{
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
ctype = GIMP_CURSOR_CROSSHAIR_SMALL;
else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable)
ctype = GIMP_BAD_CURSOR;
ctype = GIMP_CURSOR_BAD;
}
gimp_tool_control_set_cursor (tool->control, ctype);
......
......@@ -261,7 +261,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
if (color_tool->enabled)
{
GdkCursorType cursor = GIMP_BAD_CURSOR;
GdkCursorType cursor = GIMP_CURSOR_BAD;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
if (coords->x > 0 && coords->x < gdisp->gimage->width &&
......@@ -270,7 +270,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
(color_tool->options->sample_merged ||
gimp_display_coords_in_active_drawable (gdisp, coords)))
{
cursor = GIMP_COLOR_PICKER_CURSOR;
cursor = GIMP_CURSOR_COLOR_PICKER;
}
switch (color_tool->pick_mode)
......@@ -287,8 +287,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
}
gimp_tool_set_cursor (tool, gdisp,
cursor,
GIMP_COLOR_PICKER_TOOL_CURSOR, modifier);
cursor, GIMP_TOOL_CURSOR_COLOR_PICKER, modifier);
return; /* don't chain up */
}
......
......@@ -120,9 +120,9 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
GimpTool *tool = GIMP_TOOL (convolve);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_BLUR_TOOL_CURSOR);
GIMP_TOOL_CURSOR_BLUR);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_BLUR_TOOL_CURSOR);
GIMP_TOOL_CURSOR_BLUR);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
}
......
......@@ -224,7 +224,7 @@ gimp_crop_tool_init (GimpCropTool *crop_tool)
GimpTool *tool = GIMP_TOOL (crop_tool);
gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_CROP_TOOL_CURSOR);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
}
static void
......@@ -742,7 +742,7 @@ gimp_crop_tool_cursor_update (GimpTool *tool,
{
GimpCropTool *crop = GIMP_CROP_TOOL (tool);
GimpCropOptions *options;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
GdkCursorType ctype = GIMP_CURSOR_CROSSHAIR_SMALL;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options);
......@@ -769,8 +769,8 @@ gimp_crop_tool_cursor_update (GimpTool *tool,
gimp_tool_control_set_tool_cursor (tool->control,
options->crop_mode ==
GIMP_CROP_MODE_CROP ?
GIMP_CROP_TOOL_CURSOR :
GIMP_RESIZE_TOOL_CURSOR);
GIMP_TOOL_CURSOR_CROP :
GIMP_TOOL_CURSOR_RESIZE);
gimp_tool_control_set_cursor_modifier (tool->control, cmodifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
......
......@@ -120,9 +120,9 @@ gimp_dodge_burn_tool_init (GimpDodgeBurnTool *dodgeburn)
GimpTool *tool = GIMP_TOOL (dodgeburn);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_DODGE_TOOL_CURSOR);
GIMP_TOOL_CURSOR_DODGE);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_BURN_TOOL_CURSOR);
GIMP_TOOL_CURSOR_BURN);
}
static void
......
......@@ -129,7 +129,7 @@ gimp_ellipse_select_tool_init (GimpEllipseSelectTool *ellipse_select)
GimpTool *tool = GIMP_TOOL (ellipse_select);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR);
GIMP_TOOL_CURSOR_ELLIPSE_SELECT);
}
static void
......
......@@ -120,9 +120,9 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
GimpTool *tool = GIMP_TOOL (eraser);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_ERASER_TOOL_CURSOR);
GIMP_TOOL_CURSOR_ERASER);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_ERASER_TOOL_CURSOR);
GIMP_TOOL_CURSOR_ERASER);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
......
......@@ -150,11 +150,11 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool)
gimp_tool_control_set_cursor (tool->control,
GDK_SB_H_DOUBLE_ARROW);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR);
GIMP_TOOL_CURSOR_FLIP_HORIZONTAL);
gimp_tool_control_set_toggle_cursor (tool->control,
GDK_SB_V_DOUBLE_ARROW);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_FLIP_VERTICAL_TOOL_CURSOR);
GIMP_TOOL_CURSOR_FLIP_VERTICAL);
transform_tool->use_grid = FALSE;
}
......@@ -217,12 +217,12 @@ gimp_flip_tool_cursor_update (GimpTool *tool,
if (bad_cursor)
{
gimp_tool_control_set_cursor (tool->control, GIMP_BAD_CURSOR);
gimp_tool_control_set_toggle_cursor (tool->control, GIMP_BAD_CURSOR);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD);
gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_BAD);
}
else
{
gimp_tool_control_set_cursor (tool->control, GDK_SB_H_DOUBLE_ARROW);
gimp_tool_control_set_cursor (tool->control, GDK_SB_H_DOUBLE_ARROW);
gimp_tool_control_set_toggle_cursor (tool->control, GDK_SB_V_DOUBLE_ARROW);
}
......
......@@ -112,18 +112,18 @@ gimp_free_select_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpFreeSelectToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_free_select_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpFreeSelectTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_free_select_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_free_select_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpFreeSelectTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_free_select_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpFreeSelectTool",
"GimpFreeSelectTool",
&tool_info, 0);
}
......@@ -135,13 +135,9 @@ gimp_free_select_tool_get_type (void)
static void
gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
{
GObjectClass *object_class;
GimpToolClass *tool_class;
GimpDrawToolClass *draw_tool_class;
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -157,14 +153,11 @@ gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
static void
gimp_free_select_tool_init (GimpFreeSelectTool *free_select)
{
GimpTool *tool;
GimpSelectionTool *select_tool;
tool = GIMP_TOOL (free_select);
select_tool = GIMP_SELECTION_TOOL (free_select);
GimpTool *tool = GIMP_TOOL (free_select);
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_FREE_SELECT_TOOL_CURSOR);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FREE_SELECT);
free_select->points = NULL;
free_select->num_points = 0;
......@@ -174,9 +167,7 @@ gimp_free_select_tool_init (GimpFreeSelectTool *free_select)
static void
gimp_free_select_tool_finalize (GObject *object)
{
GimpFreeSelectTool *free_sel;
free_sel = GIMP_FREE_SELECT_TOOL (object);
GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (object);
if (free_sel->points)
{
......@@ -194,9 +185,7 @@ gimp_free_select_tool_button_press (GimpTool *tool,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpFreeSelectTool *free_sel;
free_sel = GIMP_FREE_SELECT_TOOL (tool);
GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
gimp_tool_control_activate (tool->control);
tool->gdisp = gdisp;
......@@ -231,10 +220,9 @@ gimp_free_select_tool_button_release (GimpTool *tool,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpFreeSelectTool *free_sel;
GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
GimpSelectionOptions *options;
free_sel = GIMP_FREE_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
......@@ -279,11 +267,8 @@ gimp_free_select_tool_motion (GimpTool *tool,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpFreeSelectTool *free_sel;
GimpSelectionTool *sel_tool;
free_sel = GIMP_FREE_SELECT_TOOL (tool);
sel_tool = GIMP_SELECTION_TOOL (tool);
GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool = GIMP_SELECTION_TOOL (tool);
if (sel_tool->op == SELECTION_ANCHOR)
{
......@@ -320,11 +305,9 @@ gimp_free_select_tool_motion (GimpTool *tool,
static void
gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
{
GimpFreeSelectTool *free_sel;
GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (draw_tool);
gint i;
free_sel = GIMP_FREE_SELECT_TOOL (draw_tool);
for (i = 1; i < free_sel->num_points; i++)
{
gimp_draw_tool_draw_line (draw_tool,
......
......@@ -86,8 +86,6 @@ static GdkSegment *
static GimpSelectionToolClass *parent_class = NULL;
/* public functions */
void
gimp_fuzzy_select_tool_register (GimpToolRegisterCallback callback,
gpointer data)
......@@ -115,37 +113,30 @@ gimp_fuzzy_select_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpFuzzySelectToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_fuzzy_select_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpFuzzySelectTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_fuzzy_select_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_fuzzy_select_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpFuzzySelectTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_fuzzy_select_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpFuzzySelectTool",
"GimpFuzzySelectTool",
&tool_info, 0);
}
return tool_type;
}
/* private functions */
static void
gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
{
GObjectClass *object_class;
GimpToolClass *tool_class;
GimpDrawToolClass *draw_tool_class;
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -161,13 +152,11 @@ gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
static void
gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
{
GimpTool *tool;
tool = GIMP_TOOL (fuzzy_select);