app/Makefile.am removed. Stuff now lives in app_procs.[ch] and in

2001-05-13  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/cursorutil.[ch]: removed. Stuff now lives in app_procs.[ch]
	and in widgets/gimpcursor.[ch]

	* app/appenv.h: added the "gimp_busy" boolean.

	* app/app_procs.[ch]: added the "busy" stuff here.

	* app/gui/gui.[ch]: "busy" stuff for the gui.

	* app/widgets/Makefile.am
	* app/widgets/gimpcursor.[ch]: exports only one function:
	gimp_cursor_new() which returns a GdkCursor which has to be
	destroyed.

	* app/apptypes.h
	* app/appenums.h: removed the cursor types.
	* app/widgets/widgets-types.h: added here.

	* app/tools/gimpeditselectiontool.[ch]: added
	gtkutil_compress_motion() here (will go to some utils file in
	widgets/).

	* app/tools/tools-types.h: #include "widgets/widgets-types.h"

	* app/dialog_handler.c
	* app/disp_callbacks.c
	* app/gdisplay.[ch]
	* app/nav_window.c
	* app/scroll.c
	* app/xcf.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage.c
	* app/gui/file-open-dialog.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimptransformtool.c
	* tools/pdbgen/pdb/image.pdb
	* app/pdb/image_cmds.c: use the new cursor and "busy" functions.

	* app/gdisplay.h
	* app/core/gimpbrush.c: added some ugly cross-includes.

	* app/context_manager.c
	* app/gdisplay_ops.c
	* app/gimprc.c
	* app/core/gimpdrawable-offset.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/preferences-dialog.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimprectselecttool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpselectiontool.c: removed inclusion of "cursorutil.h"
This commit is contained in:
Michael Natterer 2001-05-13 21:51:20 +00:00 committed by Michael Natterer
parent 0a4ec8fb8c
commit 0cbbef4025
94 changed files with 670 additions and 1369 deletions

View File

@ -1,3 +1,74 @@
2001-05-13 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/cursorutil.[ch]: removed. Stuff now lives in app_procs.[ch]
and in widgets/gimpcursor.[ch]
* app/appenv.h: added the "gimp_busy" boolean.
* app/app_procs.[ch]: added the "busy" stuff here.
* app/gui/gui.[ch]: "busy" stuff for the gui.
* app/widgets/Makefile.am
* app/widgets/gimpcursor.[ch]: exports only one function:
gimp_cursor_new() which returns a GdkCursor which has to be
destroyed.
* app/apptypes.h
* app/appenums.h: removed the cursor types.
* app/widgets/widgets-types.h: added here.
* app/tools/gimpeditselectiontool.[ch]: added
gtkutil_compress_motion() here (will go to some utils file in
widgets/).
* app/tools/tools-types.h: #include "widgets/widgets-types.h"
* app/dialog_handler.c
* app/disp_callbacks.c
* app/gdisplay.[ch]
* app/nav_window.c
* app/scroll.c
* app/xcf.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/gui/file-open-dialog.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcroptool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* tools/pdbgen/pdb/image.pdb
* app/pdb/image_cmds.c: use the new cursor and "busy" functions.
* app/gdisplay.h
* app/core/gimpbrush.c: added some ugly cross-includes.
* app/context_manager.c
* app/gdisplay_ops.c
* app/gimprc.c
* app/core/gimpdrawable-offset.c
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/preferences-dialog.c
* app/tools/gimpbezierselecttool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpclonetool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimperasertool.c
* app/tools/gimpfliptool.c
* app/tools/gimpinktool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimpmagnifytool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* app/tools/gimprectselecttool.c
* app/tools/gimprotatetool.c
* app/tools/gimpselectiontool.c: removed inclusion of "cursorutil.h"
2001-05-13 Michael Natterer <mitch@gimp.org>
* app/appenums.h

View File

@ -53,11 +53,6 @@ gimp_SOURCES = \
undo_history.c \
undo_history.h \
##
## stuff for widgets/
##
cursorutil.c \
cursorutil.h \
##
## display stuff
##
disp_callbacks.c \

View File

@ -96,6 +96,9 @@ static void app_init (void);
static void toast_old_temp_files (void);
/* FIXME: gimp_busy HACK */
gboolean gimp_busy = FALSE;
static gboolean is_app_exit_finish_done = FALSE;
@ -327,6 +330,49 @@ app_exit_finish_done (void)
return is_app_exit_finish_done;
}
void
gimp_set_busy (void)
{
/* FIXME: gimp_busy HACK */
gimp_busy = TRUE;
gui_set_busy ();
}
static gboolean
gimp_idle_unset_busy (gpointer data)
{
gimp_unset_busy ();
*((guint *) data) = 0;
return FALSE;
}
void
gimp_set_busy_until_idle (void)
{
static guint busy_idle_id = 0;
if (! busy_idle_id)
{
gimp_set_busy ();
busy_idle_id = g_idle_add_full (G_PRIORITY_HIGH,
gimp_idle_unset_busy, &busy_idle_id,
NULL);
}
}
void
gimp_unset_busy (void)
{
gui_unset_busy ();
/* FIXME: gimp_busy HACK */
gimp_busy = FALSE;
}
static void
toast_old_temp_files (void)
{

View File

@ -20,16 +20,20 @@
#define __APP_PROCS_H__
void gimp_init (gint gimp_argc,
gchar **gimp_argv);
void gimp_init (gint gimp_argc,
gchar **gimp_argv);
void app_init_update_status (const gchar *label1,
const gchar *label2,
gdouble percentage);
void app_init_update_status (const gchar *label1,
const gchar *label2,
gdouble percentage);
void app_exit (gboolean kill_it);
void app_exit_finish (void);
gboolean app_exit_finish_done (void);
void app_exit (gboolean kill_it);
void app_exit_finish (void);
gboolean app_exit_finish_done (void);
void gimp_set_busy (void);
void gimp_set_busy_until_idle (void);
void gimp_unset_busy (void);
#endif /* __APP_PROCS_H__ */

View File

@ -218,58 +218,4 @@ typedef enum /*< skip >*/
} GimpHistogramChannel;
typedef enum /*< skip >*/
{
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

@ -40,6 +40,9 @@ extern gboolean double_speed;
extern MessageHandlerType message_handler;
/* FIXME: gimp_busy HACK */
extern gboolean gimp_busy;
#ifdef G_OS_WIN32
gchar * quote_spaces (gchar *string);

View File

@ -34,8 +34,6 @@
typedef struct _Argument Argument;
typedef struct _GimpBitmapCursor GimpBitmapCursor;
typedef struct _BoundSeg BoundSeg;
typedef struct _ColorNotebook ColorNotebook;

View File

@ -41,7 +41,6 @@
#include "gui/brush-select.h"
#include "appenv.h"
#include "cursorutil.h"
#include "context_manager.h"
#include "gdisplay.h"
#include "gimprc.h"

View File

@ -39,10 +39,10 @@
#include "core/gimptoolinfo.h"
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimprc.h"
@ -559,7 +559,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
gboolean new_layer;
gint i, x, y;
gimp_add_busy_cursors ();
gimp_set_busy ();
tool = GIMP_TOOL (gt_tool);
@ -656,7 +656,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
}
}
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
gdisplays_flush ();

View File

@ -51,6 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/tools-types.h"
#include "tools/gimppainttool.h"
#include "brush_scale.h"

