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.
This commit is contained in:
Michael Natterer 2004-06-04 23:08:29 +00:00 committed by Michael Natterer
parent d0f9de48d0
commit 714d63fcda
51 changed files with 520 additions and 459 deletions

View File

@ -1,3 +1,32 @@
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> 2004-06-04 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcursor.c: changed create_cursor_foo() utility * app/widgets/gimpcursor.c: changed create_cursor_foo() utility

View File

@ -79,6 +79,7 @@ enum
PROP_CURSOR_MODE, PROP_CURSOR_MODE,
PROP_CURSOR_UPDATING, PROP_CURSOR_UPDATING,
PROP_SHOW_BRUSH_OUTLINE, PROP_SHOW_BRUSH_OUTLINE,
PROP_SHOW_PAINT_TOOL_CURSOR,
PROP_IMAGE_TITLE_FORMAT, PROP_IMAGE_TITLE_FORMAT,
PROP_IMAGE_STATUS_FORMAT, PROP_IMAGE_STATUS_FORMAT,
PROP_CONFIRM_ON_CLOSE, PROP_CONFIRM_ON_CLOSE,
@ -183,6 +184,11 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
SHOW_BRUSH_OUTLINE_BLURB, SHOW_BRUSH_OUTLINE_BLURB,
TRUE, TRUE,
0); 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, GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
"image-title-format", "image-title-format",
IMAGE_TITLE_FORMAT_BLURB, IMAGE_TITLE_FORMAT_BLURB,
@ -308,6 +314,9 @@ gimp_display_config_set_property (GObject *object,
case PROP_SHOW_BRUSH_OUTLINE: case PROP_SHOW_BRUSH_OUTLINE:
display_config->show_brush_outline = g_value_get_boolean (value); display_config->show_brush_outline = g_value_get_boolean (value);
break; break;
case PROP_SHOW_PAINT_TOOL_CURSOR:
display_config->show_paint_tool_cursor = g_value_get_boolean (value);
break;
case PROP_IMAGE_TITLE_FORMAT: case PROP_IMAGE_TITLE_FORMAT:
g_free (display_config->image_title_format); g_free (display_config->image_title_format);
display_config->image_title_format = g_value_dup_string (value); 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: case PROP_SHOW_BRUSH_OUTLINE:
g_value_set_boolean (value, display_config->show_brush_outline); g_value_set_boolean (value, display_config->show_brush_outline);
break; break;
case PROP_SHOW_PAINT_TOOL_CURSOR:
g_value_set_boolean (value, display_config->show_paint_tool_cursor);
break;
case PROP_IMAGE_TITLE_FORMAT: case PROP_IMAGE_TITLE_FORMAT:
g_value_set_string (value, display_config->image_title_format); g_value_set_string (value, display_config->image_title_format);
break; break;

View File

@ -49,6 +49,7 @@ struct _GimpDisplayConfig
GimpCursorMode cursor_mode; GimpCursorMode cursor_mode;
gboolean cursor_updating; gboolean cursor_updating;
gboolean show_brush_outline; gboolean show_brush_outline;
gboolean show_paint_tool_cursor;
gchar *image_title_format; gchar *image_title_format;
gchar *image_status_format; gchar *image_status_format;
gboolean confirm_on_close; gboolean confirm_on_close;

View File

@ -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 " \ N_("When enabled, all paint tools will show a preview of the current " \
"brush's outline.") "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 \ #define SHOW_MENUBAR_BLURB \
N_("When enabled, the menubar is visible by default. This can also be " \ N_("When enabled, the menubar is visible by default. This can also be " \
"toggled with the \"View->Show Menubar\" command.") "toggled with the \"View->Show Menubar\" command.")

View File

@ -1494,6 +1494,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_check_button_add (object, "show-brush-outline", prefs_check_button_add (object, "show-brush-outline",
_("Show _Brush Outline"), _("Show _Brush Outline"),
GTK_BOX (vbox2)); 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", prefs_check_button_add (object, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"), _("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2)); GTK_BOX (vbox2));

View File

@ -632,7 +632,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else if (gimp_image_is_empty (gimage)) else if (gimp_image_is_empty (gimage))
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR, GIMP_CURSOR_BAD,
gimp_tool_control_get_tool_cursor (active_tool->control), gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_NONE);
} }
@ -640,7 +640,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else else
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR, GIMP_CURSOR_BAD,
GIMP_TOOL_CURSOR_NONE, GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_NONE);
} }
@ -1263,7 +1263,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else if (gimp_image_is_empty (gimage)) else if (gimp_image_is_empty (gimage))
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR, GIMP_CURSOR_BAD,
gimp_tool_control_get_tool_cursor (active_tool->control), gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_NONE);
} }
@ -1271,7 +1271,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
else else
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_BAD_CURSOR, GIMP_CURSOR_BAD,
GIMP_TOOL_CURSOR_NONE, GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_NONE);
} }

View File

@ -191,7 +191,8 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); 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) switch (config->cursor_mode)
{ {
@ -199,11 +200,11 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
break; break;
case GIMP_CURSOR_MODE_TOOL_CROSSHAIR: case GIMP_CURSOR_MODE_TOOL_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_SMALL_CURSOR; cursor_type = GIMP_CURSOR_CROSSHAIR_SMALL;
break; break;
case GIMP_CURSOR_MODE_CROSSHAIR: case GIMP_CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR; cursor_type = GIMP_CURSOR_CROSSHAIR;
tool_cursor = GIMP_TOOL_CURSOR_NONE; tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE; modifier = GIMP_CURSOR_MODIFIER_NONE;
break; break;

View File

@ -1494,6 +1494,9 @@ prefs_dialog_new (Gimp *gimp,
prefs_check_button_add (object, "show-brush-outline", prefs_check_button_add (object, "show-brush-outline",
_("Show _Brush Outline"), _("Show _Brush Outline"),
GTK_BOX (vbox2)); 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", prefs_check_button_add (object, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"), _("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2)); GTK_BOX (vbox2));

View File

@ -92,7 +92,7 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
{ {
GimpTool *tool = GIMP_TOOL (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_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (airbrush),
GIMP_COLOR_PICK_MODE_FOREGROUND); GIMP_COLOR_PICK_MODE_FOREGROUND);

View File

@ -165,7 +165,7 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
tool = GIMP_TOOL (blend_tool); tool = GIMP_TOOL (blend_tool);
gimp_tool_control_set_scroll_lock (tool->control, TRUE); 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_INDEXED_IMAGE:
case GIMP_INDEXEDA_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; break;
default: default:
gimp_tool_control_set_cursor (tool->control, GIMP_MOUSE_CURSOR); gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
break; break;
} }

View File

@ -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_finalize (GObject *object);
static void gimp_paint_tool_control (GimpTool *tool, static void gimp_paint_tool_control (GimpTool *tool,
GimpToolAction action, GimpToolAction action,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_button_press (GimpTool *tool, static void gimp_paint_tool_button_press (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_button_release (GimpTool *tool, static void gimp_paint_tool_button_release (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_motion (GimpTool *tool, static void gimp_paint_tool_motion (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_arrow_key (GimpTool *tool, static void gimp_paint_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent, GdkEventKey *kevent,
GimpDisplay *gdisp); GimpDisplay *gdisp);
@ -96,8 +96,12 @@ static void gimp_paint_tool_modifier_key (GimpTool *tool,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_oper_update (GimpTool *tool, static void gimp_paint_tool_oper_update (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); 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); 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->arrow_key = gimp_paint_tool_arrow_key;
tool_class->modifier_key = gimp_paint_tool_modifier_key; tool_class->modifier_key = gimp_paint_tool_modifier_key;
tool_class->oper_update = gimp_paint_tool_oper_update; 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; 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->pick_colors = FALSE;
paint_tool->draw_line = FALSE; paint_tool->draw_line = FALSE;
paint_tool->show_cursor = TRUE;
paint_tool->draw_brush = TRUE; paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0; paint_tool->brush_x = 0.0;
paint_tool->brush_y = 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)); 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 = paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline; 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, g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline", "notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush), 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); 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 static void
gimp_paint_tool_color_picked (GimpColorTool *color_tool, gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpImageType sample_type, GimpImageType sample_type,
@ -887,7 +919,8 @@ gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
{ {
gimp_draw_tool_pause (GIMP_DRAW_TOOL (paint_tool)); 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)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
} }

View File

@ -40,6 +40,7 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */ gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line; gboolean draw_line;
gboolean show_cursor;
gboolean draw_brush; gboolean draw_brush;
gdouble brush_x; gdouble brush_x;
gdouble brush_y; gdouble brush_y;

View File

@ -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_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_BUCKET_FILL_TOOL_CURSOR); GIMP_TOOL_CURSOR_BUCKET_FILL);
} }
static void static void

View File

@ -141,7 +141,7 @@ gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select)
tool = GIMP_TOOL (by_color_select); tool = GIMP_TOOL (by_color_select);
gimp_tool_control_set_preserve (tool->control, FALSE); 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->x = 0;
by_color_select->y = 0; by_color_select->y = 0;
@ -297,11 +297,11 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool,
if (! options->sample_merged && if (! options->sample_merged &&
layer && layer != gdisp->gimage->active_layer) 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 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); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);

View File

@ -155,7 +155,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
{ {
GimpTool *tool = GIMP_TOOL (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 * static GObject *
@ -224,7 +224,7 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpCloneOptions *options; GimpCloneOptions *options;
GdkCursorType ctype = GIMP_MOUSE_CURSOR; GdkCursorType ctype = GIMP_CURSOR_MOUSE;
options = (GimpCloneOptions *) tool->tool_info->tool_options; options = (GimpCloneOptions *) tool->tool_info->tool_options;
@ -236,17 +236,17 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
* if so, is cursor inside? * if so, is cursor inside?
*/ */
if (gimp_channel_is_empty (selection)) if (gimp_channel_is_empty (selection))
ctype = GIMP_MOUSE_CURSOR; ctype = GIMP_CURSOR_MOUSE;
else if (gimp_channel_value (selection, coords->x, coords->y)) 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 (options->clone_type == GIMP_IMAGE_CLONE)
{ {
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) 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) 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); gimp_tool_control_set_cursor (tool->control, ctype);

View File

@ -261,7 +261,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
if (color_tool->enabled) if (color_tool->enabled)
{ {
GdkCursorType cursor = GIMP_BAD_CURSOR; GdkCursorType cursor = GIMP_CURSOR_BAD;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
if (coords->x > 0 && coords->x < gdisp->gimage->width && 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 || (color_tool->options->sample_merged ||
gimp_display_coords_in_active_drawable (gdisp, coords))) gimp_display_coords_in_active_drawable (gdisp, coords)))
{ {
cursor = GIMP_COLOR_PICKER_CURSOR; cursor = GIMP_CURSOR_COLOR_PICKER;
} }
switch (color_tool->pick_mode) switch (color_tool->pick_mode)
@ -287,8 +287,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
} }
gimp_tool_set_cursor (tool, gdisp, gimp_tool_set_cursor (tool, gdisp,
cursor, cursor, GIMP_TOOL_CURSOR_COLOR_PICKER, modifier);
GIMP_COLOR_PICKER_TOOL_CURSOR, modifier);
return; /* don't chain up */ return; /* don't chain up */
} }

