fixed parasite serialization that I broke yesterday.

2003-03-06  Sven Neumann  <sven@gimp.org>

	* app/core/gimpparasitelist.c: fixed parasite serialization that
	I broke yesterday.

	* app/widgets/gimpenummenu.c: added support for mnemonics.

	* app/core/core-enums.h: removed the inverted variants from the
	GimpAddMaskType enum. Registered the enum with the type system.

	* app/core/gimplayer.c: changed accordingly.

	* app/gui/layers-commands.c (layers_add_mask_query): use an enum
	frame and added a check button that allows to invert the inital
	layer mask.

	* tools/pdbgen/pdb/layer.pdb: updated documentation for the
	gimp-layer-create-mask PDB function.

	* plug-ins/script-fu/siod-wrapper.c: removed new enum values from
	the compatibility defines.

	* app/core/core-enums.c
	* app/pdb/layer_cmds.c
	* libgimp/gimpenums.h
	* libgimp/gimplayer_pdb.c
	* plug-ins/pygimp/gimpenums.py
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
This commit is contained in:
Sven Neumann 2003-03-06 13:22:11 +00:00 committed by Sven Neumann
parent 906c2fa55b
commit 5e11bae69b
18 changed files with 190 additions and 214 deletions

View File

@ -1,3 +1,33 @@
2003-03-06 Sven Neumann <sven@gimp.org>
* app/core/gimpparasitelist.c: fixed parasite serialization that
I broke yesterday.
* app/widgets/gimpenummenu.c: added support for mnemonics.
* app/core/core-enums.h: removed the inverted variants from the
GimpAddMaskType enum. Registered the enum with the type system.
* app/core/gimplayer.c: changed accordingly.
* app/gui/layers-commands.c (layers_add_mask_query): use an enum
frame and added a check button that allows to invert the inital
layer mask.
* tools/pdbgen/pdb/layer.pdb: updated documentation for the
gimp-layer-create-mask PDB function.
* plug-ins/script-fu/siod-wrapper.c: removed new enum values from
the compatibility defines.
* app/core/core-enums.c
* app/pdb/layer_cmds.c
* libgimp/gimpenums.h
* libgimp/gimplayer_pdb.c
* plug-ins/pygimp/gimpenums.py
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
2003-03-06 Sven Neumann <sven@gimp.org>
* HACKING

View File

