1997-11-25 06:05:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-09-06 08:07:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdlib.h>
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-04-28 01:27:28 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
|
2001-01-24 02:49:44 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/core-types.h"
|
|
|
|
#include "tools/tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "base/temp-buf.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-04-07 23:58:26 +08:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimp.h"
|
2001-07-03 04:57:58 +08:00
|
|
|
#include "core/gimpbuffer.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2001-07-04 02:38:56 +08:00
|
|
|
#include "core/gimpedit.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimplayer.h"
|
|
|
|
#include "core/gimppattern.h"
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "tools/gimpbucketfilltool.h"
|
2001-03-10 01:39:18 +08:00
|
|
|
#include "tools/gimpfuzzyselecttool.h"
|
2001-03-08 09:07:03 +08:00
|
|
|
#include "tools/gimpmovetool.h"
|
2001-02-21 20:18:09 +08:00
|
|
|
#include "tools/tool_manager.h"
|
|
|
|
|
2001-07-20 18:07:51 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2001-05-26 00:04:54 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
|
|
|
|
2001-07-20 18:07:51 +08:00
|
|
|
#include "gui/dialogs.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gui/info-window.h"
|
|
|
|
#include "gui/layer-select.h"
|
|
|
|
|
2001-07-03 04:57:58 +08:00
|
|
|
#include "devices.h"
|
|
|
|
#include "disp_callbacks.h"
|
|
|
|
#include "gdisplay.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
|
|
|
#include "scale.h"
|
|
|
|
#include "scroll.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "selection.h"
|
1999-08-20 03:53:30 +08:00
|
|
|
#include "undo.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-20 03:53:30 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2001-01-30 01:54:02 +08:00
|
|
|
gdisplay_redraw (GDisplay *gdisp,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-26 02:17:01 +08:00
|
|
|
glong x1, y1, x2, y2; /* coordinate of rectangle corners */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
x1 = x;
|
|
|
|
y1 = y;
|
2001-01-30 01:54:02 +08:00
|
|
|
x2 = (x + w);
|
|
|
|
y2 = (y + h);
|
|
|
|
|
2000-01-26 07:06:12 +08:00
|
|
|
x1 = CLAMP (x1, 0, gdisp->disp_width);
|
|
|
|
y1 = CLAMP (y1, 0, gdisp->disp_height);
|
|
|
|
x2 = CLAMP (x2, 0, gdisp->disp_width);
|
|
|
|
y2 = CLAMP (y2, 0, gdisp->disp_height);
|
2001-01-30 01:54:02 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if ((x2 - x1) && (y2 - y1))
|
|
|
|
{
|
2001-01-30 01:54:02 +08:00
|
|
|
gdisplay_expose_area (gdisp,
|
|
|
|
x1, y1,
|
|
|
|
(x2 - x1), (y2 - y1));
|
1999-03-21 06:05:24 +08:00
|
|
|
gdisplay_flush_displays_only (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
static void
|
|
|
|
gdisplay_check_device_cursor (GDisplay *gdisp)
|
|
|
|
{
|
1999-10-30 18:39:48 +08:00
|
|
|
GList *list;
|
1998-06-06 11:49:01 +08:00
|
|
|
|
2000-03-26 02:17:01 +08:00
|
|
|
/* gdk_input_list_devices returns an internal list, so we shouldn't
|
|
|
|
* free it afterwards
|
|
|
|
*/
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
for (list = gdk_devices_list (); list; list = g_list_next (list))
|
1998-06-06 11:49:01 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
GdkDevice *device = (GdkDevice *) list->data;
|
1998-06-06 11:49:01 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
if (device == current_device)
|
1998-06-06 11:49:01 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
gdisp->draw_cursor = ! device->has_cursor;
|
1998-06-06 11:49:01 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-05-05 17:10:35 +08:00
|
|
|
static int
|
2000-03-26 02:17:01 +08:00
|
|
|
key_to_state (gint key)
|
1999-05-05 17:10:35 +08:00
|
|
|
{
|
|
|
|
switch (key)
|
1999-10-30 18:39:48 +08:00
|
|
|
{
|
2000-03-26 02:17:01 +08:00
|
|
|
case GDK_Alt_L:
|
|
|
|
case GDK_Alt_R:
|
1999-10-30 18:39:48 +08:00
|
|
|
return GDK_MOD1_MASK;
|
2000-03-26 02:17:01 +08:00
|
|
|
case GDK_Shift_L:
|
|
|
|
case GDK_Shift_R:
|
1999-10-30 18:39:48 +08:00
|
|
|
return GDK_SHIFT_MASK;
|
2000-03-26 02:17:01 +08:00
|
|
|
case GDK_Control_L:
|
|
|
|
case GDK_Control_R:
|
1999-10-30 18:39:48 +08:00
|
|
|
return GDK_CONTROL_MASK;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
1999-05-05 17:10:35 +08:00
|
|
|
}
|
|
|
|
|
2001-02-25 03:29:47 +08:00
|
|
|
static void
|
|
|
|
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
|
|
|
|
GDisplay *gdisp)
|
|
|
|
{
|
|
|
|
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
|
|
|
|
GDisplay *gdisp)
|
|
|
|
{
|
|
|
|
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
|
|
|
|
}
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gint
|
1999-08-20 03:53:30 +08:00
|
|
|
gdisplay_shell_events (GtkWidget *widget,
|
1999-06-04 02:28:39 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
GDisplay *gdisp)
|
|
|
|
{
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_KEY_PRESS:
|
2001-04-21 00:27:44 +08:00
|
|
|
case GDK_BUTTON_PRESS:
|
1999-06-20 21:53:15 +08:00
|
|
|
/* Setting the context's display automatically sets the image, too */
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_context_set_display (gimp_get_user_context (gdisp->gimage->gimp),
|
|
|
|
gdisp);
|
2001-04-21 00:27:44 +08:00
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1999-06-20 21:53:15 +08:00
|
|
|
}
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gint
|
|
|
|
gdisplay_canvas_events (GtkWidget *canvas,
|
2001-08-05 04:38:54 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
GDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-08 01:36:00 +08:00
|
|
|
GimpTool *active_tool;
|
2000-03-26 02:17:01 +08:00
|
|
|
GdkEventExpose *eevent;
|
|
|
|
GdkEventMotion *mevent;
|
|
|
|
GdkEventButton *bevent;
|
|
|
|
GdkEventKey *kevent;
|
|
|
|
gdouble tx = 0;
|
|
|
|
gdouble ty = 0;
|
|
|
|
guint state = 0;
|
|
|
|
gint return_val = FALSE;
|
|
|
|
static gboolean scrolled = FALSE;
|
|
|
|
static guint key_signal_id = 0;
|
|
|
|
gboolean update_cursor = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-08-05 04:38:54 +08:00
|
|
|
if (! canvas->window)
|
1998-02-05 08:07:31 +08:00
|
|
|
return FALSE;
|
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* If this is the first event... */
|
|
|
|
if (!gdisp->select)
|
|
|
|
{
|
|
|
|
/* create the selection object */
|
|
|
|
gdisp->select = selection_create (gdisp->canvas->window, gdisp,
|
|
|
|
gdisp->gimage->height,
|
2001-06-04 04:40:50 +08:00
|
|
|
gdisp->gimage->width,
|
|
|
|
gimprc.marching_speed);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisp->disp_width = gdisp->canvas->allocation.width;
|
|
|
|
gdisp->disp_height = gdisp->canvas->allocation.height;
|
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
/* create GC for scrolling */
|
1997-12-18 14:30:11 +08:00
|
|
|
gdisp->scroll_gc = gdk_gc_new (gdisp->canvas->window);
|
|
|
|
gdk_gc_set_exposures (gdisp->scroll_gc, TRUE);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* set up the scrollbar observers */
|
2001-07-29 22:09:50 +08:00
|
|
|
g_signal_connect (G_OBJECT (gdisp->hsbdata), "value_changed",
|
|
|
|
G_CALLBACK (gdisplay_hscrollbar_update),
|
|
|
|
gdisp);
|
|
|
|
g_signal_connect (G_OBJECT (gdisp->vsbdata), "value_changed",
|
|
|
|
G_CALLBACK (gdisplay_vscrollbar_update),
|
|
|
|
gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* setup scale properly */
|
|
|
|
setup_scale (gdisp);
|
|
|
|
}
|
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
/* Find out what device the event occurred upon */
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (! gdisp->gimage->gimp->busy && devices_check_change (event))
|
1998-06-06 11:49:01 +08:00
|
|
|
gdisplay_check_device_cursor (gdisp);
|
1999-06-22 06:12:07 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_EXPOSE:
|
|
|
|
eevent = (GdkEventExpose *) event;
|
2001-07-09 05:44:52 +08:00
|
|
|
|
2001-01-30 01:54:02 +08:00
|
|
|
gdisplay_redraw (gdisp,
|
|
|
|
eevent->area.x, eevent->area.y,
|
|
|
|
eevent->area.width, eevent->area.height);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_CONFIGURE:
|
2001-07-09 05:44:52 +08:00
|
|
|
if ((gdisp->disp_width != gdisp->canvas->allocation.width) ||
|
1997-11-25 06:05:25 +08:00
|
|
|
(gdisp->disp_height != gdisp->canvas->allocation.height))
|
|
|
|
{
|
2001-07-09 05:44:52 +08:00
|
|
|
gdisp->disp_width = gdisp->canvas->allocation.width;
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisp->disp_height = gdisp->canvas->allocation.height;
|
2001-07-09 05:44:52 +08:00
|
|
|
|
2000-04-16 00:00:19 +08:00
|
|
|
resize_display (gdisp, FALSE, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
case GDK_LEAVE_NOTIFY:
|
2001-01-23 08:53:12 +08:00
|
|
|
if (((GdkEventCrossing *) event)->mode != GDK_CROSSING_NORMAL)
|
2000-04-16 00:00:19 +08:00
|
|
|
return TRUE;
|
1998-06-06 11:49:01 +08:00
|
|
|
gdisplay_update_cursor (gdisp, 0, 0);
|
1999-01-11 05:54:02 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (gdisp->cursor_label), "");
|
2001-06-15 00:23:40 +08:00
|
|
|
info_window_update_extended (gdisp, -1, -1);
|
1999-06-26 19:16:47 +08:00
|
|
|
|
1998-08-01 02:34:05 +08:00
|
|
|
case GDK_PROXIMITY_OUT:
|
|
|
|
gdisp->proximity = FALSE;
|
1998-06-06 11:49:01 +08:00
|
|
|
break;
|
|
|
|
|
1998-07-16 11:23:14 +08:00
|
|
|
case GDK_ENTER_NOTIFY:
|
2001-01-23 08:53:12 +08:00
|
|
|
if (((GdkEventCrossing *) event)->mode != GDK_CROSSING_NORMAL)
|
2000-04-16 00:00:19 +08:00
|
|
|
return TRUE;
|
1998-12-13 01:41:41 +08:00
|
|
|
/* Actually, should figure out tx,ty here */
|
1998-06-06 11:49:01 +08:00
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
state = bevent->state;
|
|
|
|
|
2000-03-26 02:17:01 +08:00
|
|
|
/* ignore new mouse events */
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (bevent->button)
|
|
|
|
{
|
|
|
|
case 1:
|
1999-05-05 17:10:35 +08:00
|
|
|
state |= GDK_BUTTON1_MASK;
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_grab_add (canvas);
|
1998-04-20 15:03:04 +08:00
|
|
|
|
|
|
|
/* This is a hack to prevent other stuff being run in the middle of
|
2001-01-23 08:53:12 +08:00
|
|
|
* a tool operation (like changing image types.... brrrr). We just
|
|
|
|
* block all the keypress event. A better solution is to implement
|
|
|
|
* some sort of locking for images.
|
|
|
|
* Note that this is dependent on specific GTK behavior, and isn't
|
|
|
|
* guaranteed to work in future versions of GTK.
|
|
|
|
* -Yosh
|
1998-04-20 15:03:04 +08:00
|
|
|
*/
|
|
|
|
if (key_signal_id == 0)
|
2001-07-29 22:09:50 +08:00
|
|
|
key_signal_id = g_signal_connect (G_OBJECT (canvas),
|
|
|
|
"key_press_event",
|
|
|
|
G_CALLBACK (gtk_true),
|
|
|
|
NULL);
|
2001-02-14 12:55:21 +08:00
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
/* FIXME!!! This code is ugly */
|
1998-04-20 15:03:04 +08:00
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
if (active_tool && (GIMP_IS_MOVE_TOOL (active_tool) ||
|
|
|
|
! gimp_image_is_empty (gdisp->gimage)))
|
1999-06-22 06:12:07 +08:00
|
|
|
{
|
|
|
|
if (active_tool->auto_snap_to)
|
|
|
|
{
|
|
|
|
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
|
|
|
|
bevent->x = tx;
|
|
|
|
bevent->y = ty;
|
|
|
|
update_cursor = TRUE;
|
|
|
|
}
|
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
/* reset the current tool if ... */
|
|
|
|
if ((/* it has no drawable */
|
|
|
|
! active_tool->drawable ||
|
1999-06-22 06:12:07 +08:00
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
/* or a drawable different from the current one */
|
2000-12-30 08:16:50 +08:00
|
|
|
(gimp_image_active_drawable (gdisp->gimage) !=
|
1999-06-26 19:16:47 +08:00
|
|
|
active_tool->drawable)) &&
|
1999-06-22 06:12:07 +08:00
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
/* and doesn't want to be preserved across drawable changes */
|
|
|
|
! active_tool->preserve)
|
1999-06-22 06:12:07 +08:00
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_manager_initialize_tool (gdisp->gimage->gimp,
|
|
|
|
active_tool, gdisp);
|
2001-07-08 01:36:00 +08:00
|
|
|
|
|
|
|
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
|
1999-06-22 06:12:07 +08:00
|
|
|
}
|
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
/* otherwise set it's drawable if it has none */
|
|
|
|
else if (! active_tool->drawable)
|
|
|
|
{
|
2000-12-30 08:16:50 +08:00
|
|
|
active_tool->drawable =
|
|
|
|
gimp_image_active_drawable (gdisp->gimage);
|
1999-06-26 19:16:47 +08:00
|
|
|
}
|
2001-02-14 12:55:21 +08:00
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_button_press (active_tool, bevent, gdisp);
|
2001-02-14 12:55:21 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
1999-05-05 17:10:35 +08:00
|
|
|
state |= GDK_BUTTON2_MASK;
|
1998-04-15 17:15:40 +08:00
|
|
|
scrolled = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_grab_add (canvas);
|
|
|
|
start_grab_and_scroll (gdisp, bevent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
1999-05-05 17:10:35 +08:00
|
|
|
state |= GDK_BUTTON3_MASK;
|
2001-08-05 04:38:54 +08:00
|
|
|
gimp_item_factory_popup_with_data (gdisp->ifactory, gdisp->gimage);
|
1999-06-26 19:16:47 +08:00
|
|
|
return_val = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
1999-07-10 07:03:11 +08:00
|
|
|
/* wheelmouse support */
|
|
|
|
case 4:
|
|
|
|
state |= GDK_BUTTON4_MASK;
|
1999-08-20 03:53:30 +08:00
|
|
|
if (state & GDK_SHIFT_MASK)
|
|
|
|
{
|
2001-03-04 00:22:18 +08:00
|
|
|
change_scale (gdisp, GIMP_ZOOM_IN);
|
1999-08-20 03:53:30 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GtkAdjustment *adj =
|
|
|
|
(state & GDK_CONTROL_MASK) ? gdisp->hsbdata : gdisp->vsbdata;
|
|
|
|
gfloat new_value = adj->value - adj->page_increment / 2;
|
|
|
|
new_value =
|
|
|
|
CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
|
|
|
}
|
1999-07-10 07:03:11 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
state |= GDK_BUTTON5_MASK;
|
1999-08-20 03:53:30 +08:00
|
|
|
if (state & GDK_SHIFT_MASK)
|
|
|
|
{
|
2001-03-04 00:22:18 +08:00
|
|
|
change_scale (gdisp, GIMP_ZOOM_OUT);
|
1999-08-20 03:53:30 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GtkAdjustment *adj =
|
|
|
|
(state & GDK_CONTROL_MASK) ? gdisp->hsbdata : gdisp->vsbdata;
|
|
|
|
gfloat new_value = adj->value + adj->page_increment / 2;
|
|
|
|
new_value = CLAMP (new_value,
|
|
|
|
adj->lower, adj->upper - adj->page_size);
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
|
|
|
}
|
1999-07-10 07:03:11 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
state = bevent->state;
|
|
|
|
|
2000-03-26 02:19:40 +08:00
|
|
|
/* ugly side condition: all operations which set busy cursors are
|
2000-03-26 02:17:01 +08:00
|
|
|
* invoked on BUTTON_RELEASE, thus no new BUTTON_PRESS events are
|
|
|
|
* accepted while Gimp is busy, thus it should be safe to block
|
|
|
|
* BUTTON_RELEASE. --Mitch
|
|
|
|
*
|
|
|
|
* ugly: fuzzy_select sets busy cursors while ACTIVE.
|
|
|
|
*/
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy &&
|
|
|
|
! (GIMP_IS_FUZZY_SELECT_TOOL (active_tool) &&
|
|
|
|
active_tool->state == ACTIVE))
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (bevent->button)
|
|
|
|
{
|
|
|
|
case 1:
|
1999-05-05 17:10:35 +08:00
|
|
|
state &= ~GDK_BUTTON1_MASK;
|
2000-03-26 02:17:01 +08:00
|
|
|
|
1998-04-20 15:03:04 +08:00
|
|
|
/* Lame hack. See above */
|
|
|
|
if (key_signal_id)
|
|
|
|
{
|
2001-07-29 22:09:50 +08:00
|
|
|
g_signal_handler_disconnect (G_OBJECT (canvas), key_signal_id);
|
1998-04-20 15:03:04 +08:00
|
|
|
key_signal_id = 0;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_grab_remove (canvas);
|
2001-02-14 12:55:21 +08:00
|
|
|
|
2001-03-10 01:39:18 +08:00
|
|
|
if (active_tool && (GIMP_IS_MOVE_TOOL (active_tool) ||
|
2001-02-22 05:56:39 +08:00
|
|
|
! gimp_image_is_empty (gdisp->gimage)))
|
1999-03-21 23:38:11 +08:00
|
|
|
{
|
|
|
|
if (active_tool->state == ACTIVE)
|
|
|
|
{
|
|
|
|
if (active_tool->auto_snap_to)
|
|
|
|
{
|
|
|
|
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
|
|
|
|
bevent->x = tx;
|
|
|
|
bevent->y = ty;
|
|
|
|
update_cursor = TRUE;
|
|
|
|
}
|
2001-07-09 05:44:52 +08:00
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_button_release (active_tool, bevent, gdisp);
|
1999-03-21 23:38:11 +08:00
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
1999-05-05 17:10:35 +08:00
|
|
|
state &= ~GDK_BUTTON2_MASK;
|
1998-04-15 17:15:40 +08:00
|
|
|
scrolled = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_grab_remove (canvas);
|
|
|
|
end_grab_and_scroll (gdisp, bevent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
1999-05-05 17:10:35 +08:00
|
|
|
state &= ~GDK_BUTTON3_MASK;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
1999-07-10 07:03:11 +08:00
|
|
|
/* wheelmouse support */
|
|
|
|
case 4:
|
|
|
|
state &= ~GDK_BUTTON4_MASK;
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
state &= ~GDK_BUTTON5_MASK;
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
mevent = (GdkEventMotion *) event;
|
|
|
|
state = mevent->state;
|
|
|
|
|
2000-03-26 02:17:01 +08:00
|
|
|
/* for the same reason we block BUTTON_RELEASE,
|
|
|
|
* we block MOTION_NOTIFY. --Mitch
|
|
|
|
*
|
|
|
|
* ugly: fuzzy_select sets busy cursors while ACTIVE.
|
|
|
|
*/
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy &&
|
|
|
|
! (GIMP_IS_FUZZY_SELECT_TOOL (active_tool) &&
|
|
|
|
active_tool->state == ACTIVE))
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
2001-02-14 12:55:21 +08:00
|
|
|
|
2001-03-10 01:39:18 +08:00
|
|
|
/* Ask for the pointer position, but ignore it except for cursor
|
|
|
|
* handling, so motion events sync with the button press/release events
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
if (mevent->is_hint)
|
2000-03-26 02:17:01 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning FIXME: replace gdk_input_window_get_pointer()
|
|
|
|
#endif
|
|
|
|
#if 0
|
2000-03-26 02:17:01 +08:00
|
|
|
gdk_input_window_get_pointer (canvas->window, current_device, &tx, &ty,
|
2001-03-31 00:39:14 +08:00
|
|
|
NULL, NULL, NULL, NULL);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#endif
|
2000-03-26 02:17:01 +08:00
|
|
|
}
|
1998-06-06 11:49:01 +08:00
|
|
|
else
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-06-06 11:49:01 +08:00
|
|
|
tx = mevent->x;
|
|
|
|
ty = mevent->y;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-12-13 01:41:41 +08:00
|
|
|
update_cursor = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
if (!gdisp->proximity)
|
|
|
|
{
|
|
|
|
gdisp->proximity = TRUE;
|
|
|
|
gdisplay_check_device_cursor (gdisp);
|
|
|
|
}
|
2000-03-26 02:17:01 +08:00
|
|
|
|
2001-02-14 12:55:21 +08:00
|
|
|
if (active_tool && (GIMP_IS_MOVE_TOOL(active_tool) ||
|
2001-02-22 05:56:39 +08:00
|
|
|
! gimp_image_is_empty (gdisp->gimage)) &&
|
1997-11-25 06:05:25 +08:00
|
|
|
(mevent->state & GDK_BUTTON1_MASK))
|
|
|
|
{
|
|
|
|
if (active_tool->state == ACTIVE)
|
|
|
|
{
|
|
|
|
/* if the first mouse button is down, check for automatic
|
|
|
|
* scrolling...
|
|
|
|
*/
|
2000-03-26 02:17:01 +08:00
|
|
|
if ((mevent->state & GDK_BUTTON1_MASK) &&
|
|
|
|
!active_tool->scroll_lock)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (mevent->x < 0 || mevent->y < 0 ||
|
|
|
|
mevent->x > gdisp->disp_width ||
|
|
|
|
mevent->y > gdisp->disp_height)
|
|
|
|
scroll_to_pointer_position (gdisp, mevent);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (active_tool->auto_snap_to)
|
|
|
|
{
|
|
|
|
gdisplay_snap_point (gdisp, mevent->x, mevent->y, &tx, &ty);
|
|
|
|
mevent->x = tx;
|
|
|
|
mevent->y = ty;
|
1998-12-13 01:41:41 +08:00
|
|
|
update_cursor = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_motion (active_tool, mevent, gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
1998-04-09 13:05:05 +08:00
|
|
|
else if ((mevent->state & GDK_BUTTON2_MASK) && scrolled)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
grab_and_scroll (gdisp, mevent);
|
|
|
|
}
|
2000-01-20 03:06:13 +08:00
|
|
|
|
2001-07-09 05:44:52 +08:00
|
|
|
if (/* Should we have a tool... */
|
2000-03-26 02:17:01 +08:00
|
|
|
active_tool &&
|
2001-07-09 05:44:52 +08:00
|
|
|
/* and this event is NOT driving
|
|
|
|
* button press handlers ...
|
|
|
|
*/
|
2000-03-26 02:17:01 +08:00
|
|
|
!(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)))
|
2000-01-20 03:06:13 +08:00
|
|
|
{
|
2001-07-09 05:44:52 +08:00
|
|
|
/* ...then preconditions to modify a tool
|
|
|
|
* operator state have been met.
|
|
|
|
*/
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_oper_update (active_tool, mevent, gdisp);
|
2000-01-20 03:06:13 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_KEY_PRESS:
|
|
|
|
kevent = (GdkEventKey *) event;
|
|
|
|
state = kevent->state;
|
|
|
|
|
2000-03-26 02:17:01 +08:00
|
|
|
/* ignore any key presses */
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (kevent->keyval)
|
|
|
|
{
|
|
|
|
case GDK_Left: case GDK_Right:
|
|
|
|
case GDK_Up: case GDK_Down:
|
2001-02-21 20:18:09 +08:00
|
|
|
if (active_tool && ! gimp_image_is_empty (gdisp->gimage))
|
|
|
|
gimp_tool_arrow_key (active_tool, kevent, gdisp);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return_val = TRUE;
|
2001-02-21 20:18:09 +08:00
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
case GDK_Tab:
|
2000-12-30 08:16:50 +08:00
|
|
|
if (kevent->state & GDK_MOD1_MASK &&
|
|
|
|
!gimp_image_is_empty (gdisp->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
layer_select_init (gdisp->gimage, 1, kevent->time);
|
2000-03-26 02:17:01 +08:00
|
|
|
|
|
|
|
if (kevent->state & GDK_CONTROL_MASK &&
|
2000-12-30 08:16:50 +08:00
|
|
|
!gimp_image_is_empty (gdisp->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
layer_select_init (gdisp->gimage, -1, kevent->time);
|
1999-01-11 07:20:33 +08:00
|
|
|
|
|
|
|
/* Hide or show all dialogs */
|
2001-07-09 05:44:52 +08:00
|
|
|
if (! kevent->state)
|
2001-07-20 18:07:51 +08:00
|
|
|
gimp_dialog_factories_toggle (global_dialog_factory,
|
|
|
|
"gimp:toolbox");
|
1999-01-11 07:20:33 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Update the state based on modifiers being pressed */
|
|
|
|
case GDK_Alt_L: case GDK_Alt_R:
|
|
|
|
case GDK_Shift_L: case GDK_Shift_R:
|
1999-04-28 05:06:00 +08:00
|
|
|
case GDK_Control_L: case GDK_Control_R:
|
2000-03-26 02:17:01 +08:00
|
|
|
state |= key_to_state (kevent->keyval);
|
1999-04-28 05:06:00 +08:00
|
|
|
/* For all modifier keys: call the tools modifier_key_func */
|
2000-12-30 08:16:50 +08:00
|
|
|
if (active_tool && !gimp_image_is_empty (gdisp->gimage))
|
1999-04-27 10:09:03 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#if 0
|
1999-09-04 22:42:43 +08:00
|
|
|
gdk_input_window_get_pointer (canvas->window, current_device,
|
2001-03-31 00:39:14 +08:00
|
|
|
&tx, &ty, NULL, NULL, NULL, NULL);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#endif
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_modifier_key (active_tool, kevent, gdisp);
|
1999-04-27 10:09:03 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_KEY_RELEASE:
|
|
|
|
kevent = (GdkEventKey *) event;
|
|
|
|
state = kevent->state;
|
|
|
|
|
2000-03-26 02:17:01 +08:00
|
|
|
/* ignore any key releases */
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (kevent->keyval)
|
|
|
|
{
|
|
|
|
case GDK_Alt_L: case GDK_Alt_R:
|
|
|
|
case GDK_Shift_L: case GDK_Shift_R:
|
1999-04-28 05:06:00 +08:00
|
|
|
case GDK_Control_L: case GDK_Control_R:
|
2000-03-26 02:17:01 +08:00
|
|
|
state &= ~key_to_state (kevent->keyval);
|
1999-04-28 05:06:00 +08:00
|
|
|
/* For all modifier keys: call the tools modifier_key_func */
|
2000-12-30 08:16:50 +08:00
|
|
|
if (active_tool && !gimp_image_is_empty (gdisp->gimage))
|
1999-04-27 10:09:03 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#if 0
|
1999-09-04 22:42:43 +08:00
|
|
|
gdk_input_window_get_pointer (canvas->window, current_device,
|
2001-03-31 00:39:14 +08:00
|
|
|
&tx, &ty, NULL, NULL, NULL, NULL);
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_modifier_key (active_tool, kevent, gdisp);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#endif
|
1999-04-27 10:09:03 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-03-26 02:19:40 +08:00
|
|
|
/* if we reached this point in gimp_busy mode, return now */
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
2001-08-07 20:42:23 +08:00
|
|
|
/* Cursor update support
|
|
|
|
* no_cursor_updating is TRUE (=1) when
|
|
|
|
* <Toolbox>/File/Preferences.../Interface/...
|
|
|
|
* Image Windows/Disable Cursor Updating is TOGGLED ON
|
|
|
|
*/
|
|
|
|
if (! gimprc.no_cursor_updating)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-09 05:44:52 +08:00
|
|
|
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
|
|
|
|
|
2000-12-30 08:16:50 +08:00
|
|
|
if (active_tool && !gimp_image_is_empty (gdisp->gimage) &&
|
1997-11-25 06:05:25 +08:00
|
|
|
!(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)))
|
|
|
|
{
|
|
|
|
GdkEventMotion me;
|
|
|
|
me.x = tx; me.y = ty;
|
|
|
|
me.state = state;
|
2001-02-21 20:18:09 +08:00
|
|
|
gimp_tool_cursor_update (active_tool, &me, gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-12-30 08:16:50 +08:00
|
|
|
else if (gimp_image_is_empty (gdisp->gimage))
|
2000-03-08 04:27:41 +08:00
|
|
|
{
|
2001-02-25 03:29:47 +08:00
|
|
|
gdisplay_install_tool_cursor (gdisp,
|
|
|
|
GIMP_BAD_CURSOR,
|
|
|
|
GIMP_TOOL_CURSOR_NONE,
|
|
|
|
GIMP_CURSOR_MODIFIER_NONE);
|
2000-03-08 04:27:41 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-07-16 11:23:14 +08:00
|
|
|
if (update_cursor)
|
|
|
|
gdisplay_update_cursor (gdisp, tx, ty);
|
1998-06-06 11:49:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdisplay_hruler_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (event->button == 1)
|
|
|
|
{
|
2001-07-08 01:36:00 +08:00
|
|
|
GimpToolInfo *tool_info;
|
|
|
|
GimpTool *active_tool;
|
1998-03-13 11:35:33 +08:00
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
tool_info = tool_manager_get_info_by_type (gdisp->gimage->gimp,
|
|
|
|
GIMP_TYPE_MOVE_TOOL);
|
2001-02-22 05:56:39 +08:00
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
if (tool_info)
|
|
|
|
{
|
|
|
|
gimp_context_set_tool (gimp_get_user_context (gdisp->gimage->gimp),
|
|
|
|
tool_info);
|
|
|
|
|
|
|
|
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
|
|
|
|
|
|
|
|
if (active_tool)
|
|
|
|
{
|
|
|
|
gimp_move_tool_start_hguide (active_tool, gdisp);
|
|
|
|
gtk_grab_add (gdisp->canvas);
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdisplay_vruler_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (gdisp->gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (event->button == 1)
|
|
|
|
{
|
2001-07-08 01:36:00 +08:00
|
|
|
GimpToolInfo *tool_info;
|
|
|
|
GimpTool *active_tool;
|
|
|
|
|
|
|
|
tool_info = tool_manager_get_info_by_type (gdisp->gimage->gimp,
|
|
|
|
GIMP_TYPE_MOVE_TOOL);
|
|
|
|
|
|
|
|
if (tool_info)
|
|
|
|
{
|
|
|
|
gimp_context_set_tool (gimp_get_user_context (gdisp->gimage->gimp),
|
|
|
|
tool_info);
|
1998-03-13 11:35:33 +08:00
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
active_tool = tool_manager_get_active (gdisp->gimage->gimp);
|
2001-02-22 05:56:39 +08:00
|
|
|
|
2001-07-08 01:36:00 +08:00
|
|
|
if (active_tool)
|
|
|
|
{
|
|
|
|
gimp_move_tool_start_vguide (active_tool, gdisp);
|
|
|
|
gtk_grab_add (gdisp->canvas);
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
1998-06-09 17:20:46 +08:00
|
|
|
|
2000-09-14 22:53:06 +08:00
|
|
|
static void
|
|
|
|
gdisplay_origin_menu_position (GtkMenu *menu,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *origin;
|
|
|
|
gint origin_x;
|
|
|
|
gint origin_y;
|
|
|
|
|
|
|
|
origin = (GtkWidget *) data;
|
|
|
|
|
|
|
|
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
|
|
|
|
|
2000-09-14 23:42:39 +08:00
|
|
|
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
|
|
|
|
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
|
|
|
|
|
|
|
|
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
|
|
|
|
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
|
|
|
|
|
|
|
|
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
|
|
|
|
*y -= (GTK_WIDGET (menu)->allocation.height);
|
2000-09-14 22:53:06 +08:00
|
|
|
}
|
|
|
|
|
1998-06-09 17:20:46 +08:00
|
|
|
gint
|
|
|
|
gdisplay_origin_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
2001-04-21 00:27:44 +08:00
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
if (! gdisp->gimage->gimp->busy && event->button == 1)
|
1998-06-09 17:20:46 +08:00
|
|
|
{
|
2001-04-21 00:27:44 +08:00
|
|
|
gint x, y;
|
|
|
|
|
|
|
|
gdisplay_origin_menu_position (GTK_MENU (gdisp->ifactory->widget),
|
|
|
|
&x, &y, widget);
|
2001-02-20 23:15:30 +08:00
|
|
|
|
2001-04-21 00:27:44 +08:00
|
|
|
gtk_item_factory_popup_with_data (gdisp->ifactory,
|
|
|
|
gdisp->gimage, NULL,
|
|
|
|
x, y,
|
|
|
|
1, event->time);
|
1998-06-09 17:20:46 +08:00
|
|
|
}
|
|
|
|
|
2001-07-29 22:09:50 +08:00
|
|
|
/* Return TRUE to stop signal emission so the button doesn't grab the
|
2001-08-07 20:42:23 +08:00
|
|
|
* pointer away from us.
|
|
|
|
*/
|
2001-07-29 22:09:50 +08:00
|
|
|
return TRUE;
|
1998-06-09 17:20:46 +08:00
|
|
|
}
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
void
|
|
|
|
gdisplay_drop_drawable (GtkWidget *widget,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gpointer data)
|
1999-08-20 03:53:30 +08:00
|
|
|
{
|
2001-05-13 19:35:20 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
GDisplay *gdisp;
|
|
|
|
GimpImage *src_gimage;
|
|
|
|
GimpLayer *new_layer;
|
|
|
|
GimpImage *dest_gimage;
|
|
|
|
gint src_width, src_height;
|
|
|
|
gint dest_width, dest_height;
|
|
|
|
gint off_x, off_y;
|
|
|
|
TileManager *tiles;
|
|
|
|
PixelRegion srcPR, destPR;
|
|
|
|
guchar bg[MAX_CHANNELS];
|
|
|
|
gint bytes;
|
|
|
|
GimpImageBaseType type;
|
1999-08-20 03:53:30 +08:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
|
|
|
if (gdisp->gimage->gimp->busy)
|
2001-05-13 19:35:20 +08:00
|
|
|
return;
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
drawable = GIMP_DRAWABLE (viewable);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
src_gimage = gimp_drawable_gimage (drawable);
|
|
|
|
src_width = gimp_drawable_width (drawable);
|
|
|
|
src_height = gimp_drawable_height (drawable);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
switch (gimp_drawable_type (drawable))
|
|
|
|
{
|
|
|
|
case RGB_GIMAGE: case RGBA_GIMAGE:
|
|
|
|
bytes = 4; type = RGB;
|
|
|
|
break;
|
|
|
|
case GRAY_GIMAGE: case GRAYA_GIMAGE:
|
|
|
|
bytes = 2; type = GRAY;
|
|
|
|
break;
|
|
|
|
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
|
|
|
bytes = 4; type = INDEXED;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
bytes = 3; type = RGB;
|
|
|
|
break;
|
|
|
|
}
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
gimp_image_get_background (src_gimage, drawable, bg);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
tiles = tile_manager_new (src_width, src_height, bytes);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
|
|
|
0, 0, src_width, src_height, FALSE);
|
|
|
|
pixel_region_init (&destPR, tiles,
|
|
|
|
0, 0, src_width, src_height, TRUE);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
if (type == INDEXED)
|
|
|
|
{
|
|
|
|
/* If the layer is indexed...we need to extract pixels */
|
|
|
|
extract_from_region (&srcPR, &destPR, NULL,
|
|
|
|
gimp_drawable_cmap (drawable), bg, type,
|
|
|
|
gimp_drawable_has_alpha (drawable), FALSE);
|
|
|
|
}
|
|
|
|
else if (bytes > srcPR.bytes)
|
|
|
|
{
|
|
|
|
/* If the layer doesn't have an alpha channel, add one */
|
|
|
|
add_alpha_region (&srcPR, &destPR);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Otherwise, do a straight copy */
|
|
|
|
copy_region (&srcPR, &destPR);
|
|
|
|
}
|
2000-04-02 05:56:23 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
dest_gimage = gdisp->gimage;
|
|
|
|
dest_width = dest_gimage->width;
|
|
|
|
dest_height = dest_gimage->height;
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
undo_push_group_start (dest_gimage, EDIT_PASTE_UNDO);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
new_layer =
|
|
|
|
gimp_layer_new_from_tiles (dest_gimage,
|
|
|
|
gimp_image_base_type_with_alpha (dest_gimage),
|
|
|
|
tiles,
|
|
|
|
_("Pasted Layer"),
|
|
|
|
OPAQUE_OPACITY, NORMAL_MODE);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
tile_manager_destroy (tiles);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
if (new_layer)
|
|
|
|
{
|
|
|
|
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), dest_gimage);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
off_x = (dest_gimage->width - src_width) / 2;
|
|
|
|
off_y = (dest_gimage->height - src_height) / 2;
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
gimp_layer_translate (new_layer, off_x, off_y);
|
2000-04-02 05:56:23 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
gimp_image_add_layer (dest_gimage, new_layer, -1);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
undo_push_group_end (dest_gimage);
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
gdisplays_flush ();
|
1999-08-20 03:53:30 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_context_set_display (gimp_get_user_context (gdisp->gimage->gimp),
|
|
|
|
gdisp);
|
2001-05-13 19:35:20 +08:00
|
|
|
}
|
1999-08-20 03:53:30 +08:00
|
|
|
}
|
1999-08-23 22:19:26 +08:00
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
static void
|
2001-08-07 20:42:23 +08:00
|
|
|
gdisplay_bucket_fill (GDisplay *gdisp,
|
1999-10-28 23:05:49 +08:00
|
|
|
BucketFillMode fill_mode,
|
1999-10-30 18:39:48 +08:00
|
|
|
guchar orig_color[],
|
2001-08-07 20:42:23 +08:00
|
|
|
TempBuf *orig_pat_buf)
|
1999-08-23 22:19:26 +08:00
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
TileManager *buf_tiles;
|
|
|
|
PixelRegion bufPR;
|
2001-03-12 01:24:47 +08:00
|
|
|
GimpToolInfo *tool_info;
|
1999-08-23 22:19:26 +08:00
|
|
|
GimpContext *context;
|
2001-01-08 05:07:14 +08:00
|
|
|
gint x1, x2, y1, y2;
|
|
|
|
gint bytes;
|
|
|
|
gboolean has_alpha;
|
1999-08-23 22:19:26 +08:00
|
|
|
|
1999-10-30 18:39:48 +08:00
|
|
|
guchar color[3];
|
|
|
|
TempBuf *pat_buf = NULL;
|
|
|
|
gboolean new_buf = FALSE;
|
|
|
|
|
2001-08-07 20:42:23 +08:00
|
|
|
gimage = gdisp->gimage;
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
|
|
|
|
if (gimage->gimp->busy)
|
2000-03-26 02:17:01 +08:00
|
|
|
return;
|
|
|
|
|
2000-12-30 08:16:50 +08:00
|
|
|
drawable = gimp_image_active_drawable (gimage);
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
|
|
|
|
if (! drawable)
|
1999-10-04 13:51:40 +08:00
|
|
|
return;
|
1999-08-23 22:19:26 +08:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gimp_set_busy (gimage->gimp);
|
1999-08-23 22:19:26 +08:00
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
/* Get the bucket fill context */
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_info = tool_manager_get_info_by_type (gimage->gimp,
|
|
|
|
GIMP_TYPE_BUCKET_FILL_TOOL);
|
2001-03-12 01:24:47 +08:00
|
|
|
|
|
|
|
if (tool_info && tool_info->context)
|
|
|
|
{
|
|
|
|
context = tool_info->context;
|
|
|
|
}
|
1999-08-23 22:19:26 +08:00
|
|
|
else
|
2001-03-12 01:24:47 +08:00
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
context = gimp_get_user_context (gimage->gimp);
|
2001-03-12 01:24:47 +08:00
|
|
|
}
|
2001-02-21 20:18:09 +08:00
|
|
|
|
1999-10-30 18:39:48 +08:00
|
|
|
/* Transform the passed data for the dest image */
|
|
|
|
if (fill_mode == FG_BUCKET_FILL)
|
|
|
|
{
|
|
|
|
gimp_image_transform_color (gimage, drawable, orig_color, color, RGB);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
if (((orig_pat_buf->bytes == 3) && ! gimp_drawable_is_rgb (drawable)) ||
|
|
|
|
((orig_pat_buf->bytes == 1) && ! gimp_drawable_is_gray (drawable)))
|
1999-10-30 18:39:48 +08:00
|
|
|
{
|
|
|
|
guchar *d1, *d2;
|
|
|
|
gint size;
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
if ((orig_pat_buf->bytes == 1) && gimp_drawable_is_rgb (drawable))
|
1999-10-30 18:39:48 +08:00
|
|
|
pat_buf = temp_buf_new (orig_pat_buf->width, orig_pat_buf->height,
|
|
|
|
3, 0, 0, NULL);
|
|
|
|
else
|
|
|
|
pat_buf = temp_buf_new (orig_pat_buf->width, orig_pat_buf->height,
|
|
|
|
1, 0, 0, NULL);
|
|
|
|
|
|
|
|
d1 = temp_buf_data (orig_pat_buf);
|
|
|
|
d2 = temp_buf_data (pat_buf);
|
|
|
|
|
|
|
|
size = orig_pat_buf->width * orig_pat_buf->height;
|
|
|
|
while (size--)
|
|
|
|
{
|
2000-12-30 08:16:50 +08:00
|
|
|
gimp_image_transform_color (gimage, drawable, d1, d2,
|
|
|
|
(orig_pat_buf->bytes == 3) ? RGB : GRAY);
|
1999-10-30 18:39:48 +08:00
|
|
|
d1 += orig_pat_buf->bytes;
|
|
|
|
d2 += pat_buf->bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
new_buf = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pat_buf = orig_pat_buf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
|
|
|
bytes = gimp_drawable_bytes (drawable);
|
|
|
|
has_alpha = gimp_drawable_has_alpha (drawable);
|
1999-08-23 22:19:26 +08:00
|
|
|
|
|
|
|
/* Fill the region */
|
|
|
|
buf_tiles = tile_manager_new ((x2 - x1), (y2 - y1), bytes);
|
|
|
|
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), TRUE);
|
1999-10-28 23:05:49 +08:00
|
|
|
bucket_fill_region (fill_mode, &bufPR, NULL,
|
|
|
|
color, pat_buf, x1, y1, has_alpha);
|
1999-08-23 22:19:26 +08:00
|
|
|
|
|
|
|
/* Apply it to the image */
|
|
|
|
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
|
2000-12-30 08:16:50 +08:00
|
|
|
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
|
|
|
|
gimp_context_get_opacity (context) * 255,
|
|
|
|
gimp_context_get_paint_mode (context),
|
|
|
|
NULL, x1, y1);
|
1999-08-23 22:19:26 +08:00
|
|
|
tile_manager_destroy (buf_tiles);
|
|
|
|
|
|
|
|
/* Update the displays */
|
2001-07-08 06:49:01 +08:00
|
|
|
gimp_drawable_update (drawable,
|
|
|
|
x1, y1,
|
|
|
|
(x2 - x1), (y2 - y1));
|
1999-08-23 22:19:26 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
|
1999-10-30 18:39:48 +08:00
|
|
|
if (new_buf)
|
|
|
|
temp_buf_free (pat_buf);
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gimp_unset_busy (gimage->gimp);
|
1999-08-23 22:19:26 +08:00
|
|
|
}
|
1999-10-28 23:05:49 +08:00
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
void
|
|
|
|
gdisplay_drop_pattern (GtkWidget *widget,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2001-08-07 20:42:23 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
|
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
2001-05-13 19:35:20 +08:00
|
|
|
if (GIMP_IS_PATTERN (viewable))
|
|
|
|
{
|
2001-08-07 20:42:23 +08:00
|
|
|
gdisplay_bucket_fill (gdisp,
|
|
|
|
PATTERN_BUCKET_FILL,
|
|
|
|
NULL,
|
|
|
|
GIMP_PATTERN (viewable)->mask);
|
2001-05-13 19:35:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
void
|
2001-01-20 23:37:26 +08:00
|
|
|
gdisplay_drop_color (GtkWidget *widget,
|
|
|
|
const GimpRGB *drop_color,
|
|
|
|
gpointer data)
|
1999-10-28 23:05:49 +08:00
|
|
|
{
|
2001-08-07 20:42:23 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
guchar color[4];
|
|
|
|
|
|
|
|
gdisp = (GDisplay *) data;
|
1999-10-28 23:05:49 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
gimp_rgba_get_uchar (drop_color,
|
|
|
|
&color[0],
|
|
|
|
&color[1],
|
|
|
|
&color[2],
|
|
|
|
&color[3]);
|
1999-10-28 23:05:49 +08:00
|
|
|
|
2001-08-07 20:42:23 +08:00
|
|
|
gdisplay_bucket_fill (gdisp,
|
|
|
|
FG_BUCKET_FILL,
|
|
|
|
color,
|
|
|
|
NULL);
|
1999-10-28 23:05:49 +08:00
|
|
|
}
|
2001-07-03 04:57:58 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
gdisplay_drop_buffer (GtkWidget *widget,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GimpBuffer *buffer;
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gdisp = (GDisplay *) data;
|
|
|
|
|
|
|
|
if (gdisp->gimage->gimp->busy)
|
2001-07-03 04:57:58 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
buffer = GIMP_BUFFER (viewable);
|
|
|
|
|
|
|
|
/* FIXME: popup a menu for selecting "Paste Into" */
|
|
|
|
|
|
|
|
gimp_edit_paste (gdisp->gimage,
|
|
|
|
gimp_image_active_drawable (gdisp->gimage),
|
|
|
|
buffer->tiles,
|
|
|
|
FALSE);
|
|
|
|
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|