View File

@ -120,9 +120,9 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
GimpTool *tool = GIMP_TOOL (convolve); GimpTool *tool = GIMP_TOOL (convolve);
gimp_tool_control_set_tool_cursor (tool->control, 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_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_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS); GIMP_CURSOR_MODIFIER_MINUS);
} }

View File

@ -224,7 +224,7 @@ gimp_crop_tool_init (GimpCropTool *crop_tool)
GimpTool *tool = GIMP_TOOL (crop_tool); GimpTool *tool = GIMP_TOOL (crop_tool);
gimp_tool_control_set_preserve (tool->control, FALSE); 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 static void
@ -742,7 +742,7 @@ gimp_crop_tool_cursor_update (GimpTool *tool,
{ {
GimpCropTool *crop = GIMP_CROP_TOOL (tool); GimpCropTool *crop = GIMP_CROP_TOOL (tool);
GimpCropOptions *options; GimpCropOptions *options;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR; GdkCursorType ctype = GIMP_CURSOR_CROSSHAIR_SMALL;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options); 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, gimp_tool_control_set_tool_cursor (tool->control,
options->crop_mode == options->crop_mode ==
GIMP_CROP_MODE_CROP ? GIMP_CROP_MODE_CROP ?
GIMP_CROP_TOOL_CURSOR : GIMP_TOOL_CURSOR_CROP :
GIMP_RESIZE_TOOL_CURSOR); GIMP_TOOL_CURSOR_RESIZE);
gimp_tool_control_set_cursor_modifier (tool->control, cmodifier); gimp_tool_control_set_cursor_modifier (tool->control, cmodifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);

View File

@ -120,9 +120,9 @@ gimp_dodge_burn_tool_init (GimpDodgeBurnTool *dodgeburn)
GimpTool *tool = GIMP_TOOL (dodgeburn); GimpTool *tool = GIMP_TOOL (dodgeburn);
gimp_tool_control_set_tool_cursor (tool->control, 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_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_BURN_TOOL_CURSOR); GIMP_TOOL_CURSOR_BURN);
} }
static void static void

View File

@ -129,7 +129,7 @@ gimp_ellipse_select_tool_init (GimpEllipseSelectTool *ellipse_select)
GimpTool *tool = GIMP_TOOL (ellipse_select); GimpTool *tool = GIMP_TOOL (ellipse_select);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR); GIMP_TOOL_CURSOR_ELLIPSE_SELECT);
} }
static void static void

View File

@ -120,9 +120,9 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
GimpTool *tool = GIMP_TOOL (eraser); GimpTool *tool = GIMP_TOOL (eraser);
gimp_tool_control_set_tool_cursor (tool->control, 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_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_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS); GIMP_CURSOR_MODIFIER_MINUS);

View File

@ -150,11 +150,11 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool)
gimp_tool_control_set_cursor (tool->control, gimp_tool_control_set_cursor (tool->control,
GDK_SB_H_DOUBLE_ARROW); GDK_SB_H_DOUBLE_ARROW);
gimp_tool_control_set_tool_cursor (tool->control, 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, gimp_tool_control_set_toggle_cursor (tool->control,
GDK_SB_V_DOUBLE_ARROW); GDK_SB_V_DOUBLE_ARROW);
gimp_tool_control_set_toggle_tool_cursor (tool->control, gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_FLIP_VERTICAL_TOOL_CURSOR); GIMP_TOOL_CURSOR_FLIP_VERTICAL);
transform_tool->use_grid = FALSE; transform_tool->use_grid = FALSE;
} }
@ -217,12 +217,12 @@ gimp_flip_tool_cursor_update (GimpTool *tool,
if (bad_cursor) if (bad_cursor)
{ {
gimp_tool_control_set_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_BAD_CURSOR); gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_BAD);
} }
else 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); gimp_tool_control_set_toggle_cursor (tool->control, GDK_SB_V_DOUBLE_ARROW);
} }

View File