@ -836,6 +836,7 @@ struct _AddMaskOptions
GtkWidget *query_box;
GimpLayer *layer;
GimpAddMaskType add_mask_type;
gboolean invert;
};
static void
@ -852,6 +853,10 @@ add_mask_query_ok_callback (GtkWidget *widget,
if ((layer = (options->layer)) && (gimage = GIMP_ITEM (layer)->gimage))
{
mask = gimp_layer_create_mask (layer, options->add_mask_type);
if (options->invert)
gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
gimp_layer_add_mask (layer, mask, TRUE);
g_object_unref (mask);
@ -866,12 +871,15 @@ layers_add_mask_query (GimpLayer *layer)
{
AddMaskOptions *options;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *sep;
GimpImage *gimage;
/* The new options structure */
options = g_new (AddMaskOptions, 1);
options->layer = layer;
options->add_mask_type = GIMP_ADD_WHITE_MASK;
options->invert = FALSE;
gimage = gimp_item_get_image (GIMP_ITEM (layer));
@ -893,67 +901,34 @@ layers_add_mask_query (GimpLayer *layer)
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
(GWeakNotify) g_free, options);
/* The radio frame and box */
if (! gimp_image_mask_is_empty (gimage))
{
options->add_mask_type = GIMP_ADD_SELECTION_MASK;
frame =
gimp_radio_group_new2 (TRUE, _("Initialize Layer Mask to:"),
frame = gimp_enum_radio_frame_new (GIMP_TYPE_ADD_MASK_TYPE,
gtk_label_new (_("Initialize Layer Mask to:")),
6,
G_CALLBACK (gimp_radio_button_update),
&options->add_mask_type,
GINT_TO_POINTER (options->add_mask_type),
&button);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (button),
GINT_TO_POINTER (options->add_mask_type));
_("Selection"),
GINT_TO_POINTER (GIMP_ADD_SELECTION_MASK), NULL,
_("Inverse Selection"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_SELECTION_MASK), NULL,
_("Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_COPY_MASK), NULL,
_("Inverse Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_COPY_MASK), NULL,
_("White (Full Opacity)"),
GINT_TO_POINTER (GIMP_ADD_WHITE_MASK), NULL,
_("Black (Full Transparency)"),
GINT_TO_POINTER (GIMP_ADD_BLACK_MASK), NULL,
_("Layer's Alpha Channel"),
GINT_TO_POINTER (GIMP_ADD_ALPHA_MASK), NULL,
NULL);
}
else
{
frame =
gimp_radio_group_new2 (TRUE, _("Initialize Layer Mask to:"),
G_CALLBACK (gimp_radio_button_update),
&options->add_mask_type,
GINT_TO_POINTER (options->add_mask_type),
_("Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_COPY_MASK), NULL,
_("Inverse Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_COPY_MASK), NULL,
_("White (Full Opacity)"),
GINT_TO_POINTER (GIMP_ADD_WHITE_MASK), NULL,
_("Black (Full Transparency)"),
GINT_TO_POINTER (GIMP_ADD_BLACK_MASK), NULL,
_("Layer's Alpha Channel"),
GINT_TO_POINTER (GIMP_ADD_ALPHA_MASK), NULL,
NULL);
}
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
frame);
gtk_widget_show (frame);
sep = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (GTK_BIN (frame)->child), sep, FALSE, FALSE, 0);
gtk_widget_show (sep);
button = gtk_check_button_new_with_mnemonic (_("In_vert Mask"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), options->invert);
g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&options->invert);
gtk_box_pack_end (GTK_BOX (GTK_BIN (frame)->child), button, FALSE, FALSE, 0);
gtk_widget_show (button);
gtk_widget_show (options->query_box);
}

View File

@ -8,21 +8,23 @@
/* enumerations from "./core-enums.h" */
static const GEnumValue gimp_orientation_type_enum_values[] =
static const GEnumValue gimp_add_mask_type_enum_values[] =
{
{ GIMP_ORIENTATION_HORIZONTAL, N_("Horizontal"), "horizontal" },
{ GIMP_ORIENTATION_VERTICAL, N_("Vertical"), "vertical" },
{ GIMP_ORIENTATION_UNKNOWN, N_("Unknown"), "unknown" },
{ GIMP_ADD_WHITE_MASK, N_("_White (Full Opacity)"), "white-mask" },
{ GIMP_ADD_BLACK_MASK, N_("_Black (Full Transparency)"), "black-mask" },
{ GIMP_ADD_ALPHA_MASK, N_("Layer's _Alpha Channel"), "alpha-mask" },
{ GIMP_ADD_SELECTION_MASK, N_("_Selection"), "selection-mask" },
{ GIMP_ADD_COPY_MASK, N_("_Grayscale Copy of Layer"), "copy-mask" },
{ 0, NULL, NULL }
};
GType
gimp_orientation_type_get_type (void)
gimp_add_mask_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpOrientationType", gimp_orientation_type_enum_values);
enum_type = g_enum_register_static ("GimpAddMaskType", gimp_add_mask_type_enum_values);
return enum_type;
}
@ -254,6 +256,26 @@ gimp_image_type_get_type (void)
}
static const GEnumValue gimp_orientation_type_enum_values[] =
{
{ GIMP_ORIENTATION_HORIZONTAL, N_("Horizontal"), "horizontal" },
{ GIMP_ORIENTATION_VERTICAL, N_("Vertical"), "vertical" },
{ GIMP_ORIENTATION_UNKNOWN, N_("Unknown"), "unknown" },
{ 0, NULL, NULL }
};
GType
gimp_orientation_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpOrientationType", gimp_orientation_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_preview_size_enum_values[] =
{
{ GIMP_PREVIEW_SIZE_NONE, N_("None"), "none" },

View File

@ -36,20 +36,23 @@
pairs will be copied into libgimpproxy by gimp-mkproxy.
#endif
/*
* these enums that are registered with the type system
*/
#define GIMP_TYPE_ORIENTATION_TYPE (gimp_orientation_type_get_type ())
#define GIMP_TYPE_ADD_MASK_TYPE (gimp_add_mask_type_get_type ())
GType gimp_orientation_type_get_type (void) G_GNUC_CONST;
GType gimp_add_mask_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ORIENTATION_HORIZONTAL, /*< desc="Horizontal" >*/
GIMP_ORIENTATION_VERTICAL, /*< desc="Vertical" >*/
GIMP_ORIENTATION_UNKNOWN /*< desc="Unknown" >*/
} GimpOrientationType;
GIMP_ADD_WHITE_MASK, /*< desc="_White (Full Opacity)" >*/
GIMP_ADD_BLACK_MASK, /*< desc="_Black (Full Transparency)" >*/
GIMP_ADD_ALPHA_MASK, /*< desc="Layer's _Alpha Channel" >*/
GIMP_ADD_SELECTION_MASK, /*< desc="_Selection" >*/
GIMP_ADD_COPY_MASK /*< desc="_Grayscale Copy of Layer" >*/
} GimpAddMaskType;
#define GIMP_TYPE_BLEND_MODE (gimp_blend_mode_get_type ())
@ -201,6 +204,18 @@ typedef enum
} GimpImageType;
#define GIMP_TYPE_ORIENTATION_TYPE (gimp_orientation_type_get_type ())
GType gimp_orientation_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ORIENTATION_HORIZONTAL, /*< desc="Horizontal" >*/
GIMP_ORIENTATION_VERTICAL, /*< desc="Vertical" >*/
GIMP_ORIENTATION_UNKNOWN /*< desc="Unknown" >*/
} GimpOrientationType;
#define GIMP_TYPE_PREVIEW_SIZE (gimp_preview_size_get_type ())
GType gimp_preview_size_get_type (void) G_GNUC_CONST;
@ -402,17 +417,6 @@ typedef enum /*< pdb-skip >*/ /*< skip >*/
GIMP_GRAD_HSV_CW /* clockwise hue */
} GimpGradientSegmentColor;
typedef enum /*< skip >*/
{
GIMP_ADD_WHITE_MASK,
GIMP_ADD_BLACK_MASK,
GIMP_ADD_ALPHA_MASK,
GIMP_ADD_SELECTION_MASK,
GIMP_ADD_INVERSE_SELECTION_MASK,
GIMP_ADD_COPY_MASK,
GIMP_ADD_INVERSE_COPY_MASK
} GimpAddMaskType;
typedef enum /*< skip >*/
{
GIMP_MASK_APPLY,

View File

@ -682,7 +682,6 @@ gimp_layer_create_mask (const GimpLayer *layer,
break;
case GIMP_ADD_SELECTION_MASK:
case GIMP_ADD_INVERSE_SELECTION_MASK:
{
GimpChannel *selection;
@ -702,7 +701,6 @@ gimp_layer_create_mask (const GimpLayer *layer,
break;
case GIMP_ADD_COPY_MASK:
case GIMP_ADD_INVERSE_COPY_MASK:
{
TileManager *copy_tiles = NULL;
GimpImageType layer_type;
@ -755,20 +753,6 @@ gimp_layer_create_mask (const GimpLayer *layer,
}
GIMP_CHANNEL (mask)->bounds_known = FALSE;
}
switch (add_mask_type)
{
case GIMP_ADD_WHITE_MASK:
case GIMP_ADD_BLACK_MASK:
case GIMP_ADD_ALPHA_MASK:
case GIMP_ADD_SELECTION_MASK:
case GIMP_ADD_COPY_MASK:
break;
case GIMP_ADD_INVERSE_SELECTION_MASK:
case GIMP_ADD_INVERSE_COPY_MASK:
gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
break;
}

View File

@ -489,6 +489,8 @@ parasite_serialize (const gchar *key,
}
}
g_string_append (str, "\"");
gimp_config_writer_print (writer, str->str, str->len);
g_string_free (str, TRUE);

View File

@ -836,6 +836,7 @@ struct _AddMaskOptions
GtkWidget *query_box;
GimpLayer *layer;
GimpAddMaskType add_mask_type;
gboolean invert;
};
static void
@ -852,6 +853,10 @@ add_mask_query_ok_callback (GtkWidget *widget,
if ((layer = (options->layer)) && (gimage = GIMP_ITEM (layer)->gimage))
{
mask = gimp_layer_create_mask (layer, options->add_mask_type);
if (options->invert)
gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
gimp_layer_add_mask (layer, mask, TRUE);
g_object_unref (mask);
@ -866,12 +871,15 @@ layers_add_mask_query (GimpLayer *layer)
{
AddMaskOptions *options;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *sep;
GimpImage *gimage;
/* The new options structure */
options = g_new (AddMaskOptions, 1);
options->layer = layer;
options->add_mask_type = GIMP_ADD_WHITE_MASK;
options->invert = FALSE;
gimage = gimp_item_get_image (GIMP_ITEM (layer));
@ -893,67 +901,34 @@ layers_add_mask_query (GimpLayer *layer)
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
(GWeakNotify) g_free, options);
/* The radio frame and box */
if (! gimp_image_mask_is_empty (gimage))
{
options->add_mask_type = GIMP_ADD_SELECTION_MASK;
frame =
gimp_radio_group_new2 (TRUE, _("Initialize Layer Mask to:"),
frame = gimp_enum_radio_frame_new (GIMP_TYPE_ADD_MASK_TYPE,
gtk_label_new (_("Initialize Layer Mask to:")),
6,
G_CALLBACK (gimp_radio_button_update),
&options->add_mask_type,
GINT_TO_POINTER (options->add_mask_type),
&button);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (button),
GINT_TO_POINTER (options->add_mask_type));
_("Selection"),
GINT_TO_POINTER (GIMP_ADD_SELECTION_MASK), NULL,
_("Inverse Selection"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_SELECTION_MASK), NULL,
_("Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_COPY_MASK), NULL,
_("Inverse Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_COPY_MASK), NULL,
_("White (Full Opacity)"),
GINT_TO_POINTER (GIMP_ADD_WHITE_MASK), NULL,
_("Black (Full Transparency)"),
GINT_TO_POINTER (GIMP_ADD_BLACK_MASK), NULL,
_("Layer's Alpha Channel"),
GINT_TO_POINTER (GIMP_ADD_ALPHA_MASK), NULL,
NULL);
}
else
{
frame =
gimp_radio_group_new2 (TRUE, _("Initialize Layer Mask to:"),
G_CALLBACK (gimp_radio_button_update),
&options->add_mask_type,
GINT_TO_POINTER (options->add_mask_type),
_("Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_COPY_MASK), NULL,
_("Inverse Grayscale Copy of Layer"),
GINT_TO_POINTER (GIMP_ADD_INVERSE_COPY_MASK), NULL,
_("White (Full Opacity)"),
GINT_TO_POINTER (GIMP_ADD_WHITE_MASK), NULL,
_("Black (Full Transparency)"),
GINT_TO_POINTER (GIMP_ADD_BLACK_MASK), NULL,
_("Layer's Alpha Channel"),
GINT_TO_POINTER (GIMP_ADD_ALPHA_MASK), NULL,
NULL);
}
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
frame);
gtk_widget_show (frame);
sep = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (GTK_BIN (frame)->child), sep, FALSE, FALSE, 0);
gtk_widget_show (sep);
button = gtk_check_button_new_with_mnemonic (_("In_vert Mask"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), options->invert);
g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&options->invert);
gtk_box_pack_end (GTK_BOX (GTK_BIN (frame)->child), button, FALSE, FALSE, 0);
gtk_widget_show (button);
gtk_widget_show (options->query_box);
}

View File

@ -317,7 +317,7 @@ layer_create_mask_invoker (Gimp *gimp,
success = FALSE;
mask_type = args[1].value.pdb_int;
if (mask_type < GIMP_ADD_WHITE_MASK || mask_type > GIMP_ADD_INVERSE_COPY_MASK)
if (mask_type < GIMP_ADD_WHITE_MASK || mask_type > GIMP_ADD_COPY_MASK)
success = FALSE;
if (success)
@ -341,7 +341,7 @@ static ProcArg layer_create_mask_inargs[] =
{
GIMP_PDB_INT32,
"mask_type",
"The type of mask: { GIMP_ADD_WHITE_MASK (0), GIMP_ADD_BLACK_MASK (1), GIMP_ADD_ALPHA_MASK (2), GIMP_ADD_SELECTION_MASK (3), GIMP_ADD_INVERSE_SELECTION_MASK (4), GIMP_ADD_COPY_MASK (5), GIMP_ADD_INVERSE_COPY_MASK (6) }"
"The type of mask: { GIMP_ADD_WHITE_MASK (0), GIMP_ADD_BLACK_MASK (1), GIMP_ADD_ALPHA_MASK (2), GIMP_ADD_SELECTION_MASK (3), GIMP_ADD_COPY_MASK (4) }"
}
};
@ -358,7 +358,7 @@ static ProcRecord layer_create_mask_proc =
{
"gimp_layer_create_mask",
"Create a layer mask for the specified specified layer.",
"This procedure creates a layer mask for the specified layer. Layer masks serve as an additional alpha channel for a layer. Three different types of masks are allowed initially: completely white masks (which will leave the layer fully visible), completely black masks (which will give the layer complete transparency, and the layer's already existing alpha channel (which will leave the layer fully visible, but which may be more useful than a white mask). The layer mask still needs to be added to the layer. This can be done with a call to 'gimp_image_add_layer_mask'.",
"This procedure creates a layer mask for the specified layer. Layer masks serve as an additional alpha channel for a layer. A number of ifferent types of masks are allowed for initialisation: completely white masks (which will leave the layer fully visible), completely black masks (which will give the layer complete transparency, the layer's already existing alpha channel (which will leave the layer fully visible, but which may be more useful than a white mask), the current selection or a grayscale copy of the layer. The layer mask still needs to be added to the layer. This can be done with a call to 'gimp_image_add_layer_mask'.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",

View File

@ -158,7 +158,7 @@ gimp_enum_menu_new_with_range (GType enum_type,
if (value->value < minimum || value->value > maximum)
continue;
menu_item = gtk_menu_item_new_with_label (gettext (value->value_name));
menu_item = gtk_menu_item_new_with_mnemonic (gettext (value->value_name));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
@ -222,7 +222,8 @@ gimp_enum_menu_new_with_values_valist (GType enum_type,
if (value)
{
menu_item = gtk_menu_item_new_with_label (gettext (value->value_name));
menu_item =
gtk_menu_item_new_with_mnemonic (gettext (value->value_name));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
@ -403,7 +404,7 @@ gimp_enum_radio_box_new_with_range (GType enum_type,
if (value->value < minimum || value->value > maximum)
continue;
button = gtk_radio_button_new_with_label (group,
button = gtk_radio_button_new_with_mnemonic (group,
gettext (value->value_name));
if (first_button && *first_button == NULL)

View File

@ -24,9 +24,7 @@ Enums and definitions.
@GIMP_ADD_BLACK_MASK:
@GIMP_ADD_ALPHA_MASK:
@GIMP_ADD_SELECTION_MASK:
@GIMP_ADD_INVERSE_SELECTION_MASK:
@GIMP_ADD_COPY_MASK:
@GIMP_ADD_INVERSE_COPY_MASK:
<!-- ##### ENUM GimpBlendMode ##### -->
<para>

View File

@ -30,9 +30,7 @@ typedef enum
GIMP_ADD_BLACK_MASK,
GIMP_ADD_ALPHA_MASK,
GIMP_ADD_SELECTION_MASK,
GIMP_ADD_INVERSE_SELECTION_MASK,
GIMP_ADD_COPY_MASK,
GIMP_ADD_INVERSE_COPY_MASK
GIMP_ADD_COPY_MASK
} GimpAddMaskType;
typedef enum

View File

@ -124,14 +124,15 @@ _gimp_layer_copy (gint32 layer_ID,
* Create a layer mask for the specified specified layer.
*
* This procedure creates a layer mask for the specified layer. Layer
* masks serve as an additional alpha channel for a layer. Three
* different types of masks are allowed initially: completely white
* masks (which will leave the layer fully visible), completely black
* masks (which will give the layer complete transparency, and the
* masks serve as an additional alpha channel for a layer. A number of
* ifferent types of masks are allowed for initialisation: completely
* white masks (which will leave the layer fully visible), completely
* black masks (which will give the layer complete transparency, the
* layer's already existing alpha channel (which will leave the layer
* fully visible, but which may be more useful than a white mask). The
* layer mask still needs to be added to the layer. This can be done
* with a call to 'gimp_image_add_layer_mask'.
* fully visible, but which may be more useful than a white mask), the
* current selection or a grayscale copy of the layer. The layer mask
* still needs to be added to the layer. This can be done with a call
* to 'gimp_image_add_layer_mask'.
*
* Returns: The newly created mask.
*/

View File

@ -38,9 +38,7 @@ ADD_WHITE_MASK = 0
ADD_BLACK_MASK = 1
ADD_ALPHA_MASK = 2
ADD_SELECTION_MASK = 3
ADD_INVERSE_SELECTION_MASK = 4
ADD_COPY_MASK = 5
ADD_INVERSE_COPY_MASK = 6
ADD_COPY_MASK = 4
# GimpBlendMode
FG_BG_RGB_MODE = 0

View File

@ -277,10 +277,6 @@ init_constants (void)
setvar (cintern ("WHITE-MASK"), flocons (GIMP_ADD_WHITE_MASK), NIL);
setvar (cintern ("BLACK-MASK"), flocons (GIMP_ADD_BLACK_MASK), NIL);
setvar (cintern ("ALPHA-MASK"), flocons (GIMP_ADD_ALPHA_MASK), NIL);
setvar (cintern ("SELECTION-MASK"), flocons (GIMP_ADD_SELECTION_MASK), NIL);
setvar (cintern ("INV-SELECTION-MASK"), flocons (GIMP_ADD_INVERSE_SELECTION_MASK), NIL);
setvar (cintern ("COPY-MASK"), flocons (GIMP_ADD_COPY_MASK), NIL);
setvar (cintern ("INV-COPY-MASK"), flocons (GIMP_ADD_INVERSE_COPY_MASK), NIL);
setvar (cintern ("ADD"), flocons (GIMP_CHANNEL_OP_ADD), NIL);
setvar (cintern ("SUB"), flocons (GIMP_CHANNEL_OP_SUBTRACT), NIL);

View File

@ -27,9 +27,7 @@ init_generated_constants (void)
setvar (cintern ("ADD-BLACK-MASK"), flocons (1), NIL);
setvar (cintern ("ADD-ALPHA-MASK"), flocons (2), NIL);
setvar (cintern ("ADD-SELECTION-MASK"), flocons (3), NIL);
setvar (cintern ("ADD-INVERSE-SELECTION-MASK"), flocons (4), NIL);
setvar (cintern ("ADD-COPY-MASK"), flocons (5), NIL);
setvar (cintern ("ADD-INVERSE-COPY-MASK"), flocons (6), NIL);
setvar (cintern ("ADD-COPY-MASK"), flocons (4), NIL);
setvar (cintern ("FG-BG-RGB-MODE"), flocons (0), NIL);
setvar (cintern ("FG-BG-HSV-MODE"), flocons (1), NIL);

View File

@ -277,10 +277,6 @@ init_constants (void)
setvar (cintern ("WHITE-MASK"), flocons (GIMP_ADD_WHITE_MASK), NIL);
setvar (cintern ("BLACK-MASK"), flocons (GIMP_ADD_BLACK_MASK), NIL);
setvar (cintern ("ALPHA-MASK"), flocons (GIMP_ADD_ALPHA_MASK), NIL);
setvar (cintern ("SELECTION-MASK"), flocons (GIMP_ADD_SELECTION_MASK), NIL);
setvar (cintern ("INV-SELECTION-MASK"), flocons (GIMP_ADD_INVERSE_SELECTION_MASK), NIL);
setvar (cintern ("COPY-MASK"), flocons (GIMP_ADD_COPY_MASK), NIL);
setvar (cintern ("INV-COPY-MASK"), flocons (GIMP_ADD_INVERSE_COPY_MASK), NIL);
setvar (cintern ("ADD"), flocons (GIMP_CHANNEL_OP_ADD), NIL);
setvar (cintern ("SUB"), flocons (GIMP_CHANNEL_OP_SUBTRACT), NIL);

View File

@ -326,15 +326,12 @@ package Gimp::CodeGen::enums;
header => 'core/core-enums.h',
symbols => [ qw(GIMP_ADD_WHITE_MASK GIMP_ADD_BLACK_MASK
GIMP_ADD_ALPHA_MASK GIMP_ADD_SELECTION_MASK
GIMP_ADD_INVERSE_SELECTION_MASK GIMP_ADD_COPY_MASK
GIMP_ADD_INVERSE_COPY_MASK) ],
GIMP_ADD_COPY_MASK) ],
mapping => { GIMP_ADD_WHITE_MASK => '0',
GIMP_ADD_BLACK_MASK => '1',
GIMP_ADD_ALPHA_MASK => '2',
GIMP_ADD_SELECTION_MASK => '3',
GIMP_ADD_INVERSE_SELECTION_MASK => '4',
GIMP_ADD_COPY_MASK => '5',
GIMP_ADD_INVERSE_COPY_MASK => '6' }
GIMP_ADD_COPY_MASK => '4' }
},
GimpMaskApplyMode =>
{ contig => 1,

View File

@ -299,11 +299,12 @@ sub layer_create_mask {
$help = <<'HELP';
This procedure creates a layer mask for the specified layer. Layer masks serve
as an additional alpha channel for a layer. Three different types of masks are
allowed initially: completely white masks (which will leave the layer fully
visible), completely black masks (which will give the layer complete
transparency, and the layer's already existing alpha channel (which will leave
the layer fully visible, but which may be more useful than a white mask). The
as an additional alpha channel for a layer. A number of ifferent types of
masks are allowed for initialisation: completely white masks (which will
leave the layer fully visible), completely black masks (which will give the
layer complete transparency, the layer's already existing alpha channel
(which will leave the layer fully visible, but which may be more useful than
a white mask), the current selection or a grayscale copy of the layer. The
layer mask still needs to be added to the layer. This can be done with a call
to 'gimp_image_add_layer_mask'.
HELP