View File

@ -51,6 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/tools-types.h"
#include "tools/gimppainttool.h"
#include "brush_scale.h"

View File

@ -40,7 +40,7 @@
#include "widgets/gimpdnd.h"
#include "appenv.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
@ -918,7 +918,7 @@ blend (GimpImage *gimage,
gint bytes;
gint x1, y1, x2, y2;
gimp_add_busy_cursors();
gimp_set_busy ();
has_selection = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -953,7 +953,7 @@ blend (GimpImage *gimage,
/* free the temporary buffer */
tile_manager_destroy (buf_tiles);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static gdouble

View File

@ -29,8 +29,6 @@
#include "paint-funcs/paint-funcs.h"
#include "apptypes.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"

View File

@ -39,10 +39,10 @@
#include "core/gimptoolinfo.h"
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimprc.h"
@ -559,7 +559,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
gboolean new_layer;
gint i, x, y;
gimp_add_busy_cursors ();
gimp_set_busy ();
tool = GIMP_TOOL (gt_tool);
@ -656,7 +656,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
}
}
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
gdisplays_flush ();

View File

@ -104,7 +104,7 @@
#include "core-types.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "gdisplay.h"
#include "floating_sel.h"
@ -692,7 +692,7 @@ gimp_image_convert (GimpImage *gimage,
theCustomPalette = custom_palette;
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -945,7 +945,7 @@ gimp_image_convert (GimpImage *gimage,
gimp_image_mode_changed (gimage);
gimp_remove_busy_cursors(NULL);
gimp_unset_busy ();
}
static void

View File

@ -25,6 +25,7 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "apptypes.h"
#include "core-types.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
@ -32,8 +33,7 @@
#include "paint-funcs/paint-funcs.h"
#include "apptypes.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -73,7 +73,7 @@ gimp_image_duplicate (GimpImage *gimage)
g_return_val_if_fail (gimage != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Create a new image */
new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type);

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -31,7 +31,6 @@
#include "gui/info-dialog.h"
#include "gui/palette-editor.h"
#include "gdisplay.h"
#include "cursorutil.h"
#include "gimpui.h"
#include "gimpdrawtool.h"

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -32,7 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
@ -733,7 +733,7 @@ gimp_image_resize (GimpImage *gimage,
GList *list;
GList *guide_list;
gimp_add_busy_cursors ();
gimp_set_busy ();
g_assert (new_width > 0 && new_height > 0);
@ -819,7 +819,7 @@ gimp_image_resize (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void
@ -846,7 +846,7 @@ gimp_image_scale (GimpImage *gimage,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the floating layer if one exists */
floating_layer = gimp_image_floating_sel (gimage);
@ -948,7 +948,7 @@ gimp_image_scale (GimpImage *gimage,
gimp_image_size_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
TileManager *
@ -2259,7 +2259,7 @@ gimp_image_validate (TileManager *tm,
gint x, y;
gint w, h;
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
/* Get the gimage from the tilemanager */
gimage = (GimpImage *) tile_manager_get_user_data (tm);
@ -2942,12 +2942,12 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (merge_list && merge_list->next)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -2975,7 +2975,7 @@ gimp_image_flatten (GimpImage *gimage)
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* if there's a floating selection, anchor it */
if (gimp_image_floating_sel (gimage))
@ -2996,7 +2996,7 @@ gimp_image_flatten (GimpImage *gimage)
gimp_image_alpha_changed (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
@ -3036,10 +3036,14 @@ gimp_image_merge_down (GimpImage *gimage,
if (merge_list)
{
merge_list = g_slist_prepend (merge_list, current_layer);
gimp_add_busy_cursors ();
gimp_set_busy ();
layer = gimp_image_merge_layers (gimage, merge_list, merge_type);
g_slist_free (merge_list);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return layer;
}
else

View File

@ -35,10 +35,11 @@
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
@ -1862,14 +1863,17 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
gdisp->cursor_modifier != modifier ||
always_install)
{
GdkCursor *cursor;
gdisp->current_cursor = cursor_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
cursor = gimp_cursor_new (cursor_type,
tool_cursor,
modifier);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1895,13 +1899,16 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
(gdisp->using_override_cursor &&
(gdisp->override_cursor != cursor_type)))
{
GdkCursor *cursor;
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1922,7 +1929,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
gimp_unset_win_cursor (gdisp->canvas->window);
gdk_window_set_cursor (gdisp->canvas->window, NULL);
}
void

View File

@ -20,6 +20,10 @@
#define __GDISPLAY_H__
/* FIXME: don't include gdisplay.h from core/ */
#include "widgets/widgets-types.h"
typedef enum
{
SelectionOff,

View File

@ -1,755 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "core/core-types.h"
#include "appenv.h"
#include "cursorutil.h"
#include "dialog_handler.h"
#include "gdisplay.h" /* for gdisplay_*_override_cursor() */
/* standard gimp cursors */
#include "cursors/mouse.xbm"
#include "cursors/mouse_mask.xbm"
#include "cursors/crosshair.xbm"
#include "cursors/crosshair_mask.xbm"
#include "cursors/crosshair_small.xbm"
#include "cursors/crosshair_small_mask.xbm"
#include "cursors/bad.xbm"
#include "cursors/bad_mask.xbm"
#include "cursors/zoom.xbm"
#include "cursors/zoom_mask.xbm"
#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"
#include "cursors/minus.xbm"
#include "cursors/minus_mask.xbm"
#include "cursors/intersect.xbm"
#include "cursors/intersect_mask.xbm"
#include "cursors/move.xbm"
#include "cursors/move_mask.xbm"
#include "cursors/resize.xbm"
#include "cursors/resize_mask.xbm"
#include "cursors/control.xbm"
#include "cursors/control_mask.xbm"
#include "cursors/anchor.xbm"
#include "cursors/anchor_mask.xbm"
#include "cursors/foreground.xbm"
#include "cursors/foreground_mask.xbm"
#include "cursors/background.xbm"
#include "cursors/background_mask.xbm"
#include "cursors/pattern.xbm"
#include "cursors/pattern_mask.xbm"
#include "cursors/hand.xbm"
#include "cursors/hand_mask.xbm"
/* FIXME: gimp_busy HACK */
gboolean gimp_busy = FALSE;
static GimpBitmapCursor gimp_cursors[] =
/* these have to match up with the enum in cursorutil.h */
{
{
mouse_bits, mouse_mask_bits,
mouse_width, mouse_height,
mouse_x_hot, mouse_y_hot, NULL, NULL, NULL
},
{
crosshair_bits, crosshair_mask_bits,
crosshair_width, crosshair_height,
crosshair_x_hot, crosshair_y_hot, NULL, NULL, NULL
},
{
crosshair_small_bits, crosshair_small_mask_bits,
crosshair_small_width, crosshair_small_height,
crosshair_small_x_hot, crosshair_small_y_hot, NULL, NULL, NULL
},
{
bad_bits, bad_mask_bits,
bad_width, bad_height,
bad_x_hot, bad_y_hot, NULL, NULL, NULL
},
{
zoom_bits, zoom_mask_bits,
zoom_width, zoom_height,
zoom_x_hot, zoom_y_hot, NULL, NULL, NULL
},
{
dropper_bits, dropper_mask_bits,
dropper_width, dropper_height,
dropper_x_hot, dropper_y_hot, NULL, NULL, NULL
}
};
static GimpBitmapCursor gimp_stock_tool_cursors[] =
/* these have to match up with the enum in appenums.h */
{
{
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 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,
plus_x_hot, plus_y_hot, NULL, NULL, NULL
},
{
minus_bits, minus_mask_bits,
minus_width, minus_height,
minus_x_hot, minus_y_hot, NULL, NULL, NULL
},
{
intersect_bits, intersect_mask_bits,
intersect_width, intersect_height,
intersect_x_hot, intersect_y_hot, NULL, NULL, NULL
},
{
move_bits, move_mask_bits,
move_width, move_height,
move_x_hot, move_y_hot, NULL, NULL, NULL
},
{
resize_bits, resize_mask_bits,
resize_width, resize_height,
resize_x_hot, resize_y_hot, NULL, NULL, NULL
},
{
control_bits, control_mask_bits,
control_width, control_height,
control_x_hot, control_y_hot, NULL, NULL, NULL
},
{
anchor_bits, anchor_mask_bits,
anchor_width, anchor_height,
anchor_x_hot, anchor_y_hot, NULL, NULL, NULL
},
{
foreground_bits, foreground_mask_bits,
foreground_width, foreground_height,
foreground_x_hot, foreground_y_hot, NULL, NULL, NULL
},
{
background_bits, background_mask_bits,
background_width, background_height,
background_x_hot, background_y_hot, NULL, NULL, NULL
},
{
pattern_bits, pattern_mask_bits,
pattern_width, pattern_height,
pattern_x_hot, pattern_y_hot, NULL, NULL, NULL
},
{
hand_bits, hand_mask_bits,
hand_width, hand_height,
hand_x_hot, hand_y_hot, NULL, NULL, NULL
}
};
extern GSList *display_list; /* It's in gdisplay.c, FYI */
static gboolean pending_removebusy = FALSE;
static void
create_cursor_bitmaps (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL)
bmcursor->bitmap = gdk_bitmap_create_from_data (NULL, bmcursor->bits,
bmcursor->width,
bmcursor->height);
g_return_if_fail (bmcursor->bitmap != NULL);
if (bmcursor->mask == NULL)
bmcursor->mask = gdk_bitmap_create_from_data (NULL, bmcursor->mask_bits,
bmcursor->width,
bmcursor->height);
g_return_if_fail (bmcursor->mask != NULL);
}
static void
create_cursor (GimpBitmapCursor *bmcursor)
{
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
create_cursor_bitmaps (bmcursor);
if (bmcursor->cursor == NULL)
{
GdkColor fg, bg;
/* should have a way to configure the mouse colors */
gdk_color_parse ("#FFFFFF", &bg);
gdk_color_parse ("#000000", &fg);
bmcursor->cursor = gdk_cursor_new_from_pixmap (bmcursor->bitmap,
bmcursor->mask,
&fg, &bg,
bmcursor->x_hot,
bmcursor->y_hot);
}
g_return_if_fail (bmcursor->cursor != NULL);
}
static void
gimp_change_win_cursor_internal (GdkWindow *window,
GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
GdkBitmap *bitmap;
GdkBitmap *mask;
GdkColor color;
GdkColor fg, bg;
static GdkGC *gc = NULL;
gint width;
gint height;
GimpBitmapCursor *bmcursor = NULL;
GimpBitmapCursor *bmmodifier = NULL;
GimpBitmapCursor *bmtool = NULL;
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 (cursor_type != GIMP_MOUSE_CURSOR &&
cursor_type != GIMP_CROSSHAIR_SMALL_CURSOR &&
cursor_type != GIMP_BAD_CURSOR)
{
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
cursor_type -= GIMP_MOUSE_CURSOR;
bmcursor = &gimp_cursors[(gint) cursor_type];
/* 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 (window, bmcursor->cursor);
return;
}
else if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
{
create_cursor_bitmaps (bmcursor);
}
/* prepare the tool cursor */
if (tool_cursor < GIMP_TOOL_CURSOR_NONE ||
tool_cursor >= GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY)
{
tool_cursor = GIMP_TOOL_CURSOR_NONE;
}
if (tool_cursor != GIMP_TOOL_CURSOR_NONE)
{
bmtool = &gimp_stock_tool_cursors[(gint) tool_cursor];
if (bmtool->bitmap == NULL ||
bmtool->mask == NULL)
{
create_cursor_bitmaps (bmtool);
}
}
/* prepare the cursor modifier */
if (modifier < GIMP_CURSOR_MODIFIER_NONE ||
modifier >= GIMP_LAST_CURSOR_MODIFIER_ENTRY)
{
modifier = GIMP_CURSOR_MODIFIER_NONE;
}
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);
if (bmmodifier)
{
gdk_gc_set_clip_mask (gc, bmmodifier->bitmap);
gdk_draw_pixmap (bitmap, gc, bmmodifier->bitmap,
0, 0, 0, 0, width, height);
gdk_gc_set_clip_mask (gc, NULL);
}
if (bmtool)
{
gdk_gc_set_clip_mask (gc, bmtool->bitmap);
gdk_draw_pixmap (bitmap, gc, bmtool->bitmap,
0, 0, 0, 0, width, height);
gdk_gc_set_clip_mask (gc, NULL);
}
/* ... then the mask */
gdk_draw_pixmap (mask, gc, bmcursor->mask,
0, 0, 0, 0, width, height);
if (bmmodifier)
{
gdk_gc_set_clip_mask (gc, bmmodifier->mask);
gdk_draw_pixmap (mask, gc, bmmodifier->mask,
0, 0, 0, 0, width, height);
gdk_gc_set_clip_mask (gc, NULL);
}
if (bmtool)
{
gdk_gc_set_clip_mask (gc, bmtool->mask);
gdk_draw_pixmap (mask, gc, bmtool->mask,
0, 0, 0, 0, width, height);
gdk_gc_set_clip_mask (gc, NULL);
}
/* should have a way to configure the mouse colors */
gdk_color_parse ("#FFFFFF", &bg);
gdk_color_parse ("#000000", &fg);
cursor = gdk_cursor_new_from_pixmap (bitmap, mask,
&fg, &bg,
bmcursor->x_hot,
bmcursor->y_hot);
gdk_window_set_cursor (window, cursor);
gdk_cursor_destroy (cursor);
gdk_bitmap_unref (bitmap);
gdk_bitmap_unref (mask);
}
void
gimp_change_win_cursor (GdkWindow *win,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
if (cursor_type > GDK_LAST_CURSOR)
{
gimp_change_win_cursor_internal (win,
(GimpCursorType) cursor_type,
tool_cursor,
modifier);
return;
}
cursor = gdk_cursor_new (cursor_type);
gdk_window_set_cursor (win, cursor);
gdk_cursor_destroy (cursor);
}
void
gimp_unset_win_cursor (GdkWindow *win)
{
gdk_window_set_cursor (win, NULL);
}
void
gimp_add_busy_cursors_until_idle (void)
{
if (!pending_removebusy)
{
gimp_add_busy_cursors ();
gtk_idle_add_priority (GTK_PRIORITY_HIGH,
gimp_remove_busy_cursors, NULL);
pending_removebusy = TRUE;
}
}
void
gimp_add_busy_cursors (void)
{
GDisplay *gdisp;
GSList *list;
/* FIXME: gimp_busy HACK */
gimp_busy = TRUE;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_install_override_cursor (gdisp, GDK_WATCH);
}
/* Dialogs */
dialog_idle_all ();
gdk_flush ();
}
gint
gimp_remove_busy_cursors (gpointer data)
{
GDisplay *gdisp;
GSList *list;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_remove_override_cursor (gdisp);
}
/* Dialogs */
dialog_unidle_all ();
pending_removebusy = FALSE;
/* FIXME: gimp_busy HACK */
gimp_busy = FALSE;
return 0;
}
/***************************************************************/
/* gtkutil_compress_motion:
This function walks the whole GDK event queue seeking motion events
corresponding to the widget 'widget'. If it finds any it will
remove them from the queue, write the most recent motion offset
to 'lastmotion_x' and 'lastmotion_y', then return TRUE. Otherwise
it will return FALSE and 'lastmotion_x' / 'lastmotion_y' will be
untouched.
*/
/* The gtkutil_compress_motion function source may be re-used under
the XFree86-style license. <adam@gimp.org> */
gboolean
gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y)
{
GdkEvent *event;
GList *requeued_events = NULL;
GList *list;
gboolean success = FALSE;
/* Move the entire GDK event queue to a private list, filtering
out any motion events for the desired widget. */
while (gdk_events_pending ())
{
event = gdk_event_get ();
if (!event)
{
/* Do nothing */
}
else if ((gtk_get_event_widget (event) == widget) &&
(event->any.type == GDK_MOTION_NOTIFY))
{
*lastmotion_x = event->motion.x;
*lastmotion_y = event->motion.y;
gdk_event_free (event);
success = TRUE;
}
else
{
requeued_events = g_list_prepend (requeued_events, event);
}
}
/* Replay the remains of our private event list back into the
event queue in order. */
requeued_events = g_list_reverse (requeued_events);
for (list = requeued_events; list; list = g_list_next (list))
{
gdk_event_put ((GdkEvent*) list->data);
gdk_event_free ((GdkEvent*) list->data);
}
g_list_free (requeued_events);
return success;
}

View File

@ -1,65 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CURSORUTIL_H__
#define __CURSORUTIL_H__
struct _GimpBitmapCursor
{
guchar *bits;
guchar *mask_bits;
gint width, height;
gint x_hot, y_hot;
GdkBitmap *bitmap;
GdkBitmap *mask;
GdkCursor *cursor;
};
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
GIMP_CROSSHAIR_CURSOR,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_BAD_CURSOR,
GIMP_ZOOM_CURSOR,
GIMP_COLOR_PICKER_CURSOR,
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
/* FIXME: gimp_busy HACK */
extern gboolean gimp_busy;
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);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
#endif /* __CURSORUTIL_H__ */

View File

@ -25,8 +25,10 @@
#include <gmodule.h>
#include "apptypes.h"
#include "cursorutil.h"
#include "widgets/widgets-types.h"
#include "widgets/gimpcursor.h"
#include "dialog_handler.h"
@ -172,27 +174,36 @@ dialog_idle_all (void)
}
else if(GTK_WIDGET_VISIBLE (dstate->dialog))
{
gimp_change_win_cursor (dstate->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
GdkCursor *cursor;
cursor = gimp_cursor_new (GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (dstate->dialog->window, cursor);
gdk_cursor_destroy (cursor);
}
}
if (toolbox_shell && GTK_WIDGET_VISIBLE (toolbox_shell->dialog))
{
gimp_change_win_cursor (toolbox_shell->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
GdkCursor *cursor;
cursor = gimp_cursor_new (GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (toolbox_shell->dialog->window, cursor);
gdk_cursor_destroy (cursor);
}
if (fileload_shell && GTK_WIDGET_VISIBLE (fileload_shell->dialog))
{
gimp_change_win_cursor (fileload_shell->dialog->window,
GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
GdkCursor *cursor;
cursor = gimp_cursor_new (GDK_WATCH,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (fileload_shell->dialog->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -221,18 +232,18 @@ dialog_unidle_all (void)
}
else if (GTK_WIDGET_VISIBLE (dstate->dialog))
{
gimp_unset_win_cursor (dstate->dialog->window);
gdk_window_set_cursor (dstate->dialog->window, NULL);
}
}
if (toolbox_shell && GTK_WIDGET_VISIBLE (toolbox_shell->dialog))
{
gimp_unset_win_cursor (toolbox_shell->dialog->window);
gdk_window_set_cursor (toolbox_shell->dialog->window, NULL);
}
if (fileload_shell && GTK_WIDGET_VISIBLE (fileload_shell->dialog))
{
gimp_unset_win_cursor (fileload_shell->dialog->window);
gdk_window_set_cursor (fileload_shell->dialog->window, NULL);
}
}

View File

@ -43,7 +43,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "file-dialog-utils.h"
#include "file-open-dialog.h"
#include "dialog_handler.h"
@ -680,7 +680,7 @@ file_open_genbutton_callback (GtkWidget *widget,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
gtk_widget_set_sensitive (GTK_WIDGET (fileload), FALSE);
/* new mult-file preview make: */
@ -764,7 +764,7 @@ file_open_genbutton_callback (GtkWidget *widget,
}
gtk_widget_set_sensitive (GTK_WIDGET (fileload), TRUE);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -37,7 +37,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "dialog_handler.h"
#include "docindex.h"
#include "file-dialog-utils.h"

View File

@ -31,7 +31,6 @@
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "layer-select.h"
#include "session.h"

View File

@ -41,7 +41,6 @@
#include "tools/gimpmovetool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "devices.h"
#include "dialog_handler.h"
#include "disp_callbacks.h"
@ -50,6 +49,7 @@
#include "gui/layer-select.h"
#include "appenv.h"
#include "app_procs.h"
#include "drawable.h"
#include "gimprc.h"
#include "gimpui.h"
@ -747,7 +747,7 @@ gdisplay_origin_button_press (GtkWidget *widget,
gdisp = (GDisplay *) data;
if (!gimp_busy && event->button == 1)
if (! gimp_busy && event->button == 1)
{
gint x, y;
@ -903,7 +903,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (!drawable)
return;
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the bucket fill context */
tool_info = tool_manager_get_info_by_type (GIMP_TYPE_BUCKET_FILL_TOOL);
@ -984,7 +984,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (new_buf)
temp_buf_free (pat_buf);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void

View File

@ -41,7 +41,6 @@
#include "tools/gimpmovetool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "devices.h"
#include "dialog_handler.h"
#include "disp_callbacks.h"
@ -50,6 +49,7 @@
#include "gui/layer-select.h"
#include "appenv.h"
#include "app_procs.h"
#include "drawable.h"
#include "gimprc.h"
#include "gimpui.h"
@ -747,7 +747,7 @@ gdisplay_origin_button_press (GtkWidget *widget,
gdisp = (GDisplay *) data;
if (!gimp_busy && event->button == 1)
if (! gimp_busy && event->button == 1)
{
gint x, y;
@ -903,7 +903,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (!drawable)
return;
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the bucket fill context */
tool_info = tool_manager_get_info_by_type (GIMP_TYPE_BUCKET_FILL_TOOL);
@ -984,7 +984,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (new_buf)
temp_buf_free (pat_buf);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void

View File

@ -26,8 +26,8 @@
#include "core/gimpimage.h"
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "gdisplay_ops.h"
#include "gimprc.h"

View File

@ -25,10 +25,11 @@
#include "core/core-types.h"
#include "tools/tools-types.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "scale.h"
#include "scroll.h"
@ -48,13 +49,16 @@ void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}

View File

@ -35,10 +35,11 @@
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
@ -1862,14 +1863,17 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
gdisp->cursor_modifier != modifier ||
always_install)
{
GdkCursor *cursor;
gdisp->current_cursor = cursor_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
cursor = gimp_cursor_new (cursor_type,
tool_cursor,
modifier);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1895,13 +1899,16 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
(gdisp->using_override_cursor &&
(gdisp->override_cursor != cursor_type)))
{
GdkCursor *cursor;
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1922,7 +1929,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
gimp_unset_win_cursor (gdisp->canvas->window);
gdk_window_set_cursor (gdisp->canvas->window, NULL);
}
void

View File

@ -20,6 +20,10 @@
#define __GDISPLAY_H__
/* FIXME: don't include gdisplay.h from core/ */
#include "widgets/widgets-types.h"
typedef enum
{
SelectionOff,

View File

@ -41,7 +41,6 @@
#include "tools/gimpmovetool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "devices.h"
#include "dialog_handler.h"
#include "disp_callbacks.h"
@ -50,6 +49,7 @@
#include "gui/layer-select.h"
#include "appenv.h"
#include "app_procs.h"
#include "drawable.h"
#include "gimprc.h"
#include "gimpui.h"
@ -747,7 +747,7 @@ gdisplay_origin_button_press (GtkWidget *widget,
gdisp = (GDisplay *) data;
if (!gimp_busy && event->button == 1)
if (! gimp_busy && event->button == 1)
{
gint x, y;
@ -903,7 +903,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (!drawable)
return;
gimp_add_busy_cursors ();
gimp_set_busy ();
/* Get the bucket fill context */
tool_info = tool_manager_get_info_by_type (GIMP_TYPE_BUCKET_FILL_TOOL);
@ -984,7 +984,7 @@ gdisplay_bucket_fill (GtkWidget *widget,
if (new_buf)
temp_buf_free (pat_buf);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
void

View File

@ -25,10 +25,11 @@
#include "core/core-types.h"
#include "tools/tools-types.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "scale.h"
#include "scroll.h"
@ -48,13 +49,16 @@ void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}

View File

@ -31,7 +31,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "dialog_handler.h"
#include "gui/info-dialog.h"
#include "gui/info-window.h"
@ -445,7 +445,7 @@ nav_window_update_preview (NavWinData *iwd)
gint xoff = 0;
gint yoff = 0;
gimp_add_busy_cursors ();
gimp_set_busy ();
gdisp = iwd->gdisp;
gimage = gdisp->gimage;
@ -590,7 +590,7 @@ nav_window_update_preview (NavWinData *iwd)
if (preview_buf_notdot)
temp_buf_free (preview_buf_notdot);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -31,7 +31,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "dialog_handler.h"
#include "gui/info-dialog.h"
#include "gui/info-window.h"
@ -445,7 +445,7 @@ nav_window_update_preview (NavWinData *iwd)
gint xoff = 0;
gint yoff = 0;
gimp_add_busy_cursors ();
gimp_set_busy ();
gdisp = iwd->gdisp;
gimage = gdisp->gimage;
@ -590,7 +590,7 @@ nav_window_update_preview (NavWinData *iwd)
if (preview_buf_notdot)
temp_buf_free (preview_buf_notdot);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -35,10 +35,11 @@
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
@ -1862,14 +1863,17 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp,
gdisp->cursor_modifier != modifier ||
always_install)
{
GdkCursor *cursor;
gdisp->current_cursor = cursor_type;
gdisp->tool_cursor = tool_cursor;
gdisp->cursor_modifier = modifier;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
tool_cursor,
modifier);
cursor = gimp_cursor_new (cursor_type,
tool_cursor,
modifier);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1895,13 +1899,16 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
(gdisp->using_override_cursor &&
(gdisp->override_cursor != cursor_type)))
{
GdkCursor *cursor;
gdisp->override_cursor = cursor_type;
gdisp->using_override_cursor = TRUE;
gimp_change_win_cursor (gdisp->canvas->window,
cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (cursor_type,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}
}
@ -1922,7 +1929,7 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
gimp_unset_win_cursor (gdisp->canvas->window);
gdk_window_set_cursor (gdisp->canvas->window, NULL);
}
void

View File

@ -20,6 +20,10 @@
#define __GDISPLAY_H__
/* FIXME: don't include gdisplay.h from core/ */
#include "widgets/widgets-types.h"
typedef enum
{
SelectionOff,

View File

@ -26,8 +26,8 @@
#include "core/gimpimage.h"
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "gdisplay_ops.h"
#include "gimprc.h"

View File

@ -50,7 +50,6 @@
#include "app_procs.h"
#include "appenv.h"
#include "cursorutil.h"
#include "devices.h"
#include "errors.h"
#include "general.h"

View File

@ -43,7 +43,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "file-dialog-utils.h"
#include "file-open-dialog.h"
#include "dialog_handler.h"
@ -680,7 +680,7 @@ file_open_genbutton_callback (GtkWidget *widget,
return;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
gtk_widget_set_sensitive (GTK_WIDGET (fileload), FALSE);
/* new mult-file preview make: */
@ -764,7 +764,7 @@ file_open_genbutton_callback (GtkWidget *widget,
}
gtk_widget_set_sensitive (GTK_WIDGET (fileload), TRUE);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -37,7 +37,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "dialog_handler.h"
#include "docindex.h"
#include "file-dialog-utils.h"

View File

@ -76,7 +76,6 @@
#include "gradient-editor.h"
#include "context_manager.h"
#include "cursorutil.h"
#include "errors.h"
#include "gimprc.h"

View File

@ -52,6 +52,8 @@
#include "toolbox.h"
#include "app_procs.h"
#include "dialog_handler.h"
#include "gdisplay.h" /* for gdisplay_*_override_cursor() */
#include "libgimp/gimpintl.h"
@ -61,6 +63,9 @@ static void really_quit_callback (GtkWidget *button,
gpointer data);
extern GSList *display_list; /* from gdisplay.c */
/* public functions */
void
@ -164,6 +169,42 @@ gui_exit (void)
gimp_help_free ();
}
void
gui_set_busy (void)
{
GDisplay *gdisp;
GSList *list;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_install_override_cursor (gdisp, GDK_WATCH);
}
/* Dialogs */
dialog_idle_all ();
gdk_flush ();
}
void
gui_unset_busy (void)
{
GDisplay *gdisp;
GSList *list;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_remove_override_cursor (gdisp);
}
/* Dialogs */
dialog_unidle_all ();
}
void
really_quit_dialog (void)
{

View File

@ -27,6 +27,9 @@ void gui_post_init (void);
void gui_shutdown (void);
void gui_exit (void);
void gui_set_busy (void);
void gui_unset_busy (void);
void really_quit_dialog (void);

View File

@ -31,7 +31,6 @@
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "layer-select.h"
#include "session.h"

View File

@ -31,7 +31,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "dialog_handler.h"
#include "gui/info-dialog.h"
#include "gui/info-window.h"
@ -445,7 +445,7 @@ nav_window_update_preview (NavWinData *iwd)
gint xoff = 0;
gint yoff = 0;
gimp_add_busy_cursors ();
gimp_set_busy ();
gdisp = iwd->gdisp;
gimage = gdisp->gimage;
@ -590,7 +590,7 @@ nav_window_update_preview (NavWinData *iwd)
if (preview_buf_notdot)
temp_buf_free (preview_buf_notdot);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -48,7 +48,6 @@
#include "pixel_region.h"
#include "selection.h"
#include "temp_buf.h"
#include "cursorutil.h"
#include "libgimp/gimpintl.h"

View File

@ -31,7 +31,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "selection.h"
#include "temp_buf.h"

View File

@ -35,7 +35,6 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gimprc.h"
#include "undo.h"

View File

@ -38,7 +38,6 @@
#include "core/gimpimage-mask.h"
#include "brush_scale.h"
#include "cursorutil.h"
#include "devices.h"
#include "drawable.h"
#include "gdisplay.h"

View File

@ -48,7 +48,6 @@
#include "pixel_region.h"
#include "selection.h"
#include "temp_buf.h"
#include "cursorutil.h"
#include "libgimp/gimpintl.h"

View File

@ -27,6 +27,7 @@
#include "core/core-types.h"
#include "procedural_db.h"
#include "app_procs.h"
#include "context_manager.h"
#include "core/core-types.h"
#include "core/gimpchannel.h"
@ -36,7 +37,6 @@
#include "core/gimplayer.h"
#include "core/gimplayermask.h"
#include "core/gimplist.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimage.h"
@ -344,7 +344,7 @@ image_resize_invoker (Argument *args)
if (success)
{
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
gimp_image_resize (gimage, new_width, new_height, offx, offy);
}
@ -418,7 +418,7 @@ image_scale_invoker (Argument *args)
if (success)
{
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
gimp_image_scale (gimage, new_width, new_height);
}

View File

@ -25,10 +25,11 @@
#include "core/core-types.h"
#include "tools/tools-types.h"
#include "widgets/gimpcursor.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "scale.h"
#include "scroll.h"
@ -48,13 +49,16 @@ void
start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
startx = bevent->x + gdisp->offset_x;
starty = bevent->y + gdisp->offset_y;
gimp_change_win_cursor (gdisp->canvas->window,
GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
cursor = gimp_cursor_new (GDK_FLEUR,
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
gdk_window_set_cursor (gdisp->canvas->window, cursor);
gdk_cursor_destroy (cursor);
}

View File

@ -34,7 +34,6 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "cursorutil.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"

View File

@ -40,7 +40,7 @@
#include "widgets/gimpdnd.h"
#include "appenv.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
@ -918,7 +918,7 @@ blend (GimpImage *gimage,
gint bytes;
gint x1, y1, x2, y2;
gimp_add_busy_cursors();
gimp_set_busy ();
has_selection = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -953,7 +953,7 @@ blend (GimpImage *gimage,
/* free the temporary buffer */
tile_manager_destroy (buf_tiles);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static gdouble

View File

@ -38,7 +38,6 @@
#include "core/gimpimage-mask.h"
#include "brush_scale.h"
#include "cursorutil.h"
#include "devices.h"
#include "drawable.h"
#include "gdisplay.h"

View File

@ -35,7 +35,7 @@
#include "core/gimppattern.h"
#include "appenv.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimprc.h"
@ -528,7 +528,7 @@ bucket_fill (GimpImage *gimage,
pat_buf = pattern->mask;
}
gimp_add_busy_cursors ();
gimp_set_busy ();
bytes = gimp_drawable_bytes (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
@ -604,7 +604,7 @@ bucket_fill (GimpImage *gimage,
if (new_buf)
temp_buf_free (pat_buf);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
}
static void

View File

@ -28,19 +28,21 @@
#include "tools-types.h"
#include "boundary.h"
#include "context_manager.h"
#include "cursorutil.h"
#include "paint-funcs/paint-funcs.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage-mask.h"
#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "widgets/gimpdnd.h"
#include "boundary.h"
#include "context_manager.h"
#include "gimprc.h"
#include "gimpui.h"
#include "gdisplay.h"
#include "paint-funcs/paint-funcs.h"
#include "pixel_region.h"
#include "temp_buf.h"
#include "tile.h"

View File

@ -48,7 +48,6 @@
#include "pixel_region.h"
#include "selection.h"
#include "temp_buf.h"
#include "cursorutil.h"
#include "libgimp/gimpintl.h"

View File

@ -31,7 +31,6 @@
#include "gui/info-dialog.h"
#include "gui/palette-editor.h"
#include "gdisplay.h"
#include "cursorutil.h"
#include "gimpui.h"
#include "gimpdrawtool.h"

View File

@ -36,7 +36,6 @@
#include "core/gimplist.h"
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimpcroptool.h"
@ -45,6 +44,7 @@
#include "tool_options.h"
#include "tool_manager.h"
#include "app_procs.h"
#include "floating_sel.h"
#include "pixel_region.h"
#include "undo.h"
@ -844,7 +844,7 @@ crop_image (GimpImage *gimage,
/* Make sure new width and height are non-zero */
if (width && height)
{
gimp_add_busy_cursors ();
gimp_set_busy ();
if (layer_only)
{
@ -963,7 +963,7 @@ crop_image (GimpImage *gimage,
gdisplays_shrink_wrap (gimage);
}
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
gdisplays_flush ();
}
}
@ -1282,7 +1282,7 @@ crop_automatic_callback (GtkWidget *widget,
gdisp = tool->gdisp;
gimp_draw_tool_pause (draw);
gimp_add_busy_cursors ();
gimp_set_busy ();
/* You should always keep in mind that crop->tx2 and crop->ty2 are the NOT the
coordinates of the bottomright corner of the area to be cropped. They point
@ -1402,7 +1402,7 @@ crop_automatic_callback (GtkWidget *widget,
FINISH:
g_free (buffer);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
gimp_draw_tool_resume (draw);
return;

View File

@ -35,7 +35,6 @@
#include "core/gimplist.h"
#include "boundary.h"
#include "cursorutil.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimprc.h"
@ -984,3 +983,66 @@ gimp_edit_selection_tool_arrow_key (GimpTool *tool,
undo_push_group_end (gdisp->gimage);
gdisplays_flush ();
}
/***************************************************************/
/* gtkutil_compress_motion:
This function walks the whole GDK event queue seeking motion events
corresponding to the widget 'widget'. If it finds any it will
remove them from the queue, write the most recent motion offset
to 'lastmotion_x' and 'lastmotion_y', then return TRUE. Otherwise
it will return FALSE and 'lastmotion_x' / 'lastmotion_y' will be
untouched.
*/
/* The gtkutil_compress_motion function source may be re-used under
the XFree86-style license. <adam@gimp.org> */
gboolean
gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y)
{
GdkEvent *event;
GList *requeued_events = NULL;
GList *list;
gboolean success = FALSE;
/* Move the entire GDK event queue to a private list, filtering
out any motion events for the desired widget. */
while (gdk_events_pending ())
{
event = gdk_event_get ();
if (!event)
{
/* Do nothing */
}
else if ((gtk_get_event_widget (event) == widget) &&
(event->any.type == GDK_MOTION_NOTIFY))
{
*lastmotion_x = event->motion.x;
*lastmotion_y = event->motion.y;
gdk_event_free (event);
success = TRUE;
}
else
{
requeued_events = g_list_prepend (requeued_events, event);
}
}
/* Replay the remains of our private event list back into the
event queue in order. */
requeued_events = g_list_reverse (requeued_events);
for (list = requeued_events; list; list = g_list_next (list))
{
gdk_event_put ((GdkEvent*) list->data);
gdk_event_free ((GdkEvent*) list->data);
}
g_list_free (requeued_events);
return success;
}

View File

@ -39,5 +39,9 @@ void gimp_edit_selection_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
#endif /* __GIMP_EDIT_SELECTION_TOOL_H__ */

View File

@ -31,7 +31,6 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "selection.h"
#include "temp_buf.h"

View File

@ -34,7 +34,6 @@
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
#include "cursorutil.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"

View File

@ -31,8 +31,8 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "app_procs.h"
#include "boundary.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimprc.h"
#include "pixel_region.h"
@ -627,7 +627,7 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_add_busy_cursors ();
gimp_set_busy ();
use_offsets = fuzzy_options->sample_merged ? FALSE : TRUE;
@ -673,7 +673,7 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
/* free boundary segments */
g_free (bsegs);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return segs;
}

View File

@ -35,7 +35,6 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gimprc.h"
#include "undo.h"

View File

@ -51,7 +51,6 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
#include "pixel_region.h"

View File

@ -29,7 +29,6 @@
#include "gui/info-window.h"
#include "gdisplay.h"
#include "cursorutil.h"
#include "gimpmagnifytool.h"
#include "tool_options.h"

View File

@ -33,7 +33,6 @@
#include "core/gimpimage.h"
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimpdrawtool.h"

View File

@ -28,7 +28,6 @@
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
#include "cursorutil.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"

View File

@ -38,7 +38,6 @@
#include "core/gimpimage-mask.h"
#include "brush_scale.h"
#include "cursorutil.h"
#include "devices.h"
#include "drawable.h"
#include "gdisplay.h"

View File

@ -33,7 +33,6 @@
#include "core/gimpmarshal.h"
#include "core/gimptoolinfo.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "floating_sel.h"

View File

@ -31,8 +31,8 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "app_procs.h"
#include "boundary.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimprc.h"
#include "pixel_region.h"
@ -627,7 +627,7 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_add_busy_cursors ();
gimp_set_busy ();
use_offsets = fuzzy_options->sample_merged ? FALSE : TRUE;
@ -673,7 +673,7 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
/* free boundary segments */
g_free (bsegs);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return segs;
}

View File

@ -31,7 +31,6 @@
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"

View File

@ -29,7 +29,6 @@
#include "gimpdrawtool.h"
#include "gimpselectiontool.h"
#include "cursorutil.h"
#include "gdisplay.h"

View File

@ -48,7 +48,6 @@
#include "pixel_region.h"
#include "selection.h"
#include "temp_buf.h"
#include "cursorutil.h"
#include "libgimp/gimpintl.h"

View File

@ -39,10 +39,10 @@
#include "core/gimptoolinfo.h"
#include "gui/info-dialog.h"
#include "cursorutil.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimprc.h"
@ -559,7 +559,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
gboolean new_layer;
gint i, x, y;
gimp_add_busy_cursors ();
gimp_set_busy ();
tool = GIMP_TOOL (gt_tool);
@ -656,7 +656,7 @@ gimp_transform_tool_doit (GimpTransformTool *gt_tool,
}
}
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
gdisplays_flush ();

View File

@ -22,6 +22,8 @@
#include "core/core-types.h"
#include "widgets/widgets-types.h"
/* tools */

View File

@ -25,6 +25,8 @@ libappwidgets_la_SOURCES = \
gimpcontainerview.h \
gimpcontainerview-utils.c \
gimpcontainerview-utils.h \
gimpcursor.c \
gimpcursor.h \
gimpdatafactoryview.c \
gimpdatafactoryview.h \
gimpdialogfactory.c \

View File

@ -20,12 +20,9 @@
#include <gtk/gtk.h>
#include "core/core-types.h"
#include "widgets/widgets-types.h"
#include "appenv.h"
#include "cursorutil.h"
#include "dialog_handler.h"
#include "gdisplay.h" /* for gdisplay_*_override_cursor() */
#include "gimpcursor.h"
/* standard gimp cursors */
#include "cursors/mouse.xbm"
@ -128,8 +125,18 @@
#include "cursors/hand_mask.xbm"
/* FIXME: gimp_busy HACK */
gboolean gimp_busy = FALSE;
typedef struct _GimpBitmapCursor GimpBitmapCursor;
struct _GimpBitmapCursor
{
guchar *bits;
guchar *mask_bits;
gint width, height;
gint x_hot, y_hot;
GdkBitmap *bitmap;
GdkBitmap *mask;
GdkCursor *cursor;
};
static GimpBitmapCursor gimp_cursors[] =
@ -393,10 +400,6 @@ static GimpBitmapCursor gimp_modifier_cursors[] =
};
extern GSList *display_list; /* It's in gdisplay.c, FYI */
static gboolean pending_removebusy = FALSE;
static void
create_cursor_bitmaps (GimpBitmapCursor *bmcursor)
{
@ -413,6 +416,7 @@ create_cursor_bitmaps (GimpBitmapCursor *bmcursor)
g_return_if_fail (bmcursor->mask != NULL);
}
/*
static void
create_cursor (GimpBitmapCursor *bmcursor)
{
@ -424,7 +428,7 @@ create_cursor (GimpBitmapCursor *bmcursor)
{
GdkColor fg, bg;
/* should have a way to configure the mouse colors */
* should have a way to configure the mouse colors *
gdk_color_parse ("#FFFFFF", &bg);
gdk_color_parse ("#000000", &fg);
@ -437,12 +441,12 @@ create_cursor (GimpBitmapCursor *bmcursor)
g_return_if_fail (bmcursor->cursor != NULL);
}
*/
static void
gimp_change_win_cursor_internal (GdkWindow *window,
GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
GdkCursor *
gimp_cursor_new (GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
@ -461,8 +465,12 @@ gimp_change_win_cursor_internal (GdkWindow *window,
GimpBitmapCursor *bmmodifier = NULL;
GimpBitmapCursor *bmtool = NULL;
g_return_if_fail (window != NULL);
g_return_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY);
g_return_val_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY, NULL);
if (cursor_type <= GDK_LAST_CURSOR)
{
return gdk_cursor_new (cursor_type);
}
/* allow the small tool cursor only with the standard mouse,
* the small crosshair and the bad cursor
@ -479,6 +487,8 @@ gimp_change_win_cursor_internal (GdkWindow *window,
/* if there are no modifiers, we can show the cursor immediately
*/
/* FIXME: ref the cursor in gtk-2.0 before returning it
if (modifier == GIMP_CURSOR_MODIFIER_NONE &&
tool_cursor == GIMP_TOOL_CURSOR_NONE)
{
@ -489,8 +499,10 @@ gimp_change_win_cursor_internal (GdkWindow *window,
return;
}
else if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
else */
if (bmcursor->bitmap == NULL ||
bmcursor->mask == NULL)
{
create_cursor_bitmaps (bmcursor);
}
@ -597,159 +609,8 @@ gimp_change_win_cursor_internal (GdkWindow *window,
bmcursor->x_hot,
bmcursor->y_hot);
gdk_window_set_cursor (window, cursor);
gdk_cursor_destroy (cursor);
gdk_bitmap_unref (bitmap);
gdk_bitmap_unref (mask);
}
void
gimp_change_win_cursor (GdkWindow *win,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
GdkCursor *cursor;
if (cursor_type > GDK_LAST_CURSOR)
{
gimp_change_win_cursor_internal (win,
(GimpCursorType) cursor_type,
tool_cursor,
modifier);
return;
}
cursor = gdk_cursor_new (cursor_type);
gdk_window_set_cursor (win, cursor);
gdk_cursor_destroy (cursor);
}
void
gimp_unset_win_cursor (GdkWindow *win)
{
gdk_window_set_cursor (win, NULL);
}
void
gimp_add_busy_cursors_until_idle (void)
{
if (!pending_removebusy)
{
gimp_add_busy_cursors ();
gtk_idle_add_priority (GTK_PRIORITY_HIGH,
gimp_remove_busy_cursors, NULL);
pending_removebusy = TRUE;
}
}
void
gimp_add_busy_cursors (void)
{
GDisplay *gdisp;
GSList *list;
/* FIXME: gimp_busy HACK */
gimp_busy = TRUE;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_install_override_cursor (gdisp, GDK_WATCH);
}
/* Dialogs */
dialog_idle_all ();
gdk_flush ();
}
gint
gimp_remove_busy_cursors (gpointer data)
{
GDisplay *gdisp;
GSList *list;
/* Canvases */
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_remove_override_cursor (gdisp);
}
/* Dialogs */
dialog_unidle_all ();
pending_removebusy = FALSE;
/* FIXME: gimp_busy HACK */
gimp_busy = FALSE;
return 0;
}
/***************************************************************/
/* gtkutil_compress_motion:
This function walks the whole GDK event queue seeking motion events
corresponding to the widget 'widget'. If it finds any it will
remove them from the queue, write the most recent motion offset
to 'lastmotion_x' and 'lastmotion_y', then return TRUE. Otherwise
it will return FALSE and 'lastmotion_x' / 'lastmotion_y' will be
untouched.
*/
/* The gtkutil_compress_motion function source may be re-used under
the XFree86-style license. <adam@gimp.org> */
gboolean
gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y)
{
GdkEvent *event;
GList *requeued_events = NULL;
GList *list;
gboolean success = FALSE;
/* Move the entire GDK event queue to a private list, filtering
out any motion events for the desired widget. */
while (gdk_events_pending ())
{
event = gdk_event_get ();
if (!event)
{
/* Do nothing */
}
else if ((gtk_get_event_widget (event) == widget) &&
(event->any.type == GDK_MOTION_NOTIFY))
{
*lastmotion_x = event->motion.x;
*lastmotion_y = event->motion.y;
gdk_event_free (event);
success = TRUE;
}
else
{
requeued_events = g_list_prepend (requeued_events, event);
}
}
/* Replay the remains of our private event list back into the
event queue in order. */
requeued_events = g_list_reverse (requeued_events);
for (list = requeued_events; list; list = g_list_next (list))
{
gdk_event_put ((GdkEvent*) list->data);
gdk_event_free ((GdkEvent*) list->data);
}
g_list_free (requeued_events);
return success;
return cursor;
}

View File

@ -16,50 +16,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CURSORUTIL_H__
#define __CURSORUTIL_H__
#ifndef __GIMP_CURSOR_H__
#define __GIMP_CURSOR_H__
struct _GimpBitmapCursor
{
guchar *bits;
guchar *mask_bits;
gint width, height;
gint x_hot, y_hot;
GdkBitmap *bitmap;
GdkBitmap *mask;
GdkCursor *cursor;
};
GdkCursor * gimp_cursor_new (GimpCursorType curtype,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
GIMP_CROSSHAIR_CURSOR,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_BAD_CURSOR,
GIMP_ZOOM_CURSOR,
GIMP_COLOR_PICKER_CURSOR,
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
/* FIXME: gimp_busy HACK */
extern gboolean gimp_busy;
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);
gboolean gtkutil_compress_motion (GtkWidget *widget,
gdouble *lastmotion_x,
gdouble *lastmotion_y);
#endif /* __CURSORUTIL_H__ */
#endif /* __GIMP_CURSOR_H__ */

View File

@ -76,7 +76,6 @@
#include "gradient-editor.h"
#include "context_manager.h"
#include "cursorutil.h"
#include "errors.h"
#include "gimprc.h"

View File

@ -34,6 +34,70 @@ typedef enum
GIMP_DROP_BELOW
} GimpDropType;
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
GIMP_CROSSHAIR_CURSOR,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_BAD_CURSOR,
GIMP_ZOOM_CURSOR,
GIMP_COLOR_PICKER_CURSOR,
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
typedef enum
{
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
{
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;
/* non-widget objects */

View File

@ -45,7 +45,7 @@
#include "core/gimplayermask.h"
#include "core/gimplist.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "floating_sel.h"
#include "gimage.h"
#include "gimprc.h"
@ -340,7 +340,7 @@ xcf_load_invoker (Argument *args)
gboolean success;
gchar id[14];
gimp_add_busy_cursors ();
gimp_set_busy ();
gimage = NULL;
@ -399,7 +399,7 @@ xcf_load_invoker (Argument *args)
if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return return_args;
}
@ -413,7 +413,7 @@ xcf_save_invoker (Argument *args)
gchar *filename;
gboolean success;
gimp_add_busy_cursors ();
gimp_set_busy ();
success = FALSE;
@ -446,7 +446,7 @@ xcf_save_invoker (Argument *args)
return_args = procedural_db_return_args (&xcf_plug_in_save_proc.db_info, success);
gimp_remove_busy_cursors(NULL);
gimp_unset_busy ();
return return_args;
}

View File

@ -45,7 +45,7 @@
#include "core/gimplayermask.h"
#include "core/gimplist.h"
#include "cursorutil.h"
#include "app_procs.h"
#include "floating_sel.h"
#include "gimage.h"
#include "gimprc.h"
@ -340,7 +340,7 @@ xcf_load_invoker (Argument *args)
gboolean success;
gchar id[14];
gimp_add_busy_cursors ();
gimp_set_busy ();
gimage = NULL;
@ -399,7 +399,7 @@ xcf_load_invoker (Argument *args)
if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (gimage);
gimp_remove_busy_cursors (NULL);
gimp_unset_busy ();
return return_args;
}
@ -413,7 +413,7 @@ xcf_save_invoker (Argument *args)
gchar *filename;
gboolean success;
gimp_add_busy_cursors ();
gimp_set_busy ();
success = FALSE;
@ -446,7 +446,7 @@ xcf_save_invoker (Argument *args)
return_args = procedural_db_return_args (&xcf_plug_in_save_proc.db_info, success);
gimp_remove_busy_cursors(NULL);
gimp_unset_busy ();
return return_args;
}

View File

@ -294,10 +294,10 @@ HELP
}
%invoke = (
headers => [ qw("cursorutil.h") ],
headers => [ qw("app_procs.h") ],
code => <<'CODE'
{
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
gimp_image_resize (gimage, new_width, new_height, offx, offy);
}
CODE
@ -325,7 +325,7 @@ HELP
%invoke = (
code => <<'CODE'
{
gimp_add_busy_cursors_until_idle ();
gimp_set_busy_until_idle ();
gimp_image_scale (gimage, new_width, new_height);
}
CODE