@ -112,18 +112,18 @@ gimp_free_select_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpFreeSelectToolClass), sizeof (GimpFreeSelectToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_free_select_tool_class_init, (GClassInitFunc) gimp_free_select_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpFreeSelectTool), sizeof (GimpFreeSelectTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_free_select_tool_init, (GInstanceInitFunc) gimp_free_select_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL, tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpFreeSelectTool", "GimpFreeSelectTool",
&tool_info, 0); &tool_info, 0);
} }
@ -135,13 +135,9 @@ gimp_free_select_tool_get_type (void)
static void static void
gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass) gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -157,14 +153,11 @@ gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
static void static void
gimp_free_select_tool_init (GimpFreeSelectTool *free_select) gimp_free_select_tool_init (GimpFreeSelectTool *free_select)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (free_select);
GimpSelectionTool *select_tool;
tool = GIMP_TOOL (free_select);
select_tool = GIMP_SELECTION_TOOL (free_select);
gimp_tool_control_set_scroll_lock (tool->control, TRUE); 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->points = NULL;
free_select->num_points = 0; free_select->num_points = 0;
@ -174,9 +167,7 @@ gimp_free_select_tool_init (GimpFreeSelectTool *free_select)
static void static void
gimp_free_select_tool_finalize (GObject *object) gimp_free_select_tool_finalize (GObject *object)
{ {
GimpFreeSelectTool *free_sel; GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (object);
free_sel = GIMP_FREE_SELECT_TOOL (object);
if (free_sel->points) if (free_sel->points)
{ {
@ -194,9 +185,7 @@ gimp_free_select_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFreeSelectTool *free_sel; GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
free_sel = GIMP_FREE_SELECT_TOOL (tool);
gimp_tool_control_activate (tool->control); gimp_tool_control_activate (tool->control);
tool->gdisp = gdisp; tool->gdisp = gdisp;
@ -231,10 +220,9 @@ gimp_free_select_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFreeSelectTool *free_sel; GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
free_sel = GIMP_FREE_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
@ -279,11 +267,8 @@ gimp_free_select_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFreeSelectTool *free_sel; GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool; GimpSelectionTool *sel_tool = GIMP_SELECTION_TOOL (tool);
free_sel = GIMP_FREE_SELECT_TOOL (tool);
sel_tool = GIMP_SELECTION_TOOL (tool);
if (sel_tool->op == SELECTION_ANCHOR) if (sel_tool->op == SELECTION_ANCHOR)
{ {
@ -320,11 +305,9 @@ gimp_free_select_tool_motion (GimpTool *tool,
static void static void
gimp_free_select_tool_draw (GimpDrawTool *draw_tool) gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
{ {
GimpFreeSelectTool *free_sel; GimpFreeSelectTool *free_sel = GIMP_FREE_SELECT_TOOL (draw_tool);
gint i; gint i;
free_sel = GIMP_FREE_SELECT_TOOL (draw_tool);
for (i = 1; i < free_sel->num_points; i++) for (i = 1; i < free_sel->num_points; i++)
{ {
gimp_draw_tool_draw_line (draw_tool, gimp_draw_tool_draw_line (draw_tool,

View File

@ -86,8 +86,6 @@ static GdkSegment *
static GimpSelectionToolClass *parent_class = NULL; static GimpSelectionToolClass *parent_class = NULL;
/* public functions */
void void
gimp_fuzzy_select_tool_register (GimpToolRegisterCallback callback, gimp_fuzzy_select_tool_register (GimpToolRegisterCallback callback,
gpointer data) gpointer data)
@ -115,37 +113,30 @@ gimp_fuzzy_select_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpFuzzySelectToolClass), sizeof (GimpFuzzySelectToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_fuzzy_select_tool_class_init, (GClassInitFunc) gimp_fuzzy_select_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpFuzzySelectTool), sizeof (GimpFuzzySelectTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_fuzzy_select_tool_init, (GInstanceInitFunc) gimp_fuzzy_select_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL, tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpFuzzySelectTool", "GimpFuzzySelectTool",
&tool_info, 0); &tool_info, 0);
} }
return tool_type; return tool_type;
} }
/* private functions */
static void static void
gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass) gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -161,13 +152,11 @@ gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
static void static void
gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select) gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (fuzzy_select);
tool = GIMP_TOOL (fuzzy_select);
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_FUZZY_SELECT_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_FUZZY_SELECT);
fuzzy_select->x = 0; fuzzy_select->x = 0;
fuzzy_select->y = 0; fuzzy_select->y = 0;
@ -183,9 +172,7 @@ gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
static void static void
gimp_fuzzy_select_tool_finalize (GObject *object) gimp_fuzzy_select_tool_finalize (GObject *object)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (object);
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (object);
if (fuzzy_sel->fuzzy_mask) if (fuzzy_sel->fuzzy_mask)
{ {
@ -210,10 +197,9 @@ gimp_fuzzy_select_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
fuzzy_sel->x = coords->x; fuzzy_sel->x = coords->x;
@ -254,10 +240,9 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
@ -290,9 +275,7 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool,
} }
else else
{ {
GimpDrawable *drawable; GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage);
drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
} }
@ -334,8 +317,7 @@ gimp_fuzzy_select_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool;
GimpSelectionOptions *options; GimpSelectionOptions *options;
GdkSegment *new_segs; GdkSegment *new_segs;
gint num_new_segs; gint num_new_segs;
@ -344,9 +326,7 @@ gimp_fuzzy_select_tool_motion (GimpTool *tool,
static guint32 last_time = 0; static guint32 last_time = 0;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
sel_tool = GIMP_SELECTION_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
/* don't let the events come in too fast, ignore below a delay of 100 ms */ /* don't let the events come in too fast, ignore below a delay of 100 ms */
if (time - last_time < 100) if (time - last_time < 100)
@ -400,7 +380,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel,
GimpDisplay *gdisp, GimpDisplay *gdisp,
gint *num_segs) gint *num_segs)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (fuzzy_sel);
GimpSelectionOptions *options; GimpSelectionOptions *options;
GimpDisplayShell *shell; GimpDisplayShell *shell;
PixelRegion maskPR; PixelRegion maskPR;
@ -411,7 +391,6 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel,
gint i; gint i;
gint x, y; gint x, y;
tool = GIMP_TOOL (fuzzy_sel);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
shell = GIMP_DISPLAY_SHELL (gdisp->shell); shell = GIMP_DISPLAY_SHELL (gdisp->shell);

View File

@ -37,7 +37,16 @@
#include "gimp-intl.h" #include "gimp-intl.h"
static void gimp_ink_tool_init (GimpInkTool *tool); static void gimp_ink_tool_init (GimpInkTool *tool);
static void gimp_ink_tool_class_init (GimpInkToolClass *klass);
static void gimp_ink_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static GimpPaintToolClass *parent_class = NULL;
void void
@ -72,7 +81,7 @@ gimp_ink_tool_get_type (void)
sizeof (GimpInkToolClass), sizeof (GimpInkToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
NULL, /* class_init */ (GClassInitFunc) gimp_ink_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpInkTool), sizeof (GimpInkTool),
@ -88,11 +97,34 @@ gimp_ink_tool_get_type (void)
return tool_type; return tool_type;
} }
static void
gimp_ink_tool_class_init (GimpInkToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
tool_class->cursor_update = gimp_ink_tool_cursor_update;
}
static void static void
gimp_ink_tool_init (GimpInkTool *ink_tool) gimp_ink_tool_init (GimpInkTool *ink_tool)
{ {
GimpTool *tool = GIMP_TOOL (ink_tool); GimpTool *tool = GIMP_TOOL (ink_tool);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_INK_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK);
}
static void
gimp_ink_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
paint_tool->show_cursor = TRUE;
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
} }

View File

@ -294,18 +294,18 @@ gimp_iscissors_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpIscissorsToolClass), sizeof (GimpIscissorsToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_iscissors_tool_class_init, (GClassInitFunc) gimp_iscissors_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpIscissorsTool), sizeof (GimpIscissorsTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_iscissors_tool_init, (GInstanceInitFunc) gimp_iscissors_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL, tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpIscissorsTool", "GimpIscissorsTool",
&tool_info, 0); &tool_info, 0);
} }
@ -315,13 +315,9 @@ gimp_iscissors_tool_get_type (void)
static void static void
gimp_iscissors_tool_class_init (GimpIscissorsToolClass *klass) gimp_iscissors_tool_class_init (GimpIscissorsToolClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -340,9 +336,7 @@ gimp_iscissors_tool_class_init (GimpIscissorsToolClass *klass)
static void static void
gimp_iscissors_tool_init (GimpIscissorsTool *iscissors) gimp_iscissors_tool_init (GimpIscissorsTool *iscissors)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (iscissors);
tool = GIMP_TOOL (iscissors);
iscissors->op = ISCISSORS_OP_NONE; iscissors->op = ISCISSORS_OP_NONE;
iscissors->dp_buf = NULL; iscissors->dp_buf = NULL;
@ -356,7 +350,7 @@ gimp_iscissors_tool_init (GimpIscissorsTool *iscissors)
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_snap_to (tool->control, FALSE); gimp_tool_control_set_snap_to (tool->control, FALSE);
gimp_tool_control_set_preserve (tool->control, FALSE); gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_SCISSORS_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_ISCISSORS);
gimp_iscissors_tool_reset (iscissors); gimp_iscissors_tool_reset (iscissors);
} }
@ -376,11 +370,9 @@ gimp_iscissors_tool_control (GimpTool *tool,
GimpToolAction action, GimpToolAction action,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpIscissorsTool *iscissors; GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
IscissorsDraw draw; IscissorsDraw draw;
iscissors = GIMP_ISCISSORS_TOOL (tool);
switch (iscissors->state) switch (iscissors->state)
{ {
case SEED_PLACEMENT: case SEED_PLACEMENT:
@ -424,11 +416,10 @@ gimp_iscissors_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpIscissorsTool *iscissors; GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
iscissors = GIMP_ISCISSORS_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
iscissors->x = coords->x; iscissors->x = coords->x;
iscissors->y = coords->y; iscissors->y = coords->y;
@ -589,12 +580,11 @@ gimp_iscissors_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpIscissorsTool *iscissors; GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
ICurve *curve; ICurve *curve;
iscissors = GIMP_ISCISSORS_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
/* Make sure X didn't skip the button release event -- as it's known /* Make sure X didn't skip the button release event -- as it's known
* to do * to do
@ -703,11 +693,10 @@ gimp_iscissors_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpIscissorsTool *iscissors; GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
iscissors = GIMP_ISCISSORS_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
if (iscissors->state == NO_ACTION) if (iscissors->state == NO_ACTION)
return; return;
@ -770,15 +759,12 @@ gimp_iscissors_tool_motion (GimpTool *tool,
static void static void
gimp_iscissors_tool_draw (GimpDrawTool *draw_tool) gimp_iscissors_tool_draw (GimpDrawTool *draw_tool)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (draw_tool);
GimpIscissorsTool *iscissors; GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (draw_tool);
GimpDisplay *gdisp; GimpDisplay *gdisp;
ICurve *curve; ICurve *curve;
GSList *list; GSList *list;
tool = GIMP_TOOL (draw_tool);
iscissors = GIMP_ISCISSORS_TOOL (draw_tool);
gdisp = tool->gdisp; gdisp = tool->gdisp;
/* Draw the crosshairs target if we're placing a seed */ /* Draw the crosshairs target if we're placing a seed */
@ -1019,7 +1005,7 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool); GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
GdkCursorType cursor = GIMP_MOUSE_CURSOR; GdkCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
switch (iscissors->op) switch (iscissors->op)
@ -1034,16 +1020,14 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool,
cmodifier = GIMP_CURSOR_MODIFIER_PLUS; cmodifier = GIMP_CURSOR_MODIFIER_PLUS;
break; break;
case ISCISSORS_OP_IMPOSSIBLE: case ISCISSORS_OP_IMPOSSIBLE:
cursor = GIMP_BAD_CURSOR; cursor = GIMP_CURSOR_BAD;
break; break;
default: default:
break; break;
} }
gimp_tool_set_cursor (tool, gdisp, gimp_tool_set_cursor (tool, gdisp,
cursor, cursor, GIMP_TOOL_CURSOR_ISCISSORS, cmodifier);
GIMP_SCISSORS_TOOL_CURSOR /* tool->tool_cursor*/,
cmodifier);
} }

View File

