2001-02-24  Michael Natterer  <mitch@gimp.org>

	* TODO.xml: updated.

	* app/appenums.h
	* app/apptypes.h: prefixed the cursor stuff with "Gimp", added
	the new stock tool cursor enum. Removed the old ToolType enum.

	* app/cursorutil.[ch]
	* app/gdisplay.[ch]: removed the old ToolType enum and prefixed
	the functions with "gimp_". Also stripped all "toggle cursor"
	stuff from the cursor code, so the new API is easier and not
	depending on the tool system.

	All existing tool cursors can be used via the new stock tool
	cursor enum, so no tool has to fiddle around with bitmap cursors.
	There will be an cursorutil function for registering stock tool
	cursor types on the fly.

	* app/disp_callbacks.c
	* app/scroll.[ch]: moved the display scrollbar callbacks from
	scroll.[ch] to disp_callbacks.c. Removed some crap from scroll.h

	* app/tools/tool.[ch]: removed the BitmapCursor pointers from the
	tool class struct and add cursor and toggle cursor IDs to the
	GimpTool struct. Work in progress.

	* app/dialog_handler.c
	* app/tools/bezier_select.c
	* app/tools/blend.c
	* app/tools/bucket_fill.c
	* app/tools/by_color_select.c
	* app/tools/clone.c
	* app/tools/color_picker.c
	* app/tools/convolve.c
	* app/tools/crop.c
	* app/tools/dodgeburn.c
	* app/tools/edit_selection.c
	* app/tools/ellipse_select.c
	* app/tools/flip_tool.c
	* app/tools/free_select.c
	* app/tools/fuzzy_select.c
	* app/tools/ink.c
	* app/tools/iscissors.c
	* app/tools/magnify.c
	* app/tools/measure.c
	* app/tools/move.c
	* app/tools/paint_core.[ch]
	* app/tools/perspective_tool.c
	* app/tools/rect_select.c
	* app/tools/rotate_tool.c
	* app/tools/scale_tool.c
	* app/tools/shear_tool.c
	* app/tools/text_tool.c
	* app/tools/transform_core.[ch]: changed accordingly. Did this
	"blind" for most tools because they don't compile. The changes are
	minimal, so there should be no conflicts.
This commit is contained in:
Michael Natterer 2001-02-24 19:29:47 +00:00 committed by Michael Natterer
parent 04f7131848
commit 17335326d5
88 changed files with 1642 additions and 1309 deletions

View File

@ -1,3 +1,61 @@
2001-02-24 Michael Natterer <mitch@gimp.org>
* TODO.xml: updated.
* app/appenums.h
* app/apptypes.h: prefixed the cursor stuff with "Gimp", added
the new stock tool cursor enum. Removed the old ToolType enum.
* app/cursorutil.[ch]
* app/gdisplay.[ch]: removed the old ToolType enum and prefixed
the functions with "gimp_". Also stripped all "toggle cursor"
stuff from the cursor code, so the new API is easier and not
depending on the tool system.
All existing tool cursors can be used via the new stock tool
cursor enum, so no tool has to fiddle around with bitmap cursors.
There will be an cursorutil function for registering stock tool
cursor types on the fly.
* app/disp_callbacks.c
* app/scroll.[ch]: moved the display scrollbar callbacks from
scroll.[ch] to disp_callbacks.c. Removed some crap from scroll.h
* app/tools/tool.[ch]: removed the BitmapCursor pointers from the
tool class struct and add cursor and toggle cursor IDs to the
GimpTool struct. Work in progress.
* app/dialog_handler.c
* app/tools/bezier_select.c
* app/tools/blend.c
* app/tools/bucket_fill.c
* app/tools/by_color_select.c
* app/tools/clone.c
* app/tools/color_picker.c
* app/tools/convolve.c
* app/tools/crop.c
* app/tools/dodgeburn.c
* app/tools/edit_selection.c
* app/tools/ellipse_select.c
* app/tools/flip_tool.c
* app/tools/free_select.c
* app/tools/fuzzy_select.c
* app/tools/ink.c
* app/tools/iscissors.c
* app/tools/magnify.c
* app/tools/measure.c
* app/tools/move.c
* app/tools/paint_core.[ch]
* app/tools/perspective_tool.c
* app/tools/rect_select.c
* app/tools/rotate_tool.c
* app/tools/scale_tool.c
* app/tools/shear_tool.c
* app/tools/text_tool.c
* app/tools/transform_core.[ch]: changed accordingly. Did this
"blind" for most tools because they don't compile. The changes are
minimal, so there should be no conflicts.
2001-02-24 Michael Natterer <mitch@gimp.org>
* app/commands.[ch]: added cmd_callbacks for the toolbox and

View File

@ -106,7 +106,7 @@
</contact>
</entry>
<entry size="medium" difficulty="medium" status="10%" target="1.4">
<entry size="medium" difficulty="medium" status="30%" target="1.4">
<title>Cleanup existing internal objects</title>
<description>
<p>
@ -120,7 +120,7 @@
</contact>
</entry>
<entry size="medium" difficulty="advanced" status="0%" target="1.4">
<entry size="medium" difficulty="advanced" status="80%" target="1.4">
<title>Generic data structures</title>
<description>
<p>
@ -133,7 +133,7 @@
</contact>
</entry>
<entry size="medium" difficulty="medium" status="0%" target="1.4">
<entry size="medium" difficulty="medium" status="70%" target="1.4">
<title>Generic object container(s)</title>
<description>
<p>
@ -173,13 +173,14 @@
<section>
<title>LibGimp</title>
<entry size="medium" difficulty="medium" status="40%" target="1.4">
<entry size="medium" difficulty="medium" status="50%" target="1.4">
<title>Restructure LibGimp</title>
<description>
<p>
Put libgimp, libgimpui (and new libs) into their own subdirectories
under a toplevel libs directory. Install all header files under
$prefix/include/gimp/1.3/ and change gimptool accordingly.
Put libgimp, libgimpui (and new libs) into their own
subdirectories. Install all header files under
$prefix/include/gimp-MAJOR.MINOR/ and change gimptool
accordingly.
</p>
</description>
<contact>
@ -232,7 +233,7 @@
<section>
<title>User Interface</title>
<entry size="medium" difficulty="medium" status="0%" target="1.4">
<entry size="medium" difficulty="medium" status="70%" target="1.4">
<title>Abstract Container Views</title>
<description>
<p>

View File

@ -230,53 +230,6 @@ typedef enum /*< skip >*/
RECREATE
} ToolAction;
/* Tool types */
typedef enum /*< skip >*/
{
TOOL_TYPE_NONE = -1,
FIRST_TOOLBOX_TOOL = 0,
RECT_SELECT = FIRST_TOOLBOX_TOOL,
ELLIPSE_SELECT,
FREE_SELECT,
FUZZY_SELECT,
BEZIER_SELECT,
ISCISSORS,
MOVE,
MAGNIFY,
CROP,
ROTATE,
SCALE,
SHEAR,
PERSPECTIVE,
FLIP,
TEXT,
COLOR_PICKER,
BUCKET_FILL,
BLEND,
PENCIL,
PAINTBRUSH,
AIRBRUSH,
INK,
CLONE,
ERASER,
SMUDGE,
CONVOLVE,
DODGEBURN,
MEASURE,
LAST_TOOLBOX_TOOL = MEASURE,
/* Non-toolbox tools */
BY_COLOR_SELECT,
COLOR_BALANCE,
BRIGHTNESS_CONTRAST,
HUE_SATURATION,
POSTERIZE,
THRESHOLD,
CURVES,
LEVELS,
HISTOGRAM
} ToolType;
/* possible transform functions */
typedef enum /*< skip >*/
{
@ -306,19 +259,56 @@ typedef enum /*< skip >*/
typedef enum /*< skip >*/
{
CURSOR_MODIFIER_NONE,
CURSOR_MODIFIER_PLUS,
CURSOR_MODIFIER_MINUS,
CURSOR_MODIFIER_INTERSECT,
CURSOR_MODIFIER_MOVE,
CURSOR_MODIFIER_RESIZE,
CURSOR_MODIFIER_CONTROL,
CURSOR_MODIFIER_ANCHOR,
CURSOR_MODIFIER_FOREGROUND,
CURSOR_MODIFIER_BACKGROUND,
CURSOR_MODIFIER_PATTERN,
CURSOR_MODIFIER_HAND
} CursorModifier;
GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR,
GIMP_FREE_SELECT_TOOL_CURSOR,
GIMP_FUZZY_SELECT_TOOL_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_SCISSORS_TOOL_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_ZOOM_TOOL_CURSOR,
GIMP_CROP_TOOL_CURSOR,
GIMP_RESIZE_TOOL_CURSOR,
GIMP_ROTATE_TOOL_CURSOR,
GIMP_SHEAR_TOOL_CURSOR,
GIMP_PERSPECTIVE_TOOL_CURSOR,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR,
GIMP_FLIP_VERTICAL_TOOL_CURSOR,
GIMP_TEXT_TOOL_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_BUCKET_FILL_TOOL_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_PENCIL_TOOL_CURSOR,
GIMP_PAINTBRUSH_TOOL_CURSOR,
GIMP_AIRBRUSH_TOOL_CURSOR,
GIMP_INK_TOOL_CURSOR,
GIMP_CLONE_TOOL_CURSOR,
GIMP_ERASER_TOOL_CURSOR,
GIMP_SMUDGE_TOOL_CURSOR,
GIMP_BLUR_TOOL_CURSOR,
GIMP_DODGE_TOOL_CURSOR,
GIMP_BURN_TOOL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY
} GimpToolCursorType;
typedef enum /*< skip >*/
{
GIMP_CURSOR_MODIFIER_NONE,
GIMP_CURSOR_MODIFIER_PLUS,
GIMP_CURSOR_MODIFIER_MINUS,
GIMP_CURSOR_MODIFIER_INTERSECT,
GIMP_CURSOR_MODIFIER_MOVE,
GIMP_CURSOR_MODIFIER_RESIZE,
GIMP_CURSOR_MODIFIER_CONTROL,
GIMP_CURSOR_MODIFIER_ANCHOR,
GIMP_CURSOR_MODIFIER_FOREGROUND,
GIMP_CURSOR_MODIFIER_BACKGROUND,
GIMP_CURSOR_MODIFIER_PATTERN,
GIMP_CURSOR_MODIFIER_HAND,
GIMP_LAST_CURSOR_MODIFIER_ENTRY
} GimpCursorModifier;
#endif /* __APPENUMS_H__ */

View File

@ -105,7 +105,7 @@ typedef struct _Argument Argument;
typedef struct _BezierPoint BezierPoint;
typedef struct _BezierSelect BezierSelect;
typedef struct _BitmapCursor BitmapCursor;
typedef struct _GimpBitmapCursor GimpBitmapCursor;
typedef struct _BoundSeg BoundSeg;

View File

@ -702,16 +702,16 @@ blend_cursor_update (Tool *tool,
{
case INDEXED_GIMAGE:
case INDEXEDA_GIMAGE:
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
default:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -158,9 +158,8 @@ gdisplay_new (GimpImage *gimage,
gdisp->disp_xoffset = 0;
gdisp->disp_yoffset = 0;
gdisp->current_cursor = (GdkCursorType) -1;
gdisp->cursor_tool = TOOL_TYPE_NONE;
gdisp->cursor_modifier = CURSOR_MODIFIER_NONE;
gdisp->toggle_cursor = FALSE;
gdisp->tool_cursor = GIMP_TOOL_CURSOR_NONE;
gdisp->cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
@ -210,10 +209,10 @@ gdisplay_new (GimpImage *gimage,
g_hash_table_insert (display_ht, gdisp->canvas, gdisp);
/* set the current tool cursor */
gdisplay_install_tool_cursor (gdisp, default_gdisplay_cursor,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
default_gdisplay_cursor,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
@ -1313,10 +1312,10 @@ gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y)
{
gint new_cursor;
gint new_cursor;
gchar buffer[CURSOR_STR_LENGTH];
gint t_x;
gint t_y;
gint t_x;
gint t_y;
new_cursor = gdisp->draw_cursor && gdisp->proximity;
@ -1395,8 +1394,8 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
{
/* Set a proper size for the coordinates display in the statusbar. */
gchar buffer[CURSOR_STR_LENGTH];
gint cursor_label_width;
gint label_frame_size_difference;
gint cursor_label_width;
gint label_frame_size_difference;
if (gdisp->dot_for_dot)
{
@ -1837,12 +1836,11 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install)
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install)
{
if (cursor_type != GIMP_BAD_CURSOR)
{
@ -1857,44 +1855,39 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
case CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_type = TOOL_TYPE_NONE;
modifier = CURSOR_MODIFIER_NONE;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
}
}
if (gdisp->current_cursor != cursor_type ||
gdisp->cursor_tool != tool_type ||
gdisp->cursor_modifier != modifier ||
gdisp->toggle_cursor != toggle_cursor ||
if (gdisp->current_cursor != cursor_type ||
gdisp->tool_cursor != tool_cursor ||
gdisp->cursor_modifier != modifier ||
always_install)
{
gdisp->current_cursor = cursor_type;
gdisp->cursor_tool = tool_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gdisp->toggle_cursor = toggle_cursor;
change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_type,
modifier,
toggle_cursor);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
}
}
void
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
if (!gdisp->using_override_cursor)
gdisplay_real_install_tool_cursor (gdisp,
cursor_type,
tool_type,
tool_cursor,
modifier,
toggle_cursor,
FALSE);
}
@ -1908,11 +1901,11 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
{
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
change_win_cursor (gdisp->canvas->window,
cursor_type,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}
@ -1924,9 +1917,8 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
gdisp->using_override_cursor = FALSE;
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
gdisp->tool_cursor,
gdisp->cursor_modifier,
gdisp->toggle_cursor,
TRUE);
}
}
@ -1934,7 +1926,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
gimp_unset_win_cursor (gdisp->canvas->window);
}
void

