1997-11-24 22:05:25 +00: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 05:44:11 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2000-04-27 17:27:28 +00:00
|
|
|
#include "config.h"
|
2000-01-14 12:41:00 +00:00
|
|
|
|
2000-12-16 21:37:03 +00:00
|
|
|
#include <gtk/gtk.h>
|
2000-01-14 12:41:00 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
|
2001-01-24 22:36:18 +00:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-09 22:34:59 +00:00
|
|
|
#include "tools-types.h"
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2001-05-15 11:25:25 +00:00
|
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "base/temp-buf.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-04-07 15:58:26 +00:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-07-07 12:17:23 +00:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
#include "core/gimpchannel.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimpimage-mask.h"
|
|
|
|
#include "core/gimppattern.h"
|
|
|
|
|
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-10 19:16:16 +00:00
|
|
|
#include "pdb/procedural_db.h"
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-03-08 01:07:03 +00:00
|
|
|
#include "gimpbucketfilltool.h"
|
|
|
|
#include "gimpfuzzyselecttool.h"
|
|
|
|
#include "gimptool.h"
|
2001-01-24 22:36:18 +00:00
|
|
|
#include "paint_options.h"
|
2001-02-28 01:05:22 +00:00
|
|
|
#include "tool_manager.h"
|
2001-01-24 22:36:18 +00: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-10 19:16:16 +00:00
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "gimprc.h"
|
|
|
|
#include "undo.h"
|
2001-01-21 21:58:16 +00:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-14 23:23:52 +00:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2001-05-14 00:04:29 +00:00
|
|
|
#define WANT_BUCKET_FILL_BITS
|
|
|
|
#include "icons.h"
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
typedef struct _BucketOptions BucketOptions;
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
struct _BucketOptions
|
|
|
|
{
|
1999-04-22 14:34:00 +00:00
|
|
|
PaintOptions paint_options;
|
1999-04-08 22:25:54 +00:00
|
|
|
|
1999-08-23 14:19:26 +00:00
|
|
|
gboolean sample_merged;
|
|
|
|
gboolean sample_merged_d;
|
1999-04-18 21:22:41 +00:00
|
|
|
GtkWidget *sample_merged_w;
|
1999-04-17 23:18:43 +00:00
|
|
|
|
2000-04-20 15:57:13 +00:00
|
|
|
gdouble threshold;
|
|
|
|
/* gdouble threshold_d; (from gimprc) */
|
|
|
|
GtkObject *threshold_w;
|
|
|
|
|
1999-04-18 21:22:41 +00:00
|
|
|
BucketFillMode fill_mode;
|
|
|
|
BucketFillMode fill_mode_d;
|
1999-04-27 21:06:00 +00:00
|
|
|
GtkWidget *fill_mode_w[3];
|
1999-04-08 22:25:54 +00:00
|
|
|
};
|
|
|
|
|
1999-04-12 17:55:06 +00:00
|
|
|
|
|
|
|
/* the bucket fill tool options */
|
1999-04-08 22:25:54 +00:00
|
|
|
static BucketOptions *bucket_options = NULL;
|
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
static GimpToolClass *parent_class = NULL;
|
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* local function prototypes */
|
1999-06-21 22:12:07 +00:00
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
static void gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass);
|
|
|
|
static void gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_fill_tool);
|
|
|
|
|
|
|
|
static void gimp_bucket_fill_tool_destroy (GtkObject *object);
|
|
|
|
|
|
|
|
static BucketOptions * bucket_options_new (void);
|
2001-07-17 20:50:01 +00:00
|
|
|
static void bucket_options_reset (GimpToolOptions *tool_options);
|
|
|
|
|
|
|
|
static void gimp_bucket_fill_tool_button_press (GimpTool *tool,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void gimp_bucket_fill_tool_button_release (GimpTool *tool,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
|
|
|
|
GdkEventMotion *mevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
static void gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkEventKey *kevent,
|
|
|
|
GDisplay *gdisp);
|
|
|
|
|
|
|
|
static void bucket_fill_line_color (guchar *,
|
|
|
|
guchar *,
|
|
|
|
guchar *,
|
|
|
|
gboolean ,
|
|
|
|
gint ,
|
|
|
|
gint );
|
|
|
|
static void bucket_fill_line_pattern (guchar *,
|
|
|
|
guchar *,
|
|
|
|
TempBuf *,
|
|
|
|
gboolean ,
|
|
|
|
gint ,
|
|
|
|
gint ,
|
|
|
|
gint ,
|
|
|
|
gint );
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
/* functions */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
void
|
2001-07-07 12:17:23 +00:00
|
|
|
gimp_bucket_fill_tool_register (Gimp *gimp)
|
2001-02-28 01:05:22 +00:00
|
|
|
{
|
2001-07-07 12:17:23 +00:00
|
|
|
tool_manager_register_tool (gimp,
|
|
|
|
GIMP_TYPE_BUCKET_FILL_TOOL,
|
2001-02-28 01:05:22 +00:00
|
|
|
TRUE,
|
|
|
|
"gimp:bucket_fill_tool",
|
|
|
|
_("Bucket Fill"),
|
|
|
|
_("Fill with a color or pattern"),
|
|
|
|
N_("/Tools/Paint Tools/Bucket Fill"), "<shift>B",
|
|
|
|
NULL, "tools/bucket_fill.html",
|
2001-05-14 00:04:29 +00:00
|
|
|
(const gchar **) bucket_fill_bits);
|
2001-02-28 01:05:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkType
|
|
|
|
gimp_bucket_fill_tool_get_type (void)
|
|
|
|
{
|
|
|
|
static GtkType tool_type = 0;
|
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
|
|
|
GtkTypeInfo tool_info =
|
|
|
|
{
|
|
|
|
"GimpBucketFillTool",
|
|
|
|
sizeof (GimpBucketFillTool),
|
|
|
|
sizeof (GimpBucketFillToolClass),
|
|
|
|
(GtkClassInitFunc) gimp_bucket_fill_tool_class_init,
|
|
|
|
(GtkObjectInitFunc) gimp_bucket_fill_tool_init,
|
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
|
|
|
(GtkClassInitFunc) NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
tool_type = gtk_type_unique (GIMP_TYPE_TOOL, &tool_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GimpToolClass *tool_class;
|
|
|
|
|
|
|
|
object_class = (GtkObjectClass *) klass;
|
|
|
|
tool_class = (GimpToolClass *) klass;
|
|
|
|
|
|
|
|
parent_class = gtk_type_class (GIMP_TYPE_TOOL);
|
|
|
|
|
|
|
|
object_class->destroy = gimp_bucket_fill_tool_destroy;
|
|
|
|
|
|
|
|
tool_class->button_press = gimp_bucket_fill_tool_button_press;
|
|
|
|
tool_class->button_release = gimp_bucket_fill_tool_button_release;
|
|
|
|
tool_class->modifier_key = gimp_bucket_fill_tool_modifier_key;
|
|
|
|
tool_class->cursor_update = gimp_bucket_fill_tool_cursor_update;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_fill_tool)
|
|
|
|
{
|
|
|
|
GimpTool *tool;
|
|
|
|
|
|
|
|
tool = GIMP_TOOL (bucket_fill_tool);
|
|
|
|
|
|
|
|
if (! bucket_options)
|
|
|
|
{
|
|
|
|
bucket_options = bucket_options_new ();
|
|
|
|
|
|
|
|
tool_manager_register_tool_options (GIMP_TYPE_BUCKET_FILL_TOOL,
|
2001-07-17 20:50:01 +00:00
|
|
|
(GimpToolOptions *) bucket_options);
|
2001-02-28 01:05:22 +00:00
|
|
|
|
2001-07-17 20:50:01 +00:00
|
|
|
bucket_options_reset ((GimpToolOptions *) bucket_options);
|
2001-02-28 01:05:22 +00:00
|
|
|
}
|
|
|
|
|
2001-03-31 17:08:55 +00:00
|
|
|
tool->tool_cursor = GIMP_BUCKET_FILL_TOOL_CURSOR;
|
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
tool->scroll_lock = TRUE; /* Disallow scrolling */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_bucket_fill_tool_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
|
|
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
|
|
|
}
|
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
static void
|
2001-07-17 20:50:01 +00:00
|
|
|
bucket_options_reset (GimpToolOptions *tool_options)
|
1999-04-08 22:25:54 +00:00
|
|
|
{
|
2001-03-31 20:41:39 +00:00
|
|
|
BucketOptions *options;
|
1999-04-08 22:25:54 +00:00
|
|
|
|
2001-03-31 20:41:39 +00:00
|
|
|
options = (BucketOptions *) tool_options;
|
|
|
|
|
|
|
|
paint_options_reset (tool_options);
|
1999-04-08 22:25:54 +00:00
|
|
|
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w),
|
|
|
|
options->sample_merged_d);
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w),
|
2001-06-03 20:40:50 +00:00
|
|
|
gimprc.default_threshold);
|
1999-04-27 21:06:00 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fill_mode_w[options->fill_mode_d]), TRUE);
|
1999-04-08 22:25:54 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
static BucketOptions *
|
1999-04-12 17:55:06 +00:00
|
|
|
bucket_options_new (void)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
BucketOptions *options;
|
1999-04-12 17:55:06 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
GtkWidget *vbox;
|
1999-04-12 17:55:06 +00:00
|
|
|
GtkWidget *hbox;
|
1997-11-24 22:05:25 +00:00
|
|
|
GtkWidget *label;
|
1999-04-08 22:25:54 +00:00
|
|
|
GtkWidget *scale;
|
1999-04-27 02:09:03 +00:00
|
|
|
GtkWidget *frame;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
options = g_new0 (BucketOptions, 1);
|
|
|
|
|
1999-04-22 14:34:00 +00:00
|
|
|
paint_options_init ((PaintOptions *) options,
|
2001-02-28 01:05:22 +00:00
|
|
|
GIMP_TYPE_BUCKET_FILL_TOOL,
|
1999-04-22 14:34:00 +00:00
|
|
|
bucket_options_reset);
|
2001-02-28 01:05:22 +00:00
|
|
|
|
1999-04-12 17:55:06 +00:00
|
|
|
options->sample_merged = options->sample_merged_d = FALSE;
|
2001-06-03 20:40:50 +00:00
|
|
|
options->threshold = gimprc.default_threshold;
|
1999-04-18 21:22:41 +00:00
|
|
|
options->fill_mode = options->fill_mode_d = FG_BUCKET_FILL;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* the main vbox */
|
2001-07-17 20:50:01 +00:00
|
|
|
vbox = ((GimpToolOptions *) options)->main_vbox;
|
1999-04-12 17:55:06 +00:00
|
|
|
|
2000-04-20 15:57:13 +00:00
|
|
|
/* the sample merged toggle */
|
|
|
|
options->sample_merged_w =
|
|
|
|
gtk_check_button_new_with_label (_("Sample Merged"));
|
2001-08-01 02:57:58 +00:00
|
|
|
g_signal_connect (G_OBJECT (options->sample_merged_w), "toggled",
|
|
|
|
G_CALLBACK (gimp_toggle_button_update),
|
|
|
|
&options->sample_merged);
|
2000-04-20 15:57:13 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), options->sample_merged_w, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (options->sample_merged_w);
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* the threshold scale */
|
1999-04-22 14:34:00 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
1999-04-12 17:55:06 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
label = gtk_label_new (_("Threshold:"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
1999-04-12 17:55:06 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
1997-11-24 22:05:25 +00:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
options->threshold_w =
|
2001-06-03 20:40:50 +00:00
|
|
|
gtk_adjustment_new (gimprc.default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0);
|
1999-04-08 22:25:54 +00:00
|
|
|
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w));
|
1999-04-12 17:55:06 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
1999-04-08 22:25:54 +00:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
|
2001-08-01 02:57:58 +00:00
|
|
|
g_signal_connect (G_OBJECT (options->threshold_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->threshold);
|
1999-04-08 22:25:54 +00:00
|
|
|
gtk_widget_show (scale);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-04-12 17:55:06 +00:00
|
|
|
gtk_widget_show (hbox);
|
1999-04-08 22:25:54 +00:00
|
|
|
|
1999-04-27 02:09:03 +00:00
|
|
|
/* fill type */
|
2000-01-14 12:41:00 +00:00
|
|
|
frame =
|
|
|
|
gimp_radio_group_new2 (TRUE, _("Fill Type"),
|
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-24 21:27:11 +00:00
|
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
|
|
&options->fill_mode,
|
|
|
|
GINT_TO_POINTER (options->fill_mode),
|
2000-01-14 12:41:00 +00:00
|
|
|
|
|
|
|
_("FG Color Fill"),
|
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-24 21:27:11 +00:00
|
|
|
GINT_TO_POINTER (FG_BUCKET_FILL),
|
2000-01-14 12:41:00 +00:00
|
|
|
&options->fill_mode_w[0],
|
|
|
|
_("BG Color Fill"),
|
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-24 21:27:11 +00:00
|
|
|
GINT_TO_POINTER (BG_BUCKET_FILL),
|
2000-01-14 12:41:00 +00:00
|
|
|
&options->fill_mode_w[1],
|
|
|
|
_("Pattern Fill"),
|
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-24 21:27:11 +00:00
|
|
|
GINT_TO_POINTER (PATTERN_BUCKET_FILL),
|
2000-01-14 12:41:00 +00:00
|
|
|
&options->fill_mode_w[2],
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
1999-04-27 02:09:03 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
1999-07-06 15:18:25 +00:00
|
|
|
/* bucket fill action functions */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1998-03-18 22:35:31 +00:00
|
|
|
static void
|
2001-02-28 01:05:22 +00:00
|
|
|
gimp_bucket_fill_tool_button_press (GimpTool *tool,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
GDisplay *gdisp)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-02-28 01:05:22 +00:00
|
|
|
GimpBucketFillTool *bucket_tool;
|
|
|
|
gboolean use_offsets;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
use_offsets = (bucket_options->sample_merged) ? FALSE : TRUE;
|
|
|
|
|
|
|
|
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y,
|
|
|
|
&bucket_tool->target_x,
|
|
|
|
&bucket_tool->target_y, FALSE, use_offsets);
|
|
|
|
|
|
|
|
/* Make the tool active and set the gdisplay which owns it */
|
|
|
|
gdk_pointer_grab (gdisp->canvas->window, FALSE,
|
1999-08-23 14:19:26 +00:00
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_BUTTON1_MOTION_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK,
|
1997-11-24 22:05:25 +00:00
|
|
|
NULL, NULL, bevent->time);
|
|
|
|
|
|
|
|
/* Make the tool active and set the gdisplay which owns it */
|
2000-12-31 04:07:42 +00:00
|
|
|
tool->gdisp = gdisp;
|
1997-11-24 22:05:25 +00:00
|
|
|
tool->state = ACTIVE;
|
|
|
|
}
|
|
|
|
|
1998-03-18 22:35:31 +00:00
|
|
|
static void
|
2001-02-28 01:05:22 +00:00
|
|
|
gimp_bucket_fill_tool_button_release (GimpTool *tool,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
GDisplay *gdisp)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-02-28 01:05:22 +00:00
|
|
|
GimpBucketFillTool *bucket_tool;
|
|
|
|
Argument *return_vals;
|
|
|
|
gint nreturn_vals;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-02-28 01:05:22 +00:00
|
|
|
bucket_tool = GIMP_BUCKET_FILL_TOOL (tool);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
gdk_pointer_ungrab (bevent->time);
|
|
|
|
gdk_flush ();
|
|
|
|
|
|
|
|
/* if the 3rd button isn't pressed, fill the selected region */
|
|
|
|
if (! (bevent->state & GDK_BUTTON3_MASK))
|
|
|
|
{
|
2001-07-07 12:17:23 +00:00
|
|
|
GimpContext *context;
|
|
|
|
|
|
|
|
context = gimp_get_current_context (gdisp->gimage->gimp);
|
|
|
|
|
1999-07-06 15:18:25 +00:00
|
|
|
return_vals =
|
2001-07-04 19:31:35 +00:00
|
|
|
procedural_db_run_proc (gdisp->gimage->gimp,
|
|
|
|
"gimp_bucket_fill",
|
1999-07-06 15:18:25 +00:00
|
|
|
&nreturn_vals,
|
2001-05-21 13:58:46 +00:00
|
|
|
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (gimp_image_active_drawable (gdisp->gimage)),
|
|
|
|
GIMP_PDB_INT32, (gint32) bucket_options->fill_mode,
|
2001-07-07 12:17:23 +00:00
|
|
|
GIMP_PDB_INT32, (gint32) gimp_context_get_paint_mode (context),
|
|
|
|
GIMP_PDB_FLOAT, (gdouble) gimp_context_get_opacity (context) * 100,
|
2001-05-21 13:58:46 +00:00
|
|
|
GIMP_PDB_FLOAT, (gdouble) bucket_options->threshold,
|
|
|
|
GIMP_PDB_INT32, (gint32) bucket_options->sample_merged,
|
|
|
|
GIMP_PDB_FLOAT, (gdouble) bucket_tool->target_x,
|
|
|
|
GIMP_PDB_FLOAT, (gdouble) bucket_tool->target_y,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals && return_vals[0].value.pdb_int == GIMP_PDB_SUCCESS)
|
1997-11-24 22:05:25 +00:00
|
|
|
gdisplays_flush ();
|
|
|
|
else
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-14 23:23:52 +00:00
|
|
|
g_message (_("Bucket Fill operation failed."));
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
procedural_db_destroy_args (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
|
|
|
|
tool->state = INACTIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-28 01:05:22 +00:00
|
|
|
gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
|
|
|
|
GdkEventMotion *mevent,
|
|
|
|
GDisplay *gdisp)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-02-24 19:29:47 +00:00
|
|
|
GimpLayer *layer;
|
|
|
|
GdkCursorType ctype = GDK_TOP_LEFT_ARROW;
|
|
|
|
GimpCursorModifier cmodifier = GIMP_CURSOR_MODIFIER_NONE;
|
|
|
|
gint x, y;
|
|
|
|
gint off_x, off_y;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2000-06-14 10:59:16 +00:00
|
|
|
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y,
|
|
|
|
&x, &y, FALSE, FALSE);
|
2001-02-28 01:05:22 +00:00
|
|
|
|
2000-12-29 15:22:01 +00:00
|
|
|
if ((layer = gimp_image_get_active_layer (gdisp->gimage)))
|
1998-01-22 07:02:57 +00:00
|
|
|
{
|
2001-01-14 21:11:52 +00:00
|
|
|
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
2000-07-29 16:12:40 +00:00
|
|
|
|
1998-01-22 07:02:57 +00:00
|
|
|
if (x >= off_x && y >= off_y &&
|
2001-01-14 21:11:52 +00:00
|
|
|
x < (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer))) &&
|
|
|
|
y < (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer))))
|
1998-01-22 07:02:57 +00:00
|
|
|
{
|
|
|
|
/* One more test--is there a selected region?
|
|
|
|
* if so, is cursor inside?
|
|
|
|
*/
|
2000-07-29 16:12:40 +00:00
|
|
|
if (gimage_mask_is_empty (gdisp->gimage) ||
|
|
|
|
gimage_mask_value (gdisp->gimage, x, y))
|
|
|
|
{
|
|
|
|
ctype = GIMP_MOUSE_CURSOR;
|
|
|
|
|
|
|
|
switch (bucket_options->fill_mode)
|
|
|
|
{
|
|
|
|
case FG_BUCKET_FILL:
|
2001-02-24 19:29:47 +00:00
|
|
|
cmodifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
|
2000-07-29 16:12:40 +00:00
|
|
|
break;
|
|
|
|
case BG_BUCKET_FILL:
|
2001-02-24 19:29:47 +00:00
|
|
|
cmodifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
|
2000-07-29 16:12:40 +00:00
|
|
|
break;
|
|
|
|
case PATTERN_BUCKET_FILL:
|
2001-02-24 19:29:47 +00:00
|
|
|
cmodifier = GIMP_CURSOR_MODIFIER_PATTERN;
|
2000-07-29 16:12:40 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1998-01-22 07:02:57 +00:00
|
|
|
}
|
|
|
|
}
|
2000-07-29 16:12:40 +00:00
|
|
|
|
2001-02-24 19:29:47 +00:00
|
|
|
gdisplay_install_tool_cursor (gdisp,
|
|
|
|
ctype,
|
|
|
|
GIMP_BUCKET_FILL_TOOL_CURSOR,
|
|
|
|
cmodifier);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
1999-04-27 02:09:03 +00:00
|
|
|
static void
|
2001-02-28 01:05:22 +00:00
|
|
|
gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkEventKey *kevent,
|
|
|
|
GDisplay *gdisp)
|
1999-04-27 02:09:03 +00:00
|
|
|
{
|
1999-04-27 21:06:00 +00:00
|
|
|
switch (kevent->keyval)
|
1999-04-27 02:09:03 +00:00
|
|
|
{
|
1999-04-27 21:06:00 +00:00
|
|
|
case GDK_Alt_L: case GDK_Alt_R:
|
1999-04-27 02:09:03 +00:00
|
|
|
break;
|
1999-04-27 21:06:00 +00:00
|
|
|
case GDK_Shift_L: case GDK_Shift_R:
|
1999-06-07 22:38:20 +00:00
|
|
|
break;
|
|
|
|
case GDK_Control_L: case GDK_Control_R:
|
1999-04-27 21:06:00 +00:00
|
|
|
switch (bucket_options->fill_mode)
|
|
|
|
{
|
|
|
|
case FG_BUCKET_FILL:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bucket_options->fill_mode_w[BG_BUCKET_FILL]), TRUE);
|
|
|
|
break;
|
|
|
|
case BG_BUCKET_FILL:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bucket_options->fill_mode_w[FG_BUCKET_FILL]), TRUE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1999-04-27 02:09:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-04-18 21:22:41 +00:00
|
|
|
void
|
|
|
|
bucket_fill (GimpImage *gimage,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
BucketFillMode fill_mode,
|
1999-08-23 14:19:26 +00:00
|
|
|
gint paint_mode,
|
|
|
|
gdouble opacity,
|
|
|
|
gdouble threshold,
|
|
|
|
gboolean sample_merged,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
TileManager *buf_tiles;
|
1999-08-23 14:19:26 +00:00
|
|
|
PixelRegion bufPR, maskPR;
|
2001-01-29 02:45:02 +00:00
|
|
|
GimpChannel *mask = NULL;
|
2000-12-31 04:07:42 +00:00
|
|
|
gint bytes;
|
|
|
|
gboolean has_alpha;
|
|
|
|
gint x1, y1, x2, y2;
|
|
|
|
guchar col [MAX_CHANNELS];
|
|
|
|
guchar *d1, *d2;
|
2001-02-04 17:34:30 +00:00
|
|
|
GimpPattern *pattern;
|
2000-12-31 04:07:42 +00:00
|
|
|
TempBuf *pat_buf;
|
|
|
|
gboolean new_buf = FALSE;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
pat_buf = NULL;
|
|
|
|
|
1999-04-18 21:22:41 +00:00
|
|
|
if (fill_mode == FG_BUCKET_FILL)
|
2000-12-29 15:22:01 +00:00
|
|
|
gimp_image_get_foreground (gimage, drawable, col);
|
1999-04-18 21:22:41 +00:00
|
|
|
else if (fill_mode == BG_BUCKET_FILL)
|
2000-12-29 15:22:01 +00:00
|
|
|
gimp_image_get_background (gimage, drawable, col);
|
1999-04-18 21:22:41 +00:00
|
|
|
else if (fill_mode == PATTERN_BUCKET_FILL)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-07-07 12:17:23 +00:00
|
|
|
pattern = gimp_context_get_pattern (gimp_get_current_context (gimage->gimp));
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (!pattern)
|
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-14 23:23:52 +00:00
|
|
|
g_message (_("No available patterns for this operation."));
|
1997-11-24 22:05:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the pattern doesn't match the image in terms of color type,
|
|
|
|
* transform it. (ie pattern is RGB, image is indexed)
|
|
|
|
*/
|
2001-01-14 21:11:52 +00:00
|
|
|
if (((pattern->mask->bytes == 3) && !gimp_drawable_is_rgb (drawable)) ||
|
|
|
|
((pattern->mask->bytes == 1) && !gimp_drawable_is_gray (drawable)))
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
int size;
|
|
|
|
|
2001-01-14 21:11:52 +00:00
|
|
|
if ((pattern->mask->bytes == 1) && gimp_drawable_is_rgb (drawable))
|
|
|
|
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height,
|
|
|
|
3, 0, 0, NULL);
|
1997-11-24 22:05:25 +00:00
|
|
|
else
|
2001-01-14 21:11:52 +00:00
|
|
|
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height,
|
|
|
|
1, 0, 0, NULL);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
d1 = temp_buf_data (pattern->mask);
|
|
|
|
d2 = temp_buf_data (pat_buf);
|
|
|
|
|
|
|
|
size = pattern->mask->width * pattern->mask->height;
|
|
|
|
while (size--)
|
|
|
|
{
|
2000-12-29 15:22:01 +00:00
|
|
|
gimp_image_transform_color (gimage, drawable, d1, d2,
|
|
|
|
(pattern->mask->bytes == 3) ? RGB : GRAY);
|
1997-11-24 22:05:25 +00:00
|
|
|
d1 += pattern->mask->bytes;
|
|
|
|
d2 += pat_buf->bytes;
|
|
|
|
}
|
|
|
|
|
1999-08-23 14:19:26 +00:00
|
|
|
new_buf = TRUE;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
pat_buf = pattern->mask;
|
|
|
|
}
|
|
|
|
|
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-10 19:16:16 +00:00
|
|
|
gimp_set_busy (gimage->gimp);
|
1999-01-10 23:36:29 +00:00
|
|
|
|
2001-01-14 21:11:52 +00:00
|
|
|
bytes = gimp_drawable_bytes (drawable);
|
|
|
|
has_alpha = gimp_drawable_has_alpha (drawable);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* If there is no selection mask, the do a seed bucket
|
|
|
|
* fill...To do this, calculate a new contiguous region
|
|
|
|
*/
|
2001-01-14 21:11:52 +00:00
|
|
|
if (! gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2))
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
1998-01-22 07:02:57 +00:00
|
|
|
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
|
1997-11-24 22:05:25 +00:00
|
|
|
(int) x, (int) y, sample_merged);
|
|
|
|
|
2001-01-29 02:45:02 +00:00
|
|
|
gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* make sure we handle the mask correctly if it was sample-merged */
|
|
|
|
if (sample_merged)
|
|
|
|
{
|
2000-12-31 04:07:42 +00:00
|
|
|
gint off_x, off_y;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* Limit the channel bounds to the drawable's extents */
|
2001-01-14 21:11:52 +00:00
|
|
|
gimp_drawable_offsets (drawable, &off_x, &off_y);
|
|
|
|
x1 = CLAMP (x1, off_x, (off_x + gimp_drawable_width (drawable)));
|
|
|
|
y1 = CLAMP (y1, off_y, (off_y + gimp_drawable_height (drawable)));
|
|
|
|
x2 = CLAMP (x2, off_x, (off_x + gimp_drawable_width (drawable)));
|
|
|
|
y2 = CLAMP (y2, off_y, (off_y + gimp_drawable_height (drawable)));
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-01-14 21:11:52 +00:00
|
|
|
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
|
1998-01-22 07:02:57 +00:00
|
|
|
x1, y1, (x2 - x1), (y2 - y1), TRUE);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* translate mask bounds to drawable coords */
|
|
|
|
x1 -= off_x;
|
|
|
|
y1 -= off_y;
|
|
|
|
x2 -= off_x;
|
|
|
|
y2 -= off_y;
|
|
|
|
}
|
|
|
|
else
|
2001-01-14 21:11:52 +00:00
|
|
|
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
|
1998-01-22 07:02:57 +00:00
|
|
|
x1, y1, (x2 - x1), (y2 - y1), TRUE);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* if the gimage doesn't have an alpha channel,
|
|
|
|
* make sure that the temp buf does. We need the
|
|
|
|
* alpha channel to fill with the region calculated above
|
|
|
|
*/
|
|
|
|
if (! has_alpha)
|
|
|
|
{
|
|
|
|
bytes ++;
|
1999-08-23 14:19:26 +00:00
|
|
|
has_alpha = TRUE;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buf_tiles = tile_manager_new ((x2 - x1), (y2 - y1), bytes);
|
|
|
|
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), TRUE);
|
|
|
|
|
|
|
|
if (mask)
|
|
|
|
bucket_fill_region (fill_mode, &bufPR, &maskPR, col, pat_buf, x1, y1, has_alpha);
|
|
|
|
else
|
|
|
|
bucket_fill_region (fill_mode, &bufPR, NULL, col, pat_buf, x1, y1, has_alpha);
|
|
|
|
|
|
|
|
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
|
2000-12-29 15:22:01 +00:00
|
|
|
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
|
|
|
|
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* update the image */
|
2001-07-07 22:49:01 +00:00
|
|
|
gimp_drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* free the temporary buffer */
|
|
|
|
tile_manager_destroy (buf_tiles);
|
|
|
|
|
|
|
|
/* free the mask */
|
|
|
|
if (mask)
|
2001-07-25 00:27:41 +00:00
|
|
|
g_object_unref (G_OBJECT (mask));
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (new_buf)
|
|
|
|
temp_buf_free (pat_buf);
|
1999-01-10 23:36:29 +00: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-10 19:16:16 +00:00
|
|
|
gimp_unset_busy (gimage->gimp);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-23 14:19:26 +00:00
|
|
|
bucket_fill_line_color (guchar *buf,
|
|
|
|
guchar *mask,
|
|
|
|
guchar *col,
|
|
|
|
gboolean has_alpha,
|
|
|
|
gint bytes,
|
|
|
|
gint width)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
1999-08-23 14:19:26 +00:00
|
|
|
gint alpha, b;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
alpha = (has_alpha) ? bytes - 1 : bytes;
|
|
|
|
while (width--)
|
|
|
|
{
|
|
|
|
for (b = 0; b < alpha; b++)
|
|
|
|
buf[b] = col[b];
|
|
|
|
|
|
|
|
if (has_alpha)
|
|
|
|
{
|
|
|
|
if (mask)
|
|
|
|
buf[alpha] = *mask++;
|
|
|
|
else
|
1998-01-25 01:24:46 +00:00
|
|
|
buf[alpha] = OPAQUE_OPACITY;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buf += bytes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-23 14:19:26 +00:00
|
|
|
bucket_fill_line_pattern (guchar *buf,
|
|
|
|
guchar *mask,
|
|
|
|
TempBuf *pattern,
|
|
|
|
gboolean has_alpha,
|
|
|
|
gint bytes,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
1999-08-23 14:19:26 +00:00
|
|
|
guchar *pat, *p;
|
2000-12-31 04:07:42 +00:00
|
|
|
gint alpha, b;
|
|
|
|
gint i;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* Get a pointer to the appropriate scanline of the pattern buffer */
|
|
|
|
pat = temp_buf_data (pattern) +
|
|
|
|
(y % pattern->height) * pattern->width * pattern->bytes;
|
|
|
|
|
|
|
|
alpha = (has_alpha) ? bytes - 1 : bytes;
|
|
|
|
for (i = 0; i < width; i++)
|
|
|
|
{
|
|
|
|
p = pat + ((i + x) % pattern->width) * pattern->bytes;
|
|
|
|
|
|
|
|
for (b = 0; b < alpha; b++)
|
|
|
|
buf[b] = p[b];
|
|
|
|
|
|
|
|
if (has_alpha)
|
|
|
|
{
|
|
|
|
if (mask)
|
|
|
|
buf[alpha] = *mask++;
|
|
|
|
else
|
1998-01-25 01:24:46 +00:00
|
|
|
buf[alpha] = OPAQUE_OPACITY;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buf += bytes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-23 14:19:26 +00:00
|
|
|
void
|
1999-04-18 21:22:41 +00:00
|
|
|
bucket_fill_region (BucketFillMode fill_mode,
|
|
|
|
PixelRegion *bufPR,
|
|
|
|
PixelRegion *maskPR,
|
1999-08-23 14:19:26 +00:00
|
|
|
guchar *col,
|
1999-04-18 21:22:41 +00:00
|
|
|
TempBuf *pattern,
|
1999-08-23 14:19:26 +00:00
|
|
|
gint off_x,
|
|
|
|
gint off_y,
|
|
|
|
gboolean has_alpha)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
1999-08-23 14:19:26 +00:00
|
|
|
guchar *s, *m;
|
2000-12-31 04:07:42 +00:00
|
|
|
gint y;
|
|
|
|
void *pr;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-08-23 14:19:26 +00:00
|
|
|
for (pr = pixel_regions_register (2, bufPR, maskPR);
|
|
|
|
pr != NULL;
|
|
|
|
pr = pixel_regions_process (pr))
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
s = bufPR->data;
|
|
|
|
if (maskPR)
|
|
|
|
m = maskPR->data;
|
|
|
|
else
|
|
|
|
m = NULL;
|
|
|
|
|
|
|
|
for (y = 0; y < bufPR->h; y++)
|
|
|
|
{
|
|
|
|
switch (fill_mode)
|
|
|
|
{
|
1999-04-18 21:22:41 +00:00
|
|
|
case FG_BUCKET_FILL:
|
|
|
|
case BG_BUCKET_FILL:
|
1997-11-24 22:05:25 +00:00
|
|
|
bucket_fill_line_color (s, m, col, has_alpha, bufPR->bytes, bufPR->w);
|
|
|
|
break;
|
1999-04-18 21:22:41 +00:00
|
|
|
case PATTERN_BUCKET_FILL:
|
1997-11-24 22:05:25 +00:00
|
|
|
bucket_fill_line_pattern (s, m, pattern, has_alpha, bufPR->bytes,
|
|
|
|
off_x + bufPR->x, off_y + y + bufPR->y, bufPR->w);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
s += bufPR->rowstride;
|
|
|
|
|
|
|
|
if (maskPR)
|
|
|
|
m += maskPR->rowstride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|