@ -110,18 +110,18 @@ gimp_magnify_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpMagnifyToolClass), sizeof (GimpMagnifyToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_magnify_tool_class_init, (GClassInitFunc) gimp_magnify_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpMagnifyTool), sizeof (GimpMagnifyTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_magnify_tool_init, (GInstanceInitFunc) gimp_magnify_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL, tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpMagnifyTool", "GimpMagnifyTool",
&tool_info, 0); &tool_info, 0);
} }
@ -134,11 +134,8 @@ gimp_magnify_tool_get_type (void)
static void static void
gimp_magnify_tool_class_init (GimpMagnifyToolClass *klass) gimp_magnify_tool_class_init (GimpMagnifyToolClass *klass)
{ {
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -154,9 +151,7 @@ gimp_magnify_tool_class_init (GimpMagnifyToolClass *klass)
static void static void
gimp_magnify_tool_init (GimpMagnifyTool *magnify_tool) gimp_magnify_tool_init (GimpMagnifyTool *magnify_tool)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (magnify_tool);
tool = GIMP_TOOL (magnify_tool);
magnify_tool->x = 0; magnify_tool->x = 0;
magnify_tool->y = 0; magnify_tool->y = 0;
@ -167,16 +162,16 @@ gimp_magnify_tool_init (GimpMagnifyTool *magnify_tool)
gimp_tool_control_set_snap_to (tool->control, FALSE); gimp_tool_control_set_snap_to (tool->control, FALSE);
gimp_tool_control_set_cursor (tool->control, gimp_tool_control_set_cursor (tool->control,
GIMP_ZOOM_CURSOR); GIMP_CURSOR_ZOOM);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_ZOOM_TOOL_CURSOR); GIMP_TOOL_CURSOR_ZOOM);
gimp_tool_control_set_cursor_modifier (tool->control, gimp_tool_control_set_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_PLUS); GIMP_CURSOR_MODIFIER_PLUS);
gimp_tool_control_set_toggle_cursor (tool->control, gimp_tool_control_set_toggle_cursor (tool->control,
GIMP_ZOOM_CURSOR); GIMP_CURSOR_ZOOM);
gimp_tool_control_set_toggle_tool_cursor (tool->control, gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_ZOOM_TOOL_CURSOR); GIMP_TOOL_CURSOR_ZOOM);
gimp_tool_control_set_toggle_cursor_modifier (tool->control, gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS); GIMP_CURSOR_MODIFIER_MINUS);
} }
@ -188,9 +183,7 @@ gimp_magnify_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpMagnifyTool *magnify; GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool);
magnify = GIMP_MAGNIFY_TOOL (tool);
magnify->x = coords->x; magnify->x = coords->x;
magnify->y = coords->y; magnify->y = coords->y;
@ -210,11 +203,10 @@ gimp_magnify_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpMagnifyTool *magnify; GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool);
GimpMagnifyOptions *options; GimpMagnifyOptions *options;
GimpDisplayShell *shell; GimpDisplayShell *shell;
magnify = GIMP_MAGNIFY_TOOL (tool);
options = GIMP_MAGNIFY_OPTIONS (tool->tool_info->tool_options); options = GIMP_MAGNIFY_OPTIONS (tool->tool_info->tool_options);
shell = GIMP_DISPLAY_SHELL (tool->gdisp->shell); shell = GIMP_DISPLAY_SHELL (tool->gdisp->shell);
@ -226,9 +218,9 @@ gimp_magnify_tool_button_release (GimpTool *tool,
/* First take care of the case where the user "cancels" the action */ /* First take care of the case where the user "cancels" the action */
if (! (state & GDK_BUTTON3_MASK)) if (! (state & GDK_BUTTON3_MASK))
{ {
gint x1, y1, x2, y2, w, h; gint x1, y1, x2, y2, w, h;
gint win_width, win_height; gint win_width, win_height;
gint offset_x, offset_y; gint offset_x, offset_y;
gdouble new_scale; gdouble new_scale;
x1 = (magnify->w < 0) ? magnify->x + magnify->w : magnify->x; x1 = (magnify->w < 0) ? magnify->x + magnify->w : magnify->x;
@ -267,7 +259,7 @@ gimp_magnify_tool_button_release (GimpTool *tool,
scale = MIN (((gdouble) w / (gdouble) width), scale = MIN (((gdouble) w / (gdouble) width),
((gdouble) h / (gdouble) height)); ((gdouble) h / (gdouble) height));
break; break;
case GIMP_ZOOM_TO: case GIMP_ZOOM_TO:
break; break;
} }
@ -292,9 +284,7 @@ gimp_magnify_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpMagnifyTool *magnify; GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (tool);
magnify = GIMP_MAGNIFY_TOOL (tool);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
@ -352,10 +342,9 @@ gimp_magnify_tool_cursor_update (GimpTool *tool,
static void static void
gimp_magnify_tool_draw (GimpDrawTool *draw_tool) gimp_magnify_tool_draw (GimpDrawTool *draw_tool)
{ {
GimpMagnifyTool *magnify; GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (draw_tool);
GimpMagnifyOptions *options; GimpMagnifyOptions *options;
magnify = GIMP_MAGNIFY_TOOL (draw_tool);
options = GIMP_MAGNIFY_OPTIONS (GIMP_TOOL (draw_tool)->tool_info->tool_options); options = GIMP_MAGNIFY_OPTIONS (GIMP_TOOL (draw_tool)->tool_info->tool_options);
gimp_draw_tool_draw_rectangle (draw_tool, gimp_draw_tool_draw_rectangle (draw_tool,

View File

@ -128,18 +128,18 @@ gimp_measure_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpMeasureToolClass), sizeof (GimpMeasureToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_measure_tool_class_init, (GClassInitFunc) gimp_measure_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpMeasureTool), sizeof (GimpMeasureTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_measure_tool_init, (GInstanceInitFunc) gimp_measure_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL, tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpMeasureTool", "GimpMeasureTool",
&tool_info, 0); &tool_info, 0);
} }
@ -149,11 +149,8 @@ gimp_measure_tool_get_type (void)
static void static void
gimp_measure_tool_class_init (GimpMeasureToolClass *klass) gimp_measure_tool_class_init (GimpMeasureToolClass *klass)
{ {
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -171,7 +168,7 @@ gimp_measure_tool_init (GimpMeasureTool *measure_tool)
{ {
GimpTool *tool = GIMP_TOOL (measure_tool); GimpTool *tool = GIMP_TOOL (measure_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_MEASURE_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_MEASURE);
} }
static void static void
@ -207,12 +204,11 @@ gimp_measure_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpMeasureTool *mtool; GimpMeasureTool *mtool = GIMP_MEASURE_TOOL (tool);
GimpMeasureOptions *options; GimpMeasureOptions *options;
GimpDisplayShell *shell; GimpDisplayShell *shell;
gint i; gint i;
mtool = GIMP_MEASURE_TOOL (tool);
options = GIMP_MEASURE_OPTIONS (tool->tool_info->tool_options); options = GIMP_MEASURE_OPTIONS (tool->tool_info->tool_options);
shell = GIMP_DISPLAY_SHELL (gdisp->shell); shell = GIMP_DISPLAY_SHELL (gdisp->shell);
@ -386,13 +382,12 @@ gimp_measure_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpMeasureTool *mtool; GimpMeasureTool *mtool = GIMP_MEASURE_TOOL (tool);
GimpMeasureOptions *options; GimpMeasureOptions *options;
gint dx, dy; gint dx, dy;
gint i; gint i;
gint tmp; gint tmp;
mtool = GIMP_MEASURE_TOOL (tool);
options = GIMP_MEASURE_OPTIONS (tool->tool_info->tool_options); options = GIMP_MEASURE_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (mtool)); gimp_draw_tool_pause (GIMP_DRAW_TOOL (mtool));
@ -513,7 +508,7 @@ gimp_measure_tool_cursor_update (GimpTool *tool,
{ {
GimpMeasureTool *mtool = GIMP_MEASURE_TOOL (tool); GimpMeasureTool *mtool = GIMP_MEASURE_TOOL (tool);
gboolean in_handle = FALSE; gboolean in_handle = FALSE;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR; GdkCursorType ctype = GIMP_CURSOR_CROSSHAIR_SMALL;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
gint i; gint i;

View File

@ -179,7 +179,7 @@ gimp_move_tool_init (GimpMoveTool *move_tool)
gimp_tool_control_set_snap_to (tool->control, FALSE); gimp_tool_control_set_snap_to (tool->control, FALSE);
gimp_tool_control_set_handles_empty_image (tool->control, TRUE); gimp_tool_control_set_handles_empty_image (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_MOVE_TOOL_CURSOR); GIMP_TOOL_CURSOR_MOVE);
} }
static void static void
@ -586,19 +586,19 @@ gimp_move_tool_cursor_update (GimpTool *tool,
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell); GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options); GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options);
GdkCursorType cursor = GIMP_BAD_CURSOR; GdkCursorType cursor = GIMP_CURSOR_BAD;
GimpToolCursorType tool_cursor = GIMP_MOVE_TOOL_CURSOR; GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
if (options->move_type == GIMP_TRANSFORM_TYPE_PATH) if (options->move_type == GIMP_TRANSFORM_TYPE_PATH)
{ {
tool_cursor = GIMP_BEZIER_SELECT_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_PATHS;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
if (options->move_current) if (options->move_current)
{ {
if (gimp_image_get_active_vectors (gdisp->gimage)) if (gimp_image_get_active_vectors (gdisp->gimage))
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
} }
else else
{ {
@ -607,22 +607,22 @@ gimp_move_tool_cursor_update (GimpTool *tool,
NULL, NULL, NULL, NULL, NULL, NULL)) NULL, NULL, NULL, NULL, NULL, NULL))
{ {
cursor = GDK_HAND2; cursor = GDK_HAND2;
tool_cursor = GIMP_HAND_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_HAND;
} }
} }
} }
else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION) else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION)
{ {
tool_cursor = GIMP_RECT_SELECT_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->gimage))) if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->gimage)))
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
} }
else if (options->move_current) else if (options->move_current)
{ {
if (gimp_image_active_drawable (gdisp->gimage)) if (gimp_image_active_drawable (gdisp->gimage))
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
} }
else else
{ {
@ -639,7 +639,7 @@ gimp_move_tool_cursor_update (GimpTool *tool,
FUNSCALEY (shell, snap_distance)))) FUNSCALEY (shell, snap_distance))))
{ {
cursor = GDK_HAND2; cursor = GDK_HAND2;
tool_cursor = GIMP_HAND_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage,
@ -649,18 +649,18 @@ gimp_move_tool_cursor_update (GimpTool *tool,
if (gimp_image_floating_sel (gdisp->gimage) && if (gimp_image_floating_sel (gdisp->gimage) &&
! gimp_layer_is_floating_sel (layer)) ! gimp_layer_is_floating_sel (layer))
{ {
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_RECT_SELECT_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT;
modifier = GIMP_CURSOR_MODIFIER_ANCHOR; modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
} }
else if (layer == gimp_image_get_active_layer (gdisp->gimage)) else if (layer == gimp_image_get_active_layer (gdisp->gimage))
{ {
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
} }
else else
{ {
cursor = GDK_HAND2; cursor = GDK_HAND2;
tool_cursor = GIMP_HAND_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
} }
@ -751,7 +751,7 @@ gimp_move_tool_start_guide (GimpMoveTool *move,
gimp_tool_set_cursor (tool, gdisp, gimp_tool_set_cursor (tool, gdisp,
GDK_HAND2, GDK_HAND2,
GIMP_HAND_TOOL_CURSOR, GIMP_TOOL_CURSOR_HAND,
GIMP_CURSOR_MODIFIER_MOVE); GIMP_CURSOR_MODIFIER_MOVE);
gimp_draw_tool_start (GIMP_DRAW_TOOL (move), gdisp); gimp_draw_tool_start (GIMP_DRAW_TOOL (move), gdisp);

View File

@ -90,7 +90,7 @@ gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
GimpTool *tool = GIMP_TOOL (paintbrush); GimpTool *tool = GIMP_TOOL (paintbrush);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_PAINTBRUSH_TOOL_CURSOR); GIMP_TOOL_CURSOR_PAINTBRUSH);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (paintbrush), gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (paintbrush),
GIMP_COLOR_PICK_MODE_FOREGROUND); GIMP_COLOR_PICK_MODE_FOREGROUND);