View File

@ -152,17 +152,16 @@ struct _GDisplay
GSList *update_areas; /* Update areas list */
GSList *display_areas; /* Display areas list */
GdkCursorType current_cursor; /* Currently installed cursor */
ToolType cursor_tool; /* Cursor for which tool? */
CursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
gboolean toggle_cursor; /* Cursor toggled? */
GdkCursorType current_cursor; /* Currently installed main cursor */
GimpToolCursorType tool_cursor; /* Current Tool cursor */
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
GdkCursorType override_cursor; /* Overriding cursor (ie. hourglass) */
gboolean using_override_cursor; /* is the cursor overridden? (ie. hourglass)*/
gboolean draw_cursor; /* should we draw software cursor ? */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gboolean proximity; /* is a device in proximity of gdisplay ? */
gboolean have_cursor; /* is cursor currently drawn ? */
@ -193,21 +192,19 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
gdouble *, gdouble *, gboolean);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_set_menu_sensitivity (GDisplay *);
void gdisplay_expose_area (GDisplay *, gint, gint, gint, gint);

View File

@ -26,8 +26,8 @@
#include "cursorutil.h"
#include "dialog_handler.h"
#include "gdisplay.h" /* for gdisplay_*_override_cursor() */
#include "tools/tool.h"
/* standard gimp cursors */
#include "cursors/mouse.xbm"
#include "cursors/mouse_mask.xbm"
#include "cursors/crosshair.xbm"
@ -41,6 +41,68 @@
#include "cursors/dropper.xbm"
#include "cursors/dropper_mask.xbm"
/* stock tool cursors */
#include "cursors/rect_select_small.xbm"
#include "cursors/rect_select_small_mask.xbm"
#include "cursors/ellipse_select_small.xbm"
#include "cursors/ellipse_select_small_mask.xbm"
#include "cursors/free_select_small.xbm"
#include "cursors/free_select_small_mask.xbm"
#include "cursors/fuzzy_select_small.xbm"
#include "cursors/fuzzy_select_small_mask.xbm"
#include "cursors/bezier_select_small.xbm"
#include "cursors/bezier_select_small_mask.xbm"
#include "cursors/scissors_small.xbm"
#include "cursors/scissors_small_mask.xbm"
#include "cursors/move_small.xbm"
#include "cursors/move_small_mask.xbm"
#include "cursors/zoom_small.xbm"
#include "cursors/zoom_small_mask.xbm"
#include "cursors/crop_small.xbm"
#include "cursors/crop_small_mask.xbm"
#include "cursors/resize_small.xbm"
#include "cursors/resize_small_mask.xbm"
#include "cursors/rotate_small.xbm"
#include "cursors/rotate_small_mask.xbm"
#include "cursors/shear_small.xbm"
#include "cursors/shear_small_mask.xbm"
#include "cursors/perspective_small.xbm"
#include "cursors/perspective_small_mask.xbm"
#include "cursors/flip_horizontal_small.xbm"
#include "cursors/flip_horizontal_small_mask.xbm"
#include "cursors/flip_vertical_small.xbm"
#include "cursors/flip_vertical_small_mask.xbm"
#include "cursors/text_small.xbm"
#include "cursors/text_small_mask.xbm"
#include "cursors/dropper_small.xbm"
#include "cursors/dropper_small_mask.xbm"
#include "cursors/bucket_fill_small.xbm"
#include "cursors/bucket_fill_small_mask.xbm"
#include "cursors/blend_small.xbm"
#include "cursors/blend_small_mask.xbm"
#include "cursors/pencil_small.xbm"
#include "cursors/pencil_small_mask.xbm"
#include "cursors/paintbrush_small.xbm"
#include "cursors/paintbrush_small_mask.xbm"
#include "cursors/eraser_small.xbm"
#include "cursors/eraser_small_mask.xbm"
#include "cursors/airbrush_small.xbm"
#include "cursors/airbrush_small_mask.xbm"
#include "cursors/clone_small.xbm"
#include "cursors/clone_small_mask.xbm"
#include "cursors/blur_small.xbm"
#include "cursors/blur_small_mask.xbm"
#include "cursors/ink_small.xbm"
#include "cursors/ink_small_mask.xbm"
#include "cursors/dodge_small.xbm"
#include "cursors/dodge_small_mask.xbm"
#include "cursors/burn_small.xbm"
#include "cursors/burn_small_mask.xbm"
#include "cursors/smudge_small.xbm"
#include "cursors/smudge_small_mask.xbm"
#include "cursors/measure_small.xbm"
#include "cursors/measure_small_mask.xbm"
/* modifiers */
#include "cursors/plus.xbm"
#include "cursors/plus_mask.xbm"
@ -69,7 +131,8 @@
/* FIXME: gimp_busy HACK */
gboolean gimp_busy = FALSE;
static BitmapCursor gimp_cursors[] =
static GimpBitmapCursor gimp_cursors[] =
/* these have to match up with the enum in cursorutil.h */
{
{
@ -104,24 +167,174 @@ static BitmapCursor gimp_cursors[] =
}
};
enum
static GimpBitmapCursor gimp_stock_tool_cursors[] =
/* these have to match up with the enum in appenums.h */
{
GIMP_PLUS_CURSOR = GIMP_LAST_CURSOR_ENTRY + 1,
GIMP_MINUS_CURSOR,
GIMP_INTERSECT_CURSOR,
GIMP_MOVE_CURSOR,
GIMP_RESIZE_CURSOR,
GIMP_CONTROL_CURSOR,
GIMP_ANCHOR_CURSOR,
GIMP_FOREGROUND_CURSOR,
GIMP_BACKGROUND_CURSOR,
GIMP_PATTERN_CURSOR,
GIMP_HAND_CURSOR
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
},
{
rect_select_small_bits, rect_select_small_mask_bits,
rect_select_small_width, rect_select_small_height,
0, 0, NULL, NULL, NULL
},
{
ellipse_select_small_bits, ellipse_select_small_mask_bits,
ellipse_select_small_width, ellipse_select_small_height,
0, 0, NULL, NULL, NULL
},
{
free_select_small_bits, free_select_small_mask_bits,
free_select_small_width, free_select_small_height,
0, 0, NULL, NULL, NULL
},
{
fuzzy_select_small_bits, fuzzy_select_small_mask_bits,
fuzzy_select_small_width, fuzzy_select_small_height,
0, 0, NULL, NULL, NULL
},
{
bezier_select_small_bits, bezier_select_small_mask_bits,
bezier_select_small_width, bezier_select_small_height,
0, 0, NULL, NULL, NULL
},
{
scissors_small_bits, scissors_small_mask_bits,
scissors_small_width, scissors_small_height,
0, 0, NULL, NULL, NULL
},
{
move_small_bits, move_small_mask_bits,
move_small_width, move_small_height,
0, 0, NULL, NULL, NULL
},
{
zoom_small_bits, zoom_small_mask_bits,
zoom_small_width, zoom_small_height,
0, 0, NULL, NULL, NULL
},
{
crop_small_bits, crop_small_mask_bits,
crop_small_width, crop_small_height,
0, 0, NULL, NULL, NULL
},
{
resize_small_bits, resize_small_mask_bits,
resize_small_width, resize_small_height,
0, 0, NULL, NULL, NULL
},
{
rotate_small_bits, rotate_small_mask_bits,
rotate_small_width, rotate_small_height,
0, 0, NULL, NULL, NULL
},
{
shear_small_bits, shear_small_mask_bits,
shear_small_width, shear_small_height,
0, 0, NULL, NULL, NULL
},
{
perspective_small_bits, perspective_small_mask_bits,
perspective_small_width, perspective_small_height,
0, 0, NULL, NULL, NULL
},
{
flip_horizontal_small_bits, flip_horizontal_small_mask_bits,
flip_horizontal_small_width, flip_horizontal_small_height,
0, 0, NULL, NULL, NULL
},
{
flip_vertical_small_bits, flip_vertical_small_mask_bits,
flip_vertical_small_width, flip_vertical_small_height,
0, 0, NULL, NULL, NULL
},
{
text_small_bits, text_small_mask_bits,
text_small_width, text_small_height,
0, 0, NULL, NULL, NULL
},
{
dropper_small_bits, dropper_small_mask_bits,
dropper_small_width, dropper_small_height,
0, 0, NULL, NULL, NULL
},
{
bucket_fill_small_bits, bucket_fill_small_mask_bits,
bucket_fill_small_width, bucket_fill_small_height,
0, 0, NULL, NULL, NULL
},
{
blend_small_bits, blend_small_mask_bits,
blend_small_width, blend_small_height,
0, 0, NULL, NULL, NULL
},
{
pencil_small_bits, pencil_small_mask_bits,
pencil_small_width, pencil_small_height,
0, 0, NULL, NULL, NULL
},
{
paintbrush_small_bits, paintbrush_small_mask_bits,
paintbrush_small_width, paintbrush_small_height,
0, 0, NULL, NULL, NULL
},
{
airbrush_small_bits, airbrush_small_mask_bits,
airbrush_small_width, airbrush_small_height,
0, 0, NULL, NULL, NULL
},
{
ink_small_bits, ink_small_mask_bits,
ink_small_width, ink_small_height,
0, 0, NULL, NULL, NULL
},
{
clone_small_bits, clone_small_mask_bits,
clone_small_width, clone_small_height,
0, 0, NULL, NULL, NULL
},
{
eraser_small_bits, eraser_small_mask_bits,
eraser_small_width, eraser_small_height,
0, 0, NULL, NULL, NULL
},
{
smudge_small_bits, smudge_small_mask_bits,
smudge_small_width, smudge_small_height,
0, 0, NULL, NULL, NULL
},
{
blur_small_bits, blur_small_mask_bits,
blur_small_width, blur_small_height,
0, 0, NULL, NULL, NULL
},
{
dodge_small_bits, dodge_small_mask_bits,
dodge_small_width, dodge_small_height,
0, 0, NULL, NULL, NULL
},
{
burn_small_bits, burn_small_mask_bits,
burn_small_width, burn_small_height,
0, 0, NULL, NULL, NULL
},
{
measure_small_bits, measure_small_mask_bits,
measure_small_width, measure_small_height,
0, 0, NULL, NULL, NULL
}
};
static BitmapCursor modifier_cursors[] =
/* these have to match up with the enum above */
static GimpBitmapCursor gimp_modifier_cursors[] =
/* these have to match up with the enum in appenums.h */
{
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
},
{
plus_bits, plus_mask_bits,
plus_width, plus_height,
@ -185,7 +398,7 @@ static gboolean pending_removebusy = FALSE;
static void
create_cursor_bitmaps (BitmapCursor *bmcursor)
create_cursor_bitmaps (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL)
bmcursor->bitmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits,
@ -201,7 +414,7 @@ create_cursor_bitmaps (BitmapCursor *bmcursor)
}
static void
create_cursor (BitmapCursor *bmcursor)
create_cursor (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
@ -226,14 +439,12 @@ create_cursor (BitmapCursor *bmcursor)
}
static void
gimp_change_win_cursor (GdkWindow *win,
GimpCursorType curtype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gimp_change_win_cursor_internal (GdkWindow *window,
GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
GimpCursorType modtype = GIMP_PLUS_CURSOR;
GdkCursor *cursor;
GdkBitmap *bitmap;
GdkBitmap *mask;
@ -246,122 +457,97 @@ gimp_change_win_cursor (GdkWindow *win,
gint width;
gint height;
BitmapCursor *bmcursor = NULL;
BitmapCursor *bmmodifier = NULL;
BitmapCursor *bmtool = NULL;
GimpBitmapCursor *bmcursor = NULL;
GimpBitmapCursor *bmmodifier = NULL;
GimpBitmapCursor *bmtool = NULL;
g_return_if_fail (curtype < GIMP_LAST_CURSOR_ENTRY);
g_return_if_fail (window != NULL);
g_return_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY);
/* allow the small tool cursor only with the standard mouse,
* the small crosshair and the bad cursor
*/
if (curtype != GIMP_MOUSE_CURSOR &&
curtype != GIMP_CROSSHAIR_SMALL_CURSOR &&
curtype != GIMP_BAD_CURSOR)
tool_type = TOOL_TYPE_NONE;
if (cursor_type != GIMP_MOUSE_CURSOR &&
cursor_type != GIMP_CROSSHAIR_SMALL_CURSOR &&
cursor_type != GIMP_BAD_CURSOR)
{
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
curtype -= GIMP_MOUSE_CURSOR;
bmcursor = &gimp_cursors[(int)curtype];
cursor_type -= GIMP_MOUSE_CURSOR;
bmcursor = &gimp_cursors[(gint) cursor_type];
if (modifier == CURSOR_MODIFIER_NONE &&
tool_type == TOOL_TYPE_NONE)
/* if there are no modifiers, we can show the cursor immediately
*/
if (modifier == GIMP_CURSOR_MODIFIER_NONE &&
tool_cursor == GIMP_TOOL_CURSOR_NONE)
{
if (bmcursor->cursor == NULL)
create_cursor (bmcursor);
gdk_window_set_cursor (win, bmcursor->cursor);
gdk_window_set_cursor (window, bmcursor->cursor);
return;
}
switch (modifier)
else if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
{
case CURSOR_MODIFIER_PLUS:
modtype = GIMP_PLUS_CURSOR;
break;
case CURSOR_MODIFIER_MINUS:
modtype = GIMP_MINUS_CURSOR;
break;
case CURSOR_MODIFIER_INTERSECT:
modtype = GIMP_INTERSECT_CURSOR;
break;
case CURSOR_MODIFIER_MOVE:
modtype = GIMP_MOVE_CURSOR;
break;
case CURSOR_MODIFIER_RESIZE:
modtype = GIMP_RESIZE_CURSOR;
break;
case CURSOR_MODIFIER_CONTROL:
modtype = GIMP_CONTROL_CURSOR;
break;
case CURSOR_MODIFIER_ANCHOR:
modtype = GIMP_ANCHOR_CURSOR;
break;
case CURSOR_MODIFIER_FOREGROUND:
modtype = GIMP_FOREGROUND_CURSOR;
break;
case CURSOR_MODIFIER_BACKGROUND:
modtype = GIMP_BACKGROUND_CURSOR;
break;
case CURSOR_MODIFIER_PATTERN:
modtype = GIMP_PATTERN_CURSOR;
break;
case CURSOR_MODIFIER_HAND:
modtype = GIMP_HAND_CURSOR;
break;
default:
break;
create_cursor_bitmaps (bmcursor);
}
if (modifier != CURSOR_MODIFIER_NONE)
/* prepare the tool cursor */
if (tool_cursor < GIMP_TOOL_CURSOR_NONE ||
tool_cursor >= GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY)
{
modtype -= GIMP_PLUS_CURSOR;
bmmodifier = &modifier_cursors[(int)modtype];
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
#warning FIXME (check if toggle tool cursor work)
#if 0
if (tool_type != TOOL_TYPE_NONE)
if (tool_cursor != GIMP_TOOL_CURSOR_NONE)
{
if (toggle_cursor)
bmtool = &gimp_stock_tool_cursors[(gint) tool_cursor];
if (bmtool->bitmap == NULL ||
bmtool->mask == NULL)
{
if (tool_info[(gint) tool_type].toggle_cursor.bits != NULL &&
tool_info[(gint) tool_type].toggle_cursor.mask_bits != NULL)
bmtool = &tool_info[(gint) tool_type].toggle_cursor;
}
else
{
if (tool_info[(gint) tool_type].tool_cursor.bits != NULL &&
tool_info[(gint) tool_type].tool_cursor.mask_bits != NULL)
bmtool = &tool_info[(gint) tool_type].tool_cursor;
create_cursor_bitmaps (bmtool);
}
}
#endif
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
create_cursor_bitmaps (bmcursor);
/* prepare the cursor modifier */
if (bmmodifier &&
(bmmodifier->bitmap == NULL ||
bmmodifier->mask == NULL))
create_cursor_bitmaps (bmmodifier);
if (modifier < GIMP_CURSOR_MODIFIER_NONE ||
modifier >= GIMP_LAST_CURSOR_MODIFIER_ENTRY)
{
modifier = GIMP_CURSOR_MODIFIER_NONE;
}
if (bmtool &&
(bmtool->bitmap == NULL ||
bmtool->mask == NULL))
create_cursor_bitmaps (bmtool);
if (modifier != GIMP_CURSOR_MODIFIER_NONE)
{
bmmodifier = &gimp_modifier_cursors[(gint) modifier];
if (bmmodifier->bitmap == NULL ||
bmmodifier->mask == NULL)
{
create_cursor_bitmaps (bmmodifier);
}
}
if (gc == NULL)
gc = gdk_gc_new (bmcursor->bitmap);
gdk_window_get_size (bmcursor->bitmap, &width, &height);
/* new bitmap and mask for on-the-fly cursor creation */
bitmap = gdk_pixmap_new (NULL, width, height, 1);
mask = gdk_pixmap_new (NULL, width, height, 1);
color.pixel = 1;
gdk_gc_set_foreground (gc, &color);
/* first draw the bitmap completely ... */
gdk_draw_pixmap (bitmap, gc, bmcursor->bitmap,
0, 0, 0, 0, width, height);
@ -381,6 +567,8 @@ gimp_change_win_cursor (GdkWindow *win,
gdk_gc_set_clip_mask (gc, NULL);
}
/* ... then the mask */
gdk_draw_pixmap (mask, gc, bmcursor->mask,
0, 0, 0, 0, width, height);
@ -408,37 +596,38 @@ gimp_change_win_cursor (GdkWindow *win,
&fg, &bg,
bmcursor->x_hot,
bmcursor->y_hot);
gdk_window_set_cursor (win, cursor);
gdk_window_set_cursor (window, cursor);
gdk_cursor_destroy (cursor);
gdk_bitmap_unref (bitmap);
gdk_bitmap_unref (mask);
}
void
change_win_cursor (GdkWindow *win,
GdkCursorType cursortype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gimp_change_win_cursor (GdkWindow *win,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
if (cursortype > GDK_LAST_CURSOR)
if (cursor_type > GDK_LAST_CURSOR)
{
gimp_change_win_cursor (win, (GimpCursorType) cursortype,
tool_type,
modifier,
toggle_cursor);
gimp_change_win_cursor_internal (win,
(GimpCursorType) cursor_type,
tool_cursor,
modifier);
return;
}
cursor = gdk_cursor_new (cursortype);
cursor = gdk_cursor_new (cursor_type);
gdk_window_set_cursor (win, cursor);
gdk_cursor_destroy (cursor);
}
void
unset_win_cursor (GdkWindow *win)
gimp_unset_win_cursor (GdkWindow *win)
{
gdk_window_set_cursor (win, NULL);
}

View File

@ -20,7 +20,7 @@
#define __CURSORUTIL_H__
struct _BitmapCursor
struct _GimpBitmapCursor
{
guchar *bits;
guchar *mask_bits;
@ -31,6 +31,7 @@ struct _BitmapCursor
GdkCursor *cursor;
};
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
@ -42,22 +43,23 @@ typedef enum
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
/* FIXME: gimp_busy HACK */
extern gboolean gimp_busy;
void change_win_cursor (GdkWindow *win,
GdkCursorType curtype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor);
void unset_win_cursor (GdkWindow *win);
void gimp_change_win_cursor (GdkWindow *win,
GdkCursorType curtype,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gimp_unset_win_cursor (GdkWindow *win);
void gimp_add_busy_cursors_until_idle (void);
void gimp_add_busy_cursors (void);
gint gimp_remove_busy_cursors (gpointer data);
gint gimp_remove_busy_cursors (gpointer data);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
#endif /* __CURSORUTIL_H__ */

View File

@ -172,21 +172,27 @@ dialog_idle_all (void)
}
else if(GTK_WIDGET_VISIBLE (dstate->dialog))
{
change_win_cursor (dstate->dialog->window, GDK_WATCH,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (dstate->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}
if (toolbox_shell && GTK_WIDGET_VISIBLE (toolbox_shell->dialog))
{
change_win_cursor (toolbox_shell->dialog->window, GDK_WATCH,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (toolbox_shell->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
if (fileload_shell && GTK_WIDGET_VISIBLE (fileload_shell->dialog))
{
change_win_cursor (fileload_shell->dialog->window, GDK_WATCH,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (fileload_shell->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}
@ -215,18 +221,18 @@ dialog_unidle_all (void)
}
else if (GTK_WIDGET_VISIBLE (dstate->dialog))
{
unset_win_cursor (dstate->dialog->window);
gimp_unset_win_cursor (dstate->dialog->window);
}
}
if (toolbox_shell && GTK_WIDGET_VISIBLE (toolbox_shell->dialog))
{
unset_win_cursor (toolbox_shell->dialog->window);
gimp_unset_win_cursor (toolbox_shell->dialog->window);
}
if (fileload_shell && GTK_WIDGET_VISIBLE (fileload_shell->dialog))
{
unset_win_cursor (fileload_shell->dialog->window);
gimp_unset_win_cursor (fileload_shell->dialog->window);
}
}

View File

@ -57,11 +57,6 @@
#include "libgimp/gimpintl.h"
/* Function declarations */
static void gdisplay_check_device_cursor (GDisplay *gdisp);
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
@ -129,6 +124,20 @@ key_to_state (gint key)
}
}
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gint
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
@ -187,10 +196,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
/* set up the scrollbar observers */
gtk_signal_connect (GTK_OBJECT (gdisp->hsbdata), "value_changed",
GTK_SIGNAL_FUNC(scrollbar_horz_update),
GTK_SIGNAL_FUNC (gdisplay_hscrollbar_update),
gdisp);
gtk_signal_connect (GTK_OBJECT (gdisp->vsbdata), "value_changed",
GTK_SIGNAL_FUNC (scrollbar_vert_update),
GTK_SIGNAL_FUNC (gdisplay_vscrollbar_update),
gdisp);
/* setup scale properly */
@ -643,10 +652,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
else if (gimp_image_is_empty (gdisp->gimage))
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}

View File

@ -57,11 +57,6 @@
#include "libgimp/gimpintl.h"
/* Function declarations */
static void gdisplay_check_device_cursor (GDisplay *gdisp);
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
@ -129,6 +124,20 @@ key_to_state (gint key)
}
}
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gint
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
@ -187,10 +196,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
/* set up the scrollbar observers */
gtk_signal_connect (GTK_OBJECT (gdisp->hsbdata), "value_changed",
GTK_SIGNAL_FUNC(scrollbar_horz_update),
GTK_SIGNAL_FUNC (gdisplay_hscrollbar_update),
gdisp);
gtk_signal_connect (GTK_OBJECT (gdisp->vsbdata), "value_changed",
GTK_SIGNAL_FUNC (scrollbar_vert_update),
GTK_SIGNAL_FUNC (gdisplay_vscrollbar_update),
gdisp);
/* setup scale properly */
@ -643,10 +652,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
else if (gimp_image_is_empty (gdisp->gimage))
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}

View File

@ -43,33 +43,6 @@
/* These are the values of the initial pointer grab */
static gint startx, starty;
gboolean
scrollbar_vert_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
return FALSE;
}
gboolean
scrollbar_horz_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
return FALSE;
}
void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
@ -77,8 +50,10 @@ start_grab_and_scroll (GDisplay *gdisp,
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
change_win_cursor (gdisp->canvas->window, GDK_FLEUR,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
@ -88,9 +63,8 @@ end_grab_and_scroll (GDisplay *gdisp,
{
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
CURSOR_MODIFIER_NONE,
FALSE,
gdisp->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE,
TRUE);
}

View File

@ -20,18 +20,6 @@
#define __SCROLL_H__
/* app init and exit routines */
void init_scrolling (void);
void free_scrolling (void);
/* routines for scrolling the image via the scrollbars */
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);

View File

@ -158,9 +158,8 @@ gdisplay_new (GimpImage *gimage,
gdisp->disp_xoffset = 0;
gdisp->disp_yoffset = 0;
gdisp->current_cursor = (GdkCursorType) -1;
gdisp->cursor_tool = TOOL_TYPE_NONE;
gdisp->cursor_modifier = CURSOR_MODIFIER_NONE;
gdisp->toggle_cursor = FALSE;
gdisp->tool_cursor = GIMP_TOOL_CURSOR_NONE;
gdisp->cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
@ -210,10 +209,10 @@ gdisplay_new (GimpImage *gimage,
g_hash_table_insert (display_ht, gdisp->canvas, gdisp);
/* set the current tool cursor */
gdisplay_install_tool_cursor (gdisp, default_gdisplay_cursor,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
default_gdisplay_cursor,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
@ -1313,10 +1312,10 @@ gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y)
{
gint new_cursor;
gint new_cursor;
gchar buffer[CURSOR_STR_LENGTH];
gint t_x;
gint t_y;
gint t_x;
gint t_y;
new_cursor = gdisp->draw_cursor && gdisp->proximity;
@ -1395,8 +1394,8 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
{
/* Set a proper size for the coordinates display in the statusbar. */
gchar buffer[CURSOR_STR_LENGTH];
gint cursor_label_width;
gint label_frame_size_difference;
gint cursor_label_width;
gint label_frame_size_difference;
if (gdisp->dot_for_dot)
{
@ -1837,12 +1836,11 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install)
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install)
{
if (cursor_type != GIMP_BAD_CURSOR)
{
@ -1857,44 +1855,39 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
case CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_type = TOOL_TYPE_NONE;
modifier = CURSOR_MODIFIER_NONE;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
}
}
if (gdisp->current_cursor != cursor_type ||
gdisp->cursor_tool != tool_type ||
gdisp->cursor_modifier != modifier ||
gdisp->toggle_cursor != toggle_cursor ||
if (gdisp->current_cursor != cursor_type ||
gdisp->tool_cursor != tool_cursor ||
gdisp->cursor_modifier != modifier ||
always_install)
{
gdisp->current_cursor = cursor_type;
gdisp->cursor_tool = tool_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gdisp->toggle_cursor = toggle_cursor;
change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_type,
modifier,
toggle_cursor);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
}
}
void
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
if (!gdisp->using_override_cursor)
gdisplay_real_install_tool_cursor (gdisp,
cursor_type,
tool_type,
tool_cursor,
modifier,
toggle_cursor,
FALSE);
}
@ -1908,11 +1901,11 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
{
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
change_win_cursor (gdisp->canvas->window,
cursor_type,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}
@ -1924,9 +1917,8 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
gdisp->using_override_cursor = FALSE;
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
gdisp->tool_cursor,
gdisp->cursor_modifier,
gdisp->toggle_cursor,
TRUE);
}
}
@ -1934,7 +1926,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
gimp_unset_win_cursor (gdisp->canvas->window);
}
void

