Commit c6de9711 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

marked gimp_image_add_layer_mask() and gimp_image_remove_layer_mask() as

2003-12-08  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/image.pdb: marked gimp_image_add_layer_mask()
	and gimp_image_remove_layer_mask() as deprecated. Didnn't remove
	them from the PDB because the new functions' signature differs and
	they are used very often in scripts, but removed them from the
	libgimp C wrappers.

	* tools/pdbgen/pdb/layer.pdb: added gimp_layer_add_mask() and
	gimp_layer_remove_mask().

	* libgimp/gimpcompat.h: added compat cruft.

	* app/pdb/image_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/layer_cmds.c
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimplayer_pdb.[ch]: regenerated.

	* libgimp/gimpexport.c
	* plug-ins/common/curve_bend.c
	* plug-ins/common/psd.c
	* plug-ins/pygimp/pygimp-image.c
	* plug-ins/script-fu/scripts/3d-outline.scm
	* plug-ins/script-fu/scripts/alien-neon-logo.scm
	* plug-ins/script-fu/scripts/blended-logo.scm
	* plug-ins/script-fu/scripts/burn-in-anim.scm
	* plug-ins/script-fu/scripts/carve-it.scm
	* plug-ins/script-fu/scripts/carved-logo.scm
	* plug-ins/script-fu/scripts/chrome-it.scm
	* plug-ins/script-fu/scripts/chrome-logo.scm
	* plug-ins/script-fu/scripts/coolmetal-logo.scm
	* plug-ins/script-fu/scripts/crystal-logo.scm
	* plug-ins/script-fu/scripts/fade-outline.scm
	* plug-ins/script-fu/scripts/frosty-logo.scm
	* plug-ins/script-fu/scripts/image-structure.scm
	* plug-ins/script-fu/scripts/news-text.scm
	* plug-ins/script-fu/scripts/rendermap.scm
	* plug-ins/script-fu/scripts/slide.scm
	* plug-ins/script-fu/scripts/sota-chrome-logo.scm
	* plug-ins/script-fu/scripts/speed-text.scm
	* plug-ins/script-fu/scripts/starburst-logo.scm
	* plug-ins/script-fu/scripts/textured-logo.scm
	* plug-ins/script-fu/scripts/weave.scm
	* plug-ins/script-fu/scripts/xach-effect.scm
	* plug-ins/xjt/xjt.c: changed accordingly.

2003-12-08  Michael Natterer  <mitch@gimp.org>

	* libgimp/libgimp-sections.txt
	* libgimp/tmpl/gimpimage.sgml
	* libgimp/tmpl/gimplayer.sgml: follow layer mask API change.