View File

@ -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_finalize (GObject *object);
static void gimp_paint_tool_control (GimpTool *tool, static void gimp_paint_tool_control (GimpTool *tool,
GimpToolAction action, GimpToolAction action,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_button_press (GimpTool *tool, static void gimp_paint_tool_button_press (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_button_release (GimpTool *tool, static void gimp_paint_tool_button_release (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_motion (GimpTool *tool, static void gimp_paint_tool_motion (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
guint32 time, guint32 time,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_arrow_key (GimpTool *tool, static void gimp_paint_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent, GdkEventKey *kevent,
GimpDisplay *gdisp); GimpDisplay *gdisp);
@ -96,8 +96,12 @@ static void gimp_paint_tool_modifier_key (GimpTool *tool,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_paint_tool_oper_update (GimpTool *tool, static void gimp_paint_tool_oper_update (GimpTool *tool,
GimpCoords *coords, GimpCoords *coords,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); 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); 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->arrow_key = gimp_paint_tool_arrow_key;
tool_class->modifier_key = gimp_paint_tool_modifier_key; tool_class->modifier_key = gimp_paint_tool_modifier_key;
tool_class->oper_update = gimp_paint_tool_oper_update; 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; 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->pick_colors = FALSE;
paint_tool->draw_line = FALSE; paint_tool->draw_line = FALSE;
paint_tool->show_cursor = TRUE;
paint_tool->draw_brush = TRUE; paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0; paint_tool->brush_x = 0.0;
paint_tool->brush_y = 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)); 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 = paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline; 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, g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline", "notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush), 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); 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 static void
gimp_paint_tool_color_picked (GimpColorTool *color_tool, gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpImageType sample_type, GimpImageType sample_type,
@ -887,7 +919,8 @@ gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
{ {
gimp_draw_tool_pause (GIMP_DRAW_TOOL (paint_tool)); 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)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
} }

View File

@ -40,6 +40,7 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */ gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line; gboolean draw_line;
gboolean show_cursor;
gboolean draw_brush; gboolean draw_brush;
gdouble brush_x; gdouble brush_x;
gdouble brush_y; gdouble brush_y;

View File

@ -89,7 +89,7 @@ gimp_pencil_tool_init (GimpPencilTool *pencil)
GimpTool *tool = GIMP_TOOL (pencil); GimpTool *tool = GIMP_TOOL (pencil);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_PENCIL_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_PENCIL);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (pencil), gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (pencil),
GIMP_COLOR_PICK_MODE_FOREGROUND); GIMP_COLOR_PICK_MODE_FOREGROUND);

View File

@ -138,7 +138,7 @@ gimp_perspective_tool_init (GimpPerspectiveTool *perspective_tool)
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (perspective_tool); GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (perspective_tool);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_PERSPECTIVE_TOOL_CURSOR); GIMP_TOOL_CURSOR_PERSPECTIVE);
tr_tool->shell_desc = _("Perspective Transform Information"); tr_tool->shell_desc = _("Perspective Transform Information");
tr_tool->progress_text = _("Perspective..."); tr_tool->progress_text = _("Perspective...");

View File

