diff --git a/ChangeLog b/ChangeLog index c852686514..9ae0d67371 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2006-06-01 Michael Natterer + + * cursors/Makefile.am + * cursors/modifier-bad.png + * cursors/xbm/modifier-bad-mask.xbm + * cursors/xbm/modifier-bad.xbm: new "bad" cursor + modifier. Replaces the "bad" cursor. + + * cursors/gimp-tool-cursors.xcf: added it here too. + + * app/widgets/widgets-enums.h: added GIMP_CURSOR_MODIFIER_BAD. + + * app/widgets/gimpcursor.c: add the bad modifier. Leave the bad + cursor there for now. + + * app/display/gimpdisplayshell-callbacks.c + * app/tools/gimpaligntool.c + * app/tools/gimpblendtool.c + * app/tools/gimpbycolorselecttool.c + * app/tools/gimpclonetool.c + * app/tools/gimpcolortool.c + * app/tools/gimpfliptool.c + * app/tools/gimpiscissorstool.c + * app/tools/gimpmovetool.c + * app/tools/gimptransformtool.c + * app/tools/gimpvectortool.c: use the modifier instead of the + cursor. Fixes hotspot jumping when switching between normal and + bad cursors. The changed cursor_update() functions even make more + sense IMHO. Fixes bug #158407. + 2006-06-01 Sven Neumann Added basic framework for plug-ins to access the use_cpu_accel diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index f29e2c3915..97f52950dc 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -652,17 +652,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, ! gimp_tool_control_get_handle_empty_image (active_tool->control)) { gimp_display_shell_set_cursor (shell, - GIMP_CURSOR_BAD, + GIMP_CURSOR_MOUSE, gimp_tool_control_get_tool_cursor (active_tool->control), - GIMP_CURSOR_MODIFIER_NONE); + GIMP_CURSOR_MODIFIER_BAD); } } else { gimp_display_shell_set_cursor (shell, - GIMP_CURSOR_BAD, + GIMP_CURSOR_MOUSE, GIMP_TOOL_CURSOR_NONE, - GIMP_CURSOR_MODIFIER_NONE); + GIMP_CURSOR_MODIFIER_BAD); } shell->button_press_before_focus = TRUE; @@ -1342,17 +1342,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, ! gimp_tool_control_get_handle_empty_image (active_tool->control)) { gimp_display_shell_set_cursor (shell, - GIMP_CURSOR_BAD, + GIMP_CURSOR_MOUSE, gimp_tool_control_get_tool_cursor (active_tool->control), - GIMP_CURSOR_MODIFIER_NONE); + GIMP_CURSOR_MODIFIER_BAD); } } else { gimp_display_shell_set_cursor (shell, - GIMP_CURSOR_BAD, + GIMP_CURSOR_MOUSE, GIMP_TOOL_CURSOR_NONE, - GIMP_CURSOR_MODIFIER_NONE); + GIMP_CURSOR_MODIFIER_BAD); } } diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c index b4afd5918a..269d1e6f18 100644 --- a/app/tools/gimpaligntool.c +++ b/app/tools/gimpaligntool.c @@ -392,51 +392,52 @@ gimp_align_tool_cursor_update (GimpTool *tool, GdkModifierType state, GimpDisplay *display) { - GimpAlignOptions *options = GIMP_ALIGN_OPTIONS (tool->tool_info->tool_options); - - GimpCursorType cursor = GIMP_CURSOR_BAD; + GimpAlignOptions *options; + GimpCursorType cursor = GIMP_CURSOR_MOUSE; GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; + options = GIMP_ALIGN_OPTIONS (tool->tool_info->tool_options); + if (options->align_type == GIMP_TRANSFORM_TYPE_PATH) { tool_cursor = GIMP_TOOL_CURSOR_PATHS; - modifier = GIMP_CURSOR_MODIFIER_MOVE; if (gimp_draw_tool_on_vectors (GIMP_DRAW_TOOL (tool), display, coords, 7, 7, NULL, NULL, NULL, NULL, NULL, NULL)) { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; + modifier = GIMP_CURSOR_MODIFIER_MOVE; + } + else + { + modifier = GIMP_CURSOR_MODIFIER_BAD; } } else { - GimpLayer *layer; + GimpLayer *layer = gimp_image_pick_correlate_layer (display->image, + coords->x, coords->y); - if ((layer = gimp_image_pick_correlate_layer (display->image, - coords->x, coords->y))) + if (layer) { /* if there is a floating selection, and this aint it... */ if (gimp_image_floating_sel (display->image) && ! gimp_layer_is_floating_sel (layer)) { - cursor = GIMP_CURSOR_MOUSE; - tool_cursor = GIMP_TOOL_CURSOR_MOVE; - modifier = GIMP_CURSOR_MODIFIER_ANCHOR; + modifier = GIMP_CURSOR_MODIFIER_ANCHOR; } - else if (layer == gimp_image_get_active_layer (display->image)) + else if (layer != gimp_image_get_active_layer (display->image)) { - cursor = GIMP_CURSOR_MOUSE; - } - else - { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; } } + else + { + modifier = GIMP_CURSOR_MODIFIER_BAD; + } } gimp_tool_control_set_cursor (tool->control, cursor); diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index 3f6170a0ba..393d2fedab 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -121,6 +121,8 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool) GimpTool *tool = GIMP_TOOL (blend_tool); gimp_tool_control_set_scroll_lock (tool->control, TRUE); + gimp_tool_control_set_cursor (tool->control, + GIMP_CURSOR_MOUSE); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_BLEND); gimp_tool_control_set_action_value_1 (tool->control, @@ -276,10 +278,12 @@ gimp_blend_tool_cursor_update (GimpTool *tool, { case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE: - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); + gimp_tool_control_set_cursor_modifier (tool->control, + GIMP_CURSOR_MODIFIER_BAD); break; default: - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); + gimp_tool_control_set_cursor_modifier (tool->control, + GIMP_CURSOR_MODIFIER_NONE); break; } diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index f11a7e6b45..1e046af4b2 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -100,6 +100,10 @@ gimp_by_color_select_tool_class_init (GimpByColorSelectToolClass *klass) static void gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select) { + GimpTool *tool = GIMP_TOOL (by_color_select); + + gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); + by_color_select->x = 0; by_color_select->y = 0; } @@ -248,11 +252,13 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool, if (! options->sample_merged && layer && layer != display->image->active_layer) { - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); + gimp_tool_control_set_cursor_modifier (tool->control, + GIMP_CURSOR_MODIFIER_BAD); } else { - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); + gimp_tool_control_set_cursor_modifier (tool->control, + GIMP_CURSOR_MODIFIER_NONE); } GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c index f5383dcd1c..141404f6d2 100644 --- a/app/tools/gimpclonetool.c +++ b/app/tools/gimpclonetool.c @@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, GdkModifierType state, GimpDisplay *display) { - GimpCloneOptions *options; - GimpCursorType ctype = GIMP_CURSOR_MOUSE; + GimpCloneOptions *options; + GimpCursorType cursor = GIMP_CURSOR_MOUSE; + GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options); @@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool, if (gimp_channel_is_empty (selection) || gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), coords->x, coords->y)) - ctype = GIMP_CURSOR_MOUSE; + { + cursor = GIMP_CURSOR_MOUSE; + } } if (options->clone_type == GIMP_IMAGE_CLONE) { if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) - ctype = GIMP_CURSOR_CROSSHAIR_SMALL; + { + cursor = GIMP_CURSOR_CROSSHAIR_SMALL; + } else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable) - ctype = GIMP_CURSOR_BAD; + { + modifier = GIMP_CURSOR_MODIFIER_BAD; + } } - gimp_tool_control_set_cursor (tool->control, ctype); + gimp_tool_control_set_cursor (tool->control, cursor); + gimp_tool_control_set_cursor_modifier (tool->control, modifier); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); } diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c index 1deeb4aeee..e951e2219b 100644 --- a/app/tools/gimpcolortool.c +++ b/app/tools/gimpcolortool.c @@ -504,8 +504,7 @@ gimp_color_tool_cursor_update (GimpTool *tool, } else { - GimpCursorType cursor = GIMP_CURSOR_BAD; - GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; + GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD; if (coords->x > 0 && coords->x < display->image->width && coords->y > 0 && coords->y < display->image->height && @@ -513,27 +512,26 @@ gimp_color_tool_cursor_update (GimpTool *tool, (color_tool->options->sample_merged || gimp_image_coords_in_active_drawable (display->image, coords))) { - cursor = GIMP_CURSOR_MOUSE; - } - - switch (color_tool->pick_mode) - { - case GIMP_COLOR_PICK_MODE_NONE: - modifier = GIMP_CURSOR_MODIFIER_NONE; - break; - case GIMP_COLOR_PICK_MODE_FOREGROUND: - modifier = GIMP_CURSOR_MODIFIER_FOREGROUND; - break; - case GIMP_COLOR_PICK_MODE_BACKGROUND: - modifier = GIMP_CURSOR_MODIFIER_BACKGROUND; - break; - case GIMP_COLOR_PICK_MODE_PALETTE: - modifier = GIMP_CURSOR_MODIFIER_PLUS; - break; + switch (color_tool->pick_mode) + { + case GIMP_COLOR_PICK_MODE_NONE: + modifier = GIMP_CURSOR_MODIFIER_NONE; + break; + case GIMP_COLOR_PICK_MODE_FOREGROUND: + modifier = GIMP_CURSOR_MODIFIER_FOREGROUND; + break; + case GIMP_COLOR_PICK_MODE_BACKGROUND: + modifier = GIMP_CURSOR_MODIFIER_BACKGROUND; + break; + case GIMP_COLOR_PICK_MODE_PALETTE: + modifier = GIMP_CURSOR_MODIFIER_PLUS; + break; + } } gimp_tool_set_cursor (tool, display, - cursor, GIMP_TOOL_CURSOR_COLOR_PICKER, + GIMP_CURSOR_COLOR_PICKER, + GIMP_TOOL_CURSOR_COLOR_PICKER, modifier); } diff --git a/app/tools/gimpfliptool.c b/app/tools/gimpfliptool.c index d17e65d9ca..07c757d1c1 100644 --- a/app/tools/gimpfliptool.c +++ b/app/tools/gimpfliptool.c @@ -102,6 +102,8 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool) GimpTransformTool *transform_tool = GIMP_TRANSFORM_TOOL (flip_tool); gimp_tool_control_set_snap_to (tool->control, FALSE); + gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); + gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_MOUSE); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_FLIP_HORIZONTAL); gimp_tool_control_set_toggle_tool_cursor (tool->control, @@ -147,8 +149,8 @@ gimp_flip_tool_cursor_update (GimpTool *tool, GdkModifierType state, GimpDisplay *display) { - GimpFlipOptions *options; - gboolean bad_cursor = TRUE; + GimpFlipOptions *options; + GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD; options = GIMP_FLIP_OPTIONS (tool->tool_info->tool_options); @@ -161,23 +163,16 @@ gimp_flip_tool_cursor_update (GimpTool *tool, gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), coords->x, coords->y)) { - bad_cursor = FALSE; + modifier = GIMP_CURSOR_MODIFIER_NONE; } } - if (bad_cursor) - { - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); - gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_BAD); - } - else - { - gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); - gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_MOUSE); - } + gimp_tool_control_set_cursor_modifier (tool->control, modifier); + gimp_tool_control_set_toggle_cursor_modifier (tool->control, modifier); gimp_tool_control_set_toggled (tool->control, - options->flip_type == GIMP_ORIENTATION_VERTICAL); + options->flip_type == + GIMP_ORIENTATION_VERTICAL); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); } diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 5db9251e4d..611d522fe3 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -979,29 +979,35 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool, GimpDisplay *display) { GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool); - GimpCursorType cursor = GIMP_CURSOR_MOUSE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; switch (iscissors->op) { case ISCISSORS_OP_SELECT: - GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); + GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, + state, display); return; + case ISCISSORS_OP_MOVE_POINT: modifier = GIMP_CURSOR_MODIFIER_MOVE; break; + case ISCISSORS_OP_ADD_POINT: modifier = GIMP_CURSOR_MODIFIER_PLUS; break; + case ISCISSORS_OP_IMPOSSIBLE: - cursor = GIMP_CURSOR_BAD; + modifier = GIMP_CURSOR_MODIFIER_BAD; break; + default: break; } gimp_tool_set_cursor (tool, display, - cursor, GIMP_TOOL_CURSOR_ISCISSORS, modifier); + GIMP_CURSOR_MOUSE, + GIMP_TOOL_CURSOR_ISCISSORS, + modifier); } diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c index 26e5e108dd..f0c1b85751 100644 --- a/app/tools/gimpmovetool.c +++ b/app/tools/gimpmovetool.c @@ -648,7 +648,7 @@ gimp_move_tool_cursor_update (GimpTool *tool, GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options); - GimpCursorType cursor = GIMP_CURSOR_BAD; + GimpCursorType cursor = GIMP_CURSOR_MOUSE; GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; @@ -659,8 +659,8 @@ gimp_move_tool_cursor_update (GimpTool *tool, if (options->move_current) { - if (gimp_image_get_active_vectors (display->image)) - cursor = GIMP_CURSOR_MOUSE; + if (! gimp_image_get_active_vectors (display->image)) + modifier = GIMP_CURSOR_MODIFIER_BAD; } else { @@ -668,9 +668,12 @@ gimp_move_tool_cursor_update (GimpTool *tool, coords, 7, 7, NULL, NULL, NULL, NULL, NULL, NULL)) { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; } + else + { + modifier = GIMP_CURSOR_MODIFIER_BAD; + } } } else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION) @@ -678,13 +681,13 @@ gimp_move_tool_cursor_update (GimpTool *tool, tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT; modifier = GIMP_CURSOR_MODIFIER_MOVE; - if (! gimp_channel_is_empty (gimp_image_get_mask (display->image))) - cursor = GIMP_CURSOR_MOUSE; + if (gimp_channel_is_empty (gimp_image_get_mask (display->image))) + modifier = GIMP_CURSOR_MODIFIER_BAD; } else if (options->move_current) { - if (gimp_image_active_drawable (display->image)) - cursor = GIMP_CURSOR_MOUSE; + if (! gimp_image_active_drawable (display->image)) + modifier = GIMP_CURSOR_MODIFIER_BAD; } else { @@ -700,7 +703,6 @@ gimp_move_tool_cursor_update (GimpTool *tool, FUNSCALEX (shell, snap_distance), FUNSCALEY (shell, snap_distance)))) { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; } @@ -711,21 +713,19 @@ gimp_move_tool_cursor_update (GimpTool *tool, if (gimp_image_floating_sel (display->image) && ! gimp_layer_is_floating_sel (layer)) { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_MOVE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR; } - else if (layer == gimp_image_get_active_layer (display->image)) + else if (layer != gimp_image_get_active_layer (display->image)) { - cursor = GIMP_CURSOR_MOUSE; - } - else - { - cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; } } + else + { + modifier = GIMP_CURSOR_MODIFIER_BAD; + } } gimp_tool_control_set_cursor (tool->control, cursor); diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c index f5383dcd1c..141404f6d2 100644 --- a/app/tools/gimpsourcetool.c +++ b/app/tools/gimpsourcetool.c @@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, GdkModifierType state, GimpDisplay *display) { - GimpCloneOptions *options; - GimpCursorType ctype = GIMP_CURSOR_MOUSE; + GimpCloneOptions *options; + GimpCursorType cursor = GIMP_CURSOR_MOUSE; + GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options); @@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool, if (gimp_channel_is_empty (selection) || gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), coords->x, coords->y)) - ctype = GIMP_CURSOR_MOUSE; + { + cursor = GIMP_CURSOR_MOUSE; + } } if (options->clone_type == GIMP_IMAGE_CLONE) { if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) - ctype = GIMP_CURSOR_CROSSHAIR_SMALL; + { + cursor = GIMP_CURSOR_CROSSHAIR_SMALL; + } else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable) - ctype = GIMP_CURSOR_BAD; + { + modifier = GIMP_CURSOR_MODIFIER_BAD; + } } - gimp_tool_control_set_cursor (tool->control, ctype); + gimp_tool_control_set_cursor (tool->control, cursor); + gimp_tool_control_set_cursor_modifier (tool->control, modifier); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); } diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c index 776dc72a32..aa73c9e364 100644 --- a/app/tools/gimptransformtool.c +++ b/app/tools/gimptransformtool.c @@ -643,16 +643,15 @@ gimp_transform_tool_cursor_update (GimpTool *tool, break; case GIMP_TRANSFORM_TYPE_PATH: - if (gimp_image_get_active_vectors (display->image)) - cursor = GIMP_CURSOR_MOUSE; - else - cursor = GIMP_CURSOR_BAD; + if (! gimp_image_get_active_vectors (display->image)) + modifier = GIMP_CURSOR_MODIFIER_BAD; break; } if (tr_tool->use_center && tr_tool->function == TRANSFORM_HANDLE_CENTER) { - modifier = GIMP_CURSOR_MODIFIER_MOVE; + if (modifier != GIMP_CURSOR_MODIFIER_BAD) + modifier = GIMP_CURSOR_MODIFIER_MOVE; } gimp_tool_control_set_cursor (tool->control, cursor); diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c index 219a214c31..bb0fd49e84 100644 --- a/app/tools/gimpvectortool.c +++ b/app/tools/gimpvectortool.c @@ -187,6 +187,7 @@ gimp_vector_tool_init (GimpVectorTool *vector_tool) gimp_tool_control_set_handle_empty_image (tool->control, TRUE); gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS); + gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_PATHS); @@ -1211,13 +1212,8 @@ gimp_vector_tool_cursor_update (GimpTool *tool, GimpDisplay *display) { GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (tool); - GimpCursorType cursor; - GimpToolCursorType tool_cursor; - GimpCursorModifier cmodifier; - - cursor = GIMP_CURSOR_MOUSE; - tool_cursor = GIMP_TOOL_CURSOR_PATHS; - cmodifier = GIMP_CURSOR_MODIFIER_NONE; + GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_PATHS; + GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; switch (vector_tool->function) { @@ -1227,68 +1223,67 @@ gimp_vector_tool_cursor_update (GimpTool *tool, case VECTORS_CREATE_VECTOR: case VECTORS_CREATE_STROKE: - cmodifier = GIMP_CURSOR_MODIFIER_CONTROL; + modifier = GIMP_CURSOR_MODIFIER_CONTROL; break; case VECTORS_ADD_ANCHOR: case VECTORS_INSERT_ANCHOR: tool_cursor = GIMP_TOOL_CURSOR_PATHS_ANCHOR; - cmodifier = GIMP_CURSOR_MODIFIER_PLUS; + modifier = GIMP_CURSOR_MODIFIER_PLUS; break; case VECTORS_DELETE_ANCHOR: tool_cursor = GIMP_TOOL_CURSOR_PATHS_ANCHOR; - cmodifier = GIMP_CURSOR_MODIFIER_MINUS; + modifier = GIMP_CURSOR_MODIFIER_MINUS; break; case VECTORS_DELETE_SEGMENT: tool_cursor = GIMP_TOOL_CURSOR_PATHS_SEGMENT; - cmodifier = GIMP_CURSOR_MODIFIER_MINUS; + modifier = GIMP_CURSOR_MODIFIER_MINUS; break; case VECTORS_MOVE_HANDLE: tool_cursor = GIMP_TOOL_CURSOR_PATHS_CONTROL; - cmodifier = GIMP_CURSOR_MODIFIER_MOVE; + modifier = GIMP_CURSOR_MODIFIER_MOVE; break; case VECTORS_CONVERT_EDGE: tool_cursor = GIMP_TOOL_CURSOR_PATHS_CONTROL; - cmodifier = GIMP_CURSOR_MODIFIER_MINUS; + modifier = GIMP_CURSOR_MODIFIER_MINUS; break; case VECTORS_MOVE_ANCHOR: tool_cursor = GIMP_TOOL_CURSOR_PATHS_ANCHOR; - cmodifier = GIMP_CURSOR_MODIFIER_MOVE; + modifier = GIMP_CURSOR_MODIFIER_MOVE; break; case VECTORS_MOVE_CURVE: tool_cursor = GIMP_TOOL_CURSOR_PATHS_SEGMENT; - cmodifier = GIMP_CURSOR_MODIFIER_MOVE; + modifier = GIMP_CURSOR_MODIFIER_MOVE; break; case VECTORS_MOVE_STROKE: case VECTORS_MOVE_VECTORS: - cmodifier = GIMP_CURSOR_MODIFIER_MOVE; + modifier = GIMP_CURSOR_MODIFIER_MOVE; break; case VECTORS_MOVE_ANCHORSET: tool_cursor = GIMP_TOOL_CURSOR_PATHS_ANCHOR; - cmodifier = GIMP_CURSOR_MODIFIER_MOVE; + modifier = GIMP_CURSOR_MODIFIER_MOVE; break; case VECTORS_CONNECT_STROKES: tool_cursor = GIMP_TOOL_CURSOR_PATHS_SEGMENT; - cmodifier = GIMP_CURSOR_MODIFIER_JOIN; + modifier = GIMP_CURSOR_MODIFIER_JOIN; break; default: - cursor = GIMP_CURSOR_BAD; + modifier = GIMP_CURSOR_MODIFIER_BAD; break; } - gimp_tool_control_set_cursor (tool->control, 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, modifier); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); } diff --git a/app/widgets/gimpcursor.c b/app/widgets/gimpcursor.c index 9b2b181dee..1f9a1148ac 100644 --- a/app/widgets/gimpcursor.c +++ b/app/widgets/gimpcursor.c @@ -112,6 +112,8 @@ #include "cursors/xbm/tool-hand-mask.xbm" /* cursor modifiers */ +#include "cursors/xbm/modifier-bad.xbm" +#include "cursors/xbm/modifier-bad-mask.xbm" #include "cursors/xbm/modifier-plus.xbm" #include "cursors/xbm/modifier-plus-mask.xbm" #include "cursors/xbm/modifier-minus.xbm" @@ -426,6 +428,12 @@ static GimpCursor gimp_cursor_modifiers[] = 0, 0, NULL, NULL, NULL, NULL }, + { + modifier_bad_bits, modifier_bad_mask_bits, + modifier_bad_width, modifier_bad_height, + 0, 0, + modifier_bad, NULL, NULL, NULL + }, { modifier_plus_bits, modifier_plus_mask_bits, modifier_plus_width, modifier_plus_height, diff --git a/app/widgets/widgets-enums.h b/app/widgets/widgets-enums.h index 142cf86143..0e3044a723 100644 --- a/app/widgets/widgets-enums.h +++ b/app/widgets/widgets-enums.h @@ -256,6 +256,7 @@ typedef enum /*< skip >*/ typedef enum /*< skip >*/ { GIMP_CURSOR_MODIFIER_NONE, + GIMP_CURSOR_MODIFIER_BAD, GIMP_CURSOR_MODIFIER_PLUS, GIMP_CURSOR_MODIFIER_MINUS, GIMP_CURSOR_MODIFIER_INTERSECT, diff --git a/cursors/Makefile.am b/cursors/Makefile.am index aa4c2b11f1..83abd3bb85 100644 --- a/cursors/Makefile.am +++ b/cursors/Makefile.am @@ -10,6 +10,7 @@ CURSOR_IMAGES = \ cursor-zoom.png \ \ modifier-anchor.png \ + modifier-bad.png \ modifier-background.png \ modifier-control.png \ modifier-foreground.png \ @@ -76,6 +77,8 @@ EXTRA_DIST = \ xbm/cursor-color-picker.xbm \ xbm/cursor-color-picker-mask.xbm \ \ + xbm/modifier-bad.xbm \ + xbm/modifier-bad-mask.xbm \ xbm/modifier-plus.xbm \ xbm/modifier-plus-mask.xbm \ xbm/modifier-minus.xbm \ diff --git a/cursors/gimp-tool-cursors.xcf b/cursors/gimp-tool-cursors.xcf index 4bb0473b69..55e2f00b4e 100644 Binary files a/cursors/gimp-tool-cursors.xcf and b/cursors/gimp-tool-cursors.xcf differ diff --git a/cursors/modifier-bad.png b/cursors/modifier-bad.png new file mode 100644 index 0000000000..a9b2f95162 Binary files /dev/null and b/cursors/modifier-bad.png differ diff --git a/cursors/xbm/modifier-bad-mask.xbm b/cursors/xbm/modifier-bad-mask.xbm new file mode 100644 index 0000000000..c6d35d69ba --- /dev/null +++ b/cursors/xbm/modifier-bad-mask.xbm @@ -0,0 +1,14 @@ +#define modifier_bad_mask_width 32 +#define modifier_bad_mask_height 32 +static unsigned char modifier_bad_mask_bits[] = { + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0xe0, 0x7f, + 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0xfe, 0x00, 0x00, 0xf0, 0xff, + 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xf7, 0x00, 0x00, 0xe0, 0x7f, + 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x0f, + 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 }; diff --git a/cursors/xbm/modifier-bad.xbm b/cursors/xbm/modifier-bad.xbm new file mode 100644 index 0000000000..43b66351d1 --- /dev/null +++ b/cursors/xbm/modifier-bad.xbm @@ -0,0 +1,14 @@ +#define modifier_bad_width 32 +#define modifier_bad_height 32 +static unsigned char modifier_bad_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xc0, 0x3f, + 0x00, 0x00, 0xc0, 0x38, 0x00, 0x00, 0x60, 0x7c, 0x00, 0x00, 0x60, 0x6e, + 0x00, 0x00, 0x60, 0x67, 0x00, 0x00, 0xe0, 0x63, 0x00, 0x00, 0xc0, 0x31, + 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x0f, 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 };