parent ca493e0d
2003-12-08 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/image.pdb: marked gimp_image_add_layer_mask()
and gimp_image_remove_layer_mask() as deprecated. Didnn't remove
them from the PDB because the new functions' signature differs and
they are used very often in scripts, but removed them from the
libgimp C wrappers.
* tools/pdbgen/pdb/layer.pdb: added gimp_layer_add_mask() and
gimp_layer_remove_mask().
* libgimp/gimpcompat.h: added compat cruft.
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c
* app/pdb/layer_cmds.c
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimplayer_pdb.[ch]: regenerated.
* libgimp/gimpexport.c
* plug-ins/common/curve_bend.c
* plug-ins/common/psd.c
* plug-ins/pygimp/pygimp-image.c
* plug-ins/script-fu/scripts/3d-outline.scm
* plug-ins/script-fu/scripts/alien-neon-logo.scm
* plug-ins/script-fu/scripts/blended-logo.scm
* plug-ins/script-fu/scripts/burn-in-anim.scm
* plug-ins/script-fu/scripts/carve-it.scm
* plug-ins/script-fu/scripts/carved-logo.scm
* plug-ins/script-fu/scripts/chrome-it.scm
* plug-ins/script-fu/scripts/chrome-logo.scm
* plug-ins/script-fu/scripts/coolmetal-logo.scm
* plug-ins/script-fu/scripts/crystal-logo.scm
* plug-ins/script-fu/scripts/fade-outline.scm
* plug-ins/script-fu/scripts/frosty-logo.scm
* plug-ins/script-fu/scripts/image-structure.scm
* plug-ins/script-fu/scripts/news-text.scm
* plug-ins/script-fu/scripts/rendermap.scm
* plug-ins/script-fu/scripts/slide.scm
* plug-ins/script-fu/scripts/sota-chrome-logo.scm
* plug-ins/script-fu/scripts/speed-text.scm
* plug-ins/script-fu/scripts/starburst-logo.scm
* plug-ins/script-fu/scripts/textured-logo.scm
* plug-ins/script-fu/scripts/weave.scm
* plug-ins/script-fu/scripts/xach-effect.scm
* plug-ins/xjt/xjt.c: changed accordingly.
2003-12-08 Dave Neary <bolsh@gimp.org>
* app/core/core-enums.h:
......@@ -2208,11 +2208,11 @@ static ProcArg image_add_layer_mask_inargs[] =
static ProcRecord image_add_layer_mask_proc =
{
"gimp_image_add_layer_mask",
"Add a layer mask to the specified layer.",
"This procedure adds a layer mask to the specified layer. Layer masks serve as an additional alpha channel for a layer. This procedure will fail if a number of prerequisites aren't met. The layer cannot already have a layer mask. The specified mask must exist and have the same dimensions as the layer. Both the mask and the layer must have been created for use with the specified image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"This procedure is deprecated! Use the procedure returned as 'help' instead.",
"gimp_layer_add_mask",
"",
"",
"",
GIMP_INTERNAL,
3,
image_add_layer_mask_inargs,
......@@ -2270,11 +2270,11 @@ static ProcArg image_remove_layer_mask_inargs[] =
static ProcRecord image_remove_layer_mask_proc =
{
"gimp_image_remove_layer_mask",
"Remove the specified layer mask from the layer.",
"This procedure removes the specified layer mask from the layer. If the mask doesn't exist, an error is returned.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"This procedure is deprecated! Use the procedure returned as 'help' instead.",
"gimp_layer_remove_mask",
"",
"",
"",
GIMP_INTERNAL,
3,
image_remove_layer_mask_inargs,
......
......@@ -69,7 +69,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 344 procedures registered total */
/* 346 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -84,106 +84,106 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Brushes"), 0.009);
register_brushes_procs (gimp);
(* status_callback) (NULL, _("Channel"), 0.041);
(* status_callback) (NULL, _("Channel"), 0.04);
register_channel_procs (gimp);
(* status_callback) (NULL, _("Color"), 0.067);
(* status_callback) (NULL, _("Color"), 0.066);
register_color_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.105);
(* status_callback) (NULL, _("Convert"), 0.104);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.113);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.125);
(* status_callback) (NULL, _("Drawable procedures"), 0.124);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.218);
(* status_callback) (NULL, _("Edit procedures"), 0.217);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.235);
(* status_callback) (NULL, _("File Operations"), 0.234);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.259);
(* status_callback) (NULL, _("Floating selections"), 0.257);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.276);
(* status_callback) (NULL, _("Font UI"), 0.275);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.285);
(* status_callback) (NULL, _("Fonts"), 0.283);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.291);
(* status_callback) (NULL, _("Gimprc procedures"), 0.289);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.308);
(* status_callback) (NULL, _("Gradient UI"), 0.306);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.317);
(* status_callback) (NULL, _("Gradients"), 0.315);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.337);
(* status_callback) (NULL, _("Guide procedures"), 0.335);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.355);
(* status_callback) (NULL, _("Help procedures"), 0.353);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.358);
(* status_callback) (NULL, _("Image"), 0.355);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.529);
(* status_callback) (NULL, _("Layer"), 0.526);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.599);
(* status_callback) (NULL, _("Message procedures"), 0.601);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.608);
(* status_callback) (NULL, _("Miscellaneous"), 0.61);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Misc Tool procedures"), 0.613);
(* status_callback) (NULL, _("Misc Tool procedures"), 0.616);
register_misc_tools_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.622);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.624);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.666);
(* status_callback) (NULL, _("Palette"), 0.668);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.683);
(* status_callback) (NULL, _("Palette UI"), 0.685);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.692);
(* status_callback) (NULL, _("Palettes"), 0.694);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.706);
(* status_callback) (NULL, _("Parasite procedures"), 0.708);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.741);
(* status_callback) (NULL, _("Paths"), 0.743);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.785);
(* status_callback) (NULL, _("Pattern UI"), 0.786);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.794);
(* status_callback) (NULL, _("Patterns"), 0.795);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.808);
(* status_callback) (NULL, _("Plug-in"), 0.809);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.826);
(* status_callback) (NULL, _("Procedural database"), 0.827);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.849);
(* status_callback) (NULL, _("Image mask"), 0.85);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.901);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.902);
register_selection_tools_procs (gimp);
(* status_callback) (NULL, _("Text procedures"), 0.916);
register_text_tool_procs (gimp);
(* status_callback) (NULL, _("Transform Tool procedures"), 0.927);
(* status_callback) (NULL, _("Transform Tool procedures"), 0.928);
register_transform_tools_procs (gimp);
(* status_callback) (NULL, _("Undo"), 0.945);
......
......@@ -51,6 +51,8 @@ static ProcRecord layer_translate_proc;
static ProcRecord layer_set_offsets_proc;
static ProcRecord layer_create_mask_proc;
static ProcRecord layer_get_mask_proc;
static ProcRecord layer_add_mask_proc;
static ProcRecord layer_remove_mask_proc;
static ProcRecord layer_is_floating_sel_proc;
static ProcRecord layer_get_preserve_trans_proc;
static ProcRecord layer_set_preserve_trans_proc;
......@@ -79,6 +81,8 @@ register_layer_procs (Gimp *gimp)
procedural_db_register (gimp, &layer_set_offsets_proc);
procedural_db_register (gimp, &layer_create_mask_proc);
procedural_db_register (gimp, &layer_get_mask_proc);
procedural_db_register (gimp, &layer_add_mask_proc);
procedural_db_register (gimp, &layer_remove_mask_proc);
procedural_db_register (gimp, &layer_is_floating_sel_proc);
procedural_db_register (gimp, &layer_get_preserve_trans_proc);
procedural_db_register (gimp, &layer_set_preserve_trans_proc);
......@@ -952,6 +956,115 @@ static ProcRecord layer_get_mask_proc =
{ { layer_get_mask_invoker } }
};
static Argument *
layer_add_mask_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
GimpLayer *layer;
GimpLayerMask *mask;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_LAYER (layer))
success = FALSE;
mask = (GimpLayerMask *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! GIMP_IS_LAYER_MASK (mask))
success = FALSE;
if (success)
{
success = gimp_layer_add_mask (layer, mask, TRUE) != NULL;
if (success)
g_object_unref (mask);
}
return procedural_db_return_args (&layer_add_mask_proc, success);
}
static ProcArg layer_add_mask_inargs[] =
{
{
GIMP_PDB_LAYER,
"layer",
"The layer"
},
{
GIMP_PDB_CHANNEL,
"mask",
"The mask to add to the layer to receive the mask"
}
};
static ProcRecord layer_add_mask_proc =
{
"gimp_layer_add_mask",
"Add a layer mask to the specified layer.",
"This procedure adds a layer mask to the specified layer. Layer masks serve as an additional alpha channel for a layer. This procedure will fail if a number of prerequisites aren't met. The layer cannot already have a layer mask. The specified mask must exist and have the same dimensions as the layer. Both the mask and the layer must have been created for use with the specified image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_add_mask_inargs,
0,
NULL,
{ { layer_add_mask_invoker } }
};
static Argument *
layer_remove_mask_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
GimpLayer *layer;
gint32 mode;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_LAYER (layer))
success = FALSE;
mode = args[1].value.pdb_int;
if (mode < GIMP_MASK_APPLY || mode > GIMP_MASK_DISCARD)
success = FALSE;
if (success)
gimp_layer_apply_mask (layer, mode, TRUE);
return procedural_db_return_args (&layer_remove_mask_proc, success);
}
static ProcArg layer_remove_mask_inargs[] =
{
{
GIMP_PDB_LAYER,
"layer",
"The layer"
},
{
GIMP_PDB_INT32,
"mode",
"Removal mode: { GIMP_MASK_APPLY (0), GIMP_MASK_DISCARD (1) } from which to remove mask"
}
};
static ProcRecord layer_remove_mask_proc =
{
"gimp_layer_remove_mask",
"Remove the specified layer mask from the layer.",
"This procedure removes the specified layer mask from the layer. If the mask doesn't exist, an error is returned.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
2,
layer_remove_mask_inargs,
0,
NULL,
{ { layer_remove_mask_invoker } }
};
static Argument *
layer_is_floating_sel_invoker (Gimp *gimp,
Argument *args)
......
2003-12-08 Michael Natterer <mitch@gimp.org>
* libgimp/libgimp-sections.txt
* libgimp/tmpl/gimpimage.sgml
* libgimp/tmpl/gimplayer.sgml: follow layer mask API change.
2003-12-08 Michael Natterer <mitch@gimp.org>
* libgimp/libgimp-sections.txt
......
......@@ -339,8 +339,6 @@ gimp_image_lower_channel
gimp_image_flatten
gimp_image_merge_visible_layers
gimp_image_merge_down
gimp_image_add_layer_mask
gimp_image_remove_layer_mask
gimp_image_clean_all
gimp_image_is_dirty
gimp_image_get_active_layer
......@@ -377,14 +375,16 @@ gimp_image_attach_new_parasite
<FILE>gimplayer</FILE>
gimp_layer_new
gimp_layer_copy
gimp_layer_create_mask
gimp_layer_scale
gimp_layer_resize
gimp_layer_resize_to_image_size
gimp_layer_translate
gimp_layer_add_alpha
gimp_layer_set_offsets
gimp_layer_create_mask
gimp_layer_get_mask
gimp_layer_add_mask
gimp_layer_remove_mask
gimp_layer_new_from_drawable
gimp_layer_get_preserve_trans
gimp_layer_set_preserve_trans
......
......@@ -336,28 +336,6 @@ and operations involving multiple layers.
@Returns:
<!-- ##### FUNCTION gimp_image_add_layer_mask ##### -->
<para>
</para>
@image_ID:
@layer_ID:
@mask_ID:
@Returns:
<!-- ##### FUNCTION gimp_image_remove_layer_mask ##### -->
<para>
</para>
@image_ID:
@layer_ID:
@mode:
@Returns:
<!-- ##### FUNCTION gimp_image_clean_all ##### -->
<para>
......
......@@ -39,16 +39,6 @@ Operations on single layers.
@Returns:
<!-- ##### FUNCTION gimp_layer_create_mask ##### -->
<para>
</para>
@layer_ID:
@mask_type:
@Returns:
<!-- ##### FUNCTION gimp_layer_scale ##### -->
<para>
......@@ -114,6 +104,16 @@ Operations on single layers.
@Returns:
<!-- ##### FUNCTION gimp_layer_create_mask ##### -->
<para>
</para>
@layer_ID:
@mask_type:
@Returns:
<!-- ##### FUNCTION gimp_layer_get_mask ##### -->
<para>
......@@ -123,6 +123,26 @@ Operations on single layers.
@Returns:
<!-- ##### FUNCTION gimp_layer_add_mask ##### -->
<para>
</para>
@layer_ID:
@mask_ID:
@Returns:
<!-- ##### FUNCTION gimp_layer_remove_mask ##### -->
<para>
</para>
@layer_ID:
@mode:
@Returns:
<!-- ##### FUNCTION gimp_layer_new_from_drawable ##### -->
<para>
......
......@@ -79,6 +79,8 @@ G_BEGIN_DECLS
#define gimp_image_active_drawable gimp_image_get_active_drawable
#define gimp_image_floating_selection gimp_image_get_floating_sel
#define gimp_image_add_layer_mask(i,l,m) gimp_layer_add_mask(l,m)
#define gimp_image_remove_layer_mask(i,l,m) gimp_layer_remove_mask(l,m)
#define gimp_gradients_get_active gimp_gradients_get_gradient
#define gimp_gradients_set_active gimp_gradients_set_gradient
......
......@@ -141,7 +141,7 @@ export_apply_masks (gint32 image_ID,
for (i = 0; i < n_layers; i++)
{
if (gimp_layer_get_mask (layers[i]) != -1)
gimp_image_remove_layer_mask (image_ID, layers[i], GIMP_MASK_APPLY);
gimp_layer_remove_mask (layers[i], GIMP_MASK_APPLY);
}
g_free (layers);
......
......@@ -1176,82 +1176,6 @@ gimp_image_merge_down (gint32 image_ID,
return layer_ID;
}
/**
* gimp_image_add_layer_mask:
* @image_ID: The image.
* @layer_ID: The layer to receive the mask.
* @mask_ID: The mask to add to the layer.
*
* Add a layer mask to the specified layer.
*
* This procedure adds a layer mask to the specified layer. Layer masks
* serve as an additional alpha channel for a layer. This procedure
* will fail if a number of prerequisites aren't met. The layer cannot
* already have a layer mask. The specified mask must exist and have
* the same dimensions as the layer. Both the mask and the layer must
* have been created for use with the specified image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_add_layer_mask (gint32 image_ID,
gint32 layer_ID,
gint32 mask_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_image_add_layer_mask",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_CHANNEL, mask_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_remove_layer_mask:
* @image_ID: The image.
* @layer_ID: The layer from which to remove mask.
* @mode: Removal mode.
*
* Remove the specified layer mask from the layer.
*
* This procedure removes the specified layer mask from the layer. If
* the mask doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_remove_layer_mask (gint32 image_ID,
gint32 layer_ID,
GimpMaskApplyMode mode)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_image_remove_layer_mask",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_INT32, mode,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* _gimp_image_get_cmap:
* @image_ID: The image.
......
......@@ -93,12 +93,6 @@ gint32 gimp_image_merge_visible_layers (gint32 ima
gint32 gimp_image_merge_down (gint32 image_ID,
gint32 merge_layer_ID,
GimpMergeType merge_type);
gboolean gimp_image_add_layer_mask (gint32 image_ID,
gint32 layer_ID,
gint32 mask_ID);
gboolean gimp_image_remove_layer_mask (gint32 image_ID,
gint32 layer_ID,
GimpMaskApplyMode mode);
guint8* _gimp_image_get_cmap (gint32 image_ID,
gint *num_bytes);
gboolean _gimp_image_set_cmap (gint32 image_ID,
......
......@@ -453,6 +453,76 @@ gimp_layer_get_mask (gint32 layer_ID)
return mask_ID;
}
/**
* gimp_layer_add_mask:
* @layer_ID: The layer.
* @mask_ID: The mask to add to the layer to receive the mask.
*
* Add a layer mask to the specified layer.
*
* This procedure adds a layer mask to the specified layer. Layer masks
* serve as an additional alpha channel for a layer. This procedure
* will fail if a number of prerequisites aren't met. The layer cannot
* already have a layer mask. The specified mask must exist and have
* the same dimensions as the layer. Both the mask and the layer must
* have been created for use with the specified image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_add_mask (gint32 layer_ID,
gint32 mask_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_layer_add_mask",
&nreturn_vals,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_CHANNEL, mask_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_layer_remove_mask:
* @layer_ID: The layer.
* @mode: Removal mode: from which to remove mask.
*
* Remove the specified layer mask from the layer.
*
* This procedure removes the specified layer mask from the layer. If
* the mask doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_layer_remove_mask (gint32 layer_ID,
GimpMaskApplyMode mode)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_layer_remove_mask",
&nreturn_vals,
GIMP_PDB_LAYER, layer_ID,
GIMP_PDB_INT32, mode,
GIMP_PDB_END);