View File

@ -152,17 +152,16 @@ struct _GDisplay
GSList *update_areas; /* Update areas list */
GSList *display_areas; /* Display areas list */
GdkCursorType current_cursor; /* Currently installed cursor */
ToolType cursor_tool; /* Cursor for which tool? */
CursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
gboolean toggle_cursor; /* Cursor toggled? */
GdkCursorType current_cursor; /* Currently installed main cursor */
GimpToolCursorType tool_cursor; /* Current Tool cursor */
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
GdkCursorType override_cursor; /* Overriding cursor (ie. hourglass) */
gboolean using_override_cursor; /* is the cursor overridden? (ie. hourglass)*/
gboolean draw_cursor; /* should we draw software cursor ? */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gboolean proximity; /* is a device in proximity of gdisplay ? */
gboolean have_cursor; /* is cursor currently drawn ? */
@ -193,21 +192,19 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
gdouble *, gdouble *, gboolean);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_set_menu_sensitivity (GDisplay *);
void gdisplay_expose_area (GDisplay *, gint, gint, gint, gint);

View File

@ -57,11 +57,6 @@
#include "libgimp/gimpintl.h"
/* Function declarations */
static void gdisplay_check_device_cursor (GDisplay *gdisp);
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
@ -129,6 +124,20 @@ key_to_state (gint key)
}
}
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gint
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
@ -187,10 +196,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
/* set up the scrollbar observers */
gtk_signal_connect (GTK_OBJECT (gdisp->hsbdata), "value_changed",
GTK_SIGNAL_FUNC(scrollbar_horz_update),
GTK_SIGNAL_FUNC (gdisplay_hscrollbar_update),
gdisp);
gtk_signal_connect (GTK_OBJECT (gdisp->vsbdata), "value_changed",
GTK_SIGNAL_FUNC (scrollbar_vert_update),
GTK_SIGNAL_FUNC (gdisplay_vscrollbar_update),
gdisp);
/* setup scale properly */
@ -643,10 +652,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
else if (gimp_image_is_empty (gdisp->gimage))
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}

