
2006-05-14 Michael Natterer <mitch@gimp.org> Allow to initialize a new layer mask with any of the image's channels. Fixes bug #310207. * libgimpbase/gimpbaseenums.h (enum GimpAddMaskType): added value GIMP_ADD_CHANNEL_MASK. * libgimpbase/gimpbaseenums.c * tools/pdbgen/enums.pl: regenerated. * app/core/gimplayer.[ch] (gimp_layer_create_mask): added GimpChannel* parameter. Hacked the GIMP_ADD_SELECTION_MASK code a bit so it can handle GIMP_ADD_CHANNEL_MASK too. Cleaned up the function a bit. * app/dialogs/layer-add-mask-dialog.[ch]: added a menu of the image's channels. * app/actions/layers-commands.c (layers_add_mask_response): pass the channel selected in the menu to gimp_layer_create_mask(). * tools/pdbgen/pdb/layer.pdb (layer_create_mask): use the image's active channel when GIMP_ADD_CHANNEL_MASK is passed. Fail if there is no active channel. * app/pdb/layer_cmds.c: regenerated.
43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef __LAYER_ADD_MASK_DIALOG_H__
|
|
#define __LAYER_ADD_MASK_DIALOG_H__
|
|
|
|
|
|
typedef struct _LayerAddMaskDialog LayerAddMaskDialog;
|
|
|
|
struct _LayerAddMaskDialog
|
|
{
|
|
GtkWidget *dialog;
|
|
|
|
GimpLayer *layer;
|
|
GimpAddMaskType add_mask_type;
|
|
GimpChannel *channel;
|
|
gboolean invert;
|
|
};
|
|
|
|
|
|
LayerAddMaskDialog * layer_add_mask_dialog_new (GimpLayer *layer,
|
|
GtkWidget *parent,
|
|
GimpAddMaskType add_mask_type,
|
|
gboolean invert);
|
|
|
|
|
|
#endif /* __LAYER_ADD_MASK_DIALOG_H__ */
|