@ -136,11 +136,8 @@ gimp_rect_select_tool_get_type (void)
static void static void
gimp_rect_select_tool_class_init (GimpRectSelectToolClass *klass) gimp_rect_select_tool_class_init (GimpRectSelectToolClass *klass)
{ {
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -159,7 +156,7 @@ gimp_rect_select_tool_init (GimpRectSelectTool *rect_select)
GimpTool *tool = GIMP_TOOL (rect_select); GimpTool *tool = GIMP_TOOL (rect_select);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_RECT_SELECT_TOOL_CURSOR); GIMP_TOOL_CURSOR_RECT_SELECT);
rect_select->x = rect_select->y = 0.0; rect_select->x = rect_select->y = 0.0;
rect_select->w = rect_select->h = 0.0; rect_select->w = rect_select->h = 0.0;
@ -172,15 +169,13 @@ gimp_rect_select_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpRectSelectTool *rect_sel; GimpRectSelectTool *rect_sel = GIMP_RECT_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool; GimpSelectionTool *sel_tool = GIMP_SELECTION_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
GimpUnit unit = GIMP_UNIT_PIXEL; GimpUnit unit = GIMP_UNIT_PIXEL;
gdouble unit_factor; gdouble unit_factor;
rect_sel = GIMP_RECT_SELECT_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
sel_tool = GIMP_SELECTION_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
rect_sel->x = coords->x; rect_sel->x = coords->x;
rect_sel->y = coords->y; rect_sel->y = coords->y;
@ -264,16 +259,12 @@ gimp_rect_select_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpRectSelectTool *rect_sel; GimpRectSelectTool *rect_sel = GIMP_RECT_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool;
gdouble x, y; gdouble x, y;
gdouble w, h; gdouble w, h;
gint ix, iy; gint ix, iy;
gint iw, ih; gint iw, ih;
rect_sel = GIMP_RECT_SELECT_TOOL (tool);
sel_tool = GIMP_SELECTION_TOOL (tool);
gimp_tool_pop_status (tool); gimp_tool_pop_status (tool);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
@ -323,8 +314,8 @@ gimp_rect_select_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpRectSelectTool *rect_sel; GimpRectSelectTool *rect_sel = GIMP_RECT_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool; GimpSelectionTool *sel_tool = GIMP_SELECTION_TOOL (tool);
gdouble ox, oy; gdouble ox, oy;
gdouble w, h; gdouble w, h;
gdouble tw, th; gdouble tw, th;
@ -332,9 +323,6 @@ gimp_rect_select_tool_motion (GimpTool *tool,
gint ix, iy; gint ix, iy;
gint iw, ih; gint iw, ih;
rect_sel = GIMP_RECT_SELECT_TOOL (tool);
sel_tool = GIMP_SELECTION_TOOL (tool);
if (coords->x != rect_sel->x || coords->y != rect_sel->y) if (coords->x != rect_sel->x || coords->y != rect_sel->y)
rect_sel->moved = TRUE; rect_sel->moved = TRUE;
@ -523,13 +511,11 @@ gimp_rect_select_tool_real_rect_select (GimpRectSelectTool *rect_tool,
gint w, gint w,
gint h) gint h)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (rect_tool);
GimpSelectionTool *sel_tool; GimpSelectionTool *sel_tool = GIMP_SELECTION_TOOL (rect_tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
tool = GIMP_TOOL (rect_tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
sel_tool = GIMP_SELECTION_TOOL (rect_tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->gimage), gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->gimage),
x, y, w, h, x, y, w, h,

View File

@ -86,8 +86,6 @@ static GdkSegment *
static GimpSelectionToolClass *parent_class = NULL; static GimpSelectionToolClass *parent_class = NULL;
/* public functions */
void void
gimp_fuzzy_select_tool_register (GimpToolRegisterCallback callback, gimp_fuzzy_select_tool_register (GimpToolRegisterCallback callback,
gpointer data) gpointer data)
@ -115,37 +113,30 @@ gimp_fuzzy_select_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpFuzzySelectToolClass), sizeof (GimpFuzzySelectToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_fuzzy_select_tool_class_init, (GClassInitFunc) gimp_fuzzy_select_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpFuzzySelectTool), sizeof (GimpFuzzySelectTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_fuzzy_select_tool_init, (GInstanceInitFunc) gimp_fuzzy_select_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL, tool_type = g_type_register_static (GIMP_TYPE_SELECTION_TOOL,
"GimpFuzzySelectTool", "GimpFuzzySelectTool",
&tool_info, 0); &tool_info, 0);
} }
return tool_type; return tool_type;
} }
/* private functions */
static void static void
gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass) gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class; GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class; GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -161,13 +152,11 @@ gimp_fuzzy_select_tool_class_init (GimpFuzzySelectToolClass *klass)
static void static void
gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select) gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (fuzzy_select);
tool = GIMP_TOOL (fuzzy_select);
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_FUZZY_SELECT_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_FUZZY_SELECT);
fuzzy_select->x = 0; fuzzy_select->x = 0;
fuzzy_select->y = 0; fuzzy_select->y = 0;
@ -183,9 +172,7 @@ gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
static void static void
gimp_fuzzy_select_tool_finalize (GObject *object) gimp_fuzzy_select_tool_finalize (GObject *object)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (object);
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (object);
if (fuzzy_sel->fuzzy_mask) if (fuzzy_sel->fuzzy_mask)
{ {
@ -210,10 +197,9 @@ gimp_fuzzy_select_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
fuzzy_sel->x = coords->x; fuzzy_sel->x = coords->x;
@ -254,10 +240,9 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionOptions *options; GimpSelectionOptions *options;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
@ -290,9 +275,7 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool,
} }
else else
{ {
GimpDrawable *drawable; GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage);
drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
} }
@ -334,8 +317,7 @@ gimp_fuzzy_select_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpFuzzySelectTool *fuzzy_sel; GimpFuzzySelectTool *fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool);
GimpSelectionTool *sel_tool;
GimpSelectionOptions *options; GimpSelectionOptions *options;
GdkSegment *new_segs; GdkSegment *new_segs;
gint num_new_segs; gint num_new_segs;
@ -344,9 +326,7 @@ gimp_fuzzy_select_tool_motion (GimpTool *tool,
static guint32 last_time = 0; static guint32 last_time = 0;
fuzzy_sel = GIMP_FUZZY_SELECT_TOOL (tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
sel_tool = GIMP_SELECTION_TOOL (tool);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
/* don't let the events come in too fast, ignore below a delay of 100 ms */ /* don't let the events come in too fast, ignore below a delay of 100 ms */
if (time - last_time < 100) if (time - last_time < 100)
@ -400,7 +380,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel,
GimpDisplay *gdisp, GimpDisplay *gdisp,
gint *num_segs) gint *num_segs)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (fuzzy_sel);
GimpSelectionOptions *options; GimpSelectionOptions *options;
GimpDisplayShell *shell; GimpDisplayShell *shell;
PixelRegion maskPR; PixelRegion maskPR;
@ -411,7 +391,6 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel,
gint i; gint i;
gint x, y; gint x, y;
tool = GIMP_TOOL (fuzzy_sel);
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
shell = GIMP_DISPLAY_SHELL (gdisp->shell); shell = GIMP_DISPLAY_SHELL (gdisp->shell);

View File

@ -118,18 +118,18 @@ gimp_rotate_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpRotateToolClass), sizeof (GimpRotateToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_rotate_tool_class_init, (GClassInitFunc) gimp_rotate_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpRotateTool), sizeof (GimpRotateTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_rotate_tool_init, (GInstanceInitFunc) gimp_rotate_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL, tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL,
"GimpRotateTool", "GimpRotateTool",
&tool_info, 0); &tool_info, 0);
} }
@ -142,9 +142,7 @@ gimp_rotate_tool_get_type (void)
static void static void
gimp_rotate_tool_class_init (GimpRotateToolClass *klass) gimp_rotate_tool_class_init (GimpRotateToolClass *klass)
{ {
GimpTransformToolClass *trans_class; GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -160,7 +158,7 @@ gimp_rotate_tool_init (GimpRotateTool *rotate_tool)
GimpTool *tool = GIMP_TOOL (rotate_tool); GimpTool *tool = GIMP_TOOL (rotate_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (rotate_tool); GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (rotate_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_ROTATE_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_ROTATE);
tr_tool->shell_desc = _("Rotation Information"); tr_tool->shell_desc = _("Rotation Information");
tr_tool->progress_text = _("Rotating..."); tr_tool->progress_text = _("Rotating...");

View File

@ -114,18 +114,18 @@ gimp_scale_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpScaleToolClass), sizeof (GimpScaleToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_scale_tool_class_init, (GClassInitFunc) gimp_scale_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpScaleTool), sizeof (GimpScaleTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_scale_tool_init, (GInstanceInitFunc) gimp_scale_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL, tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL,
"GimpScaleTool", "GimpScaleTool",
&tool_info, 0); &tool_info, 0);
} }
@ -138,9 +138,7 @@ gimp_scale_tool_get_type (void)
static void static void
gimp_scale_tool_class_init (GimpScaleToolClass *klass) gimp_scale_tool_class_init (GimpScaleToolClass *klass)
{ {
GimpTransformToolClass *trans_class; GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -156,7 +154,7 @@ gimp_scale_tool_init (GimpScaleTool *scale_tool)
GimpTool *tool = GIMP_TOOL (scale_tool); GimpTool *tool = GIMP_TOOL (scale_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (scale_tool); GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (scale_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_RESIZE_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_RESIZE);
tr_tool->shell_desc = _("Scaling Information"); tr_tool->shell_desc = _("Scaling Information");
tr_tool->progress_text = _("Scaling..."); tr_tool->progress_text = _("Scaling...");

View File

@ -265,7 +265,7 @@ gimp_selection_tool_cursor_update (GimpTool *tool,
break; break;
case SELECTION_MOVE: case SELECTION_MOVE:
case SELECTION_MOVE_COPY: case SELECTION_MOVE_COPY:
tool_cursor = GIMP_MOVE_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_MOVE;
break; break;
case SELECTION_ANCHOR: case SELECTION_ANCHOR:
cmodifier = GIMP_CURSOR_MODIFIER_ANCHOR; cmodifier = GIMP_CURSOR_MODIFIER_ANCHOR;
@ -273,7 +273,5 @@ gimp_selection_tool_cursor_update (GimpTool *tool,
} }
gimp_tool_set_cursor (tool, gdisp, gimp_tool_set_cursor (tool, gdisp,
GIMP_MOUSE_CURSOR, GIMP_CURSOR_MOUSE, tool_cursor, cmodifier);
tool_cursor,
cmodifier);
} }

View File

@ -115,18 +115,18 @@ gimp_shear_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpShearToolClass), sizeof (GimpShearToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_shear_tool_class_init, (GClassInitFunc) gimp_shear_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpShearTool), sizeof (GimpShearTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_shear_tool_init, (GInstanceInitFunc) gimp_shear_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL, tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL,
"GimpShearTool", "GimpShearTool",
&tool_info, 0); &tool_info, 0);
} }
@ -136,9 +136,7 @@ gimp_shear_tool_get_type (void)
static void static void
gimp_shear_tool_class_init (GimpShearToolClass *klass) gimp_shear_tool_class_init (GimpShearToolClass *klass)
{ {
GimpTransformToolClass *trans_class; GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -154,7 +152,7 @@ gimp_shear_tool_init (GimpShearTool *shear_tool)
GimpTool *tool = GIMP_TOOL (shear_tool); GimpTool *tool = GIMP_TOOL (shear_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (shear_tool); GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (shear_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_SHEAR_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SHEAR);
tr_tool->use_center = FALSE; tr_tool->use_center = FALSE;
tr_tool->shell_desc = _("Shearing Information"); tr_tool->shell_desc = _("Shearing Information");

View File

@ -92,7 +92,7 @@ gimp_smudge_tool_init (GimpSmudgeTool *smudge)
{ {
GimpTool *tool = GIMP_TOOL (smudge); GimpTool *tool = GIMP_TOOL (smudge);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_SMUDGE_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SMUDGE);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (smudge), gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (smudge),
GIMP_COLOR_PICK_MODE_FOREGROUND); GIMP_COLOR_PICK_MODE_FOREGROUND);

View File

@ -155,7 +155,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
{ {
GimpTool *tool = GIMP_TOOL (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 * static GObject *
@ -224,7 +224,7 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
GimpDisplay *gdisp) GimpDisplay *gdisp)
{ {
GimpCloneOptions *options; GimpCloneOptions *options;
GdkCursorType ctype = GIMP_MOUSE_CURSOR; GdkCursorType ctype = GIMP_CURSOR_MOUSE;
options = (GimpCloneOptions *) tool->tool_info->tool_options; options = (GimpCloneOptions *) tool->tool_info->tool_options;
@ -236,17 +236,17 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
* if so, is cursor inside? * if so, is cursor inside?
*/ */
if (gimp_channel_is_empty (selection)) if (gimp_channel_is_empty (selection))
ctype = GIMP_MOUSE_CURSOR; ctype = GIMP_CURSOR_MOUSE;
else if (gimp_channel_value (selection, coords->x, coords->y)) 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 (options->clone_type == GIMP_IMAGE_CLONE)
{ {
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) 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) 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); gimp_tool_control_set_cursor (tool->control, ctype);

View File

@ -157,18 +157,18 @@ gimp_text_tool_get_type (void)
static const GTypeInfo tool_info = static const GTypeInfo tool_info =
{ {
sizeof (GimpTextToolClass), sizeof (GimpTextToolClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_text_tool_class_init, (GClassInitFunc) gimp_text_tool_class_init,
NULL, /* class_finalize */ NULL, /* class_finalize */
NULL, /* class_data */ NULL, /* class_data */
sizeof (GimpTextTool), sizeof (GimpTextTool),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gimp_text_tool_init, (GInstanceInitFunc) gimp_text_tool_init,
}; };
tool_type = g_type_register_static (GIMP_TYPE_TOOL, tool_type = g_type_register_static (GIMP_TYPE_TOOL,
"GimpTextTool", "GimpTextTool",
&tool_info, 0); &tool_info, 0);
} }
@ -211,7 +211,7 @@ gimp_text_tool_init (GimpTextTool *text_tool)
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_preserve (tool->control, TRUE); gimp_tool_control_set_preserve (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TEXT_TOOL_CURSOR); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_TEXT);
} }
static GObject * static GObject *