View File

@ -43,33 +43,6 @@
/* These are the values of the initial pointer grab */
static gint startx, starty;
gboolean
scrollbar_vert_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
return FALSE;
}
gboolean
scrollbar_horz_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
return FALSE;
}
void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
@ -77,8 +50,10 @@ start_grab_and_scroll (GDisplay *gdisp,
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
change_win_cursor (gdisp->canvas->window, GDK_FLEUR,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
@ -88,9 +63,8 @@ end_grab_and_scroll (GDisplay *gdisp,
{
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
CURSOR_MODIFIER_NONE,
FALSE,
gdisp->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE,
TRUE);
}

View File

@ -20,18 +20,6 @@
#define __SCROLL_H__
/* app init and exit routines */
void init_scrolling (void);
void free_scrolling (void);
/* routines for scrolling the image via the scrollbars */
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);

View File

@ -158,9 +158,8 @@ gdisplay_new (GimpImage *gimage,
gdisp->disp_xoffset = 0;
gdisp->disp_yoffset = 0;
gdisp->current_cursor = (GdkCursorType) -1;
gdisp->cursor_tool = TOOL_TYPE_NONE;
gdisp->cursor_modifier = CURSOR_MODIFIER_NONE;
gdisp->toggle_cursor = FALSE;
gdisp->tool_cursor = GIMP_TOOL_CURSOR_NONE;
gdisp->cursor_modifier = GIMP_CURSOR_MODIFIER_NONE;
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
@ -210,10 +209,10 @@ gdisplay_new (GimpImage *gimage,
g_hash_table_insert (display_ht, gdisp->canvas, gdisp);
/* set the current tool cursor */
gdisplay_install_tool_cursor (gdisp, default_gdisplay_cursor,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
default_gdisplay_cursor,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
@ -1313,10 +1312,10 @@ gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y)
{
gint new_cursor;
gint new_cursor;
gchar buffer[CURSOR_STR_LENGTH];
gint t_x;
gint t_y;
gint t_x;
gint t_y;
new_cursor = gdisp->draw_cursor && gdisp->proximity;
@ -1395,8 +1394,8 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
{
/* Set a proper size for the coordinates display in the statusbar. */
gchar buffer[CURSOR_STR_LENGTH];
gint cursor_label_width;
gint label_frame_size_difference;
gint cursor_label_width;
gint label_frame_size_difference;
if (gdisp->dot_for_dot)
{
@ -1837,12 +1836,11 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install)
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install)
{
if (cursor_type != GIMP_BAD_CURSOR)
{
@ -1857,44 +1855,39 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
case CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_type = TOOL_TYPE_NONE;
modifier = CURSOR_MODIFIER_NONE;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
}
}
if (gdisp->current_cursor != cursor_type ||
gdisp->cursor_tool != tool_type ||
gdisp->cursor_modifier != modifier ||
gdisp->toggle_cursor != toggle_cursor ||
if (gdisp->current_cursor != cursor_type ||
gdisp->tool_cursor != tool_cursor ||
gdisp->cursor_modifier != modifier ||
always_install)
{
gdisp->current_cursor = cursor_type;
gdisp->cursor_tool = tool_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gdisp->toggle_cursor = toggle_cursor;
change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_type,
modifier,
toggle_cursor);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
}
}
void
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
if (!gdisp->using_override_cursor)
gdisplay_real_install_tool_cursor (gdisp,
cursor_type,
tool_type,
tool_cursor,
modifier,
toggle_cursor,
FALSE);
}
@ -1908,11 +1901,11 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
{
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
change_win_cursor (gdisp->canvas->window,
cursor_type,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
}
@ -1924,9 +1917,8 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
gdisp->using_override_cursor = FALSE;
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
gdisp->tool_cursor,
gdisp->cursor_modifier,
gdisp->toggle_cursor,
TRUE);
}
}
@ -1934,7 +1926,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
gimp_unset_win_cursor (gdisp->canvas->window);
}
void

View File

@ -152,17 +152,16 @@ struct _GDisplay
GSList *update_areas; /* Update areas list */
GSList *display_areas; /* Display areas list */
GdkCursorType current_cursor; /* Currently installed cursor */
ToolType cursor_tool; /* Cursor for which tool? */
CursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
gboolean toggle_cursor; /* Cursor toggled? */
GdkCursorType current_cursor; /* Currently installed main cursor */
GimpToolCursorType tool_cursor; /* Current Tool cursor */
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
GdkCursorType override_cursor; /* Overriding cursor (ie. hourglass) */
gboolean using_override_cursor; /* is the cursor overridden? (ie. hourglass)*/
gboolean draw_cursor; /* should we draw software cursor ? */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */
gboolean proximity; /* is a device in proximity of gdisplay ? */
gboolean have_cursor; /* is cursor currently drawn ? */
@ -193,21 +192,19 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
gdouble *, gdouble *, gboolean);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
void gdisplay_set_menu_sensitivity (GDisplay *);
void gdisplay_expose_area (GDisplay *, gint, gint, gint, gint);

View File

@ -381,11 +381,12 @@ clone_cursor_update (Tool *tool,
ctype = GIMP_BAD_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_CROSSHAIR_SMALL_CURSOR ?
TOOL_TYPE_NONE : CLONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE :
GIMP_CLONE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -321,6 +321,9 @@ tools_new_convolve (void)
}
tool = paint_core_new (CONVOLVE);
tool->tool_cursor = GIMP_BLUR_TOOL_CURSOR;
tool->modifier_key_func = convolve_modifier_key_func;
tool->cursor_update_func = convolve_cursor_update_func;

View File

@ -391,6 +391,10 @@ tools_new_dodgeburn (void)
}
tool = paint_core_new (DODGEBURN);
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
tool->toggle_cursor = GIMP_BURN_TOOL_CURSOR;
tool->modifier_key_func = dodgeburn_modifier_key_func;
tool->cursor_update_func = dodgeburn_cursor_update_func;

View File

