Commit 0cbbef40 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

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"
parent 0a4ec8fb
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
......
......@@ -53,11 +53,6 @@ gimp_SOURCES = \
undo_history.c \
undo_history.h \
##
## stuff for widgets/
##
cursorutil.c \
cursorutil.h \
##
## display stuff
##
disp_callbacks.c \
......
......@@ -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)
{
......
......@@ -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__ */
......@@ -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__ */
......@@ -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);
......
......@@ -34,8 +34,6 @@
typedef struct _Argument Argument;
typedef struct _GimpBitmapCursor GimpBitmapCursor;
typedef struct _BoundSeg BoundSeg;
typedef struct _ColorNotebook ColorNotebook;
......
......@@ -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"
......
......@@ -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 ();
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......
......@@ -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"
......
......@@ -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 ();
......
......@@ -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
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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 ();