1997-11-24 22:05:25 +00:00
/* The GIMP -- an image manipulation program
2003-07-03 00:47:26 +00:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1997-11-24 22:05:25 +00:00
*
* 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
*/
1999-03-28 06:55:29 +00:00
/* NOTE: This file is autogenerated by pdbgen.pl. */
2000-12-29 15:22:01 +00:00
# include "config.h"
2001-08-17 14:27:31 +00:00
# include <glib-object.h>
1999-03-28 06:55:29 +00:00
2001-05-21 13:58:46 +00:00
# include "libgimpbase/gimpbasetypes.h"
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
2000-12-29 15:22:01 +00:00
# include "procedural_db.h"
2003-09-15 17:26:28 +00:00
# include "core/gimp-edit.h"
2001-07-04 19:31:35 +00:00
# include "core/gimp.h"
2004-01-05 14:35:19 +00:00
# include "core/gimpchannel.h"
2003-09-01 17:56:44 +00:00
# include "core/gimpcontext.h"
2004-01-05 14:35:19 +00:00
# include "core/gimpdrawable-blend.h"
# include "core/gimpdrawable-bucket-fill.h"
2001-07-07 22:49:01 +00:00
# include "core/gimpdrawable.h"
2001-08-14 14:53:55 +00:00
# include "core/gimpimage.h"
2001-05-09 02:32:03 +00:00
# include "core/gimplayer.h"
2003-09-01 17:56:44 +00:00
# include "core/gimptoolinfo.h"
1997-11-24 22:05:25 +00:00
1999-03-28 06:55:29 +00:00
static ProcRecord edit_cut_proc ;
static ProcRecord edit_copy_proc ;
static ProcRecord edit_paste_proc ;
static ProcRecord edit_clear_proc ;
static ProcRecord edit_fill_proc ;
2004-01-05 14:35:19 +00:00
static ProcRecord edit_bucket_fill_proc ;
static ProcRecord edit_blend_proc ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_stroke_proc ;
1997-11-24 22:05:25 +00:00
1999-03-28 06:55:29 +00:00
void
2001-07-04 19:31:35 +00:00
register_edit_procs ( Gimp * gimp )
1999-03-28 06:55:29 +00:00
{
2001-07-04 19:31:35 +00:00
procedural_db_register ( gimp , & edit_cut_proc ) ;
procedural_db_register ( gimp , & edit_copy_proc ) ;
procedural_db_register ( gimp , & edit_paste_proc ) ;
procedural_db_register ( gimp , & edit_clear_proc ) ;
procedural_db_register ( gimp , & edit_fill_proc ) ;
2004-01-05 14:35:19 +00:00
procedural_db_register ( gimp , & edit_bucket_fill_proc ) ;
procedural_db_register ( gimp , & edit_blend_proc ) ;
2001-07-04 19:31:35 +00:00
procedural_db_register ( gimp , & edit_stroke_proc ) ;
1999-03-28 06:55:29 +00:00
}
1997-11-24 22:05:25 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
edit_cut_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
1999-03-28 06:55:29 +00:00
GimpImage * gimage ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2002-02-25 17:58:50 +00:00
gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2001-06-29 19:25:03 +00:00
success = gimp_edit_cut ( gimage , drawable ) ! = NULL ;
1997-11-24 22:05:25 +00:00
}
return procedural_db_return_args ( & edit_cut_proc , success ) ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_cut_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1999-03-28 06:55:29 +00:00
" The drawable to cut from "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_cut_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_cut " ,
1999-03-28 06:55:29 +00:00
" Cut from the specified drawable. " ,
" If there is a selection in the image, then the area specified by the selection is cut from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable will be removed and its contents stored in the internal GIMP edit buffer. The drawable MUST belong to the specified image, or an error is returned. " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-13 20:40:00 +00:00
1 ,
1999-03-28 06:55:29 +00:00
edit_cut_inargs ,
1997-11-24 22:05:25 +00:00
0 ,
NULL ,
1999-03-28 06:55:29 +00:00
{ { edit_cut_invoker } }
1997-11-24 22:05:25 +00:00
} ;
static Argument *
2001-07-04 19:31:35 +00:00
edit_copy_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
1999-03-28 06:55:29 +00:00
GimpImage * gimage ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2002-02-25 17:58:50 +00:00
gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2001-06-29 19:25:03 +00:00
success = gimp_edit_copy ( gimage , drawable ) ! = NULL ;
1997-11-24 22:05:25 +00:00
}
return procedural_db_return_args ( & edit_copy_proc , success ) ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_copy_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1999-03-28 06:55:29 +00:00
" The drawable to copy from "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_copy_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_copy " ,
1999-03-28 06:55:29 +00:00
" Copy from the specified drawable. " ,
" If there is a selection in the image, then the area specified by the selection is copied from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable's contents will be stored in the internal GIMP edit buffer. The drawable MUST belong to the specified image, or an error is returned. " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-13 20:40:00 +00:00
1 ,
1999-03-28 06:55:29 +00:00
edit_copy_inargs ,
1997-11-24 22:05:25 +00:00
0 ,
NULL ,
1999-03-28 06:55:29 +00:00
{ { edit_copy_invoker } }
1997-11-24 22:05:25 +00:00
} ;
static Argument *
2001-07-04 19:31:35 +00:00
edit_paste_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
Argument * return_args ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
1999-03-28 06:55:29 +00:00
gboolean paste_into ;
GimpLayer * layer = NULL ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
1999-03-28 06:55:29 +00:00
paste_into = args [ 1 ] . value . pdb_int ? TRUE : FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2004-01-26 16:18:16 +00:00
success = gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) ;
2004-01-26 15:34:47 +00:00
if ( success )
{
2004-01-26 16:18:16 +00:00
layer = gimp_edit_paste ( gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ,
drawable , gimp - > global_buffer ,
2004-01-26 15:34:47 +00:00
paste_into , - 1 , - 1 , - 1 , - 1 ) ;
if ( ! layer )
success = FALSE ;
}
1997-11-24 22:05:25 +00:00
}
1999-03-28 06:55:29 +00:00
return_args = procedural_db_return_args ( & edit_paste_proc , success ) ;
1997-11-24 22:05:25 +00:00
1999-03-28 06:55:29 +00:00
if ( success )
2002-02-25 17:58:50 +00:00
return_args [ 1 ] . value . pdb_int = gimp_item_get_ID ( GIMP_ITEM ( layer ) ) ;
1997-11-24 22:05:25 +00:00
return return_args ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_paste_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1999-03-28 06:55:29 +00:00
" The drawable to paste to "
1997-11-24 22:05:25 +00:00
} ,
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
1997-11-24 22:05:25 +00:00
" paste_into " ,
1999-03-28 06:55:29 +00:00
" Clear selection, or paste behind it? "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcArg edit_paste_outargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_LAYER ,
1997-11-24 22:05:25 +00:00
" floating_sel " ,
1999-03-28 06:55:29 +00:00
" The new floating selection "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_paste_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_paste " ,
1999-03-28 06:55:29 +00:00
" Paste buffer to the specified drawable. " ,
" This procedure pastes a copy of the internal GIMP edit buffer to the specified drawable. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. The \" paste_into \" option specifies whether to clear the current image selection, or to paste the buffer \" behind \" the selection. This allows the selection to act as a mask for the pasted buffer. Anywhere that the selection mask is non-zero, the pasted buffer will show through. The pasted buffer will be a new layer in the image which is designated as the image floating selection. If the image has a floating selection at the time of pasting, the old floating selection will be anchored to it's drawable before the new floating selection is added. This procedure returns the new floating layer. The resulting floating selection will already be attached to the specified drawable, and a subsequent call to floating_sel_attach is not needed. " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-13 20:40:00 +00:00
2 ,
1999-03-28 06:55:29 +00:00
edit_paste_inargs ,
1997-11-24 22:05:25 +00:00
1 ,
1999-03-28 06:55:29 +00:00
edit_paste_outargs ,
{ { edit_paste_invoker } }
1997-11-24 22:05:25 +00:00
} ;
static Argument *
2001-07-04 19:31:35 +00:00
edit_clear_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
1999-03-28 06:55:29 +00:00
GimpImage * gimage ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2002-02-25 17:58:50 +00:00
gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2001-06-29 19:25:03 +00:00
success = gimp_edit_clear ( gimage , drawable ) ;
1997-11-24 22:05:25 +00:00
}
return procedural_db_return_args ( & edit_clear_proc , success ) ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_clear_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1998-12-25 18:22:01 +00:00
" The drawable to clear from "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_clear_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_clear " ,
1999-03-28 06:55:29 +00:00
" Clear selected area of drawable. " ,
" This procedure clears the specified drawable. If the drawable has an alpha channel, the cleared pixels will become transparent. If the drawable does not have an alpha channel, cleared pixels will be set to the background color. This procedure only affects regions within a selection if there is a selection active. " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-13 20:40:00 +00:00
1 ,
1999-03-28 06:55:29 +00:00
edit_clear_inargs ,
1997-11-24 22:05:25 +00:00
0 ,
NULL ,
1999-03-28 06:55:29 +00:00
{ { edit_clear_invoker } }
1997-11-24 22:05:25 +00:00
} ;
static Argument *
2001-07-04 19:31:35 +00:00
edit_fill_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
2000-03-24 14:54:59 +00:00
gint32 fill_type ;
1999-03-28 06:55:29 +00:00
GimpImage * gimage ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
2000-03-24 14:54:59 +00:00
fill_type = args [ 1 ] . value . pdb_int ;
2004-01-06 14:02:08 +00:00
if ( fill_type < GIMP_FOREGROUND_FILL | | fill_type > GIMP_PATTERN_FILL )
2000-03-24 14:54:59 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2002-02-25 17:58:50 +00:00
gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2001-06-29 19:25:03 +00:00
success = gimp_edit_fill ( gimage , drawable , ( GimpFillType ) fill_type ) ;
1997-11-24 22:05:25 +00:00
}
return procedural_db_return_args ( & edit_fill_proc , success ) ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_fill_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1999-03-28 06:55:29 +00:00
" The drawable to fill to "
2000-03-24 14:54:59 +00:00
} ,
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_INT32 ,
2000-03-24 14:54:59 +00:00
" fill_type " ,
2004-01-06 14:02:08 +00:00
" The type of fill: GIMP_FOREGROUND_FILL (0), GIMP_BACKGROUND_FILL (1), GIMP_WHITE_FILL (2), GIMP_TRANSPARENT_FILL (3), GIMP_PATTERN_FILL (4) "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_fill_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_fill " ,
1999-03-28 06:55:29 +00:00
" Fill selected area of drawable. " ,
2000-03-24 14:54:59 +00:00
" This procedure fills the specified drawable with the fill mode. If the fill mode is foreground, the current foreground color is used. If the fill mode is background, the current background color is used. Other fill modes should not be used. This procedure only affects regions within a selection if there is a selection active. " ,
" Spencer Kimball & Peter Mattis & Raphael Quinet " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
2000-03-24 14:54:59 +00:00
" 1995-2000 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2000-03-24 14:54:59 +00:00
2 ,
1999-03-28 06:55:29 +00:00
edit_fill_inargs ,
1997-11-24 22:05:25 +00:00
0 ,
NULL ,
1999-03-28 06:55:29 +00:00
{ { edit_fill_invoker } }
1997-11-24 22:05:25 +00:00
} ;
2004-01-05 14:35:19 +00:00
static Argument *
edit_bucket_fill_invoker ( Gimp * gimp ,
Argument * args )
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 fill_mode ;
gint32 paint_mode ;
gdouble opacity ;
gdouble threshold ;
gboolean sample_merged ;
gdouble x ;
gdouble y ;
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
success = FALSE ;
fill_mode = args [ 1 ] . value . pdb_int ;
if ( fill_mode < GIMP_FG_BUCKET_FILL | | fill_mode > GIMP_PATTERN_BUCKET_FILL )
success = FALSE ;
paint_mode = args [ 2 ] . value . pdb_int ;
if ( paint_mode < GIMP_NORMAL_MODE | | paint_mode > GIMP_COLOR_ERASE_MODE )
success = FALSE ;
opacity = args [ 3 ] . value . pdb_float ;
if ( opacity < 0.0 | | opacity > 100.0 )
success = FALSE ;
threshold = args [ 4 ] . value . pdb_float ;
if ( threshold < 0.0 | | threshold > 255.0 )
success = FALSE ;
sample_merged = args [ 5 ] . value . pdb_int ? TRUE : FALSE ;
x = args [ 6 ] . value . pdb_float ;
y = args [ 7 ] . value . pdb_float ;
if ( success )
{
GimpImage * gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
if ( ! gimage )
{
success = FALSE ;
}
else
{
gboolean do_seed_fill ;
do_seed_fill = gimp_channel_is_empty ( gimp_image_get_mask ( gimage ) ) ;
gimp_drawable_bucket_fill ( drawable , fill_mode ,
paint_mode , opacity / 100.0 ,
do_seed_fill ,
FALSE /* don't fill transparent */ ,
threshold , sample_merged , x , y ) ;
}
}
return procedural_db_return_args ( & edit_bucket_fill_proc , success ) ;
}
static ProcArg edit_bucket_fill_inargs [ ] =
{
{
GIMP_PDB_DRAWABLE ,
" drawable " ,
" The affected drawable "
} ,
{
GIMP_PDB_INT32 ,
" fill_mode " ,
" The type of fill: { GIMP_FG_BUCKET_FILL (0), GIMP_BG_BUCKET_FILL (1), GIMP_PATTERN_BUCKET_FILL (2) } "
} ,
{
GIMP_PDB_INT32 ,
" paint_mode " ,
" The paint application mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) } "
} ,
{
GIMP_PDB_FLOAT ,
" opacity " ,
" The opacity of the final bucket fill (0 <= opacity <= 100) "
} ,
{
GIMP_PDB_FLOAT ,
" threshold " ,
" The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels (0 <= threshold <= 255). This parameter is only valid when there is no selection in the specified image. "
} ,
{
GIMP_PDB_INT32 ,
" sample_merged " ,
" Use the composite image, not the drawable "
} ,
{
GIMP_PDB_FLOAT ,
" x " ,
" The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image. "
} ,
{
GIMP_PDB_FLOAT ,
" y " ,
" The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image. "
}
} ;
static ProcRecord edit_bucket_fill_proc =
{
" gimp_edit_bucket_fill " ,
" Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates. " ,
" This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is non-zero, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
GIMP_INTERNAL ,
8 ,
edit_bucket_fill_inargs ,
0 ,
NULL ,
{ { edit_bucket_fill_invoker } }
} ;
static Argument *
edit_blend_invoker ( Gimp * gimp ,
Argument * args )
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 blend_mode ;
gint32 paint_mode ;
gint32 gradient_type ;
gdouble opacity ;
gdouble offset ;
gint32 repeat ;
gboolean reverse ;
gboolean supersample ;
gint32 max_depth ;
gdouble threshold ;
gboolean dither ;
gdouble x1 ;
gdouble y1 ;
gdouble x2 ;
gdouble y2 ;
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
success = FALSE ;
blend_mode = args [ 1 ] . value . pdb_int ;
if ( blend_mode < GIMP_FG_BG_RGB_MODE | | blend_mode > GIMP_CUSTOM_MODE )
success = FALSE ;
paint_mode = args [ 2 ] . value . pdb_int ;
if ( paint_mode < GIMP_NORMAL_MODE | | paint_mode > GIMP_COLOR_ERASE_MODE )
success = FALSE ;
gradient_type = args [ 3 ] . value . pdb_int ;
if ( gradient_type < GIMP_GRADIENT_LINEAR | | gradient_type > GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE )
success = FALSE ;
opacity = args [ 4 ] . value . pdb_float ;
if ( opacity < 0.0 | | opacity > 100.0 )
success = FALSE ;
offset = args [ 5 ] . value . pdb_float ;
if ( offset < 0.0 )
success = FALSE ;
repeat = args [ 6 ] . value . pdb_int ;
if ( repeat < GIMP_REPEAT_NONE | | repeat > GIMP_REPEAT_TRIANGULAR )
success = FALSE ;
reverse = args [ 7 ] . value . pdb_int ? TRUE : FALSE ;
supersample = args [ 8 ] . value . pdb_int ? TRUE : FALSE ;
max_depth = args [ 9 ] . value . pdb_int ;
if ( supersample & & ( max_depth < 1 | | max_depth > 9 ) )
success = FALSE ;
threshold = args [ 10 ] . value . pdb_float ;
if ( supersample & & ( threshold < 0.0 | | threshold > 4.0 ) )
success = FALSE ;
dither = args [ 11 ] . value . pdb_int ? TRUE : FALSE ;
x1 = args [ 12 ] . value . pdb_float ;
y1 = args [ 13 ] . value . pdb_float ;
x2 = args [ 14 ] . value . pdb_float ;
y2 = args [ 15 ] . value . pdb_float ;
if ( success )
{
if ( ! gimp_item_get_image ( GIMP_ITEM ( drawable ) ) )
{
success = FALSE ;
}
else
{
gimp_drawable_blend ( drawable ,
blend_mode ,
paint_mode ,
gradient_type ,
opacity / 100.0 ,
offset , repeat , reverse ,
supersample , max_depth ,
threshold , dither ,
x1 , y1 , x2 , y2 ,
NULL , NULL ) ;
}
}
return procedural_db_return_args ( & edit_blend_proc , success ) ;
}
static ProcArg edit_blend_inargs [ ] =
{
{
GIMP_PDB_DRAWABLE ,
" drawable " ,
" The affected drawable "
} ,
{
GIMP_PDB_INT32 ,
" blend_mode " ,
" The type of blend: { GIMP_FG_BG_RGB_MODE (0), GIMP_FG_BG_HSV_MODE (1), GIMP_FG_TRANSPARENT_MODE (2), GIMP_CUSTOM_MODE (3) } "
} ,
{
GIMP_PDB_INT32 ,
" paint_mode " ,
" The paint application mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) } "
} ,
{
GIMP_PDB_INT32 ,
" gradient_type " ,
" The type of gradient: { GIMP_GRADIENT_LINEAR (0), GIMP_GRADIENT_BILINEAR (1), GIMP_GRADIENT_RADIAL (2), GIMP_GRADIENT_SQUARE (3), GIMP_GRADIENT_CONICAL_SYMMETRIC (4), GIMP_GRADIENT_CONICAL_ASYMMETRIC (5), GIMP_GRADIENT_SHAPEBURST_ANGULAR (6), GIMP_GRADIENT_SHAPEBURST_SPHERICAL (7), GIMP_GRADIENT_SHAPEBURST_DIMPLED (8), GIMP_GRADIENT_SPIRAL_CLOCKWISE (9), GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE (10) } "
} ,
{
GIMP_PDB_FLOAT ,
" opacity " ,
" The opacity of the final blend (0 <= opacity <= 100) "
} ,
{
GIMP_PDB_FLOAT ,
" offset " ,
" Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent (0 <= offset) "
} ,
{
GIMP_PDB_INT32 ,
" repeat " ,
" Repeat mode: { GIMP_REPEAT_NONE (0), GIMP_REPEAT_SAWTOOTH (1), GIMP_REPEAT_TRIANGULAR (2) } "
} ,
{
GIMP_PDB_INT32 ,
" reverse " ,
" Use the reverse gradient (TRUE or FALSE) "
} ,
{
GIMP_PDB_INT32 ,
" supersample " ,
" Do adaptive supersampling (TRUE or FALSE) "
} ,
{
GIMP_PDB_INT32 ,
" max_depth " ,
" Maximum recursion levels for supersampling "
} ,
{
GIMP_PDB_FLOAT ,
" threshold " ,
" Supersampling threshold "
} ,
{
GIMP_PDB_INT32 ,
" dither " ,
" Use dithering to reduce banding (TRUE or FALSE) "
} ,
{
GIMP_PDB_FLOAT ,
" x1 " ,
" The x coordinate of this blend's starting point "
} ,
{
GIMP_PDB_FLOAT ,
" y1 " ,
" The y coordinate of this blend's starting point "
} ,
{
GIMP_PDB_FLOAT ,
" x2 " ,
" The x coordinate of this blend's ending point "
} ,
{
GIMP_PDB_FLOAT ,
" y2 " ,
" The y coordinate of this blend's ending point "
}
} ;
static ProcRecord edit_blend_proc =
{
" gimp_edit_blend " ,
" Blend between the starting and ending coordinates with the specified blend mode and gradient type. " ,
" This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
GIMP_INTERNAL ,
16 ,
edit_blend_inargs ,
0 ,
NULL ,
{ { edit_blend_invoker } }
} ;
1997-11-24 22:05:25 +00:00
static Argument *
2001-07-04 19:31:35 +00:00
edit_stroke_invoker ( Gimp * gimp ,
Argument * args )
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
gboolean success = TRUE ;
1998-01-22 07:02:57 +00:00
GimpDrawable * drawable ;
1997-11-24 22:05:25 +00:00
2002-02-25 17:58:50 +00:00
drawable = ( GimpDrawable * ) gimp_item_get_by_ID ( gimp , args [ 0 ] . value . pdb_int ) ;
2002-08-29 17:21:21 +00:00
if ( ! GIMP_IS_DRAWABLE ( drawable ) )
1999-03-28 06:55:29 +00:00
success = FALSE ;
1997-11-24 22:05:25 +00:00
if ( success )
{
2003-09-01 17:56:44 +00:00
GimpImage * gimage ;
GimpToolInfo * tool_info ;
2002-02-25 17:58:50 +00:00
gimage = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ;
2003-09-01 17:56:44 +00:00
tool_info = gimp_context_get_tool ( gimp_get_current_context ( gimp ) ) ;
2003-09-03 10:19:47 +00:00
success = gimp_item_stroke ( GIMP_ITEM ( gimp_image_get_mask ( gimage ) ) ,
2003-09-26 15:37:53 +00:00
drawable ,
2004-01-22 00:16:49 +00:00
GIMP_OBJECT ( tool_info - > paint_info ) ,
TRUE /* use defaults, not tool option values */ ) ;
1997-11-24 22:05:25 +00:00
}
return procedural_db_return_args ( & edit_stroke_proc , success ) ;
}
1999-03-28 06:55:29 +00:00
static ProcArg edit_stroke_inargs [ ] =
1997-11-24 22:05:25 +00:00
{
1999-03-28 06:55:29 +00:00
{
2001-05-21 13:58:46 +00:00
GIMP_PDB_DRAWABLE ,
1997-11-24 22:05:25 +00:00
" drawable " ,
1999-03-28 06:55:29 +00:00
" The drawable to stroke to "
1997-11-24 22:05:25 +00:00
}
} ;
1999-03-28 06:55:29 +00:00
static ProcRecord edit_stroke_proc =
1997-11-24 22:05:25 +00:00
{
" gimp_edit_stroke " ,
1998-12-25 18:22:01 +00:00
" Stroke the current selection " ,
1999-03-28 06:55:29 +00:00
" This procedure strokes the current selection, painting along the selection boundary with the active brush and foreground color. The paint is applied to the specified drawable regardless of the active selection. " ,
1997-11-24 22:05:25 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE
* airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c
by_color_select.c, channel_ops.c, clone.c, color_balance.c
color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c
equalize.c, eraser.c, flip_tool.c, fuzzy_select.c,
gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c,
levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c,
rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c:
API-mega-break-it-all patch part one: removed the unnecessary
PDB_IMAGE argument from many functions.
Affected functions:
gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill
gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance
gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline
gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill
gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser
gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram
gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush
gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize
gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha
gimp_selection_load gimp_shear gimp_threshold
1998-11-13 20:40:00 +00:00
1 ,
1999-03-28 06:55:29 +00:00
edit_stroke_inargs ,
1997-11-24 22:05:25 +00:00
0 ,
NULL ,
1999-03-28 06:55:29 +00:00
{ { edit_stroke_invoker } }
1997-11-24 22:05:25 +00:00
} ;