@ -1074,10 +1074,10 @@ ink_cursor_update (Tool *tool,
ctype = GIMP_MOUSE_CURSOR;
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
INK,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_INK_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -381,11 +381,12 @@ clone_cursor_update (Tool *tool,
ctype = GIMP_BAD_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_CROSSHAIR_SMALL_CURSOR ?
TOOL_TYPE_NONE : CLONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE :
GIMP_CLONE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -43,33 +43,6 @@
/* These are the values of the initial pointer grab */
static gint startx, starty;
gboolean
scrollbar_vert_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
return FALSE;
}
gboolean
scrollbar_horz_update (GtkAdjustment *adjustment,
gpointer data)
{
GDisplay *gdisp;
gdisp = (GDisplay *) data;
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
return FALSE;
}
void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
@ -77,8 +50,10 @@ start_grab_and_scroll (GDisplay *gdisp,
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
change_win_cursor (gdisp->canvas->window, GDK_FLEUR,
TOOL_TYPE_NONE, CURSOR_MODIFIER_NONE, FALSE);
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
@ -88,9 +63,8 @@ end_grab_and_scroll (GDisplay *gdisp,
{
gdisplay_real_install_tool_cursor (gdisp,
gdisp->current_cursor,
gdisp->cursor_tool,
CURSOR_MODIFIER_NONE,
FALSE,
gdisp->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE,
TRUE);
}

View File

@ -20,18 +20,6 @@
#define __SCROLL_H__
/* app init and exit routines */
void init_scrolling (void);
void free_scrolling (void);
/* routines for scrolling the image via the scrollbars */
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);

View File

@ -1725,10 +1725,10 @@ bezier_select_cursor_update (Tool *tool,
if (gdisp != tool->gdisp || bezier_sel->core->draw_state == INVISIBLE)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
return;
}
@ -1753,33 +1753,33 @@ bezier_select_cursor_update (Tool *tool,
if ((mevent->state & GDK_SHIFT_MASK) &&
!(mevent->state & GDK_CONTROL_MASK))
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
}
else if ((mevent->state & GDK_CONTROL_MASK) &&
!(mevent->state & GDK_SHIFT_MASK))
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
}
else if ((mevent->state & GDK_CONTROL_MASK) &&
(mevent->state & GDK_SHIFT_MASK))
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_INTERSECT);
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
return;
}
@ -1790,17 +1790,17 @@ bezier_select_cursor_update (Tool *tool,
if (mevent->state & GDK_SHIFT_MASK)
{
/* moving on 1 curve */
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
}
}
else
@ -1810,44 +1810,44 @@ bezier_select_cursor_update (Tool *tool,
case EXTEND_NEW:
if (on_control_pnt && bezier_sel->closed)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_CONTROL,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_CONTROL);
/* g_print ("add to curve cursor\n"); */
}
else if (on_curve)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
/* g_print ("edit control point cursor\n"); */
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
break;
case EXTEND_ADD:
if (on_curve)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
/* g_print ("add to curve cursor\n"); */
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
/* g_print ("default no action cursor\n"); */
}
break;
@ -1855,18 +1855,18 @@ bezier_select_cursor_update (Tool *tool,
case EXTEND_EDIT:
if (on_control_pnt)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_CONTROL,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_CONTROL);
/* g_print ("edit control point cursor\n"); */
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
/* g_print ("default no action cursor\n"); */
}
break;
@ -1874,36 +1874,36 @@ bezier_select_cursor_update (Tool *tool,
case EXTEND_REMOVE:
if (on_control_pnt && mevent->state & GDK_SHIFT_MASK)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
/* g_print ("delete whole curve cursor\n"); */
}
else if (on_control_pnt)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
/* g_print ("remove point cursor\n"); */
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
/* g_print ("default no action cursor\n"); */
}
break;
default:
g_print ("In default\n");
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BEZIER_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -702,16 +702,16 @@ blend_cursor_update (Tool *tool,
{
case INDEXED_GIMAGE:
case INDEXEDA_GIMAGE:
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
default:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -284,11 +284,11 @@ bucket_fill_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
GimpLayer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
gint x, y;
gint off_x, off_y;
GimpLayer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
gint x, y;
gint off_x, off_y;
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y,
&x, &y, FALSE, FALSE);
@ -311,23 +311,23 @@ bucket_fill_cursor_update (Tool *tool,
switch (bucket_options->fill_mode)
{
case FG_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_FOREGROUND;
cmodifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
break;
case BG_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_BACKGROUND;
cmodifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
break;
case PATTERN_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_PATTERN;
cmodifier = GIMP_CURSOR_MODIFIER_PATTERN;
break;
}
}
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
BUCKET_FILL,
cmodifier,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_BUCKET_FILL_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -505,55 +505,55 @@ by_color_select_cursor_update (Tool *tool,
switch (by_col_sel->operation)
{
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_MOVE_MASK:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ANCHOR:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_ANCHOR,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_ANCHOR);
}
return;
}
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -381,11 +381,12 @@ clone_cursor_update (Tool *tool,
ctype = GIMP_BAD_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_CROSSHAIR_SMALL_CURSOR ?
TOOL_TYPE_NONE : CLONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE :
GIMP_CLONE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -27,13 +27,13 @@
#include "appenv.h"
#include "color_picker.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimpui.h"
#include "gimprc.h"
#include "cursorutil.h"
#include "info_dialog.h"
#include "palette.h"
#include "tool.h"
@ -43,8 +43,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
#include "cursors/dropper_small.xbm"
#include "cursors/dropper_small_mask.xbm"
/* maximum information buffer size */
@ -138,13 +136,6 @@ static gchar index_buf[MAX_INFO_BUF];
static gchar gray_buf [MAX_INFO_BUF];
static gchar hex_buf [MAX_INFO_BUF];
BitmapCursor tool_cursor =
{
dropper_small_bits, dropper_small_mask_bits,
dropper_small_width, dropper_small_height,
0, 0, NULL, NULL, NULL
};
static GimpToolClass *parent_class = NULL;
@ -199,8 +190,6 @@ gimp_color_picker_class_init (GimpColorPickerClass *klass)
object_class->destroy = gimp_color_picker_destroy;
tool_class->tool_cursor = &tool_cursor;
tool_class->control = color_picker_control;
tool_class->button_press = color_picker_button_press;
tool_class->button_release = color_picker_button_release;
@ -578,17 +567,17 @@ color_picker_cursor_update (GimpTool *tool,
x > 0 && x < gdisp->gimage->width &&
y > 0 && y < gdisp->gimage->height)
{
gdisplay_install_tool_cursor (gdisp, GIMP_COLOR_PICKER_CURSOR,
COLOR_PICKER,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_COLOR_PICKER_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
COLOR_PICKER,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
}

View File

@ -321,6 +321,9 @@ tools_new_convolve (void)
}
tool = paint_core_new (CONVOLVE);
tool->tool_cursor = GIMP_BLUR_TOOL_CURSOR;
tool->modifier_key_func = convolve_modifier_key_func;
tool->cursor_update_func = convolve_cursor_update_func;

View File

@ -601,8 +601,8 @@ crop_cursor_update (Tool *tool,
{
Crop *crop;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
crop = (Crop *) tool->private;
@ -614,22 +614,22 @@ crop_cursor_update (Tool *tool,
else if (mevent->x == CLAMP (mevent->x, crop->x1, crop->x1 + crop->srw) &&
mevent->y == CLAMP (mevent->y, crop->y1, crop->y1 + crop->srh))
{
cmodifier = CURSOR_MODIFIER_RESIZE;
cmodifier = GIMP_CURSOR_MODIFIER_RESIZE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x2 - crop->srw, crop->x2) &&
mevent->y == CLAMP (mevent->y, crop->y2 - crop->srh, crop->y2))
{
cmodifier = CURSOR_MODIFIER_RESIZE;
cmodifier = GIMP_CURSOR_MODIFIER_RESIZE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x1, crop->x1 + crop->srw) &&
mevent->y == CLAMP (mevent->y, crop->y2 - crop->srh, crop->y2))
{
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x2 - crop->srw, crop->x2) &&
mevent->y == CLAMP (mevent->y, crop->y1, crop->y1 + crop->srh))
{
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
else if (! (mevent->x > crop->x1 && mevent->x < crop->x2 &&
mevent->y > crop->y1 && mevent->y < crop->y2))
@ -637,10 +637,11 @@ crop_cursor_update (Tool *tool,
ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
CROP,
cmodifier,
crop_options->type != CROP_CROP);
gdisplay_install_tool_cursor (gdisp,
ctype,
crop_options->type == CROP_CROP ?
GIMP_CROP_TOOL_CURSOR : GIMP_RESIZE_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -391,6 +391,10 @@ tools_new_dodgeburn (void)
}
tool = paint_core_new (DODGEBURN);
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
tool->toggle_cursor = GIMP_BURN_TOOL_CURSOR;
tool->modifier_key_func = dodgeburn_modifier_key_func;
tool->cursor_update_func = dodgeburn_cursor_update_func;

View File

@ -664,10 +664,10 @@ edit_selection_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_MOVE);
}
static gint

View File

@ -147,6 +147,8 @@ tools_new_ellipse_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_ELLIPSE_SELECT_TOOL_CURSOR;
tool->button_press_func = rect_select_button_press;
tool->button_release_func = rect_select_button_release;
tool->motion_func = rect_select_motion;

View File

@ -217,10 +217,12 @@ flip_cursor_update (Tool *tool,
}
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
FLIP,
CURSOR_MODIFIER_NONE,
ctype == GDK_SB_V_DOUBLE_ARROW);
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GDK_SB_H_DOUBLE_ARROW ?
GIMP_FLIP_HORIZONTAL_TOOL_CORSOR :
GIMP_FLIP_VERTICAL_TOOL_CORSOR,
CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -369,6 +369,8 @@ tools_new_free_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_FREE_SELECT_TOOL_CURSOR;
tool->button_press_func = free_select_button_press;
tool->button_release_func = free_select_button_release;
tool->motion_func = free_select_motion;

View File

@ -664,6 +664,8 @@ tools_new_fuzzy_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_FUZZY_SELECT_TOOL_CURSOR;
tool->button_press_func = fuzzy_select_button_press;
tool->button_release_func = fuzzy_select_button_release;
tool->motion_func = fuzzy_select_motion;

View File

@ -702,16 +702,16 @@ blend_cursor_update (Tool *tool,
{
case INDEXED_GIMAGE:
case INDEXEDA_GIMAGE:
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
default:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
BLEND,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -284,11 +284,11 @@ bucket_fill_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
GimpLayer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
gint x, y;
gint off_x, off_y;
GimpLayer *layer;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
gint x, y;
gint off_x, off_y;
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y,
&x, &y, FALSE, FALSE);
@ -311,23 +311,23 @@ bucket_fill_cursor_update (Tool *tool,
switch (bucket_options->fill_mode)
{
case FG_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_FOREGROUND;
cmodifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
break;
case BG_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_BACKGROUND;
cmodifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
break;
case PATTERN_BUCKET_FILL:
cmodifier = CURSOR_MODIFIER_PATTERN;
cmodifier = GIMP_CURSOR_MODIFIER_PATTERN;
break;
}
}
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
BUCKET_FILL,
cmodifier,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_BUCKET_FILL_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -505,55 +505,55 @@ by_color_select_cursor_update (Tool *tool,
switch (by_col_sel->operation)
{
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_MOVE_MASK:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ANCHOR:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_ANCHOR,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_ANCHOR);
}
return;
}
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -381,11 +381,12 @@ clone_cursor_update (Tool *tool,
ctype = GIMP_BAD_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_CROSSHAIR_SMALL_CURSOR ?
TOOL_TYPE_NONE : CLONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE :
GIMP_CLONE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -321,6 +321,9 @@ tools_new_convolve (void)
}
tool = paint_core_new (CONVOLVE);
tool->tool_cursor = GIMP_BLUR_TOOL_CURSOR;
tool->modifier_key_func = convolve_modifier_key_func;
tool->cursor_update_func = convolve_cursor_update_func;

View File

@ -601,8 +601,8 @@ crop_cursor_update (Tool *tool,
{
Crop *crop;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
GdkCursorType ctype = GIMP_MOUSE_CURSOR;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
crop = (Crop *) tool->private;
@ -614,22 +614,22 @@ crop_cursor_update (Tool *tool,
else if (mevent->x == CLAMP (mevent->x, crop->x1, crop->x1 + crop->srw) &&
mevent->y == CLAMP (mevent->y, crop->y1, crop->y1 + crop->srh))
{
cmodifier = CURSOR_MODIFIER_RESIZE;
cmodifier = GIMP_CURSOR_MODIFIER_RESIZE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x2 - crop->srw, crop->x2) &&
mevent->y == CLAMP (mevent->y, crop->y2 - crop->srh, crop->y2))
{
cmodifier = CURSOR_MODIFIER_RESIZE;
cmodifier = GIMP_CURSOR_MODIFIER_RESIZE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x1, crop->x1 + crop->srw) &&
mevent->y == CLAMP (mevent->y, crop->y2 - crop->srh, crop->y2))
{
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
else if (mevent->x == CLAMP (mevent->x, crop->x2 - crop->srw, crop->x2) &&
mevent->y == CLAMP (mevent->y, crop->y1, crop->y1 + crop->srh))
{
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
else if (! (mevent->x > crop->x1 && mevent->x < crop->x2 &&
mevent->y > crop->y1 && mevent->y < crop->y2))
@ -637,10 +637,11 @@ crop_cursor_update (Tool *tool,
ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
CROP,
cmodifier,
crop_options->type != CROP_CROP);
gdisplay_install_tool_cursor (gdisp,
ctype,
crop_options->type == CROP_CROP ?
GIMP_CROP_TOOL_CURSOR : GIMP_RESIZE_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -391,6 +391,10 @@ tools_new_dodgeburn (void)
}
tool = paint_core_new (DODGEBURN);
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
tool->toggle_cursor = GIMP_BURN_TOOL_CURSOR;
tool->modifier_key_func = dodgeburn_modifier_key_func;
tool->cursor_update_func = dodgeburn_cursor_update_func;

View File

@ -664,10 +664,10 @@ edit_selection_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_MOVE);
}
static gint

View File

@ -147,6 +147,8 @@ tools_new_ellipse_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_ELLIPSE_SELECT_TOOL_CURSOR;
tool->button_press_func = rect_select_button_press;
tool->button_release_func = rect_select_button_release;
tool->motion_func = rect_select_motion;

View File

@ -217,10 +217,12 @@ flip_cursor_update (Tool *tool,
}
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
FLIP,
CURSOR_MODIFIER_NONE,
ctype == GDK_SB_V_DOUBLE_ARROW);
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GDK_SB_H_DOUBLE_ARROW ?
GIMP_FLIP_HORIZONTAL_TOOL_CORSOR :
GIMP_FLIP_VERTICAL_TOOL_CORSOR,
CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -369,6 +369,8 @@ tools_new_free_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_FREE_SELECT_TOOL_CURSOR;
tool->button_press_func = free_select_button_press;
tool->button_release_func = free_select_button_release;
tool->motion_func = free_select_motion;

View File

@ -664,6 +664,8 @@ tools_new_fuzzy_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_FUZZY_SELECT_TOOL_CURSOR;
tool->button_press_func = fuzzy_select_button_press;
tool->button_release_func = fuzzy_select_button_release;
tool->motion_func = fuzzy_select_motion;

View File