View File

@ -85,11 +85,11 @@ gimp_tool_control_init (GimpToolControl *control)
control->handle_empty_image = FALSE; control->handle_empty_image = FALSE;
control->motion_mode = GIMP_MOTION_MODE_HINT; control->motion_mode = GIMP_MOTION_MODE_HINT;
control->cursor = GIMP_MOUSE_CURSOR; control->cursor = GIMP_CURSOR_MOUSE;
control->tool_cursor = GIMP_TOOL_CURSOR_NONE; control->tool_cursor = GIMP_TOOL_CURSOR_NONE;
control->cursor_modifier = GIMP_CURSOR_MODIFIER_NONE; control->cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
control->toggle_cursor = GIMP_MOUSE_CURSOR; control->toggle_cursor = GIMP_CURSOR_MOUSE;
control->toggle_tool_cursor = GIMP_TOOL_CURSOR_NONE; control->toggle_tool_cursor = GIMP_TOOL_CURSOR_NONE;
control->toggle_cursor_modifier = GIMP_CURSOR_MODIFIER_NONE; control->toggle_cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
} }

View File

@ -608,14 +608,14 @@ gimp_transform_tool_cursor_update (GimpTool *tool,
if (GIMP_IS_LAYER (drawable) && if (GIMP_IS_LAYER (drawable) &&
gimp_layer_get_mask (GIMP_LAYER (drawable))) gimp_layer_get_mask (GIMP_LAYER (drawable)))
{ {
ctype = GIMP_BAD_CURSOR; ctype = GIMP_CURSOR_BAD;
} }
else if (gimp_display_coords_in_active_drawable (gdisp, coords)) else if (gimp_display_coords_in_active_drawable (gdisp, coords))
{ {
if (gimp_channel_is_empty (selection) || if (gimp_channel_is_empty (selection) ||
gimp_channel_value (selection, coords->x, coords->y)) gimp_channel_value (selection, coords->x, coords->y))
{ {
ctype = GIMP_MOUSE_CURSOR; ctype = GIMP_CURSOR_MOUSE;
} }
} }
} }
@ -626,15 +626,15 @@ gimp_transform_tool_cursor_update (GimpTool *tool,
if (gimp_channel_is_empty (selection) || if (gimp_channel_is_empty (selection) ||
gimp_channel_value (selection, coords->x, coords->y)) gimp_channel_value (selection, coords->x, coords->y))
{ {
ctype = GIMP_MOUSE_CURSOR; ctype = GIMP_CURSOR_MOUSE;
} }
break; break;
case GIMP_TRANSFORM_TYPE_PATH: case GIMP_TRANSFORM_TYPE_PATH:
if (gimp_image_get_active_vectors (gdisp->gimage)) if (gimp_image_get_active_vectors (gdisp->gimage))
ctype = GIMP_MOUSE_CURSOR; ctype = GIMP_CURSOR_MOUSE;
else else
ctype = GIMP_BAD_CURSOR; ctype = GIMP_CURSOR_BAD;
break; break;
} }

View File

