gimp/libgimp/gimplayer_pdb.c

3138 lines
100 KiB
C
Raw Normal View History

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
2000-05-31 14:15:06 +08:00
*
* gimplayer_pdb.c
1998-01-25 18:26:47 +08:00
*
* This library is free software: you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
1998-01-25 18:26:47 +08:00
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
1998-01-25 18:26:47 +08:00
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
*/
/* NOTE: This file is auto-generated by pdbgen.pl */
1997-11-25 06:05:25 +08:00
#include "config.h"
#include "gimp.h"
1997-11-25 06:05:25 +08:00
/**
* SECTION: gimplayer
* @title: gimplayer
* @short_description: Operations on a single layer.
*
* Operations on a single layer.
**/
/**
* _gimp_layer_new:
* @image: The image to which to add the layer.
* @width: The layer width.
* @height: The layer height.
* @type: The layer type.
* @name: The layer name.
* @opacity: The layer opacity.
* @mode: The layer combination mode.
*
* Create a new layer.
*
* This procedure creates a new layer with the specified width, height,
* and type. Name, opacity, and mode are also supplied parameters. The
* new layer still needs to be added to the image, as this is not
* automatic. Add the new layer with the gimp_image_insert_layer()
* command. Other attributes such as layer mask modes, and offsets
* should be set with explicit procedure calls.
*
* Returns: (transfer full): The newly created layer.
**/
GimpLayer *
_gimp_layer_new (GimpImage *image,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer = NULL;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_INT, width,
G_TYPE_INT, height,
GIMP_TYPE_IMAGE_TYPE, type,
G_TYPE_STRING, name,
G_TYPE_DOUBLE, opacity,
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return layer;
1997-11-25 06:05:25 +08:00
}
/**
* __gimp_layer_new: (skip)
* @image_ID: The image to which to add the layer.
* @width: The layer width.
* @height: The layer height.
* @type: The layer type.
* @name: The layer name.
* @opacity: The layer opacity.
* @mode: The layer combination mode.
*
* Create a new layer.
*
* This procedure creates a new layer with the specified width, height,
* and type. Name, opacity, and mode are also supplied parameters. The
* new layer still needs to be added to the image, as this is not
* automatic. Add the new layer with the gimp_image_insert_layer()
* command. Other attributes such as layer mask modes, and offsets
* should be set with explicit procedure calls.
*
* Returns: The newly created layer.
**/
gint32
__gimp_layer_new (gint32 image_ID,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gdouble opacity,
GimpLayerMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_INT, width,
G_TYPE_INT, height,
GIMP_TYPE_IMAGE_TYPE, type,
G_TYPE_STRING, name,
G_TYPE_DOUBLE, opacity,
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_layer_new_from_visible:
* @image: The source image from where the content is copied.
* @dest_image: The destination image to which to add the layer.
* @name: The layer name.
*
* Create a new layer from what is visible in an image.
*
* This procedure creates a new layer from what is visible in the given
* image. The new layer still needs to be added to the destination
* image, as this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: (transfer full): The newly created layer.
*
* Since: 2.6
**/
GimpLayer *
gimp_layer_new_from_visible (GimpImage *image,
GimpImage *dest_image,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (dest_image),
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-visible",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
return layer;
}
/**
* _gimp_layer_new_from_visible: (skip)
* @image_ID: The source image from where the content is copied.
* @dest_image_ID: The destination image to which to add the layer.
* @name: The layer name.
*
* Create a new layer from what is visible in an image.
*
* This procedure creates a new layer from what is visible in the given
* image. The new layer still needs to be added to the destination
* image, as this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly created layer.
*
* Since: 2.6
**/
gint32
_gimp_layer_new_from_visible (gint32 image_ID,
gint32 dest_image_ID,
const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, dest_image_ID,
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-visible",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_layer_new_from_drawable:
* @drawable: The source drawable from where the new layer is copied.
* @dest_image: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: (transfer full): The newly copied layer.
**/
GimpLayer *
gimp_layer_new_from_drawable (GimpDrawable *drawable,
GimpImage *dest_image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer_copy = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, gimp_item_get_id (GIMP_ITEM (drawable)),
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (dest_image),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-drawable",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-drawable",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_copy = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
return layer_copy;
}
/**
* _gimp_layer_new_from_drawable: (skip)
* @drawable_ID: The source drawable from where the new layer is copied.
* @dest_image_ID: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* gimp_image_insert_layer() command. Other attributes such as layer
* mask modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly copied layer.
**/
gint32
_gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_copy_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
GIMP_TYPE_IMAGE_ID, dest_image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-new-from-drawable",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-new-from-drawable",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_copy_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_copy_ID;
}
/**
* gimp_layer_group_new:
* @image: The image to which to add the layer group.
*
* Create a new layer group.
*
* This procedure creates a new layer group. Attributes such as layer
* mode and opacity should be set with explicit procedure calls. Add
* the new layer group (which is a kind of layer) with the
* gimp_image_insert_layer() command.
* Other procedures useful with layer groups:
* gimp_image_reorder_item(), gimp_item_get_parent(),
* gimp_item_get_children(), gimp_item_is_group().
*
* Returns: (transfer full): The newly created layer group.
*
* Since: 2.8
**/
GimpLayer *
gimp_layer_group_new (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer_group = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-group-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-group-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_group = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
return layer_group;
}
/**
* _gimp_layer_group_new: (skip)
* @image_ID: The image to which to add the layer group.
*
* Create a new layer group.
*
* This procedure creates a new layer group. Attributes such as layer
* mode and opacity should be set with explicit procedure calls. Add
* the new layer group (which is a kind of layer) with the
* gimp_image_insert_layer() command.
* Other procedures useful with layer groups:
* gimp_image_reorder_item(), gimp_item_get_parent(),
* gimp_item_get_children(), gimp_item_is_group().
*
* Returns: The newly created layer group.
*
* Since: 2.8
**/
gint32
_gimp_layer_group_new (gint32 image_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_group_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-group-new",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-group-new",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_group_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_group_ID;
}
/**
* _gimp_layer_copy:
* @layer: The layer to copy.
* @add_alpha: Add an alpha channel to the copied layer.
*
* Copy a layer.
*
* This procedure copies the specified layer and returns the copy. The
* newly copied layer is for use within the original layer's image. It
* should not be subsequently added to any other image. The copied
* layer can optionally have an added alpha channel. This is useful if
* the background layer in an image is being copied and added to the
* same image.
*
* Returns: (transfer full): The newly copied layer.
**/
GimpLayer *
_gimp_layer_copy (GimpLayer *layer,
gboolean add_alpha)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer_copy = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_BOOLEAN, add_alpha,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-copy",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-copy",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_copy = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
return layer_copy;
}
/**
* __gimp_layer_copy: (skip)
* @layer_ID: The layer to copy.
* @add_alpha: Add an alpha channel to the copied layer.
*
* Copy a layer.
*
* This procedure copies the specified layer and returns the copy. The
* newly copied layer is for use within the original layer's image. It
* should not be subsequently added to any other image. The copied
* layer can optionally have an added alpha channel. This is useful if
* the background layer in an image is being copied and added to the
* same image.
*
* Returns: The newly copied layer.
**/
1997-11-25 06:05:25 +08:00
gint32
__gimp_layer_copy (gint32 layer_ID,
gboolean add_alpha)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_copy_ID = -1;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_BOOLEAN, add_alpha,
G_TYPE_NONE);
1997-11-25 06:05:25 +08:00
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-copy",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-copy",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_copy_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return layer_copy_ID;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_add_alpha:
* @layer: The layer.
*
* Add an alpha channel to the layer if it doesn't already have one.
*
* This procedure adds an additional component to the specified layer
* if it does not already possess an alpha channel. An alpha channel
* makes it possible to clear and erase to transparency, instead of the
* background color. This transforms layers of type RGB to RGBA, GRAY
* to GRAYA, and INDEXED to INDEXEDA.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_add_alpha (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-add-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-add-alpha",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_add_alpha: (skip)
* @layer_ID: The layer.
*
* Add an alpha channel to the layer if it doesn't already have one.
*
* This procedure adds an additional component to the specified layer
* if it does not already possess an alpha channel. An alpha channel
* makes it possible to clear and erase to transparency, instead of the
* background color. This transforms layers of type RGB to RGBA, GRAY
* to GRAYA, and INDEXED to INDEXEDA.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_add_alpha (gint32 layer_ID)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-add-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-add-alpha",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_flatten:
* @layer: The layer.
*
* Remove the alpha channel from the layer if it has one.
*
* This procedure removes the alpha channel from a layer, blending all
* (partially) transparent pixels in the layer against the background
* color. This transforms layers of type RGBA to RGB, GRAYA to GRAY,
* and INDEXEDA to INDEXED.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
gimp_layer_flatten (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-flatten",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-flatten",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_flatten: (skip)
* @layer_ID: The layer.
*
* Remove the alpha channel from the layer if it has one.
*
* This procedure removes the alpha channel from a layer, blending all
* (partially) transparent pixels in the layer against the background
* color. This transforms layers of type RGBA to RGB, GRAYA to GRAY,
* and INDEXEDA to INDEXED.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
_gimp_layer_flatten (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-flatten",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-flatten",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_scale:
* @layer: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @local_origin: Use a local origin (as opposed to the image origin).
*
* Scale the layer using the default interpolation method.
*
* This procedure scales the layer so that its new width and height are
* equal to the supplied parameters. The 'local-origin' parameter
* specifies whether to scale from the center of the layer, or from the
* image origin. This operation only works if the layer has been added
* to an image. The interpolation method used can be set with
* gimp_context_set_interpolation().
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_scale (GimpLayer *layer,
gint new_width,
gint new_height,
gboolean local_origin)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_BOOLEAN, local_origin,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-scale",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-scale",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_scale: (skip)
* @layer_ID: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @local_origin: Use a local origin (as opposed to the image origin).
*
* Scale the layer using the default interpolation method.
*
* This procedure scales the layer so that its new width and height are
* equal to the supplied parameters. The 'local-origin' parameter
* specifies whether to scale from the center of the layer, or from the
* image origin. This operation only works if the layer has been added
* to an image. The interpolation method used can be set with
* gimp_context_set_interpolation().
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_scale (gint32 layer_ID,
gint new_width,
gint new_height,
gboolean local_origin)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_BOOLEAN, local_origin,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-scale",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-scale",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_resize:
* @layer: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @offx: x offset between upper left corner of old and new layers: (old - new).
* @offy: y offset between upper left corner of old and new layers: (old - new).
*
* Resize the layer to the specified extents.
*
* This procedure resizes the layer so that its new width and height
* are equal to the supplied parameters. Offsets are also provided
* which describe the position of the previous layer's content. This
* operation only works if the layer has been added to an image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_resize (GimpLayer *layer,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-resize",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-resize",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* _gimp_layer_resize: (skip)
* @layer_ID: The layer.
* @new_width: New layer width.
* @new_height: New layer height.
* @offx: x offset between upper left corner of old and new layers: (old - new).
* @offy: y offset between upper left corner of old and new layers: (old - new).
*
* Resize the layer to the specified extents.
*
* This procedure resizes the layer so that its new width and height
* are equal to the supplied parameters. Offsets are also provided
* which describe the position of the previous layer's content. This
* operation only works if the layer has been added to an image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_resize (gint32 layer_ID,
gint new_width,
gint new_height,
gint offx,
gint offy)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_INT, new_width,
G_TYPE_INT, new_height,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-resize",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-resize",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_resize_to_image_size:
* @layer: The layer to resize.
*
* Resize a layer to the image size.
*
* This procedure resizes the layer so that it's new width and height
* are equal to the width and height of its image container.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_resize_to_image_size (GimpLayer *layer)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
1997-11-25 06:05:25 +08:00
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-resize-to-image-size",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-resize-to-image-size",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* _gimp_layer_resize_to_image_size: (skip)
* @layer_ID: The layer to resize.
*
* Resize a layer to the image size.
*
* This procedure resizes the layer so that it's new width and height
* are equal to the width and height of its image container.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_resize_to_image_size (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-resize-to-image-size",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-resize-to-image-size",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_set_offsets:
* @layer: The layer.
* @offx: Offset in x direction.
* @offy: Offset in y direction.
*
* Set the layer offsets.
*
* This procedure sets the offsets for the specified layer. The offsets
* are relative to the image origin and can be any values. This
* operation is valid only on layers which have been added to an image.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_offsets (GimpLayer *layer,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-offsets",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-offsets",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_offsets: (skip)
* @layer_ID: The layer.
* @offx: Offset in x direction.
* @offy: Offset in y direction.
*
* Set the layer offsets.
*
* This procedure sets the offsets for the specified layer. The offsets
* are relative to the image origin and can be any values. This
* operation is valid only on layers which have been added to an image.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_offsets (gint32 layer_ID,
gint offx,
gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_INT, offx,
G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-offsets",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-offsets",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_create_mask:
* @layer: The layer to which to add the mask.
* @mask_type: The type of mask.
*
* Create a layer mask for the specified layer.
*
* This procedure creates a layer mask for the specified layer.
* Layer masks serve as an additional alpha channel for a layer.
* Different types of masks are allowed for initialisation:
* - white mask (leaves the layer fully visible);
* - black mask (gives the layer complete transparency);
* - the layer's alpha channel (either a copy, or a transfer, which
* leaves the layer fully visible, but which may be more useful than a
* white mask);
* - the current selection;
* - a grayscale copy of the layer;
* - or a copy of the active channel.
*
* The layer mask still needs to be added to the layer. This can be
* done with a call to gimp_layer_add_mask().
*
* gimp_layer_create_mask() will fail if there are no active channels
* on the image, when called with 'ADD-CHANNEL-MASK'. It will return a
* black mask when called with 'ADD-ALPHA-MASK' or
* 'ADD-ALPHA-TRANSFER-MASK' on a layer with no alpha channels, or with
* 'ADD-SELECTION-MASK' when there is no selection on the image.
*
* Returns: The newly created mask.
**/
gint32
gimp_layer_create_mask (GimpLayer *layer,
GimpAddMaskType mask_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 mask_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_ADD_MASK_TYPE, mask_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-create-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-create-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mask_ID = gimp_value_get_layer_mask_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mask_ID;
}
/**
* _gimp_layer_create_mask: (skip)
* @layer_ID: The layer to which to add the mask.
* @mask_type: The type of mask.
*
* Create a layer mask for the specified layer.
*
* This procedure creates a layer mask for the specified layer.
* Layer masks serve as an additional alpha channel for a layer.
* Different types of masks are allowed for initialisation:
* - white mask (leaves the layer fully visible);
* - black mask (gives the layer complete transparency);
* - the layer's alpha channel (either a copy, or a transfer, which
* leaves the layer fully visible, but which may be more useful than a
* white mask);
* - the current selection;
* - a grayscale copy of the layer;
* - or a copy of the active channel.
*
* The layer mask still needs to be added to the layer. This can be
* done with a call to gimp_layer_add_mask().
*
* gimp_layer_create_mask() will fail if there are no active channels
* on the image, when called with 'ADD-CHANNEL-MASK'. It will return a
* black mask when called with 'ADD-ALPHA-MASK' or
* 'ADD-ALPHA-TRANSFER-MASK' on a layer with no alpha channels, or with
* 'ADD-SELECTION-MASK' when there is no selection on the image.
*
* Returns: The newly created mask.
**/
gint32
_gimp_layer_create_mask (gint32 layer_ID,
GimpAddMaskType mask_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 mask_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_ADD_MASK_TYPE, mask_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-create-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-create-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mask_ID = gimp_value_get_layer_mask_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mask_ID;
}
/**
* gimp_layer_get_mask:
* @layer: The layer.
*
* Get the specified layer's mask if it exists.
*
* This procedure returns the specified layer's mask, or -1 if none
* exists.
*
* Returns: The layer mask.
**/
gint32
gimp_layer_get_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 mask_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mask_ID = gimp_value_get_layer_mask_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mask_ID;
}
/**
* _gimp_layer_get_mask: (skip)
* @layer_ID: The layer.
*
* Get the specified layer's mask if it exists.
*
* This procedure returns the specified layer's mask, or -1 if none
* exists.
*
* Returns: The layer mask.
**/
gint32
_gimp_layer_get_mask (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 mask_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mask_ID = gimp_value_get_layer_mask_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mask_ID;
}
/**
* gimp_layer_from_mask:
* @mask_ID: Mask for which to return the layer.
*
* Get the specified mask's layer.
*
* This procedure returns the specified mask's layer , or -1 if none
* exists.
*
* Returns: (transfer full): The mask's layer.
*
* Since: 2.2
**/
GimpLayer *
gimp_layer_from_mask (gint32 mask_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_MASK_ID, mask_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-from-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-from-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
return layer;
}
/**
* _gimp_layer_from_mask: (skip)
* @mask_ID: Mask for which to return the layer.
*
* Get the specified mask's layer.
*
* This procedure returns the specified mask's layer , or -1 if none
* exists.
*
* Returns: The mask's layer.
*
* Since: 2.2
**/
gint32
_gimp_layer_from_mask (gint32 mask_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 layer_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_MASK_ID, mask_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-from-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-from-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return layer_ID;
}
/**
* gimp_layer_add_mask:
* @layer: 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. The layer must have been created
* for use with the specified image and the mask must have been created
* with the procedure 'gimp-layer-create-mask'.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_add_mask (GimpLayer *layer,
gint32 mask_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_LAYER_MASK_ID, mask_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-add-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-add-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_add_mask: (skip)
* @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. The layer must have been created
* for use with the specified image and the mask must have been created
* with the procedure 'gimp-layer-create-mask'.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_add_mask (gint32 layer_ID,
gint32 mask_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_LAYER_MASK_ID, mask_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-add-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-add-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_remove_mask:
* @layer: 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_layer_remove_mask (GimpLayer *layer,
GimpMaskApplyMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_MASK_APPLY_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-remove-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-remove-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_remove_mask: (skip)
* @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_layer_remove_mask (gint32 layer_ID,
GimpMaskApplyMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_MASK_APPLY_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-remove-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-remove-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_is_floating_sel:
* @layer: The layer.
*
* Is the specified layer a floating selection?
*
* This procedure returns whether the layer is a floating selection.
* Floating selections are special cases of layers which are attached
* to a specific drawable.
*
* Returns: TRUE if the layer is a floating selection.
**/
gboolean
gimp_layer_is_floating_sel (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean is_floating_sel = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-is-floating-sel",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-is-floating-sel",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
is_floating_sel = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return is_floating_sel;
}
/**
* _gimp_layer_is_floating_sel: (skip)
* @layer_ID: The layer.
*
* Is the specified layer a floating selection?
*
* This procedure returns whether the layer is a floating selection.
* Floating selections are special cases of layers which are attached
* to a specific drawable.
*
* Returns: TRUE if the layer is a floating selection.
**/
gboolean
_gimp_layer_is_floating_sel (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean is_floating_sel = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-is-floating-sel",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-is-floating-sel",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
is_floating_sel = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return is_floating_sel;
}
/**
* gimp_layer_get_lock_alpha:
* @layer: The layer.
*
* Get the lock alpha channel setting of the specified layer.
*
* This procedure returns the specified layer's lock alpha channel
* setting.
*
* Returns: The layer's lock alpha channel setting.
**/
gboolean
gimp_layer_get_lock_alpha (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean lock_alpha = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-lock-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-lock-alpha",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
lock_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return lock_alpha;
}
/**
* _gimp_layer_get_lock_alpha: (skip)
* @layer_ID: The layer.
*
* Get the lock alpha channel setting of the specified layer.
*
* This procedure returns the specified layer's lock alpha channel
* setting.
*
* Returns: The layer's lock alpha channel setting.
**/
gboolean
_gimp_layer_get_lock_alpha (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean lock_alpha = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-lock-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-lock-alpha",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
lock_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return lock_alpha;
}
/**
* gimp_layer_set_lock_alpha:
* @layer: The layer.
* @lock_alpha: The new layer's lock alpha channel setting.
*
* Set the lock alpha channel setting of the specified layer.
*
* This procedure sets the specified layer's lock alpha channel
* setting.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_lock_alpha (GimpLayer *layer,
gboolean lock_alpha)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_BOOLEAN, lock_alpha,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-lock-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-lock-alpha",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_lock_alpha: (skip)
* @layer_ID: The layer.
* @lock_alpha: The new layer's lock alpha channel setting.
*
* Set the lock alpha channel setting of the specified layer.
*
* This procedure sets the specified layer's lock alpha channel
* setting.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_lock_alpha (gint32 layer_ID,
gboolean lock_alpha)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_BOOLEAN, lock_alpha,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-lock-alpha",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-lock-alpha",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_get_apply_mask:
* @layer: The layer.
*
* Get the apply mask setting of the specified layer.
*
* This procedure returns the specified layer's apply mask setting. If
* the value is TRUE, then the layer mask for this layer is currently
* being composited with the layer's alpha channel.
*
* Returns: The layer's apply mask setting.
**/
gboolean
gimp_layer_get_apply_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean apply_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-apply-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-apply-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
apply_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return apply_mask;
}
/**
* _gimp_layer_get_apply_mask: (skip)
* @layer_ID: The layer.
*
* Get the apply mask setting of the specified layer.
*
* This procedure returns the specified layer's apply mask setting. If
* the value is TRUE, then the layer mask for this layer is currently
* being composited with the layer's alpha channel.
*
* Returns: The layer's apply mask setting.
**/
gboolean
_gimp_layer_get_apply_mask (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean apply_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-apply-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-apply-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
apply_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return apply_mask;
}
/**
* gimp_layer_set_apply_mask:
* @layer: The layer.
* @apply_mask: The new layer's apply mask setting.
*
* Set the apply mask setting of the specified layer.
*
* This procedure sets the specified layer's apply mask setting. This
* controls whether the layer's mask is currently affecting the alpha
* channel. If there is no layer mask, this function will return an
* error.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_apply_mask (GimpLayer *layer,
gboolean apply_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_BOOLEAN, apply_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-apply-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-apply-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_apply_mask: (skip)
* @layer_ID: The layer.
* @apply_mask: The new layer's apply mask setting.
*
* Set the apply mask setting of the specified layer.
*
* This procedure sets the specified layer's apply mask setting. This
* controls whether the layer's mask is currently affecting the alpha
* channel. If there is no layer mask, this function will return an
* error.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_apply_mask (gint32 layer_ID,
gboolean apply_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_BOOLEAN, apply_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-apply-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-apply-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_get_show_mask:
* @layer: The layer.
*
* Get the show mask setting of the specified layer.
*
* This procedure returns the specified layer's show mask setting. This
* controls whether the layer or its mask is visible. TRUE indicates
* that the mask should be visible. If the layer has no mask, then this
* function returns an error.
*
* Returns: The layer's show mask setting.
**/
gboolean
gimp_layer_get_show_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean show_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-show-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-show-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
show_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return show_mask;
}
/**
* _gimp_layer_get_show_mask: (skip)
* @layer_ID: The layer.
*
* Get the show mask setting of the specified layer.
*
* This procedure returns the specified layer's show mask setting. This
* controls whether the layer or its mask is visible. TRUE indicates
* that the mask should be visible. If the layer has no mask, then this
* function returns an error.
*
* Returns: The layer's show mask setting.
**/
gboolean
_gimp_layer_get_show_mask (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean show_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-show-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-show-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
show_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return show_mask;
}
/**
* gimp_layer_set_show_mask:
* @layer: The layer.
* @show_mask: The new layer's show mask setting.
*
* Set the show mask setting of the specified layer.
*
* This procedure sets the specified layer's show mask setting. This
* controls whether the layer or its mask is visible. TRUE indicates
* that the mask should be visible. If there is no layer mask, this
* function will return an error.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_show_mask (GimpLayer *layer,
gboolean show_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_BOOLEAN, show_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-show-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-show-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_show_mask: (skip)
* @layer_ID: The layer.
* @show_mask: The new layer's show mask setting.
*
* Set the show mask setting of the specified layer.
*
* This procedure sets the specified layer's show mask setting. This
* controls whether the layer or its mask is visible. TRUE indicates
* that the mask should be visible. If there is no layer mask, this
* function will return an error.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_show_mask (gint32 layer_ID,
gboolean show_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_BOOLEAN, show_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-show-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-show-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_get_edit_mask:
* @layer: The layer.
*
* Get the edit mask setting of the specified layer.
*
* This procedure returns the specified layer's edit mask setting. If
* the value is TRUE, then the layer mask for this layer is currently
* active, and not the layer.
*
* Returns: The layer's edit mask setting.
**/
gboolean
gimp_layer_get_edit_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean edit_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-edit-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-edit-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
edit_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return edit_mask;
}
/**
* _gimp_layer_get_edit_mask: (skip)
* @layer_ID: The layer.
*
* Get the edit mask setting of the specified layer.
*
* This procedure returns the specified layer's edit mask setting. If
* the value is TRUE, then the layer mask for this layer is currently
* active, and not the layer.
*
* Returns: The layer's edit mask setting.
**/
gboolean
_gimp_layer_get_edit_mask (gint32 layer_ID)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean edit_mask = FALSE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-edit-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-edit-mask",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
edit_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
1997-11-25 06:05:25 +08:00
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return edit_mask;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_set_edit_mask:
* @layer: The layer.
* @edit_mask: The new layer's edit mask setting.
*
* Set the edit mask setting of the specified layer.
*
* This procedure sets the specified layer's edit mask setting. This
* controls whether the layer or it's mask is currently active for
* editing. If the specified layer has no layer mask, then this
* procedure will return an error.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_edit_mask (GimpLayer *layer,
gboolean edit_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_BOOLEAN, edit_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-edit-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-edit-mask",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
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.
2003-12-09 06:33:17 +08:00
/**
* _gimp_layer_set_edit_mask: (skip)
* @layer_ID: The layer.
* @edit_mask: The new layer's edit mask setting.
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.
2003-12-09 06:33:17 +08:00
*
* Set the edit mask setting of the specified layer.
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.
2003-12-09 06:33:17 +08:00
*
* This procedure sets the specified layer's edit mask setting. This
* controls whether the layer or it's mask is currently active for
* editing. If the specified layer has no layer mask, then this
* procedure will return an error.
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.
2003-12-09 06:33:17 +08:00
*
* Returns: TRUE on success.
**/
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.
2003-12-09 06:33:17 +08:00
gboolean
_gimp_layer_set_edit_mask (gint32 layer_ID,
gboolean edit_mask)
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.
2003-12-09 06:33:17 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
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.
2003-12-09 06:33:17 +08:00
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_BOOLEAN, edit_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-edit-mask",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-edit-mask",
args);
gimp_value_array_unref (args);
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.
2003-12-09 06:33:17 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
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.
2003-12-09 06:33:17 +08:00
gimp_value_array_unref (return_vals);
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.
2003-12-09 06:33:17 +08:00
return success;
}
/**
* gimp_layer_get_opacity:
* @layer: The layer.
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.
2003-12-09 06:33:17 +08:00
*
* Get the opacity of the specified layer.
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.
2003-12-09 06:33:17 +08:00
*
* This procedure returns the specified layer's opacity.
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.
2003-12-09 06:33:17 +08:00
*
* Returns: The layer opacity.
**/
gdouble
gimp_layer_get_opacity (GimpLayer *layer)
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.
2003-12-09 06:33:17 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gdouble opacity = 0.0;
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.
2003-12-09 06:33:17 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
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.
2003-12-09 06:33:17 +08:00
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-opacity",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-opacity",
args);
gimp_value_array_unref (args);
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.
2003-12-09 06:33:17 +08:00
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
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.
2003-12-09 06:33:17 +08:00
return opacity;
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.
2003-12-09 06:33:17 +08:00
}
/**
* _gimp_layer_get_opacity: (skip)
* @layer_ID: The layer.
*
* Get the opacity of the specified layer.
*
* This procedure returns the specified layer's opacity.
*
* Returns: The layer opacity.
**/
gdouble
_gimp_layer_get_opacity (gint32 layer_ID)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gdouble opacity = 0.0;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-opacity",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-opacity",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
1997-11-25 06:05:25 +08:00
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return opacity;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_set_opacity:
* @layer: The layer.
* @opacity: The new layer opacity.
*
* Set the opacity of the specified layer.
*
* This procedure sets the specified layer's opacity.
*
* Returns: TRUE on success.
**/
Sven Neumann <sven@gimp.org> 2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> Episode IV... * app/Makefile.am * app/message_cmds.c: new name * app/interface_cmds.c: removed * app/help_cmds.c: new name * app/gimphelp_cmds.c: removed * app/internal_procs.c * app/gimphelp_cmds.c * app/plug_in_cmds.c: moved gimp_plugin_help_register to plug_in_cmds.c, s/gimp_plugin_domain_add/gimp_plugin_domain_register/ * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimpfileops_pdb.[ch] * libgimp/gimpguides_pdb.[ch] * libgimp/gimpmessage_pdb.[ch] * libgimp/gimpprocedural_db_pdb.[ch] * libgimp/gimpplugin_pdb.[ch]: new files containing PDB wrappers moved out of libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch] * libgimp/gimphelp_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimplayer_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c: various changes. * libgimp/gimpunit.c: new file * libgimp/gimpunit_pdb.[ch]: contains only PDB wrappers prefixed with "_" which are called from libgimp/gimpunit.c only. * libgimp/gimpunit.h: minor stuff * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_query_database gimp_query_images * libgimp/gimp.[ch]: removed all PDB wrappers. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: changed * tools/pdbgen/lib.pl: tried to fix libgimp autogeneration and fixed just a few comments. * tools/pdbgen/pdb/interface.pdb * tools/pdbgen/pdb/gimphelp.pdb: removed * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb: new names * plug-ins/script-fu/script-fu.c * plug-ins/perl/Gimp/Lib.xs: s/gimp_plugin_domain_add/gimp_plugin_domain_register/ 2000-05-31 Michael Natterer <mitch@gimp.org> * POTFILES.in: s/gimpunit_pdb/gimpunit/
2000-05-31 21:24:14 +08:00
gboolean
gimp_layer_set_opacity (GimpLayer *layer,
gdouble opacity)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_DOUBLE, opacity,
G_TYPE_NONE);
1997-11-25 06:05:25 +08:00
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-opacity",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-opacity",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
1997-11-25 06:05:25 +08:00
return success;
1997-11-25 06:05:25 +08:00
}
/**
* _gimp_layer_set_opacity: (skip)
* @layer_ID: The layer.
* @opacity: The new layer opacity.
*
* Set the opacity of the specified layer.
*
* This procedure sets the specified layer's opacity.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_opacity (gint32 layer_ID,
gdouble opacity)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_DOUBLE, opacity,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-opacity",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-opacity",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_get_mode:
* @layer: The layer.
*
* Get the combination mode of the specified layer.
*
* This procedure returns the specified layer's combination mode.
*
* Returns: The layer combination mode.
**/
GimpLayerMode
gimp_layer_get_mode (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerMode mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-mode",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mode;
}
/**
* _gimp_layer_get_mode: (skip)
* @layer_ID: The layer.
*
* Get the combination mode of the specified layer.
*
* This procedure returns the specified layer's combination mode.
*
* Returns: The layer combination mode.
**/
GimpLayerMode
_gimp_layer_get_mode (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerMode mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-mode",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return mode;
}
/**
* gimp_layer_set_mode:
* @layer: The layer.
* @mode: The new layer combination mode.
*
* Set the combination mode of the specified layer.
*
* This procedure sets the specified layer's combination mode.
*
* Returns: TRUE on success.
**/
gboolean
gimp_layer_set_mode (GimpLayer *layer,
GimpLayerMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-mode",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_mode: (skip)
* @layer_ID: The layer.
* @mode: The new layer combination mode.
*
* Set the combination mode of the specified layer.
*
* This procedure sets the specified layer's combination mode.
*
* Returns: TRUE on success.
**/
gboolean
_gimp_layer_set_mode (gint32 layer_ID,
GimpLayerMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-mode",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_get_blend_space:
* @layer: The layer.
*
* Get the blend space of the specified layer.
*
* This procedure returns the specified layer's blend space.
*
* Returns: The layer blend space.
*
* Since: 2.10
**/
GimpLayerColorSpace
gimp_layer_get_blend_space (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerColorSpace blend_space = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-blend-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-blend-space",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
blend_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return blend_space;
}
/**
* _gimp_layer_get_blend_space: (skip)
* @layer_ID: The layer.
*
* Get the blend space of the specified layer.
*
* This procedure returns the specified layer's blend space.
*
* Returns: The layer blend space.
*
* Since: 2.10
**/
GimpLayerColorSpace
_gimp_layer_get_blend_space (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerColorSpace blend_space = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-blend-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-blend-space",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
blend_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return blend_space;
}
/**
* gimp_layer_set_blend_space:
* @layer: The layer.
* @blend_space: The new layer blend space.
*
* Set the blend space of the specified layer.
*
* This procedure sets the specified layer's blend space.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
gimp_layer_set_blend_space (GimpLayer *layer,
GimpLayerColorSpace blend_space)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_LAYER_COLOR_SPACE, blend_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-blend-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-blend-space",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* _gimp_layer_set_blend_space: (skip)
* @layer_ID: The layer.
* @blend_space: The new layer blend space.
*
* Set the blend space of the specified layer.
*
* This procedure sets the specified layer's blend space.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_layer_set_blend_space (gint32 layer_ID,
GimpLayerColorSpace blend_space)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_LAYER_COLOR_SPACE, blend_space,
G_TYPE_NONE);
1997-11-25 06:05:25 +08:00
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-blend-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-blend-space",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
1997-11-25 06:05:25 +08:00
}
/**
* gimp_layer_get_composite_space:
* @layer: The layer.
*
* Get the composite space of the specified layer.
*
* This procedure returns the specified layer's composite space.
*
* Returns: The layer composite space.
*
* Since: 2.10
**/
GimpLayerColorSpace
gimp_layer_get_composite_space (GimpLayer *layer)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerColorSpace composite_space = 0;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-composite-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-space",
args);
gimp_value_array_unref (args);
1997-11-25 06:05:25 +08:00
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
composite_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return composite_space;
1997-11-25 06:05:25 +08:00
}
/**
* _gimp_layer_get_composite_space: (skip)
* @layer_ID: The layer.
*
* Get the composite space of the specified layer.
*
* This procedure returns the specified layer's composite space.
*
* Returns: The layer composite space.
*
* Since: 2.10
**/
GimpLayerColorSpace
_gimp_layer_get_composite_space (gint32 layer_ID)
1997-11-25 06:05:25 +08:00
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerColorSpace composite_space = 0;
1997-11-25 06:05:25 +08:00
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-composite-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-space",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
composite_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return composite_space;
}
/**
* gimp_layer_set_composite_space:
* @layer: The layer.
* @composite_space: The new layer composite space.
*
* Set the composite space of the specified layer.
*
* This procedure sets the specified layer's composite space.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
gimp_layer_set_composite_space (GimpLayer *layer,
GimpLayerColorSpace composite_space)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_LAYER_COLOR_SPACE, composite_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-composite-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-space",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_composite_space: (skip)
* @layer_ID: The layer.
* @composite_space: The new layer composite space.
*
* Set the composite space of the specified layer.
*
* This procedure sets the specified layer's composite space.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_layer_set_composite_space (gint32 layer_ID,
GimpLayerColorSpace composite_space)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_LAYER_COLOR_SPACE, composite_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-composite-space",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-space",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* gimp_layer_get_composite_mode:
* @layer: The layer.
*
* Get the composite mode of the specified layer.
*
* This procedure returns the specified layer's composite mode.
*
* Returns: The layer composite mode.
*
* Since: 2.10
**/
GimpLayerCompositeMode
gimp_layer_get_composite_mode (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerCompositeMode composite_mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-composite-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-mode",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
composite_mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return composite_mode;
}
/**
* _gimp_layer_get_composite_mode: (skip)
* @layer_ID: The layer.
*
* Get the composite mode of the specified layer.
*
* This procedure returns the specified layer's composite mode.
*
* Returns: The layer composite mode.
*
* Since: 2.10
**/
GimpLayerCompositeMode
_gimp_layer_get_composite_mode (gint32 layer_ID)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
GimpLayerCompositeMode composite_mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-get-composite-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-mode",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
composite_mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
return composite_mode;
}
/**
* gimp_layer_set_composite_mode:
* @layer: The layer.
* @composite_mode: The new layer composite mode.
*
* Set the composite mode of the specified layer.
*
* This procedure sets the specified layer's composite mode.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
gimp_layer_set_composite_mode (GimpLayer *layer,
GimpLayerCompositeMode composite_mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, gimp_item_get_id (GIMP_ITEM (layer)),
GIMP_TYPE_LAYER_COMPOSITE_MODE, composite_mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-composite-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-mode",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}
/**
* _gimp_layer_set_composite_mode: (skip)
* @layer_ID: The layer.
* @composite_mode: The new layer composite mode.
*
* Set the composite mode of the specified layer.
*
* This procedure sets the specified layer's composite mode.
*
* Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
_gimp_layer_set_composite_mode (gint32 layer_ID,
GimpLayerCompositeMode composite_mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER_ID, layer_ID,
GIMP_TYPE_LAYER_COMPOSITE_MODE, composite_mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
"gimp-layer-set-composite-mode",
args);
else
return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-mode",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
return success;
}