@ -1074,10 +1074,10 @@ ink_cursor_update (Tool *tool,
ctype = GIMP_MOUSE_CURSOR;
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
INK,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_INK_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -1016,63 +1016,63 @@ iscissors_cursor_update (Tool *tool,
switch (iscissors->op)
{
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_MOVE_MASK: /* abused */
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE: /* abused */
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case -1:
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
default:
switch (iscissors->state)
{
case WAITING:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SEED_PLACEMENT:
case SEED_ADJUSTMENT:
default:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -355,17 +355,17 @@ magnify_cursor_update (Tool *tool,
{
if (magnify_options->type == ZOOMIN)
{
gdisplay_install_tool_cursor (gdisp, GIMP_ZOOM_CURSOR,
MAGNIFY,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_ZOOM_CURSOR,
GIMP_MAGNIFY_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_ZOOM_CURSOR,
MAGNIFY,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_ZOOM_CURSOR,
GIMP_MAGNIFY_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
}
}

View File

@ -45,9 +45,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
#include "cursors/measure_small.xbm"
#include "cursors/measure_small_mask.xbm"
/* definitions */
@ -112,14 +109,6 @@ static InfoDialog *measure_tool_info = NULL;
static gchar distance_buf[MAX_INFO_BUF];
static gchar angle_buf[MAX_INFO_BUF];
BitmapCursor measure_tool_cursor =
{
measure_small_bits, measure_small_mask_bits,
measure_small_width, measure_small_height,
0, 0, NULL, NULL, NULL
};
static GimpToolClass *parent_class = NULL;
@ -173,8 +162,6 @@ gimp_measure_tool_class_init (GimpMeasureToolClass *klass)
object_class->destroy = gimp_measure_tool_destroy;
tool_class->tool_cursor = &measure_tool_cursor;
tool_class->control = measure_tool_control;
tool_class->button_press = measure_tool_button_press;
tool_class->button_release = measure_tool_button_release;
@ -465,10 +452,10 @@ measure_tool_button_press (GimpTool *tool,
/* set the pointer to the crosshair,
* so one actually sees the cursor position
*/
gdisplay_install_tool_cursor (gdisp, GIMP_CROSSHAIR_SMALL_CURSOR,
MEASURE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void
@ -707,8 +694,8 @@ measure_tool_cursor_update (GimpTool *tool,
gint i;
gboolean in_handle = FALSE;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
measure_tool = GIMP_MEASURE_TOOL (tool);
@ -739,26 +726,26 @@ measure_tool_cursor_update (GimpTool *tool,
}
if (mevent->state & GDK_SHIFT_MASK)
cmodifier = CURSOR_MODIFIER_PLUS;
cmodifier = GIMP_CURSOR_MODIFIER_PLUS;
else
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
if (i == 0 && measure_tool->num_points == 3 &&
cmodifier == CURSOR_MODIFIER_PLUS)
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier == GIMP_CURSOR_MODIFIER_PLUS)
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
break;
}
}
if (!in_handle && measure_tool->num_points > 1 &&
mevent->state & GDK_MOD1_MASK)
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
gdisplay_install_tool_cursor (gdisp, ctype,
MEASURE,
cmodifier,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_MEASURE_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -44,8 +44,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
#include "cursors/move_small.xbm"
#include "cursors/move_small_mask.xbm"
static void gimp_move_tool_class_init (GimpMoveToolClass *klass);
@ -78,14 +76,6 @@ static ToolOptions *move_options = NULL;
/* local variables */
static GdkGC *move_gc = NULL;
BitmapCursor move_cursor =
{
move_small_bits, move_small_mask_bits,
move_small_width, move_small_height,
0, 0, NULL, NULL, NULL
};
static GimpToolClass *parent_class = NULL;
@ -139,8 +129,6 @@ gimp_move_tool_class_init (GimpMoveToolClass *klass)
object_class->destroy = gimp_move_tool_destroy;
tool_class->tool_cursor = &move_cursor;
tool_class->control = move_tool_control;
tool_class->button_press = move_tool_button_press;
tool_class->button_release = move_tool_button_release;
@ -461,16 +449,14 @@ move_tool_cursor_update (GimpTool *tool,
! gimage_mask_is_empty (gdisp->gimage))
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
}
else if (mevent->state & GDK_SHIFT_MASK)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
else
{
@ -479,9 +465,8 @@ move_tool_cursor_update (GimpTool *tool,
{
tool->gdisp = gdisp;
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_HAND,
FALSE);
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_HAND);
if (tool->state != ACTIVE)
{
@ -503,27 +488,29 @@ move_tool_cursor_update (GimpTool *tool,
/* if there is a floating selection, and this aint it... */
if (gimp_image_floating_sel (gdisp->gimage) &&
! gimp_layer_is_floating_sel (layer))
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_ANCHOR,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_ANCHOR);
}
else if (layer == gdisp->gimage->active_layer)
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
else
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_HAND,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_HAND);
}
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
}
}

View File

@ -128,6 +128,8 @@ tools_new_perspective_tool (void)
tool = transform_core_new (PERSPECTIVE, TRUE);
tool->tool_cursor = GIMP_PERSPECTIVE_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -619,46 +619,46 @@ rect_select_cursor_update (Tool *tool,
switch (rect_sel->op)
{
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_MOVE_MASK:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ANCHOR:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_ANCHOR,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_ANCHOR);
break;
}
}

View File

@ -664,6 +664,8 @@ tools_new_fuzzy_select (void)
tool->private = (void *) private;
tool->tool_cursor = GIMP_FUZZY_SELECT_TOOL_CURSOR;
tool->button_press_func = fuzzy_select_button_press;
tool->button_release_func = fuzzy_select_button_release;
tool->motion_func = fuzzy_select_motion;

View File

@ -212,6 +212,8 @@ tools_new_rotate_tool (void)
tool = transform_core_new (ROTATE, TRUE);
tool->tool_cursor = GIMP_ROTATE_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -202,6 +202,8 @@ tools_new_scale_tool (void)
tool = transform_core_new (SCALE, TRUE);
tool->tool_cursor = GIMP_RESIZE_TOOL_CURSOR;
private = tool->private;
/* set the scale specific transformation attributes */

View File

@ -147,6 +147,8 @@ tools_new_shear_tool (void)
tool = transform_core_new (SHEAR, TRUE);
tool->tool_cursor = GIMP_SHEAR_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -381,11 +381,12 @@ clone_cursor_update (Tool *tool,
ctype = GIMP_BAD_CURSOR;
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_CROSSHAIR_SMALL_CURSOR ?
TOOL_TYPE_NONE : CLONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE :
GIMP_CLONE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
Tool *

View File

@ -380,17 +380,17 @@ text_cursor_update (Tool *tool,
/* if there is a floating selection, and this aint it... */
if (gimp_layer_is_floating_sel (layer))
{
gdisplay_install_tool_cursor (gdisp, GDK_FLEUR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GDK_FLEUR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
return;
}
gdisplay_install_tool_cursor (gdisp, GDK_XTERM,
TEXT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GDK_XTERM,
GIMP_TEXT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -248,16 +248,18 @@ gimp_tool_class_init (GimpToolClass *klass)
static void
gimp_tool_init (GimpTool *tool)
{
tool->state = INACTIVE;
tool->paused_count = 0;
tool->scroll_lock = FALSE; /* Allow scrolling */
tool->auto_snap_to = TRUE; /* Snap to guides */
tool->state = INACTIVE;
tool->paused_count = 0;
tool->scroll_lock = FALSE; /* Allow scrolling */
tool->auto_snap_to = TRUE; /* Snap to guides */
tool->preserve = TRUE; /* Preserve tool across drawable changes */
tool->gdisp = NULL;
tool->drawable = NULL;
tool->preserve = TRUE; /* Preserve tool across drawable changes */
tool->gdisp = NULL;
tool->drawable = NULL;
tool->toggled = FALSE;
tool->tool_cursor = GIMP_TOOL_CURSOR_NONE;
tool->toggle_cursor = GIMP_TOOL_CURSOR_NONE;
tool->toggled = FALSE;
}
static void
@ -450,9 +452,8 @@ gimp_tool_real_cursor_update (GimpTool *tool,
GDisplay *gdisp)
{
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -69,7 +69,14 @@ struct _GimpTool
GDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
gboolean toggled; /* Bad hack to let the paint_core show the
GimpToolCursorType tool_cursor;
GimpToolCursorType toggle_cursor; /* one of these or both will go
* away once all cursor_update
* functions are properly
* virtualized
*/
gboolean toggled; /* Bad hack to let the paint_core show the
* right toggle cursors
*/
PaintCore *paintcore;
@ -84,10 +91,6 @@ struct _GimpToolClass
/* FIXME: most of this stuff must go away */
gchar *pdb_string;
BitmapCursor *tool_cursor;
BitmapCursor *toggle_cursor;
void (* initialize) (GimpTool *tool,
GDisplay *gdisp);
void (* control) (GimpTool *tool,

View File

@ -1074,10 +1074,10 @@ ink_cursor_update (Tool *tool,
ctype = GIMP_MOUSE_CURSOR;
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
INK,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_INK_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -1016,63 +1016,63 @@ iscissors_cursor_update (Tool *tool,
switch (iscissors->op)
{
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_MOVE_MASK: /* abused */
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE: /* abused */
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case -1:
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_BAD_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
default:
switch (iscissors->state)
{
case WAITING:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SEED_PLACEMENT:
case SEED_ADJUSTMENT:
default:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
ISCISSORS,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_ISCISSORS_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
}
}

View File

@ -355,17 +355,17 @@ magnify_cursor_update (Tool *tool,
{
if (magnify_options->type == ZOOMIN)
{
gdisplay_install_tool_cursor (gdisp, GIMP_ZOOM_CURSOR,
MAGNIFY,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_ZOOM_CURSOR,
GIMP_MAGNIFY_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_PLUS);
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_ZOOM_CURSOR,
MAGNIFY,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_ZOOM_CURSOR,
GIMP_MAGNIFY_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MINUS);
}
}

View File

@ -45,9 +45,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
#include "cursors/measure_small.xbm"
#include "cursors/measure_small_mask.xbm"
/* definitions */
@ -112,14 +109,6 @@ static InfoDialog *measure_tool_info = NULL;
static gchar distance_buf[MAX_INFO_BUF];
static gchar angle_buf[MAX_INFO_BUF];
BitmapCursor measure_tool_cursor =
{
measure_small_bits, measure_small_mask_bits,
measure_small_width, measure_small_height,
0, 0, NULL, NULL, NULL
};
static GimpToolClass *parent_class = NULL;
@ -173,8 +162,6 @@ gimp_measure_tool_class_init (GimpMeasureToolClass *klass)
object_class->destroy = gimp_measure_tool_destroy;
tool_class->tool_cursor = &measure_tool_cursor;
tool_class->control = measure_tool_control;
tool_class->button_press = measure_tool_button_press;
tool_class->button_release = measure_tool_button_release;
@ -465,10 +452,10 @@ measure_tool_button_press (GimpTool *tool,
/* set the pointer to the crosshair,
* so one actually sees the cursor position
*/
gdisplay_install_tool_cursor (gdisp, GIMP_CROSSHAIR_SMALL_CURSOR,
MEASURE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void
@ -707,8 +694,8 @@ measure_tool_cursor_update (GimpTool *tool,
gint i;
gboolean in_handle = FALSE;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
GdkCursorType ctype = GIMP_CROSSHAIR_SMALL_CURSOR;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
measure_tool = GIMP_MEASURE_TOOL (tool);
@ -739,26 +726,26 @@ measure_tool_cursor_update (GimpTool *tool,
}
if (mevent->state & GDK_SHIFT_MASK)
cmodifier = CURSOR_MODIFIER_PLUS;
cmodifier = GIMP_CURSOR_MODIFIER_PLUS;
else
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
if (i == 0 && measure_tool->num_points == 3 &&
cmodifier == CURSOR_MODIFIER_PLUS)
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier == GIMP_CURSOR_MODIFIER_PLUS)
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
break;
}
}
if (!in_handle && measure_tool->num_points > 1 &&
mevent->state & GDK_MOD1_MASK)
cmodifier = CURSOR_MODIFIER_MOVE;
cmodifier = GIMP_CURSOR_MODIFIER_MOVE;
}
gdisplay_install_tool_cursor (gdisp, ctype,
MEASURE,
cmodifier,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
GIMP_MEASURE_TOOL_CURSOR,
cmodifier);
}
static void

View File

@ -44,8 +44,6 @@
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
#include "cursors/move_small.xbm"
#include "cursors/move_small_mask.xbm"
static void gimp_move_tool_class_init (GimpMoveToolClass *klass);
@ -78,14 +76,6 @@ static ToolOptions *move_options = NULL;
/* local variables */
static GdkGC *move_gc = NULL;
BitmapCursor move_cursor =
{
move_small_bits, move_small_mask_bits,
move_small_width, move_small_height,
0, 0, NULL, NULL, NULL
};
static GimpToolClass *parent_class = NULL;
@ -139,8 +129,6 @@ gimp_move_tool_class_init (GimpMoveToolClass *klass)
object_class->destroy = gimp_move_tool_destroy;
tool_class->tool_cursor = &move_cursor;
tool_class->control = move_tool_control;
tool_class->button_press = move_tool_button_press;
tool_class->button_release = move_tool_button_release;
@ -461,16 +449,14 @@ move_tool_cursor_update (GimpTool *tool,
! gimage_mask_is_empty (gdisp->gimage))
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_MOVE,
FALSE);
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_MOVE);
}
else if (mevent->state & GDK_SHIFT_MASK)
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
else
{
@ -479,9 +465,8 @@ move_tool_cursor_update (GimpTool *tool,
{
tool->gdisp = gdisp;
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_HAND,
FALSE);
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_HAND);
if (tool->state != ACTIVE)
{
@ -503,27 +488,29 @@ move_tool_cursor_update (GimpTool *tool,
/* if there is a floating selection, and this aint it... */
if (gimp_image_floating_sel (gdisp->gimage) &&
! gimp_layer_is_floating_sel (layer))
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
RECT_SELECT,
CURSOR_MODIFIER_ANCHOR,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_ANCHOR);
}
else if (layer == gdisp->gimage->active_layer)
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
else
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_HAND,
FALSE);
{
gdisplay_install_tool_cursor (gdisp, GDK_HAND2,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_HAND);
}
}
else
{
gdisplay_install_tool_cursor (gdisp, GIMP_BAD_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
}
}

View File

@ -470,14 +470,14 @@ paint_core_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
GimpLayer *layer;
PaintCore *paint_core;
gint x, y;
gchar status_str[STATUSBAR_SIZE];
GimpLayer *layer;
PaintCore *paint_core;
gint x, y;
gchar status_str[STATUSBAR_SIZE];
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
CursorModifier cmodifier = CURSOR_MODIFIER_NONE;
gboolean ctoggle = FALSE;
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
gboolean ctoggle = FALSE;
paint_core = tool->paint_core;
@ -586,11 +586,11 @@ paint_core_cursor_update (Tool *tool,
{
case ERASER:
ctype = GIMP_MOUSE_CURSOR;
cmodifier = CURSOR_MODIFIER_MINUS;
cmodifier = GIMP_CURSOR_MODIFIER_MINUS;
break;
case CONVOLVE:
ctype = GIMP_MOUSE_CURSOR;
cmodifier = CURSOR_MODIFIER_MINUS;
cmodifier = GIMP_CURSOR_MODIFIER_MINUS;
break;
case DODGEBURN:
ctype = GIMP_MOUSE_CURSOR;
@ -624,11 +624,14 @@ paint_core_cursor_update (Tool *tool,
ctype = GIMP_MOUSE_CURSOR;
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
gdisplay_install_tool_cursor (gdisp,
ctype,
ctype == GIMP_COLOR_PICKER_CURSOR ?
COLOR_PICKER : tool->type,
cmodifier,
ctoggle);
GIMP_COLOR_PICKER_CURSOR :
ctoggle ?
tool->toggle_cursor : tool->tool_cursor,
cmodifier);
}
}

View File

@ -140,7 +140,11 @@ void paint_core_control (Tool *tool,
/* paint tool functions */
void paint_core_no_draw (Tool *tool);
/* ToolType doesn't exist an more
Tool * paint_core_new (ToolType type);
*/
void paint_core_free (Tool *tool);
int paint_core_init (PaintCore *paint_core,
GimpDrawable *drawable,

View File

@ -128,6 +128,8 @@ tools_new_perspective_tool (void)
tool = transform_core_new (PERSPECTIVE, TRUE);
tool->tool_cursor = GIMP_PERSPECTIVE_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -619,46 +619,46 @@ rect_select_cursor_update (Tool *tool,
switch (rect_sel->op)
{
case SELECTION_ADD:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_PLUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_PLUS);
break;
case SELECTION_SUB:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_MINUS,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_MINUS);
break;
case SELECTION_INTERSECT:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_INTERSECT,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_INTERSECT);
break;
case SELECTION_REPLACE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_MOVE_MASK:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_MOVE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_MOVE);
break;
case SELECTION_MOVE:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
break;
case SELECTION_ANCHOR:
gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR,
tool->type,
CURSOR_MODIFIER_ANCHOR,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GIMP_MOUSE_CURSOR,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_ANCHOR);
break;
}
}

View File

@ -212,6 +212,8 @@ tools_new_rotate_tool (void)
tool = transform_core_new (ROTATE, TRUE);
tool->tool_cursor = GIMP_ROTATE_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -202,6 +202,8 @@ tools_new_scale_tool (void)
tool = transform_core_new (SCALE, TRUE);
tool->tool_cursor = GIMP_RESIZE_TOOL_CURSOR;
private = tool->private;
/* set the scale specific transformation attributes */

View File

@ -147,6 +147,8 @@ tools_new_shear_tool (void)
tool = transform_core_new (SHEAR, TRUE);
tool->tool_cursor = GIMP_SHEAR_TOOL_CURSOR;
private = tool->private;
/* set the rotation specific transformation attributes */

View File

@ -380,17 +380,17 @@ text_cursor_update (Tool *tool,
/* if there is a floating selection, and this aint it... */
if (gimp_layer_is_floating_sel (layer))
{
gdisplay_install_tool_cursor (gdisp, GDK_FLEUR,
MOVE,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GDK_FLEUR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
return;
}
gdisplay_install_tool_cursor (gdisp, GDK_XTERM,
TEXT,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
GDK_XTERM,
GIMP_TEXT_TOOL_CURSOR,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -248,16 +248,18 @@ gimp_tool_class_init (GimpToolClass *klass)
static void
gimp_tool_init (GimpTool *tool)
{
tool->state = INACTIVE;
tool->paused_count = 0;
tool->scroll_lock = FALSE; /* Allow scrolling */
tool->auto_snap_to = TRUE; /* Snap to guides */
tool->state = INACTIVE;
tool->paused_count = 0;
tool->scroll_lock = FALSE; /* Allow scrolling */
tool->auto_snap_to = TRUE; /* Snap to guides */
tool->preserve = TRUE; /* Preserve tool across drawable changes */
tool->gdisp = NULL;
tool->drawable = NULL;
tool->preserve = TRUE; /* Preserve tool across drawable changes */
tool->gdisp = NULL;
tool->drawable = NULL;
tool->toggled = FALSE;
tool->tool_cursor = GIMP_TOOL_CURSOR_NONE;
tool->toggle_cursor = GIMP_TOOL_CURSOR_NONE;
tool->toggled = FALSE;
}
static void
@ -450,9 +452,8 @@ gimp_tool_real_cursor_update (GimpTool *tool,
GDisplay *gdisp)
{
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW,
TOOL_TYPE_NONE,
CURSOR_MODIFIER_NONE,
FALSE);
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
}
static void

View File

@ -69,7 +69,14 @@ struct _GimpTool
GDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
gboolean toggled; /* Bad hack to let the paint_core show the
GimpToolCursorType tool_cursor;
GimpToolCursorType toggle_cursor; /* one of these or both will go
* away once all cursor_update
* functions are properly
* virtualized
*/
gboolean toggled; /* Bad hack to let the paint_core show the
* right toggle cursors
*/
PaintCore *paintcore;
@ -84,10 +91,6 @@ struct _GimpToolClass
/* FIXME: most of this stuff must go away */
gchar *pdb_string;
BitmapCursor *tool_cursor;
BitmapCursor *toggle_cursor;
void (* initialize) (GimpTool *tool,
GDisplay *gdisp);
void (* control) (GimpTool *tool,

View File

@ -696,10 +696,10 @@ transform_core_cursor_update (Tool *tool,
}
}
gdisplay_install_tool_cursor (gdisp, ctype,
tool->type,
CURSOR_MODIFIER_NONE,
FALSE);
gdisplay_install_tool_cursor (gdisp,
ctype,
tool->tool_cursor,
GIMP_CURSOR_MODIFIER_NONE);
}
void

View File

@ -126,8 +126,10 @@ void transform_core_control (Tool *tool,
GDisplay *gdisp);
/* transform tool functions */
/* make PDB compile: ToolType doesn't exist any more
Tool * transform_core_new (ToolType tool_type,
gboolean interactive);
*/
void transform_core_free (Tool *tool);
void transform_core_draw (Tool *tool);
void transform_core_no_draw (Tool *tool);

View File

@ -26,8 +26,8 @@
#include "cursorutil.h"
#include "dialog_handler.h"
#include "gdisplay.h" /* for gdisplay_*_override_cursor() */
#include "tools/tool.h"
/* standard gimp cursors */
#include "cursors/mouse.xbm"
#include "cursors/mouse_mask.xbm"
#include "cursors/crosshair.xbm"
@ -41,6 +41,68 @@
#include "cursors/dropper.xbm"
#include "cursors/dropper_mask.xbm"
/* stock tool cursors */
#include "cursors/rect_select_small.xbm"
#include "cursors/rect_select_small_mask.xbm"
#include "cursors/ellipse_select_small.xbm"
#include "cursors/ellipse_select_small_mask.xbm"
#include "cursors/free_select_small.xbm"
#include "cursors/free_select_small_mask.xbm"
#include "cursors/fuzzy_select_small.xbm"
#include "cursors/fuzzy_select_small_mask.xbm"
#include "cursors/bezier_select_small.xbm"
#include "cursors/bezier_select_small_mask.xbm"
#include "cursors/scissors_small.xbm"
#include "cursors/scissors_small_mask.xbm"
#include "cursors/move_small.xbm"
#include "cursors/move_small_mask.xbm"
#include "cursors/zoom_small.xbm"
#include "cursors/zoom_small_mask.xbm"
#include "cursors/crop_small.xbm"
#include "cursors/crop_small_mask.xbm"
#include "cursors/resize_small.xbm"
#include "cursors/resize_small_mask.xbm"
#include "cursors/rotate_small.xbm"
#include "cursors/rotate_small_mask.xbm"
#include "cursors/shear_small.xbm"
#include "cursors/shear_small_mask.xbm"
#include "cursors/perspective_small.xbm"
#include "cursors/perspective_small_mask.xbm"
#include "cursors/flip_horizontal_small.xbm"
#include "cursors/flip_horizontal_small_mask.xbm"
#include "cursors/flip_vertical_small.xbm"
#include "cursors/flip_vertical_small_mask.xbm"
#include "cursors/text_small.xbm"
#include "cursors/text_small_mask.xbm"
#include "cursors/dropper_small.xbm"
#include "cursors/dropper_small_mask.xbm"
#include "cursors/bucket_fill_small.xbm"
#include "cursors/bucket_fill_small_mask.xbm"
#include "cursors/blend_small.xbm"
#include "cursors/blend_small_mask.xbm"
#include "cursors/pencil_small.xbm"
#include "cursors/pencil_small_mask.xbm"
#include "cursors/paintbrush_small.xbm"
#include "cursors/paintbrush_small_mask.xbm"
#include "cursors/eraser_small.xbm"
#include "cursors/eraser_small_mask.xbm"
#include "cursors/airbrush_small.xbm"
#include "cursors/airbrush_small_mask.xbm"
#include "cursors/clone_small.xbm"
#include "cursors/clone_small_mask.xbm"
#include "cursors/blur_small.xbm"
#include "cursors/blur_small_mask.xbm"
#include "cursors/ink_small.xbm"
#include "cursors/ink_small_mask.xbm"
#include "cursors/dodge_small.xbm"
#include "cursors/dodge_small_mask.xbm"
#include "cursors/burn_small.xbm"
#include "cursors/burn_small_mask.xbm"
#include "cursors/smudge_small.xbm"
#include "cursors/smudge_small_mask.xbm"
#include "cursors/measure_small.xbm"
#include "cursors/measure_small_mask.xbm"
/* modifiers */
#include "cursors/plus.xbm"
#include "cursors/plus_mask.xbm"
@ -69,7 +131,8 @@
/* FIXME: gimp_busy HACK */
gboolean gimp_busy = FALSE;
static BitmapCursor gimp_cursors[] =
static GimpBitmapCursor gimp_cursors[] =
/* these have to match up with the enum in cursorutil.h */
{
{
@ -104,24 +167,174 @@ static BitmapCursor gimp_cursors[] =
}
};
enum
static GimpBitmapCursor gimp_stock_tool_cursors[] =
/* these have to match up with the enum in appenums.h */
{
GIMP_PLUS_CURSOR = GIMP_LAST_CURSOR_ENTRY + 1,
GIMP_MINUS_CURSOR,
GIMP_INTERSECT_CURSOR,
GIMP_MOVE_CURSOR,
GIMP_RESIZE_CURSOR,
GIMP_CONTROL_CURSOR,
GIMP_ANCHOR_CURSOR,
GIMP_FOREGROUND_CURSOR,
GIMP_BACKGROUND_CURSOR,
GIMP_PATTERN_CURSOR,
GIMP_HAND_CURSOR
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
},
{
rect_select_small_bits, rect_select_small_mask_bits,
rect_select_small_width, rect_select_small_height,
0, 0, NULL, NULL, NULL
},
{
ellipse_select_small_bits, ellipse_select_small_mask_bits,
ellipse_select_small_width, ellipse_select_small_height,
0, 0, NULL, NULL, NULL
},
{
free_select_small_bits, free_select_small_mask_bits,
free_select_small_width, free_select_small_height,
0, 0, NULL, NULL, NULL
},
{
fuzzy_select_small_bits, fuzzy_select_small_mask_bits,
fuzzy_select_small_width, fuzzy_select_small_height,
0, 0, NULL, NULL, NULL
},
{
bezier_select_small_bits, bezier_select_small_mask_bits,
bezier_select_small_width, bezier_select_small_height,
0, 0, NULL, NULL, NULL
},
{
scissors_small_bits, scissors_small_mask_bits,
scissors_small_width, scissors_small_height,
0, 0, NULL, NULL, NULL
},
{
move_small_bits, move_small_mask_bits,
move_small_width, move_small_height,
0, 0, NULL, NULL, NULL
},
{
zoom_small_bits, zoom_small_mask_bits,
zoom_small_width, zoom_small_height,
0, 0, NULL, NULL, NULL
},
{
crop_small_bits, crop_small_mask_bits,
crop_small_width, crop_small_height,
0, 0, NULL, NULL, NULL
},
{
resize_small_bits, resize_small_mask_bits,
resize_small_width, resize_small_height,
0, 0, NULL, NULL, NULL
},
{
rotate_small_bits, rotate_small_mask_bits,
rotate_small_width, rotate_small_height,
0, 0, NULL, NULL, NULL
},
{
shear_small_bits, shear_small_mask_bits,
shear_small_width, shear_small_height,
0, 0, NULL, NULL, NULL
},
{
perspective_small_bits, perspective_small_mask_bits,
perspective_small_width, perspective_small_height,
0, 0, NULL, NULL, NULL
},
{
flip_horizontal_small_bits, flip_horizontal_small_mask_bits,
flip_horizontal_small_width, flip_horizontal_small_height,
0, 0, NULL, NULL, NULL
},
{
flip_vertical_small_bits, flip_vertical_small_mask_bits,
flip_vertical_small_width, flip_vertical_small_height,
0, 0, NULL, NULL, NULL
},
{
text_small_bits, text_small_mask_bits,
text_small_width, text_small_height,
0, 0, NULL, NULL, NULL
},
{
dropper_small_bits, dropper_small_mask_bits,
dropper_small_width, dropper_small_height,
0, 0, NULL, NULL, NULL
},
{
bucket_fill_small_bits, bucket_fill_small_mask_bits,
bucket_fill_small_width, bucket_fill_small_height,
0, 0, NULL, NULL, NULL
},
{
blend_small_bits, blend_small_mask_bits,
blend_small_width, blend_small_height,
0, 0, NULL, NULL, NULL
},
{
pencil_small_bits, pencil_small_mask_bits,
pencil_small_width, pencil_small_height,
0, 0, NULL, NULL, NULL
},
{
paintbrush_small_bits, paintbrush_small_mask_bits,
paintbrush_small_width, paintbrush_small_height,
0, 0, NULL, NULL, NULL
},
{
airbrush_small_bits, airbrush_small_mask_bits,
airbrush_small_width, airbrush_small_height,
0, 0, NULL, NULL, NULL
},
{
ink_small_bits, ink_small_mask_bits,
ink_small_width, ink_small_height,
0, 0, NULL, NULL, NULL
},
{
clone_small_bits, clone_small_mask_bits,
clone_small_width, clone_small_height,
0, 0, NULL, NULL, NULL
},
{
eraser_small_bits, eraser_small_mask_bits,
eraser_small_width, eraser_small_height,
0, 0, NULL, NULL, NULL
},
{
smudge_small_bits, smudge_small_mask_bits,
smudge_small_width, smudge_small_height,
0, 0, NULL, NULL, NULL
},
{
blur_small_bits, blur_small_mask_bits,
blur_small_width, blur_small_height,
0, 0, NULL, NULL, NULL
},
{
dodge_small_bits, dodge_small_mask_bits,
dodge_small_width, dodge_small_height,
0, 0, NULL, NULL, NULL
},
{
burn_small_bits, burn_small_mask_bits,
burn_small_width, burn_small_height,
0, 0, NULL, NULL, NULL
},
{
measure_small_bits, measure_small_mask_bits,
measure_small_width, measure_small_height,
0, 0, NULL, NULL, NULL
}
};
static BitmapCursor modifier_cursors[] =
/* these have to match up with the enum above */
static GimpBitmapCursor gimp_modifier_cursors[] =
/* these have to match up with the enum in appenums.h */
{
{
NULL, NULL,
0, 0,
0, 0, NULL, NULL, NULL
},
{
plus_bits, plus_mask_bits,
plus_width, plus_height,
@ -185,7 +398,7 @@ static gboolean pending_removebusy = FALSE;
static void
create_cursor_bitmaps (BitmapCursor *bmcursor)
create_cursor_bitmaps (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL)
bmcursor->bitmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits,
@ -201,7 +414,7 @@ create_cursor_bitmaps (BitmapCursor *bmcursor)
}
static void
create_cursor (BitmapCursor *bmcursor)
create_cursor (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
@ -226,14 +439,12 @@ create_cursor (BitmapCursor *bmcursor)
}
static void
gimp_change_win_cursor (GdkWindow *win,
GimpCursorType curtype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gimp_change_win_cursor_internal (GdkWindow *window,
GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
GimpCursorType modtype = GIMP_PLUS_CURSOR;
GdkCursor *cursor;
GdkBitmap *bitmap;
GdkBitmap *mask;
@ -246,122 +457,97 @@ gimp_change_win_cursor (GdkWindow *win,
gint width;
gint height;
BitmapCursor *bmcursor = NULL;
BitmapCursor *bmmodifier = NULL;
BitmapCursor *bmtool = NULL;
GimpBitmapCursor *bmcursor = NULL;
GimpBitmapCursor *bmmodifier = NULL;
GimpBitmapCursor *bmtool = NULL;
g_return_if_fail (curtype < GIMP_LAST_CURSOR_ENTRY);
g_return_if_fail (window != NULL);
g_return_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY);
/* allow the small tool cursor only with the standard mouse,
* the small crosshair and the bad cursor
*/
if (curtype != GIMP_MOUSE_CURSOR &&
curtype != GIMP_CROSSHAIR_SMALL_CURSOR &&
curtype != GIMP_BAD_CURSOR)
tool_type = TOOL_TYPE_NONE;
if (cursor_type != GIMP_MOUSE_CURSOR &&
cursor_type != GIMP_CROSSHAIR_SMALL_CURSOR &&
cursor_type != GIMP_BAD_CURSOR)
{
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
curtype -= GIMP_MOUSE_CURSOR;
bmcursor = &gimp_cursors[(int)curtype];
cursor_type -= GIMP_MOUSE_CURSOR;
bmcursor = &gimp_cursors[(gint) cursor_type];
if (modifier == CURSOR_MODIFIER_NONE &&
tool_type == TOOL_TYPE_NONE)
/* if there are no modifiers, we can show the cursor immediately
*/
if (modifier == GIMP_CURSOR_MODIFIER_NONE &&
tool_cursor == GIMP_TOOL_CURSOR_NONE)
{
if (bmcursor->cursor == NULL)
create_cursor (bmcursor);
gdk_window_set_cursor (win, bmcursor->cursor);
gdk_window_set_cursor (window, bmcursor->cursor);
return;
}
switch (modifier)
else if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
{
case CURSOR_MODIFIER_PLUS:
modtype = GIMP_PLUS_CURSOR;
break;
case CURSOR_MODIFIER_MINUS:
modtype = GIMP_MINUS_CURSOR;
break;
case CURSOR_MODIFIER_INTERSECT:
modtype = GIMP_INTERSECT_CURSOR;
break;
case CURSOR_MODIFIER_MOVE:
modtype = GIMP_MOVE_CURSOR;
break;
case CURSOR_MODIFIER_RESIZE:
modtype = GIMP_RESIZE_CURSOR;
break;
case CURSOR_MODIFIER_CONTROL:
modtype = GIMP_CONTROL_CURSOR;
break;
case CURSOR_MODIFIER_ANCHOR:
modtype = GIMP_ANCHOR_CURSOR;
break;
case CURSOR_MODIFIER_FOREGROUND:
modtype = GIMP_FOREGROUND_CURSOR;
break;
case CURSOR_MODIFIER_BACKGROUND:
modtype = GIMP_BACKGROUND_CURSOR;
break;
case CURSOR_MODIFIER_PATTERN:
modtype = GIMP_PATTERN_CURSOR;
break;
case CURSOR_MODIFIER_HAND:
modtype = GIMP_HAND_CURSOR;
break;
default:
break;
create_cursor_bitmaps (bmcursor);
}
if (modifier != CURSOR_MODIFIER_NONE)
/* prepare the tool cursor */
if (tool_cursor < GIMP_TOOL_CURSOR_NONE ||
tool_cursor >= GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY)
{
modtype -= GIMP_PLUS_CURSOR;
bmmodifier = &modifier_cursors[(int)modtype];
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
#warning FIXME (check if toggle tool cursor work)
#if 0
if (tool_type != TOOL_TYPE_NONE)
if (tool_cursor != GIMP_TOOL_CURSOR_NONE)
{
if (toggle_cursor)
bmtool = &gimp_stock_tool_cursors[(gint) tool_cursor];
if (bmtool->bitmap == NULL ||
bmtool->mask == NULL)
{
if (tool_info[(gint) tool_type].toggle_cursor.bits != NULL &&
tool_info[(gint) tool_type].toggle_cursor.mask_bits != NULL)
bmtool = &tool_info[(gint) tool_type].toggle_cursor;
}
else
{
if (tool_info[(gint) tool_type].tool_cursor.bits != NULL &&
tool_info[(gint) tool_type].tool_cursor.mask_bits != NULL)
bmtool = &tool_info[(gint) tool_type].tool_cursor;
create_cursor_bitmaps (bmtool);
}
}
#endif
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
create_cursor_bitmaps (bmcursor);
/* prepare the cursor modifier */
if (bmmodifier &&
(bmmodifier->bitmap == NULL ||
bmmodifier->mask == NULL))
create_cursor_bitmaps (bmmodifier);
if (modifier < GIMP_CURSOR_MODIFIER_NONE ||
modifier >= GIMP_LAST_CURSOR_MODIFIER_ENTRY)
{
modifier = GIMP_CURSOR_MODIFIER_NONE;
}
if (bmtool &&
(bmtool->bitmap == NULL ||
bmtool->mask == NULL))
create_cursor_bitmaps (bmtool);
if (modifier != GIMP_CURSOR_MODIFIER_NONE)
{
bmmodifier = &gimp_modifier_cursors[(gint) modifier];
if (bmmodifier->bitmap == NULL ||
bmmodifier->mask == NULL)
{
create_cursor_bitmaps (bmmodifier);
}
}
if (gc == NULL)
gc = gdk_gc_new (bmcursor->bitmap);
gdk_window_get_size (bmcursor->bitmap, &width, &height);
/* new bitmap and mask for on-the-fly cursor creation */
bitmap = gdk_pixmap_new (NULL, width, height, 1);
mask = gdk_pixmap_new (NULL, width, height, 1);
color.pixel = 1;
gdk_gc_set_foreground (gc, &color);
/* first draw the bitmap completely ... */
gdk_draw_pixmap (bitmap, gc, bmcursor->bitmap,
0, 0, 0, 0, width, height);
@ -381,6 +567,8 @@ gimp_change_win_cursor (GdkWindow *win,
gdk_gc_set_clip_mask (gc, NULL);
}
/* ... then the mask */
gdk_draw_pixmap (mask, gc, bmcursor->mask,
0, 0, 0, 0, width, height);
@ -408,37 +596,38 @@ gimp_change_win_cursor (GdkWindow *win,
&fg, &bg,
bmcursor->x_hot,
bmcursor->y_hot);
gdk_window_set_cursor (win, cursor);
gdk_window_set_cursor (window, cursor);
gdk_cursor_destroy (cursor);
gdk_bitmap_unref (bitmap);
gdk_bitmap_unref (mask);
}
void
change_win_cursor (GdkWindow *win,
GdkCursorType cursortype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor)
gimp_change_win_cursor (GdkWindow *win,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
if (cursortype > GDK_LAST_CURSOR)
if (cursor_type > GDK_LAST_CURSOR)
{
gimp_change_win_cursor (win, (GimpCursorType) cursortype,
tool_type,
modifier,
toggle_cursor);
gimp_change_win_cursor_internal (win,
(GimpCursorType) cursor_type,
tool_cursor,
modifier);
return;
}
cursor = gdk_cursor_new (cursortype);
cursor = gdk_cursor_new (cursor_type);
gdk_window_set_cursor (win, cursor);
gdk_cursor_destroy (cursor);
}
void
unset_win_cursor (GdkWindow *win)
gimp_unset_win_cursor (GdkWindow *win)
{
gdk_window_set_cursor (win, NULL);
}

View File

@ -20,7 +20,7 @@
#define __CURSORUTIL_H__
struct _BitmapCursor
struct _GimpBitmapCursor
{
guchar *bits;
guchar *mask_bits;
@ -31,6 +31,7 @@ struct _BitmapCursor
GdkCursor *cursor;
};
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
@ -42,22 +43,23 @@ typedef enum
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
/* FIXME: gimp_busy HACK */
extern gboolean gimp_busy;
void change_win_cursor (GdkWindow *win,
GdkCursorType curtype,
ToolType tool_type,
CursorModifier modifier,
gboolean toggle_cursor);
void unset_win_cursor (GdkWindow *win);
void gimp_change_win_cursor (GdkWindow *win,
GdkCursorType curtype,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gimp_unset_win_cursor (GdkWindow *win);
void gimp_add_busy_cursors_until_idle (void);
void gimp_add_busy_cursors (void);
gint gimp_remove_busy_cursors (gpointer data);
gint gimp_remove_busy_cursors (gpointer data);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
#endif /* __CURSORUTIL_H__ */