@ -223,8 +223,7 @@ gimp_vector_tool_init (GimpVectorTool *vector_tool)
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_PATHS);
GIMP_BEZIER_SELECT_TOOL_CURSOR);
vector_tool->status_msg = NULL; vector_tool->status_msg = NULL;
@ -1252,15 +1251,15 @@ gimp_vector_tool_cursor_update (GimpTool *tool,
vector_tool = GIMP_VECTOR_TOOL (tool); vector_tool = GIMP_VECTOR_TOOL (tool);
cursor = GIMP_MOUSE_CURSOR; cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_BEZIER_SELECT_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_PATHS;
cmodifier = GIMP_CURSOR_MODIFIER_NONE; cmodifier = GIMP_CURSOR_MODIFIER_NONE;
switch (vector_tool->function) switch (vector_tool->function)
{ {
case VECTORS_SELECT_VECTOR: case VECTORS_SELECT_VECTOR:
cursor = GDK_HAND2; cursor = GDK_HAND2;
tool_cursor = GIMP_HAND_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_HAND;
break; break;
case VECTORS_CREATE_VECTOR: case VECTORS_CREATE_VECTOR:
case VECTORS_CREATE_STROKE: case VECTORS_CREATE_STROKE:
@ -1277,7 +1276,7 @@ gimp_vector_tool_cursor_update (GimpTool *tool,
case VECTORS_MOVE_HANDLE: case VECTORS_MOVE_HANDLE:
case VECTORS_CONVERT_EDGE: case VECTORS_CONVERT_EDGE:
cursor = GDK_HAND2; cursor = GDK_HAND2;
tool_cursor = GIMP_HAND_TOOL_CURSOR; tool_cursor = GIMP_TOOL_CURSOR_HAND;
cmodifier = GIMP_CURSOR_MODIFIER_CONTROL; cmodifier = GIMP_CURSOR_MODIFIER_CONTROL;
break; break;
case VECTORS_MOVE_ANCHOR: case VECTORS_MOVE_ANCHOR:
@ -1291,12 +1290,12 @@ gimp_vector_tool_cursor_update (GimpTool *tool,
cmodifier = GIMP_CURSOR_MODIFIER_INTERSECT; cmodifier = GIMP_CURSOR_MODIFIER_INTERSECT;
break; break;
default: default:
cursor = GIMP_BAD_CURSOR; cursor = GIMP_CURSOR_BAD;
break; break;
} }
gimp_tool_control_set_cursor (tool->control, cursor); gimp_tool_control_set_cursor (tool->control, cursor);
gimp_tool_control_set_tool_cursor (tool->control, tool_cursor); gimp_tool_control_set_tool_cursor (tool->control, tool_cursor);
gimp_tool_control_set_cursor_modifier (tool->control, cmodifier); gimp_tool_control_set_cursor_modifier (tool->control, cmodifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
@ -1305,19 +1304,15 @@ gimp_vector_tool_cursor_update (GimpTool *tool,
static void static void
gimp_vector_tool_draw (GimpDrawTool *draw_tool) gimp_vector_tool_draw (GimpDrawTool *draw_tool)
{ {
GimpVectorTool *vector_tool; GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (draw_tool);
GimpTool *tool; GimpAnchor *cur_anchor = NULL;
GimpAnchor *cur_anchor = NULL; GimpStroke *cur_stroke = NULL;
GimpStroke *cur_stroke = NULL;
GimpVectors *vectors; GimpVectors *vectors;
GArray *coords; GArray *coords;
gboolean closed; gboolean closed;
GList *draw_anchors; GList *draw_anchors;
GList *list; GList *list;
vector_tool = GIMP_VECTOR_TOOL (draw_tool);
tool = GIMP_TOOL (draw_tool);
vectors = vector_tool->vectors; vectors = vector_tool->vectors;
if (!vectors) if (!vectors)

View File

@ -27,6 +27,7 @@
#include "cursors/gimp-tool-cursors.h" #include "cursors/gimp-tool-cursors.h"
/* standard gimp cursors */ /* standard gimp cursors */
#include "cursors/xbm/cursor-none.xbm"
#include "cursors/xbm/cursor-mouse.xbm" #include "cursors/xbm/cursor-mouse.xbm"
#include "cursors/xbm/cursor-mouse-mask.xbm" #include "cursors/xbm/cursor-mouse-mask.xbm"
#include "cursors/xbm/cursor-crosshair.xbm" #include "cursors/xbm/cursor-crosshair.xbm"
@ -148,6 +149,13 @@ static GimpBitmapCursor gimp_cursors[] =
{ {
/* these have to match up with enum GimpCursorType in widgets-enums.h */ /* these have to match up with enum GimpCursorType in widgets-enums.h */
{
cursor_none_bits, cursor_none_bits,
cursor_none_width, cursor_none_height,
cursor_none_x_hot, cursor_none_y_hot, NULL, NULL,
cursor_none, NULL
},
{ {
cursor_mouse_bits, cursor_mouse_mask_bits, cursor_mouse_bits, cursor_mouse_mask_bits,
cursor_mouse_width, cursor_mouse_height, cursor_mouse_width, cursor_mouse_height,
@ -556,31 +564,31 @@ gimp_cursor_new (GdkDisplay *display,
GimpBitmapCursor *bmtool = NULL; GimpBitmapCursor *bmtool = NULL;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY, NULL); g_return_val_if_fail (cursor_type < GIMP_CURSOR_LAST, NULL);
if (cursor_type <= GDK_LAST_CURSOR) if (cursor_type <= GDK_LAST_CURSOR)
return gdk_cursor_new_for_display (display, cursor_type); return gdk_cursor_new_for_display (display, cursor_type);
g_return_val_if_fail (cursor_type >= GIMP_MOUSE_CURSOR, NULL); g_return_val_if_fail (cursor_type >= GIMP_CURSOR_NONE, NULL);
/* allow the small tool cursor only with the standard mouse, /* allow the small tool cursor only with the standard mouse,
* the small crosshair and the bad cursor * the small crosshair and the bad cursor
*/ */
if (cursor_type != GIMP_MOUSE_CURSOR && if (cursor_type != GIMP_CURSOR_MOUSE &&
cursor_type != GIMP_CROSSHAIR_SMALL_CURSOR && cursor_type != GIMP_CURSOR_CROSSHAIR_SMALL &&
cursor_type != GIMP_BAD_CURSOR) cursor_type != GIMP_CURSOR_BAD)
{ {
tool_cursor = GIMP_TOOL_CURSOR_NONE; tool_cursor = GIMP_TOOL_CURSOR_NONE;
} }
/* prepare the main cursor */ /* prepare the main cursor */
cursor_type -= GIMP_MOUSE_CURSOR; cursor_type -= GIMP_CURSOR_NONE;
bmcursor = &gimp_cursors[cursor_type]; bmcursor = &gimp_cursors[cursor_type];
/* prepare the tool cursor */ /* prepare the tool cursor */
if (tool_cursor >= GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY) if (tool_cursor >= GIMP_TOOL_CURSOR_LAST)
tool_cursor = GIMP_TOOL_CURSOR_NONE; tool_cursor = GIMP_TOOL_CURSOR_NONE;
if (tool_cursor != GIMP_TOOL_CURSOR_NONE) if (tool_cursor != GIMP_TOOL_CURSOR_NONE)

View File

@ -190,50 +190,51 @@ typedef enum /*< skip >*/
typedef enum /*< skip >*/ typedef enum /*< skip >*/
{ {
GIMP_MOUSE_CURSOR = 1024 /* (GDK_LAST_CURSOR + 2) yes, this is insane */, GIMP_CURSOR_NONE = 1024, /* (GDK_LAST_CURSOR + 2) yes, this is insane */
GIMP_CROSSHAIR_CURSOR, GIMP_CURSOR_MOUSE,
GIMP_CROSSHAIR_SMALL_CURSOR, GIMP_CURSOR_CROSSHAIR,
GIMP_BAD_CURSOR, GIMP_CURSOR_CROSSHAIR_SMALL,
GIMP_ZOOM_CURSOR, GIMP_CURSOR_BAD,
GIMP_COLOR_PICKER_CURSOR, GIMP_CURSOR_ZOOM,
GIMP_LAST_CURSOR_ENTRY GIMP_CURSOR_COLOR_PICKER,
GIMP_CURSOR_LAST
} GimpCursorType; } GimpCursorType;
typedef enum /*< skip >*/ typedef enum /*< skip >*/
{ {
GIMP_TOOL_CURSOR_NONE, GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR, GIMP_TOOL_CURSOR_RECT_SELECT,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR, GIMP_TOOL_CURSOR_ELLIPSE_SELECT,
GIMP_FREE_SELECT_TOOL_CURSOR, GIMP_TOOL_CURSOR_FREE_SELECT,
GIMP_FUZZY_SELECT_TOOL_CURSOR, GIMP_TOOL_CURSOR_FUZZY_SELECT,
GIMP_BEZIER_SELECT_TOOL_CURSOR, GIMP_TOOL_CURSOR_PATHS,
GIMP_SCISSORS_TOOL_CURSOR, GIMP_TOOL_CURSOR_ISCISSORS,
GIMP_MOVE_TOOL_CURSOR, GIMP_TOOL_CURSOR_MOVE,
GIMP_ZOOM_TOOL_CURSOR, GIMP_TOOL_CURSOR_ZOOM,
GIMP_CROP_TOOL_CURSOR, GIMP_TOOL_CURSOR_CROP,
GIMP_RESIZE_TOOL_CURSOR, GIMP_TOOL_CURSOR_RESIZE,
GIMP_ROTATE_TOOL_CURSOR, GIMP_TOOL_CURSOR_ROTATE,
GIMP_SHEAR_TOOL_CURSOR, GIMP_TOOL_CURSOR_SHEAR,
GIMP_PERSPECTIVE_TOOL_CURSOR, GIMP_TOOL_CURSOR_PERSPECTIVE,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR, GIMP_TOOL_CURSOR_FLIP_HORIZONTAL,
GIMP_FLIP_VERTICAL_TOOL_CURSOR, GIMP_TOOL_CURSOR_FLIP_VERTICAL,
GIMP_TEXT_TOOL_CURSOR, GIMP_TOOL_CURSOR_TEXT,
GIMP_COLOR_PICKER_TOOL_CURSOR, GIMP_TOOL_CURSOR_COLOR_PICKER,
GIMP_BUCKET_FILL_TOOL_CURSOR, GIMP_TOOL_CURSOR_BUCKET_FILL,
GIMP_BLEND_TOOL_CURSOR, GIMP_TOOL_CURSOR_BLEND,
GIMP_PENCIL_TOOL_CURSOR, GIMP_TOOL_CURSOR_PENCIL,
GIMP_PAINTBRUSH_TOOL_CURSOR, GIMP_TOOL_CURSOR_PAINTBRUSH,
GIMP_AIRBRUSH_TOOL_CURSOR, GIMP_TOOL_CURSOR_AIRBRUSH,
GIMP_INK_TOOL_CURSOR, GIMP_TOOL_CURSOR_INK,
GIMP_CLONE_TOOL_CURSOR, GIMP_TOOL_CURSOR_CLONE,
GIMP_ERASER_TOOL_CURSOR, GIMP_TOOL_CURSOR_ERASER,
GIMP_SMUDGE_TOOL_CURSOR, GIMP_TOOL_CURSOR_SMUDGE,
GIMP_BLUR_TOOL_CURSOR, GIMP_TOOL_CURSOR_BLUR,
GIMP_DODGE_TOOL_CURSOR, GIMP_TOOL_CURSOR_DODGE,
GIMP_BURN_TOOL_CURSOR, GIMP_TOOL_CURSOR_BURN,
GIMP_MEASURE_TOOL_CURSOR, GIMP_TOOL_CURSOR_MEASURE,
GIMP_HAND_TOOL_CURSOR, GIMP_TOOL_CURSOR_HAND,
GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY GIMP_TOOL_CURSOR_LAST
} GimpToolCursorType; } GimpToolCursorType;
typedef enum /*< skip >*/ typedef enum /*< skip >*/

View File

@ -6,6 +6,7 @@ CURSOR_IMAGES = \
cursor-crosshair.png \ cursor-crosshair.png \
cursor-crosshair-small.png \ cursor-crosshair-small.png \
cursor-mouse.png \ cursor-mouse.png \
cursor-none.png \
cursor-zoom.png \ cursor-zoom.png \
\ \
modifier-anchor.png \ modifier-anchor.png \
@ -55,6 +56,7 @@ EXTRA_DIST = \
$(CURSOR_IMAGES) \ $(CURSOR_IMAGES) \
gimp-tool-cursors.xcf \ gimp-tool-cursors.xcf \
\ \
xbm/cursor-none.xbm \
xbm/cursor-mouse.xbm \ xbm/cursor-mouse.xbm \
xbm/cursor-mouse-mask.xbm \ xbm/cursor-mouse-mask.xbm \
xbm/cursor-crosshair.xbm \ xbm/cursor-crosshair.xbm \

BIN
cursors/cursor-none.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

View File

@ -0,0 +1,16 @@
#define cursor_none_width 32
#define cursor_none_height 32
#define cursor_none_x_hot 10
#define cursor_none_y_hot 10
static unsigned char cursor_none_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };