app/Makefile.am new files cut out of layer.[ch]. Renamed all functions to

2001-01-28  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/gimplayermask.[ch]: new files cut out of layer.[ch]. Renamed
	all functions to gimp_layes_mask_*(). removed artefacts like
	the ref/unref functions.

	* app/apptypes.h: removed the "LayerMask" typedef.

	* app/layer.[ch]: removed the layer mask stuff and renamed all
	functions to gimp_layer_*(). Added temporary typedefs for the old
	function names. The layer mask preview stuff is still there (should
	probably go to new layer_preview.{ch] files).

	* app/gimpimage.[ch]: added
	gimp_image_invalidate_[layer|channel]_previews() formerly known as
	[layer|channel]_invalidate_previews().

	* app/channel.[ch]: moved channel_layer_alpha() and
	channel_layer_mask() here because they are methods of the Channel.

	* app/channel_ops.c
	* app/convert.c
	* app/disp_callbacks.c
	* app/fileops.c
	* app/floating_sel.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/gimpdnd.c
	* app/global_edit.c
	* app/layers_dialog.c
	* app/preferences_dialog.c
	* app/toolbox.c
	* app/undo.c
	* app/xcf.c
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/tools/crop.c
	* app/tools/text_tool.c
	* app/tools/transform_core.c
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/drawable.pdb: changed accordingly, cleanup.
This commit is contained in:
Michael Natterer 2001-01-28 16:44:22 +00:00 committed by Michael Natterer
parent 41746cb56e
commit 8ddebdf79a
81 changed files with 4075 additions and 3695 deletions

View File

@ -1,3 +1,47 @@
2001-01-28 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/gimplayermask.[ch]: new files cut out of layer.[ch]. Renamed
all functions to gimp_layes_mask_*(). removed artefacts like
the ref/unref functions.
* app/apptypes.h: removed the "LayerMask" typedef.
* app/layer.[ch]: removed the layer mask stuff and renamed all
functions to gimp_layer_*(). Added temporary typedefs for the old
function names. The layer mask preview stuff is still there (should
probably go to new layer_preview.{ch] files).
* app/gimpimage.[ch]: added
gimp_image_invalidate_[layer|channel]_previews() formerly known as
[layer|channel]_invalidate_previews().
* app/channel.[ch]: moved channel_layer_alpha() and
channel_layer_mask() here because they are methods of the Channel.
* app/channel_ops.c
* app/convert.c
* app/disp_callbacks.c
* app/fileops.c
* app/floating_sel.c
* app/gimage.c
* app/gimage_mask.c
* app/gimpdnd.c
* app/global_edit.c
* app/layers_dialog.c
* app/preferences_dialog.c
* app/toolbox.c
* app/undo.c
* app/xcf.c
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/tools/crop.c
* app/tools/text_tool.c
* app/tools/transform_core.c
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/drawable.pdb: changed accordingly, cleanup.
2001-01-26 Daniel Egger <egger@suse.de> 2001-01-26 Daniel Egger <egger@suse.de>
* plug-ins/common/iwarp.c: Cleaned up code and * plug-ins/common/iwarp.c: Cleaned up code and

View File

@ -125,6 +125,8 @@ gimp_SOURCES = \
gimphistogram.h \ gimphistogram.h \
gimpimage.c \ gimpimage.c \
gimpimage.h \ gimpimage.h \
gimplayermask.c \
gimplayermask.h \
gimplist.c \ gimplist.c \
gimplist.h \ gimplist.h \
gimplut.c \ gimplut.c \

View File

@ -50,7 +50,6 @@ typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask; typedef struct _GimpLayerMask GimpLayerMask;
typedef GimpLayer Layer; /* convenience */ typedef GimpLayer Layer; /* convenience */
typedef GimpLayerMask LayerMask; /* convenience */
typedef struct _GimpImage GimpImage; typedef struct _GimpImage GimpImage;
typedef GimpImage GImage; typedef GimpImage GImage;
@ -148,11 +147,11 @@ typedef struct _TransformCore TransformCore;
/* some undo stuff */ /* some undo stuff */
typedef struct _layer_undo LayerUndo; typedef struct _LayerUndo LayerUndo;
typedef struct _layer_mask_undo LayerMaskUndo; typedef struct _LayerMaskUndo LayerMaskUndo;
typedef struct _fs_to_layer_undo FStoLayerUndo; typedef struct _FStoLayerUndo FStoLayerUndo;
typedef GSList PathUndo; typedef GSList PathUndo;

View File

@ -546,24 +546,6 @@ channel_preview_private (Channel *channel,
} }
} }
void
channel_invalidate_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
tmp = g_slist_next (tmp);
}
}
Tattoo Tattoo
channel_get_tattoo (const Channel *channel) channel_get_tattoo (const Channel *channel)
{ {
@ -1674,8 +1656,31 @@ channel_translate (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, channel_load (Channel *mask,
Layer *layer) Channel *channel)
{
PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */
channel_push_undo (mask);
/* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, TRUE);
copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE;
}
void
channel_layer_alpha (Channel *mask,
GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
@ -1710,23 +1715,39 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_load (Channel *mask, channel_layer_mask (Channel *mask,
Channel *channel) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0;
gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); channel_push_undo (mask);
/* copy the channel to the mask */ /* clear the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
0, 0, 0, 0,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (channel)->height, FALSE); TRUE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, color_region (&destPR, &empty);
0, 0,
GIMP_DRAWABLE (channel)->width, x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
GIMP_DRAWABLE (channel)->height, TRUE); y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);
copy_region (&srcPR, &destPR); copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE; mask->bounds_known = FALSE;

View File

@ -127,8 +127,6 @@ TempBuf * channel_preview (Channel *channel,
gint width, gint width,
gint height); gint height);
void channel_invalidate_previews (GimpImage *gimage);
Tattoo channel_get_tattoo (const Channel *channel); Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel, void channel_set_tattoo (Channel *channel,
Tattoo value); Tattoo value);
@ -215,6 +213,11 @@ void channel_translate (Channel *mask,
void channel_load (Channel *mask, void channel_load (Channel *mask,
Channel *channel); Channel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void channel_invalidate_bounds (Channel *channel);

View File

@ -29,6 +29,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "channel_ops.h" #include "channel_ops.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "drawable.h" #include "drawable.h"

View File

@ -1457,7 +1457,7 @@ convert_image (GImage *gimage,
undo_push_group_end (gimage); undo_push_group_end (gimage);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
layer_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_title (gimage); gdisplays_update_title (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);

View File

@ -34,6 +34,7 @@
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimplayermask.h"
#include "global_edit.h" #include "global_edit.h"
#include "layer.h" #include "layer.h"
#include "paint_funcs.h" #include "paint_funcs.h"

View File

@ -546,24 +546,6 @@ channel_preview_private (Channel *channel,
} }
} }
void
channel_invalidate_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
tmp = g_slist_next (tmp);
}
}
Tattoo Tattoo
channel_get_tattoo (const Channel *channel) channel_get_tattoo (const Channel *channel)
{ {
@ -1674,8 +1656,31 @@ channel_translate (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, channel_load (Channel *mask,
Layer *layer) Channel *channel)
{
PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */
channel_push_undo (mask);
/* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, TRUE);
copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE;
}
void
channel_layer_alpha (Channel *mask,
GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
@ -1710,23 +1715,39 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_load (Channel *mask, channel_layer_mask (Channel *mask,
Channel *channel) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0;
gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); channel_push_undo (mask);
/* copy the channel to the mask */ /* clear the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
0, 0, 0, 0,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (channel)->height, FALSE); TRUE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, color_region (&destPR, &empty);
0, 0,
GIMP_DRAWABLE (channel)->width, x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
GIMP_DRAWABLE (channel)->height, TRUE); y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);
copy_region (&srcPR, &destPR); copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE; mask->bounds_known = FALSE;

View File

@ -127,8 +127,6 @@ TempBuf * channel_preview (Channel *channel,
gint width, gint width,
gint height); gint height);
void channel_invalidate_previews (GimpImage *gimage);
Tattoo channel_get_tattoo (const Channel *channel); Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel, void channel_set_tattoo (Channel *channel,
Tattoo value); Tattoo value);
@ -215,6 +213,11 @@ void channel_translate (Channel *mask,
void channel_load (Channel *mask, void channel_load (Channel *mask,
Channel *channel); Channel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void channel_invalidate_bounds (Channel *channel);

View File

@ -546,24 +546,6 @@ channel_preview_private (Channel *channel,
} }
} }
void
channel_invalidate_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
tmp = g_slist_next (tmp);
}
}
Tattoo Tattoo
channel_get_tattoo (const Channel *channel) channel_get_tattoo (const Channel *channel)
{ {
@ -1674,8 +1656,31 @@ channel_translate (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, channel_load (Channel *mask,
Layer *layer) Channel *channel)
{
PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */
channel_push_undo (mask);
/* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, TRUE);
copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE;
}
void
channel_layer_alpha (Channel *mask,
GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
@ -1710,23 +1715,39 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_load (Channel *mask, channel_layer_mask (Channel *mask,
Channel *channel) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0;
gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); channel_push_undo (mask);
/* copy the channel to the mask */ /* clear the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
0, 0, 0, 0,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (channel)->height, FALSE); TRUE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, color_region (&destPR, &empty);
0, 0,
GIMP_DRAWABLE (channel)->width, x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
GIMP_DRAWABLE (channel)->height, TRUE); y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);
copy_region (&srcPR, &destPR); copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE; mask->bounds_known = FALSE;

View File

@ -127,8 +127,6 @@ TempBuf * channel_preview (Channel *channel,
gint width, gint width,
gint height); gint height);
void channel_invalidate_previews (GimpImage *gimage);
Tattoo channel_get_tattoo (const Channel *channel); Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel, void channel_set_tattoo (Channel *channel,
Tattoo value); Tattoo value);
@ -215,6 +213,11 @@ void channel_translate (Channel *mask,
void channel_load (Channel *mask, void channel_load (Channel *mask,
Channel *channel); Channel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void channel_invalidate_bounds (Channel *channel);

View File

@ -29,6 +29,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "channel_ops.h" #include "channel_ops.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "drawable.h" #include "drawable.h"

View File

@ -34,6 +34,7 @@
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimplayermask.h"
#include "global_edit.h" #include "global_edit.h"
#include "layer.h" #include "layer.h"
#include "paint_funcs.h" #include "paint_funcs.h"

View File

@ -1457,7 +1457,7 @@ convert_image (GImage *gimage,
undo_push_group_end (gimage); undo_push_group_end (gimage);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
layer_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_title (gimage); gdisplays_update_title (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);

View File

@ -29,6 +29,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "channel_ops.h" #include "channel_ops.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "drawable.h" #include "drawable.h"

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -24,10 +24,12 @@
#include "appenv.h" #include "appenv.h"
#include "boundary.h" #include "boundary.h"
#include "channel.h"
#include "drawable.h" #include "drawable.h"
#include "floating_sel.h" #include "floating_sel.h"
#include "gdisplay.h" #include "gdisplay.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
@ -331,7 +333,7 @@ gimage_mask_extract (GImage *gimage,
else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable)) else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable))
{ {
gimp_image_remove_layer_mask (gimage, gimp_image_remove_layer_mask (gimage,
layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)),
DISCARD); DISCARD);
} }
else if (cut_gimage && GIMP_IS_CHANNEL (drawable)) else if (cut_gimage && GIMP_IS_CHANNEL (drawable))

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -34,6 +34,7 @@
#include "gdisplay_ops.h" #include "gdisplay_ops.h"
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimplayermask.h"
#include "gimpparasite.h" #include "gimpparasite.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
@ -72,7 +73,7 @@ typedef enum
} UndoState; } UndoState;
typedef gboolean (* UndoPopFunc) (GImage *, UndoState, UndoType, gpointer); typedef gboolean (* UndoPopFunc) (GimpImage *, UndoState, UndoType, gpointer);
typedef void (* UndoFreeFunc) (UndoState, UndoType, gpointer); typedef void (* UndoFreeFunc) (UndoState, UndoType, gpointer);
typedef struct _Undo Undo; typedef struct _Undo Undo;
@ -91,47 +92,47 @@ struct _Undo
/* Pop functions */ /* Pop functions */
static gboolean undo_pop_image (GImage *, static gboolean undo_pop_image (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_mask (GImage *, static gboolean undo_pop_mask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_displace (GImage *, static gboolean undo_pop_layer_displace (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_transform (GImage *, static gboolean undo_pop_transform (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_paint (GImage *, static gboolean undo_pop_paint (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer (GImage *, static gboolean undo_pop_layer (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_mod (GImage *, static gboolean undo_pop_layer_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_mask (GImage *, static gboolean undo_pop_layer_mask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_channel (GImage *, static gboolean undo_pop_channel (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_channel_mod (GImage *, static gboolean undo_pop_channel_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_to_layer (GImage *, static gboolean undo_pop_fs_to_layer (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_rigor (GImage *, static gboolean undo_pop_fs_rigor (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_relax (GImage *, static gboolean undo_pop_fs_relax (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_gimage_mod (GImage *, static gboolean undo_pop_gimage_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_guide (GImage *, static gboolean undo_pop_guide (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_parasite (GImage *, static gboolean undo_pop_parasite (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_qmask (GImage *, static gboolean undo_pop_qmask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_resolution (GImage *, static gboolean undo_pop_resolution (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_rename (GImage *, static gboolean undo_pop_layer_rename (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_reposition (GImage *, static gboolean undo_pop_layer_reposition (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_cantundo (GImage *, static gboolean undo_pop_cantundo (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
@ -207,9 +208,9 @@ channel_size (Channel *channel)
static void static void
undo_free_list (GImage *gimage, undo_free_list (GimpImage *gimage,
UndoState state, UndoState state,
GSList *list) GSList *list)
{ {
GSList *orig; GSList *orig;
Undo *undo; Undo *undo;
@ -234,7 +235,7 @@ undo_free_list (GImage *gimage,
static GSList * static GSList *
remove_stack_bottom (GImage *gimage) remove_stack_bottom (GimpImage *gimage)
{ {
GSList *list; GSList *list;
GSList *last; GSList *last;
@ -303,7 +304,7 @@ undo_new (UndoType type,
static gboolean static gboolean
undo_free_up_space (GImage *gimage) undo_free_up_space (GimpImage *gimage)
{ {
/* If there are 0 levels of undo return FALSE. */ /* If there are 0 levels of undo return FALSE. */
if (levels_of_undo == 0) if (levels_of_undo == 0)
@ -320,10 +321,10 @@ undo_free_up_space (GImage *gimage)
static Undo * static Undo *
undo_push (GImage *gimage, undo_push (GimpImage *gimage,
glong size, glong size,
UndoType type, UndoType type,
gboolean dirties_image) gboolean dirties_image)
{ {
Undo *new; Undo *new;
@ -376,7 +377,7 @@ undo_push (GImage *gimage,
static gboolean static gboolean
pop_stack (GImage *gimage, pop_stack (GimpImage *gimage,
GSList **stack_ptr, GSList **stack_ptr,
GSList **unstack_ptr, GSList **unstack_ptr,
UndoState state) UndoState state)
@ -490,7 +491,7 @@ pop_stack (GImage *gimage,
gboolean gboolean
undo_pop (GImage *gimage) undo_pop (GimpImage *gimage)
{ {
/* Very bad idea to pop an action off the undo stack if we're in the /* Very bad idea to pop an action off the undo stack if we're in the
* middle of a group, since the whole group won't be popped. Might * middle of a group, since the whole group won't be popped. Might
@ -504,7 +505,7 @@ undo_pop (GImage *gimage)
gboolean gboolean
undo_redo (GImage *gimage) undo_redo (GimpImage *gimage)
{ {
/* ditto for redo stack */ /* ditto for redo stack */
g_return_val_if_fail (gimage->pushing_undo_group == UNDO_NULL, FALSE); g_return_val_if_fail (gimage->pushing_undo_group == UNDO_NULL, FALSE);
@ -558,7 +559,7 @@ undo_get_topitem_type (GSList *stack)
const gchar * const gchar *
undo_get_undo_name (GImage *gimage) undo_get_undo_name (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, NULL); g_return_val_if_fail (gimage != NULL, NULL);
@ -570,7 +571,7 @@ undo_get_undo_name (GImage *gimage)
} }
UndoType UndoType
undo_get_undo_top_type (GImage *gimage) undo_get_undo_top_type (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, UNDO_NULL); g_return_val_if_fail (gimage != NULL, UNDO_NULL);
@ -583,7 +584,7 @@ undo_get_undo_top_type (GImage *gimage)
const gchar * const gchar *
undo_get_redo_name (GImage *gimage) undo_get_redo_name (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, NULL); g_return_val_if_fail (gimage != NULL, NULL);
@ -631,7 +632,7 @@ undo_map_over_stack (GSList *stack,
} }
void void
undo_map_over_undo_stack (GImage *gimage, undo_map_over_undo_stack (GimpImage *gimage,
undo_map_fn fn, undo_map_fn fn,
gpointer data) gpointer data)
{ {
@ -641,7 +642,7 @@ undo_map_over_undo_stack (GImage *gimage,
} }
void void
undo_map_over_redo_stack (GImage *gimage, undo_map_over_redo_stack (GimpImage *gimage,
undo_map_fn fn, undo_map_fn fn,
gpointer data) gpointer data)
{ {
@ -652,7 +653,7 @@ undo_map_over_redo_stack (GImage *gimage,
void void
undo_free (GImage *gimage) undo_free (GimpImage *gimage)
{ {
undo_free_list (gimage, UNDO, gimage->undo_stack); undo_free_list (gimage, UNDO, gimage->undo_stack);
undo_free_list (gimage, REDO, gimage->redo_stack); undo_free_list (gimage, REDO, gimage->redo_stack);
@ -683,7 +684,7 @@ undo_free (GImage *gimage)
/* group Undo funcs */ /* group Undo funcs */
gboolean gboolean
undo_push_group_start (GImage *gimage, undo_push_group_start (GimpImage *gimage,
UndoType type) UndoType type)
{ {
Undo *boundary_marker; Undo *boundary_marker;
@ -733,7 +734,7 @@ undo_push_group_start (GImage *gimage,
gboolean gboolean
undo_push_group_end (GImage *gimage) undo_push_group_end (GimpImage *gimage)
{ {
Undo *boundary_marker; Undo *boundary_marker;
@ -778,7 +779,7 @@ struct _ImageUndo
gboolean gboolean
undo_push_image (GImage *gimage, undo_push_image (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gint x1, gint x1,
gint y1, gint y1,
@ -834,7 +835,7 @@ undo_push_image (GImage *gimage,
gboolean gboolean
undo_push_image_mod (GImage *gimage, undo_push_image_mod (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gint x1, gint x1,
gint y1, gint y1,
@ -893,7 +894,7 @@ undo_push_image_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_image (GImage *gimage, undo_pop_image (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer image_undo_ptr) gpointer image_undo_ptr)
@ -984,8 +985,8 @@ undo_free_image (UndoState state,
/* Mask Undo functions */ /* Mask Undo functions */
gboolean gboolean
undo_push_mask (GImage *gimage, undo_push_mask (GimpImage *gimage,
gpointer mask_ptr) gpointer mask_ptr)
{ {
Undo *new; Undo *new;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1019,19 +1020,19 @@ undo_push_mask (GImage *gimage,
static gboolean static gboolean
undo_pop_mask (GImage *gimage, undo_pop_mask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer mask_ptr) gpointer mask_ptr)
{ {
MaskUndo *mask_undo; MaskUndo *mask_undo;
TileManager *new_tiles; TileManager *new_tiles;
Channel *sel_mask; Channel *sel_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gint selection; gint selection;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint width, height; gint width, height;
guchar empty = 0; guchar empty = 0;
width = height = 0; width = height = 0;
@ -1135,7 +1136,7 @@ struct _LayerDisplayUndo
}; };
gboolean gboolean
undo_push_layer_displace (GImage *gimage, undo_push_layer_displace (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -1161,13 +1162,13 @@ undo_push_layer_displace (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_displace (GImage *gimage, undo_pop_layer_displace (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer info_ptr) gpointer info_ptr)
{ {
Layer *layer; GimpLayer *layer;
gint old_offsets[2]; gint old_offsets[2];
LayerDisplaceUndo *ldu; LayerDisplaceUndo *ldu;
ldu = (LayerDisplaceUndo *) info_ptr; ldu = (LayerDisplaceUndo *) info_ptr;
@ -1234,8 +1235,8 @@ undo_free_layer_displace (UndoState state,
/* Transform Undo */ /* Transform Undo */
gboolean gboolean
undo_push_transform (GImage *gimage, undo_push_transform (GimpImage *gimage,
gpointer tu_ptr) gpointer tu_ptr)
{ {
Undo *new; Undo *new;
@ -1257,7 +1258,7 @@ undo_push_transform (GImage *gimage,
static gboolean static gboolean
undo_pop_transform (GImage *gimage, undo_pop_transform (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer tu_ptr) gpointer tu_ptr)
@ -1265,8 +1266,8 @@ undo_pop_transform (GImage *gimage,
TransformCore *tc; TransformCore *tc;
TransformUndo *tu; TransformUndo *tu;
TileManager *temp; TileManager *temp;
gdouble d; gdouble d;
gint i; gint i;
/* Can't have ANY tool selected - maybe a plugin running */ /* Can't have ANY tool selected - maybe a plugin running */
if (active_tool == NULL) if (active_tool == NULL)
@ -1325,8 +1326,8 @@ undo_free_transform (UndoState state,
/* Paint Undo */ /* Paint Undo */
gboolean gboolean
undo_push_paint (GImage *gimage, undo_push_paint (GimpImage *gimage,
gpointer pu_ptr) gpointer pu_ptr)
{ {
Undo *new; Undo *new;
@ -1348,7 +1349,7 @@ undo_push_paint (GImage *gimage,
static gboolean static gboolean
undo_pop_paint (GImage *gimage, undo_pop_paint (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer pu_ptr) gpointer pu_ptr)
@ -1409,9 +1410,9 @@ undo_free_paint (UndoState state,
/* New Layer Undo */ /* New Layer Undo */
gboolean gboolean
undo_push_layer (GImage *gimage, undo_push_layer (GimpImage *gimage,
UndoType type, UndoType type,
gpointer lu_ptr) gpointer lu_ptr)
{ {
LayerUndo *lu; LayerUndo *lu;
Undo *new; Undo *new;
@ -1445,7 +1446,7 @@ undo_push_layer (GImage *gimage,
static gboolean static gboolean
undo_pop_layer (GImage *gimage, undo_pop_layer (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer lu_ptr) gpointer lu_ptr)
@ -1533,10 +1534,10 @@ undo_free_layer (UndoState state,
/* Layer Mod Undo */ /* Layer Mod Undo */
gboolean gboolean
undo_push_layer_mod (GImage *gimage, undo_push_layer_mod (GimpImage *gimage,
gpointer layer_ptr) gpointer layer_ptr)
{ {
Layer *layer; GimpLayer *layer;
Undo *new; Undo *new;
TileManager *tiles; TileManager *tiles;
gpointer *data; gpointer *data;
@ -1574,7 +1575,7 @@ undo_push_layer_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_mod (GImage *gimage, undo_pop_layer_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -1583,10 +1584,10 @@ undo_pop_layer_mod (GImage *gimage,
gint layer_type; gint layer_type;
TileManager *tiles; TileManager *tiles;
TileManager *temp; TileManager *temp;
Layer *layer; GimpLayer *layer;
data = (gpointer *) data_ptr; data = (gpointer *) data_ptr;
layer = (Layer *) data[0]; layer = (GimpLayer *) data[0];
tiles = (TileManager *) data[1]; tiles = (TileManager *) data[1];
@ -1656,9 +1657,9 @@ undo_free_layer_mod (UndoState state,
/* Layer Mask Undo */ /* Layer Mask Undo */
gboolean gboolean
undo_push_layer_mask (GImage *gimage, undo_push_layer_mask (GimpImage *gimage,
UndoType type, UndoType type,
gpointer lmu_ptr) gpointer lmu_ptr)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
Undo *new; Undo *new;
@ -1683,7 +1684,8 @@ undo_push_layer_mask (GImage *gimage,
else else
{ {
if (type == LAYER_MASK_REMOVE_UNDO) if (type == LAYER_MASK_REMOVE_UNDO)
layer_mask_delete (lmu->mask); gtk_object_unref (GTK_OBJECT (lmu->mask));
g_free (lmu); g_free (lmu);
return FALSE; return FALSE;
} }
@ -1691,7 +1693,7 @@ undo_push_layer_mask (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_mask (GImage *gimage, undo_pop_layer_mask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer lmu_ptr) gpointer lmu_ptr)
@ -1758,7 +1760,7 @@ undo_free_layer_mask (UndoState state,
*/ */
if ((state == REDO && type == LAYER_MASK_ADD_UNDO) || if ((state == REDO && type == LAYER_MASK_ADD_UNDO) ||
(state == UNDO && type == LAYER_MASK_REMOVE_UNDO)) (state == UNDO && type == LAYER_MASK_REMOVE_UNDO))
layer_mask_delete (lmu->mask); gtk_object_unref (GTK_OBJECT (lmu->mask));
g_free (lmu); g_free (lmu);
} }
@ -1768,13 +1770,13 @@ undo_free_layer_mask (UndoState state,
/* New Channel Undo */ /* New Channel Undo */
gboolean gboolean
undo_push_channel (GImage *gimage, undo_push_channel (GimpImage *gimage,
UndoType type, UndoType type,
gpointer cu_ptr) gpointer cu_ptr)
{ {
ChannelUndo *cu; ChannelUndo *cu;
Undo *new; Undo *new;
gint size; gint size;
g_return_val_if_fail (type == CHANNEL_ADD_UNDO || g_return_val_if_fail (type == CHANNEL_ADD_UNDO ||
type == CHANNEL_REMOVE_UNDO, type == CHANNEL_REMOVE_UNDO,
@ -1803,7 +1805,7 @@ undo_push_channel (GImage *gimage,
static gboolean static gboolean
undo_pop_channel (GImage *gimage, undo_pop_channel (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer cu_ptr) gpointer cu_ptr)
@ -1879,8 +1881,8 @@ undo_free_channel (UndoState state,
/* Channel Mod Undo */ /* Channel Mod Undo */
gboolean gboolean
undo_push_channel_mod (GImage *gimage, undo_push_channel_mod (GimpImage *gimage,
gpointer channel_ptr) gpointer channel_ptr)
{ {
Channel *channel; Channel *channel;
TileManager *tiles; TileManager *tiles;
@ -1915,7 +1917,7 @@ undo_push_channel_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_channel_mod (GImage *gimage, undo_pop_channel_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -1972,11 +1974,11 @@ undo_free_channel_mod (UndoState state,
/* Floating Selection to Layer Undo */ /* Floating Selection to Layer Undo */
gboolean gboolean
undo_push_fs_to_layer (GImage *gimage, undo_push_fs_to_layer (GimpImage *gimage,
gpointer fsu_ptr) gpointer fsu_ptr)
{ {
FStoLayerUndo *fsu; FStoLayerUndo *fsu;
Undo *new; Undo *new;
fsu = (FStoLayerUndo *) fsu_ptr; fsu = (FStoLayerUndo *) fsu_ptr;
@ -1999,7 +2001,7 @@ undo_push_fs_to_layer (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_to_layer (GImage *gimage, undo_pop_fs_to_layer (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer fsu_ptr) gpointer fsu_ptr)
@ -2079,8 +2081,8 @@ undo_free_fs_to_layer (UndoState state,
/* Floating Selection Rigor Undo */ /* Floating Selection Rigor Undo */
gboolean gboolean
undo_push_fs_rigor (GImage *gimage, undo_push_fs_rigor (GimpImage *gimage,
gint layer_ID) gint layer_ID)
{ {
Undo *new; Undo *new;
@ -2101,7 +2103,7 @@ undo_push_fs_rigor (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_rigor (GImage *gimage, undo_pop_fs_rigor (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer layer_ptr) gpointer layer_ptr)
@ -2158,8 +2160,8 @@ undo_free_fs_rigor (UndoState state,
/* Floating Selection Relax Undo */ /* Floating Selection Relax Undo */
gboolean gboolean
undo_push_fs_relax (GImage *gimage, undo_push_fs_relax (GimpImage *gimage,
gint32 layer_ID) gint32 layer_ID)
{ {
Undo *new; Undo *new;
@ -2180,7 +2182,7 @@ undo_push_fs_relax (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_relax (GImage *gimage, undo_pop_fs_relax (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer layer_ptr) gpointer layer_ptr)
@ -2237,7 +2239,7 @@ undo_free_fs_relax (UndoState state,
/* GImage Mod Undo */ /* GImage Mod Undo */
gboolean gboolean
undo_push_gimage_mod (GImage *gimage) undo_push_gimage_mod (GimpImage *gimage)
{ {
Undo *new; Undo *new;
gint *data; gint *data;
@ -2262,7 +2264,7 @@ undo_push_gimage_mod (GImage *gimage)
static gboolean static gboolean
undo_pop_gimage_mod (GImage *gimage, undo_pop_gimage_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2284,8 +2286,8 @@ undo_pop_gimage_mod (GImage *gimage,
gimp_image_projection_realloc (gimage); gimp_image_projection_realloc (gimage);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
channel_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
layer_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);
gdisplays_update_title (gimage); gdisplays_update_title (gimage);
@ -2314,13 +2316,13 @@ typedef struct _QmaskUndo QmaskUndo;
struct _QmaskUndo struct _QmaskUndo
{ {
GImage *gimage; GimpImage *gimage;
gboolean qmask; gboolean qmask;
}; };
gboolean gboolean
undo_push_qmask (GImage *gimage) undo_push_qmask (GimpImage *gimage)
{ {
Undo *new; Undo *new;
QmaskUndo *data; QmaskUndo *data;
@ -2343,7 +2345,7 @@ undo_push_qmask (GImage *gimage)
} }
static gboolean static gboolean
undo_pop_qmask (GImage *gimage, undo_pop_qmask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2379,14 +2381,14 @@ typedef struct _GuideUndo GuideUndo;
struct _GuideUndo struct _GuideUndo
{ {
GImage *gimage; GimpImage *gimage;
Guide *guide; Guide *guide;
Guide orig; Guide orig;
}; };
gboolean gboolean
undo_push_guide (GImage *gimage, undo_push_guide (GimpImage *gimage,
gpointer guide) gpointer guide)
{ {
Undo *new; Undo *new;
GuideUndo *data; GuideUndo *data;
@ -2413,7 +2415,7 @@ undo_push_guide (GImage *gimage,
static gboolean static gboolean
undo_pop_guide (GImage *gimage, undo_pop_guide (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2469,7 +2471,7 @@ struct _ResolutionUndo
}; };
gboolean gboolean
undo_push_resolution (GImage *gimage) undo_push_resolution (GimpImage *gimage)
{ {
Undo *new; Undo *new;
ResolutionUndo *data; ResolutionUndo *data;
@ -2493,7 +2495,7 @@ undo_push_resolution (GImage *gimage)
} }
static gboolean static gboolean
undo_pop_resolution (GImage *gimage, undo_pop_resolution (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2541,15 +2543,15 @@ typedef struct _ParasiteUndo ParasiteUndo;
struct _ParasiteUndo struct _ParasiteUndo
{ {
GImage *gimage; GimpImage *gimage;
GimpDrawable *drawable; GimpDrawable *drawable;
GimpParasite *parasite; GimpParasite *parasite;
gchar *name; gchar *name;
}; };
gboolean gboolean
undo_push_image_parasite (GImage *gimage, undo_push_image_parasite (GimpImage *gimage,
gpointer parasite) gpointer parasite)
{ {
Undo *new; Undo *new;
ParasiteUndo *data; ParasiteUndo *data;
@ -2574,7 +2576,7 @@ undo_push_image_parasite (GImage *gimage,
} }
gboolean gboolean
undo_push_image_parasite_remove (GImage *gimage, undo_push_image_parasite_remove (GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Undo *new; Undo *new;
@ -2600,7 +2602,7 @@ undo_push_image_parasite_remove (GImage *gimage,
} }
gboolean gboolean
undo_push_drawable_parasite (GImage *gimage, undo_push_drawable_parasite (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gpointer parasite) gpointer parasite)
{ {
@ -2626,7 +2628,7 @@ undo_push_drawable_parasite (GImage *gimage,
} }
gboolean gboolean
undo_push_drawable_parasite_remove (GImage *gimage, undo_push_drawable_parasite_remove (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
const gchar *name) const gchar *name)
{ {
@ -2653,7 +2655,7 @@ undo_push_drawable_parasite_remove (GImage *gimage,
static gboolean static gboolean
undo_pop_parasite (GImage *gimage, undo_pop_parasite (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2732,7 +2734,7 @@ struct _LayerRepositionUndo
}; };
gboolean gboolean
undo_push_layer_reposition (GImage *gimage, undo_push_layer_reposition (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -2756,13 +2758,13 @@ undo_push_layer_reposition (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_layer_reposition (GImage *gimage, undo_pop_layer_reposition (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
void *data_ptr) void *data_ptr)
{ {
LayerRepositionUndo *data = data_ptr; LayerRepositionUndo *data = data_ptr;
gint tmp; gint tmp;
/* what's the layer's current index? */ /* what's the layer's current index? */
tmp = g_slist_index (gimage->layers, data->layer); tmp = g_slist_index (gimage->layers, data->layer);
@ -2795,7 +2797,7 @@ struct _LayerRenameUndo
}; };
gboolean gboolean
undo_push_layer_rename (GImage *gimage, undo_push_layer_rename (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -2819,13 +2821,13 @@ undo_push_layer_rename (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_layer_rename (GImage *gimage, undo_pop_layer_rename (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
void *data_ptr) void *data_ptr)
{ {
LayerRenameUndo *data = data_ptr; LayerRenameUndo *data = data_ptr;
gchar *tmp; gchar *tmp;
tmp = g_strdup (layer_get_name (data->layer)); tmp = g_strdup (layer_get_name (data->layer));
layer_set_name (data->layer, data->old_name); layer_set_name (data->layer, data->old_name);
@ -2854,7 +2856,7 @@ undo_free_layer_rename (UndoState state,
*/ */
gboolean gboolean
undo_push_cantundo (GImage *gimage, undo_push_cantundo (GimpImage *gimage,
const gchar *action) const gchar *action)
{ {
Undo *new; Undo *new;
@ -2875,7 +2877,7 @@ undo_push_cantundo (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_cantundo (GImage *gimage, undo_pop_cantundo (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -32,6 +32,7 @@
#include "gdisplay.h" #include "gdisplay.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "paint_funcs.h" #include "paint_funcs.h"
#include "pixel_region.h" #include "pixel_region.h"
#include "tile_manager.h" #include "tile_manager.h"

File diff suppressed because it is too large Load Diff

View File

@ -16,29 +16,55 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __LAYER_H__ #ifndef __GIMP_LAYER_H__
#define __LAYER_H__ #define __GIMP_LAYER_H__
#include "channel.h"
#include "gimpdrawable.h" #include "gimpdrawable.h"
#define GIMP_TYPE_LAYER (gimp_layer_get_type ()) /* EEK */
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ()) #define layer_new gimp_layer_new
#define GIMP_LAYER_MASK(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask)) #define layer_copy gimp_layer_copy
#define GIMP_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass)) #define layer_create_mask gimp_layer_create_mask
#define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define layer_scale gimp_layer_scale
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) #define layer_resize gimp_layer_resize
#define layer_delete gimp_layer_delete
#define layer_translate gimp_layer_translate
#define layer_get_name gimp_layer_get_name
#define layer_set_name gimp_layer_set_name
#define layer_get_tattoo gimp_layer_get_tattoo
#define layer_set_tattoo gimp_layer_set_tattoo
#define layer_add_alpha gimp_layer_add_alpha
#define layer_has_alpha gimp_layer_has_alpha
#define layer_preview gimp_layer_preview
#define layer_is_floating_sel gimp_layer_is_floating_sel
#define layer_invalidate_previews gimp_layer_invalidate_previews
#define layer_linked gimp_layer_linked
#define layer_get_mask gimp_layer_get_mask
#define layer_new_from_tiles gimp_layer_new_from_tiles
#define layer_resize_to_image gimp_layer_resize_to_image
#define layer_invalidate_boundary gimp_layer_invalidate_boundary
#define layer_scale_by_factors gimp_layer_scale_by_factors
#define layer_boundary gimp_layer_boundary
#define layer_pick_correlate gimp_layer_pick_correlate
#define layer_apply_mask gimp_layer_apply_mask
#define layer_add_mask gimp_layer_add_mask
#define layer_check_scaling gimp_layer_check_scaling
#define gimp_drawable_layer GIMP_IS_LAYER
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
typedef struct _GimpLayerClass GimpLayerClass; typedef struct _GimpLayerClass GimpLayerClass;
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
struct _GimpLayer struct _GimpLayer
{ {
@ -47,7 +73,7 @@ struct _GimpLayer
gboolean linked; /* control linkage */ gboolean linked; /* control linkage */
gboolean preserve_trans; /* preserve transparency */ gboolean preserve_trans; /* preserve transparency */
LayerMask *mask; /* possible layer mask */ GimpLayerMask *mask; /* possible layer mask */
gint apply_mask; /* controls mask application */ gint apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */ gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */ gboolean show_mask; /* show mask or layer? */
@ -73,142 +99,94 @@ struct _GimpLayerClass
GimpDrawableClass parent_class; GimpDrawableClass parent_class;
}; };
struct _GimpLayerMask
{
GimpChannel parent_instance;
Layer *layer;
};
struct _GimpLayerMaskClass
{
GimpChannelClass parent_class;
};
/* Special undo types */ /* Special undo types */
struct _layer_undo struct _LayerUndo
{ {
Layer *layer; /* the actual layer */ GimpLayer *layer; /* the actual layer */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Layer *prev_layer; /* previous active layer */ GimpLayer *prev_layer; /* previous active layer */
}; };
struct _layer_mask_undo struct _FStoLayerUndo
{ {
Layer *layer; /* the layer */ GimpLayer *layer; /* the layer */
gboolean apply_mask; /* apply mask? */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show the mask? */
LayerMask *mask; /* the layer mask */
gint mode; /* the application mode */
};
struct _fs_to_layer_undo
{
Layer *layer; /* the layer */
GimpDrawable *drawable; /* drawable of floating sel */ GimpDrawable *drawable; /* drawable of floating sel */
}; };
/* function declarations */ /* function declarations */
GtkType gimp_layer_get_type (void); GtkType gimp_layer_get_type (void);
Layer * layer_new (GimpImage *gimage, GimpLayer * gimp_layer_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
const gchar *name, const gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
Layer * layer_copy (Layer *layer, GimpLayer * gimp_layer_copy (GimpLayer *layer,
gboolean add_alpha); gboolean add_alpha);
Layer * layer_new_from_tiles (GimpImage *gimage, GimpLayer * gimp_layer_new_from_tiles (GimpImage *gimage,
GimpImageType layer_type, GimpImageType layer_type,
TileManager *tiles, TileManager *tiles,
gchar *name, gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
gboolean layer_check_scaling (Layer *layer, gboolean gimp_layer_check_scaling (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height); gint new_height);
LayerMask * layer_create_mask (Layer *layer, GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
AddMaskType add_mask_type); AddMaskType add_mask_type);
LayerMask * layer_add_mask (Layer *layer, GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
void layer_delete (Layer *layer); void gimp_layer_delete (GimpLayer *layer);
void layer_apply_mask (Layer *layer, void gimp_layer_apply_mask (GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
void layer_translate (Layer *layer, void gimp_layer_translate (GimpLayer *layer,
gint off_x, gint off_x,
gint off_y); gint off_y);
void layer_add_alpha (Layer *layer); void gimp_layer_add_alpha (GimpLayer *layer);
gboolean layer_scale_by_factors (Layer *layer, gboolean gimp_layer_scale_by_factors (GimpLayer *layer,
gdouble w_factor, gdouble w_factor,
gdouble h_factor); gdouble h_factor);
void layer_scale (Layer *layer, void gimp_layer_scale (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gboolean local_origin); gboolean local_origin);
void layer_resize (Layer *layer, void gimp_layer_resize (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void layer_resize_to_image (Layer *layer); void gimp_layer_resize_to_image (GimpLayer *layer);
BoundSeg * layer_boundary (Layer *layer, BoundSeg * gimp_layer_boundary (GimpLayer *layer,
gint *num_segs); gint *num_segs);
void layer_invalidate_boundary (Layer *layer); void gimp_layer_invalidate_boundary (GimpLayer *layer);
gint layer_pick_correlate (Layer *layer, gint gimp_layer_pick_correlate (GimpLayer *layer,
gint x, gint x,
gint y); gint y);
void gimp_layer_set_name (GimpLayer *layer,
const gchar *name);
const gchar * gimp_layer_get_name (const GimpLayer *layer);
GimpLayerMask * gimp_layer_get_mask (GimpLayer *layer);
gboolean gimp_layer_has_alpha (GimpLayer *layer);
gboolean gimp_layer_is_floating_sel (GimpLayer *layer);
gboolean gimp_layer_linked (GimpLayer *layer);
Tattoo gimp_layer_get_tattoo (const GimpLayer *layer);
void gimp_layer_set_tattoo (GimpLayer *layer,
Tattoo value);
TempBuf * gimp_layer_preview (GimpLayer *layer,
gint width,
gint height);
TempBuf * gimp_layer_mask_preview (GimpLayer *layer,
gint width,
gint height);
GtkType gimp_layer_mask_get_type (void); #endif /* __GIMP_LAYER_H__ */
LayerMask * layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
LayerMask * layer_mask_copy (LayerMask *layer_mask);
void layer_mask_delete (LayerMask *layer_mask);
LayerMask * layer_mask_ref (LayerMask *layer_mask);
void layer_mask_unref (LayerMask *layer_mask);
void layer_mask_set_layer (LayerMask *layer_mask,
Layer *layer);
Layer * layer_mask_get_layer (LayerMask *layer_mask);
/* access functions */
void layer_set_name (Layer *layer,
const gchar *name);
const gchar * layer_get_name (const Layer *layer);
guchar * layer_data (Layer *layer);
LayerMask * layer_get_mask (Layer *layer);
gboolean layer_has_alpha (Layer *layer);
gboolean layer_is_floating_sel (Layer *layer);
gboolean layer_linked (Layer *layer);
TempBuf * layer_preview (Layer *layer,
gint width,
gint height);
TempBuf * layer_mask_preview (Layer *layer,
gint width,
gint height);
void layer_invalidate_previews (GimpImage *gimage);
Tattoo layer_get_tattoo (const Layer *layer);
void layer_set_tattoo (Layer *layer,
Tattoo value);
#define gimp_drawable_layer GIMP_IS_LAYER
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
void channel_layer_alpha (Channel *mask,
Layer *layer);
/* from channel.c */
void channel_layer_mask (Channel *mask,
Layer *layer);
#endif /* __LAYER_H__ */

213
app/core/gimplayermask.c Normal file
View File

@ -0,0 +1,213 @@
/* 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.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "apptypes.h"
#include "boundary.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayermask.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "undo.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "tile.h"
#include "libgimp/gimpparasite.h"
#include "libgimp/gimpintl.h"
static void gimp_layer_mask_class_init (GimpLayerMaskClass *klass);
static void gimp_layer_mask_init (GimpLayerMask *layermask);
static void gimp_layer_mask_destroy (GtkObject *object);
static GimpChannelClass *parent_class = NULL;
GtkType
gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;
if (! layer_mask_type)
{
GtkTypeInfo layer_mask_info =
{
"GimpLayerMask",
sizeof (GimpLayerMask),
sizeof (GimpLayerMaskClass),
(GtkClassInitFunc) gimp_layer_mask_class_init,
(GtkObjectInitFunc) gimp_layer_mask_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
layer_mask_type = gtk_type_unique (GIMP_TYPE_CHANNEL, &layer_mask_info);
}
return layer_mask_type;
}
static void
gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_CHANNEL);
/*
gtk_object_class_add_signals (object_class, layer_mask_signals, LAST_SIGNAL);
*/
object_class->destroy = gimp_layer_mask_destroy;
}
static void
gimp_layer_mask_init (GimpLayerMask *layer_mask)
{
layer_mask->layer = NULL;
}
static void
gimp_layer_mask_destroy (GtkObject *object)
{
GimpLayerMask *layer_mask;
g_return_if_fail (object != NULL);
g_return_if_fail (GIMP_IS_LAYER_MASK (object));
layer_mask = GIMP_LAYER_MASK (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
GimpLayerMask *
gimp_layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color)
{
GimpLayerMask *layer_mask;
layer_mask = gtk_type_new (GIMP_TYPE_LAYER_MASK);
gimp_drawable_configure (GIMP_DRAWABLE (layer_mask),
gimage, width, height, GRAY_GIMAGE, name);
/* set the layer_mask color and opacity */
GIMP_CHANNEL (layer_mask)->color = *color;
GIMP_CHANNEL (layer_mask)->show_masked = TRUE;
/* selection mask variables */
GIMP_CHANNEL (layer_mask)->empty = TRUE;
GIMP_CHANNEL (layer_mask)->segs_in = NULL;
GIMP_CHANNEL (layer_mask)->segs_out = NULL;
GIMP_CHANNEL (layer_mask)->num_segs_in = 0;
GIMP_CHANNEL (layer_mask)->num_segs_out = 0;
GIMP_CHANNEL (layer_mask)->bounds_known = TRUE;
GIMP_CHANNEL (layer_mask)->boundary_known = TRUE;
GIMP_CHANNEL (layer_mask)->x1 = 0;
GIMP_CHANNEL (layer_mask)->y1 = 0;
GIMP_CHANNEL (layer_mask)->x2 = width;
GIMP_CHANNEL (layer_mask)->y2 = height;
return layer_mask;
}
GimpLayerMask *
gimp_layer_mask_copy (GimpLayerMask *layer_mask)
{
gchar *layer_mask_name;
GimpLayerMask *new_layer_mask;
PixelRegion srcPR, destPR;
/* formulate the new layer_mask name */
layer_mask_name =
g_strdup_printf (_("%s copy"),
gimp_object_get_name (GIMP_OBJECT (layer_mask)));
/* allocate a new layer_mask object */
new_layer_mask = gimp_layer_mask_new (GIMP_DRAWABLE (layer_mask)->gimage,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
layer_mask_name,
&GIMP_CHANNEL (layer_mask)->color);
GIMP_DRAWABLE(new_layer_mask)->visible =
GIMP_DRAWABLE(layer_mask)->visible;
GIMP_DRAWABLE(new_layer_mask)->offset_x =
GIMP_DRAWABLE(layer_mask)->offset_x;
GIMP_DRAWABLE(new_layer_mask)->offset_y =
GIMP_DRAWABLE(layer_mask)->offset_y;
GIMP_CHANNEL(new_layer_mask)->show_masked =
GIMP_CHANNEL(layer_mask)->show_masked;
/* copy the contents across layer masks */
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer_mask)->tiles,
0, 0,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (new_layer_mask)->tiles,
0, 0,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
TRUE);
copy_region (&srcPR, &destPR);
/* free up the layer_mask_name memory */
g_free (layer_mask_name);
return new_layer_mask;
}
void
gimp_layer_mask_set_layer (GimpLayerMask *mask,
GimpLayer *layer)
{
mask->layer = layer;
}
GimpLayer *
gimp_layer_mask_get_layer (GimpLayerMask *mask)
{
return mask->layer;
}

81
app/core/gimplayermask.h Normal file
View File

@ -0,0 +1,81 @@
/* 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 __GIMP_LAYER_MASK_H__
#define __GIMP_LAYER_MASK_H__
#include "channel.h"
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())
#define GIMP_LAYER_MASK(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask))
#define GIMP_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass))
#define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK))
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK))
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
struct _GimpLayerMask
{
GimpChannel parent_instance;
GimpLayer *layer;
};
struct _GimpLayerMaskClass
{
GimpChannelClass parent_class;
};
/* Special undo type */
struct _LayerMaskUndo
{
GimpLayer *layer; /* the layer */
gboolean apply_mask; /* apply mask? */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show the mask? */
GimpLayerMask *mask; /* the layer mask */
gint mode; /* the application mode */
};
/* function declarations */
GtkType gimp_layer_mask_get_type (void);
GimpLayerMask * gimp_layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpLayerMask * gimp_layer_mask_copy (GimpLayerMask *layer_mask);
void gimp_layer_mask_set_layer (GimpLayerMask *layer_mask,
GimpLayer *layer);
Layer * gimp_layer_mask_get_layer (GimpLayerMask *layer_mask);
#endif /* __GIMP_LAYER_MASK_H__ */

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

View File

@ -908,7 +908,7 @@ prefs_cancel_callback (GtkWidget *widget,
transparency_size = old_transparency_size; transparency_size = old_transparency_size;
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();
@ -995,7 +995,7 @@ prefs_toggle_callback (GtkWidget *widget,
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();

View File

@ -751,21 +751,21 @@ gdisplay_drag_drop (GtkWidget *widget,
if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context))) if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
if (layer) if (layer)
{ {

View File

@ -751,21 +751,21 @@ gdisplay_drag_drop (GtkWidget *widget,
if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context))) if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
if (layer) if (layer)
{ {

View File

@ -751,21 +751,21 @@ gdisplay_drag_drop (GtkWidget *widget,
if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context))) if (!gimp_busy && (src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
if (layer) if (layer)
{ {

View File

@ -888,8 +888,8 @@ file_open_image (const gchar *filename,
if (gimage) if (gimage)
{ {
layer_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
channel_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
} }
return pdb_id_to_image (gimage_id); return pdb_id_to_image (gimage_id);

View File

@ -32,6 +32,7 @@
#include "gdisplay.h" #include "gdisplay.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "paint_funcs.h" #include "paint_funcs.h"
#include "pixel_region.h" #include "pixel_region.h"
#include "tile_manager.h" #include "tile_manager.h"

View File

@ -56,7 +56,7 @@ static void gimage_repaint_handler (GimpImage* gimage,
gint, gint, gint, gint); gint, gint, gint, gint);
GImage * GimpImage *
gimage_new (gint width, gimage_new (gint width,
gint height, gint height,
GimpImageBaseType base_type) GimpImageBaseType base_type)
@ -91,7 +91,7 @@ gimage_new (gint width,
} }
/* Ack, GImages have their own ref counts! This is going to cause /* Ack, GimpImages have their own ref counts! This is going to cause
trouble.. It should be pretty easy to convert to proper GtkObject trouble.. It should be pretty easy to convert to proper GtkObject
ref counting, though. */ ref counting, though. */
@ -101,7 +101,7 @@ gimage_new (gint width,
(Sven, 23.01.2000) */ (Sven, 23.01.2000) */
void void
gimage_delete (GImage *gimage) gimage_delete (GimpImage *gimage)
{ {
if (gimage->disp_count <= 0) if (gimage->disp_count <= 0)
gtk_object_unref (GTK_OBJECT (gimage)); gtk_object_unref (GTK_OBJECT (gimage));
@ -208,8 +208,8 @@ gimage_resize_handler (GimpImage *gimage)
undo_push_group_end (gimage); undo_push_group_end (gimage);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
channel_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
layer_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_resize_cursor_label (gimage); gdisplays_resize_cursor_label (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);
@ -236,7 +236,7 @@ gimage_repaint_handler (GimpImage *gimage,
/* These really belong in the layer class */ /* These really belong in the layer class */
void void
gimage_set_layer_mask_apply (GImage *gimage, gimage_set_layer_mask_apply (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
int off_x, off_y; int off_x, off_y;
@ -255,9 +255,9 @@ gimage_set_layer_mask_apply (GImage *gimage,
} }
void void
gimage_set_layer_mask_edit (GImage *gimage, gimage_set_layer_mask_edit (GimpImage *gimage,
Layer *layer, Layer *layer,
gboolean edit) gboolean edit)
{ {
/* find the layer */ /* find the layer */
if (!layer) if (!layer)
@ -268,7 +268,7 @@ gimage_set_layer_mask_edit (GImage *gimage,
} }
void void
gimage_set_layer_mask_show (GImage *gimage, gimage_set_layer_mask_show (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
gint off_x, off_y; gint off_x, off_y;

View File

@ -24,10 +24,12 @@
#include "appenv.h" #include "appenv.h"
#include "boundary.h" #include "boundary.h"
#include "channel.h"
#include "drawable.h" #include "drawable.h"
#include "floating_sel.h" #include "floating_sel.h"
#include "gdisplay.h" #include "gdisplay.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
@ -331,7 +333,7 @@ gimage_mask_extract (GImage *gimage,
else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable)) else if (cut_gimage && GIMP_IS_LAYER_MASK (drawable))
{ {
gimp_image_remove_layer_mask (gimage, gimp_image_remove_layer_mask (gimage,
layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)),
DISCARD); DISCARD);
} }
else if (cut_gimage && GIMP_IS_CHANNEL (drawable)) else if (cut_gimage && GIMP_IS_CHANNEL (drawable))

View File

@ -546,24 +546,6 @@ channel_preview_private (Channel *channel,
} }
} }
void
channel_invalidate_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
tmp = g_slist_next (tmp);
}
}
Tattoo Tattoo
channel_get_tattoo (const Channel *channel) channel_get_tattoo (const Channel *channel)
{ {
@ -1674,8 +1656,31 @@ channel_translate (Channel *mask,
} }
void void
channel_layer_alpha (Channel *mask, channel_load (Channel *mask,
Layer *layer) Channel *channel)
{
PixelRegion srcPR, destPR;
/* push the current mask onto the undo stack */
channel_push_undo (mask);
/* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height, TRUE);
copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE;
}
void
channel_layer_alpha (Channel *mask,
GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0; guchar empty = 0;
@ -1710,23 +1715,39 @@ channel_layer_alpha (Channel *mask,
} }
void void
channel_load (Channel *mask, channel_layer_mask (Channel *mask,
Channel *channel) GimpLayer *layer)
{ {
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
guchar empty = 0;
gint x1, y1, x2, y2;
/* push the current mask onto the undo stack */ /* push the current mask onto the undo stack */
channel_push_undo (mask); channel_push_undo (mask);
/* copy the channel to the mask */ /* clear the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
0, 0, 0, 0,
GIMP_DRAWABLE (channel)->width, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (channel)->height, FALSE); TRUE);
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, color_region (&destPR, &empty);
0, 0,
GIMP_DRAWABLE (channel)->width, x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
GIMP_DRAWABLE (channel)->height, TRUE); y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);
copy_region (&srcPR, &destPR); copy_region (&srcPR, &destPR);
mask->bounds_known = FALSE; mask->bounds_known = FALSE;

View File

@ -127,8 +127,6 @@ TempBuf * channel_preview (Channel *channel,
gint width, gint width,
gint height); gint height);
void channel_invalidate_previews (GimpImage *gimage);
Tattoo channel_get_tattoo (const Channel *channel); Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel, void channel_set_tattoo (Channel *channel,
Tattoo value); Tattoo value);
@ -215,6 +213,11 @@ void channel_translate (Channel *mask,
void channel_load (Channel *mask, void channel_load (Channel *mask,
Channel *channel); Channel *channel);
void channel_layer_alpha (Channel *mask,
GimpLayer *layer);
void channel_layer_mask (Channel *mask,
GimpLayer *layer);
void channel_invalidate_bounds (Channel *channel); void channel_invalidate_bounds (Channel *channel);

View File

@ -35,6 +35,7 @@
#include "gimpcontextpreview.h" #include "gimpcontextpreview.h"
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimpbrushlist.h" #include "gimpbrushlist.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "gradient.h" #include "gradient.h"
#include "gradient_header.h" #include "gradient_header.h"
@ -1090,8 +1091,9 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
else if (GIMP_IS_LAYER_MASK (drawable)) else if (GIMP_IS_LAYER_MASK (drawable))
{ {
tmpbuf = tmpbuf =
layer_mask_preview (layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), gimp_layer_mask_preview
width, height); (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)),
width, height);
} }
else if (GIMP_IS_CHANNEL (drawable)) else if (GIMP_IS_CHANNEL (drawable))
{ {

View File

@ -29,6 +29,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "channel_ops.h" #include "channel_ops.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "drawable.h" #include "drawable.h"

View File

@ -1457,7 +1457,7 @@ convert_image (GImage *gimage,
undo_push_group_end (gimage); undo_push_group_end (gimage);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
layer_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_title (gimage); gdisplays_update_title (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);

View File

@ -29,6 +29,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "channel_ops.h" #include "channel_ops.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "drawable.h" #include "drawable.h"

View File

@ -35,6 +35,7 @@
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimplayermask.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpparasite.h" #include "gimpparasite.h"
@ -2099,6 +2100,40 @@ gimp_image_validate (TileManager *tm,
gimp_image_construct (gimage, x, y, w, h); gimp_image_construct (gimage, x, y, w, h);
} }
void
gimp_image_invalidate_layer_previews (GimpImage *gimage)
{
GSList *tmp;
GimpLayer *layer;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->layers; tmp; tmp = g_slist_next (tmp))
{
layer = (Layer *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (layer), TRUE);
}
}
void
gimp_image_invalidate_channel_previews (GimpImage *gimage)
{
GSList *tmp;
Channel *channel;
g_return_if_fail (gimage != NULL);
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp))
{
channel = (Channel *) tmp->data;
gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE);
}
}
gint gint
gimp_image_get_layer_index (const GimpImage *gimage, gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg) const Layer *layer_arg)
@ -3222,10 +3257,10 @@ gimp_image_remove_layer (GimpImage *gimage,
return NULL; return NULL;
} }
LayerMask * GimpLayerMask *
gimp_image_add_layer_mask (GimpImage *gimage, gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask) GimpLayerMask *mask)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3258,7 +3293,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
return NULL; return NULL;
} }
layer_add_mask (layer, mask); gimp_layer_add_mask (layer, mask);
/* Prepare a layer undo and push it */ /* Prepare a layer undo and push it */
lmu = g_new (LayerMaskUndo, 1); lmu = g_new (LayerMaskUndo, 1);
@ -3274,7 +3309,7 @@ gimp_image_add_layer_mask (GimpImage *gimage,
Channel * Channel *
gimp_image_remove_layer_mask (GimpImage *gimage, gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
MaskApplyMode mode) MaskApplyMode mode)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
@ -3964,7 +3999,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
if (layer->mask && layer->apply_mask) if (layer->mask && layer->apply_mask)
{ {
mask_buf = layer_mask_preview (layer, w, h); mask_buf = gimp_layer_mask_preview (layer, w, h);
maskPR.bytes = mask_buf->bytes; maskPR.bytes = mask_buf->bytes;
maskPR.rowstride = mask_buf->width; maskPR.rowstride = mask_buf->width;
maskPR.data = mask_buf_data (mask_buf) + maskPR.data = mask_buf_data (mask_buf) +

View File

@ -282,113 +282,118 @@ void gimp_image_colormap_changed (const GimpImage *image,
/* layer/channel functions */ /* layer/channel functions */
gint gimp_image_get_layer_index (const GimpImage *gimage, gint gimp_image_get_layer_index (const GimpImage *gimage,
const Layer *layer_arg); const Layer *layer_arg);
Layer * gimp_image_get_layer_by_index (const GimpImage *gimage, Layer * gimp_image_get_layer_by_index (const GimpImage *gimage,
gint layer_index); gint layer_index);
gint gimp_image_get_channel_index (const GimpImage *gimage, gint gimp_image_get_channel_index (const GimpImage *gimage,
const Channel *channel_arg); const Channel *channel_arg);
Layer * gimp_image_get_active_layer (const GimpImage *gimage); Layer * gimp_image_get_active_layer (const GimpImage *gimage);
Channel * gimp_image_get_active_channel (const GimpImage *gimage); Channel * gimp_image_get_active_channel (const GimpImage *gimage);
Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, Layer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
Tattoo tatoo); Tattoo tatoo);
Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, Channel * gimp_image_get_channel_by_name (const GimpImage *gimage,
const gchar *name); const gchar *name);
Channel * gimp_image_get_mask (const GimpImage *gimage); Channel * gimp_image_get_mask (const GimpImage *gimage);
gboolean gimp_image_get_component_active (const GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_get_component_visible (const GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage,
ChannelType type); ChannelType type);
gboolean gimp_image_layer_boundary (const GimpImage *gimage, gboolean gimp_image_layer_boundary (const GimpImage *gimage,
BoundSeg **segs, BoundSeg **segs,
gint *n_segs); gint *n_segs);
Layer * gimp_image_set_active_layer (GimpImage *gimage, Layer * gimp_image_set_active_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
Channel * gimp_image_set_active_channel (GimpImage *gimage, Channel * gimp_image_set_active_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
Channel * gimp_image_unset_active_channel (GimpImage *gimage); Channel * gimp_image_unset_active_channel (GimpImage *gimage);
void gimp_image_set_component_active (GimpImage *gimage, void gimp_image_set_component_active (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean active); gboolean active);
void gimp_image_set_component_visible (GimpImage *gimage, void gimp_image_set_component_visible (GimpImage *gimage,
ChannelType type, ChannelType type,
gboolean visible); gboolean visible);
Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage, Layer * gimp_image_pick_correlate_layer (const GimpImage *gimage,
gint x, gint x,
gint y); gint y);
Layer * gimp_image_raise_layer (GimpImage *gimage, Layer * gimp_image_raise_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer (GimpImage *gimage, Layer * gimp_image_lower_layer (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_raise_layer_to_top (GimpImage *gimage, Layer * gimp_image_raise_layer_to_top (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, Layer * gimp_image_lower_layer_to_bottom (GimpImage *gimage,
Layer *layer_arg); Layer *layer_arg);
Layer * gimp_image_position_layer (GimpImage *gimage, Layer * gimp_image_position_layer (GimpImage *gimage,
Layer *layer_arg, Layer *layer_arg,
gint new_index, gint new_index,
gboolean push_undo); gboolean push_undo);
Layer * gimp_image_merge_visible_layers (GimpImage *gimage, Layer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_merge_down (GimpImage *gimage, Layer * gimp_image_merge_down (GimpImage *gimage,
Layer *current_layer, Layer *current_layer,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_flatten (GimpImage *gimage); Layer * gimp_image_flatten (GimpImage *gimage);
Layer * gimp_image_merge_layers (GimpImage *gimage, Layer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list, GSList *merge_list,
MergeType merge_type); MergeType merge_type);
Layer * gimp_image_add_layer (GimpImage *gimage, Layer * gimp_image_add_layer (GimpImage *gimage,
Layer *float_layer, Layer *float_layer,
gint position); gint position);
Layer * gimp_image_remove_layer (GimpImage *gimage, Layer * gimp_image_remove_layer (GimpImage *gimage,
Layer *layer); Layer *layer);
LayerMask * gimp_image_add_layer_mask (GimpImage *gimage, GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage,
Layer *layer, GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
Channel * gimp_image_remove_layer_mask (GimpImage *gimage, Channel * gimp_image_remove_layer_mask (GimpImage *gimage,
Layer *layer, Layer *layer,
MaskApplyMode mode); MaskApplyMode mode);
Channel * gimp_image_raise_channel (GimpImage *gimage, Channel * gimp_image_raise_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_lower_channel (GimpImage *gimage, Channel * gimp_image_lower_channel (GimpImage *gimage,
Channel *channel_arg); Channel *channel_arg);
Channel * gimp_image_position_channel (GimpImage *gimage, Channel * gimp_image_position_channel (GimpImage *gimage,
Channel *channel_arg, Channel *channel_arg,
gint position); gint position);
Channel * gimp_image_add_channel (GimpImage *gimage, Channel * gimp_image_add_channel (GimpImage *gimage,
Channel *channel, Channel *channel,
gint position); gint position);
Channel * gimp_image_remove_channel (GimpImage *gimage, Channel * gimp_image_remove_channel (GimpImage *gimage,
Channel *channel); Channel *channel);
void gimp_image_construct (GimpImage *gimage, void gimp_image_construct (GimpImage *gimage,
gint x, gint x,
gint y, gint y,
gint w, gint w,
gint h); gint h);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
void gimp_image_invalidate_layer_previews (GimpImage *gimage);
void gimp_image_invalidate_channel_previews (GimpImage *gimage);
void gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gint x1,
gint y1,
gint x2,
gint y2);
void gimp_image_validate (TileManager *tm,
Tile *tile);
/* Access functions */ /* Access functions */

File diff suppressed because it is too large Load Diff

View File

@ -16,29 +16,55 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __LAYER_H__ #ifndef __GIMP_LAYER_H__
#define __LAYER_H__ #define __GIMP_LAYER_H__
#include "channel.h"
#include "gimpdrawable.h" #include "gimpdrawable.h"
#define GIMP_TYPE_LAYER (gimp_layer_get_type ()) /* EEK */
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ()) #define layer_new gimp_layer_new
#define GIMP_LAYER_MASK(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask)) #define layer_copy gimp_layer_copy
#define GIMP_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass)) #define layer_create_mask gimp_layer_create_mask
#define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define layer_scale gimp_layer_scale
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) #define layer_resize gimp_layer_resize
#define layer_delete gimp_layer_delete
#define layer_translate gimp_layer_translate
#define layer_get_name gimp_layer_get_name
#define layer_set_name gimp_layer_set_name
#define layer_get_tattoo gimp_layer_get_tattoo
#define layer_set_tattoo gimp_layer_set_tattoo
#define layer_add_alpha gimp_layer_add_alpha
#define layer_has_alpha gimp_layer_has_alpha
#define layer_preview gimp_layer_preview
#define layer_is_floating_sel gimp_layer_is_floating_sel
#define layer_invalidate_previews gimp_layer_invalidate_previews
#define layer_linked gimp_layer_linked
#define layer_get_mask gimp_layer_get_mask
#define layer_new_from_tiles gimp_layer_new_from_tiles
#define layer_resize_to_image gimp_layer_resize_to_image
#define layer_invalidate_boundary gimp_layer_invalidate_boundary
#define layer_scale_by_factors gimp_layer_scale_by_factors
#define layer_boundary gimp_layer_boundary
#define layer_pick_correlate gimp_layer_pick_correlate
#define layer_apply_mask gimp_layer_apply_mask
#define layer_add_mask gimp_layer_add_mask
#define layer_check_scaling gimp_layer_check_scaling
#define gimp_drawable_layer GIMP_IS_LAYER
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
typedef struct _GimpLayerClass GimpLayerClass; typedef struct _GimpLayerClass GimpLayerClass;
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
struct _GimpLayer struct _GimpLayer
{ {
@ -47,7 +73,7 @@ struct _GimpLayer
gboolean linked; /* control linkage */ gboolean linked; /* control linkage */
gboolean preserve_trans; /* preserve transparency */ gboolean preserve_trans; /* preserve transparency */
LayerMask *mask; /* possible layer mask */ GimpLayerMask *mask; /* possible layer mask */
gint apply_mask; /* controls mask application */ gint apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */ gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */ gboolean show_mask; /* show mask or layer? */
@ -73,142 +99,94 @@ struct _GimpLayerClass
GimpDrawableClass parent_class; GimpDrawableClass parent_class;
}; };
struct _GimpLayerMask
{
GimpChannel parent_instance;
Layer *layer;
};
struct _GimpLayerMaskClass
{
GimpChannelClass parent_class;
};
/* Special undo types */ /* Special undo types */
struct _layer_undo struct _LayerUndo
{ {
Layer *layer; /* the actual layer */ GimpLayer *layer; /* the actual layer */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Layer *prev_layer; /* previous active layer */ GimpLayer *prev_layer; /* previous active layer */
}; };
struct _layer_mask_undo struct _FStoLayerUndo
{ {
Layer *layer; /* the layer */ GimpLayer *layer; /* the layer */
gboolean apply_mask; /* apply mask? */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show the mask? */
LayerMask *mask; /* the layer mask */
gint mode; /* the application mode */
};
struct _fs_to_layer_undo
{
Layer *layer; /* the layer */
GimpDrawable *drawable; /* drawable of floating sel */ GimpDrawable *drawable; /* drawable of floating sel */
}; };
/* function declarations */ /* function declarations */
GtkType gimp_layer_get_type (void); GtkType gimp_layer_get_type (void);
Layer * layer_new (GimpImage *gimage, GimpLayer * gimp_layer_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
const gchar *name, const gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
Layer * layer_copy (Layer *layer, GimpLayer * gimp_layer_copy (GimpLayer *layer,
gboolean add_alpha); gboolean add_alpha);
Layer * layer_new_from_tiles (GimpImage *gimage, GimpLayer * gimp_layer_new_from_tiles (GimpImage *gimage,
GimpImageType layer_type, GimpImageType layer_type,
TileManager *tiles, TileManager *tiles,
gchar *name, gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
gboolean layer_check_scaling (Layer *layer, gboolean gimp_layer_check_scaling (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height); gint new_height);
LayerMask * layer_create_mask (Layer *layer, GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
AddMaskType add_mask_type); AddMaskType add_mask_type);
LayerMask * layer_add_mask (Layer *layer, GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
void layer_delete (Layer *layer); void gimp_layer_delete (GimpLayer *layer);
void layer_apply_mask (Layer *layer, void gimp_layer_apply_mask (GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
void layer_translate (Layer *layer, void gimp_layer_translate (GimpLayer *layer,
gint off_x, gint off_x,
gint off_y); gint off_y);
void layer_add_alpha (Layer *layer); void gimp_layer_add_alpha (GimpLayer *layer);
gboolean layer_scale_by_factors (Layer *layer, gboolean gimp_layer_scale_by_factors (GimpLayer *layer,
gdouble w_factor, gdouble w_factor,
gdouble h_factor); gdouble h_factor);
void layer_scale (Layer *layer, void gimp_layer_scale (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gboolean local_origin); gboolean local_origin);
void layer_resize (Layer *layer, void gimp_layer_resize (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void layer_resize_to_image (Layer *layer); void gimp_layer_resize_to_image (GimpLayer *layer);
BoundSeg * layer_boundary (Layer *layer, BoundSeg * gimp_layer_boundary (GimpLayer *layer,
gint *num_segs); gint *num_segs);
void layer_invalidate_boundary (Layer *layer); void gimp_layer_invalidate_boundary (GimpLayer *layer);
gint layer_pick_correlate (Layer *layer, gint gimp_layer_pick_correlate (GimpLayer *layer,
gint x, gint x,
gint y); gint y);
void gimp_layer_set_name (GimpLayer *layer,
const gchar *name);
const gchar * gimp_layer_get_name (const GimpLayer *layer);
GimpLayerMask * gimp_layer_get_mask (GimpLayer *layer);
gboolean gimp_layer_has_alpha (GimpLayer *layer);
gboolean gimp_layer_is_floating_sel (GimpLayer *layer);
gboolean gimp_layer_linked (GimpLayer *layer);
Tattoo gimp_layer_get_tattoo (const GimpLayer *layer);
void gimp_layer_set_tattoo (GimpLayer *layer,
Tattoo value);
TempBuf * gimp_layer_preview (GimpLayer *layer,
gint width,
gint height);
TempBuf * gimp_layer_mask_preview (GimpLayer *layer,
gint width,
gint height);
GtkType gimp_layer_mask_get_type (void); #endif /* __GIMP_LAYER_H__ */
LayerMask * layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
LayerMask * layer_mask_copy (LayerMask *layer_mask);
void layer_mask_delete (LayerMask *layer_mask);
LayerMask * layer_mask_ref (LayerMask *layer_mask);
void layer_mask_unref (LayerMask *layer_mask);
void layer_mask_set_layer (LayerMask *layer_mask,
Layer *layer);
Layer * layer_mask_get_layer (LayerMask *layer_mask);
/* access functions */
void layer_set_name (Layer *layer,
const gchar *name);
const gchar * layer_get_name (const Layer *layer);
guchar * layer_data (Layer *layer);
LayerMask * layer_get_mask (Layer *layer);
gboolean layer_has_alpha (Layer *layer);
gboolean layer_is_floating_sel (Layer *layer);
gboolean layer_linked (Layer *layer);
TempBuf * layer_preview (Layer *layer,
gint width,
gint height);
TempBuf * layer_mask_preview (Layer *layer,
gint width,
gint height);
void layer_invalidate_previews (GimpImage *gimage);
Tattoo layer_get_tattoo (const Layer *layer);
void layer_set_tattoo (Layer *layer,
Tattoo value);
#define gimp_drawable_layer GIMP_IS_LAYER
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
void channel_layer_alpha (Channel *mask,
Layer *layer);
/* from channel.c */
void channel_layer_mask (Channel *mask,
Layer *layer);
#endif /* __LAYER_H__ */

213
app/gimplayermask.c Normal file
View File

@ -0,0 +1,213 @@
/* 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.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "apptypes.h"
#include "boundary.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayermask.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "undo.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "tile.h"
#include "libgimp/gimpparasite.h"
#include "libgimp/gimpintl.h"
static void gimp_layer_mask_class_init (GimpLayerMaskClass *klass);
static void gimp_layer_mask_init (GimpLayerMask *layermask);
static void gimp_layer_mask_destroy (GtkObject *object);
static GimpChannelClass *parent_class = NULL;
GtkType
gimp_layer_mask_get_type (void)
{
static GtkType layer_mask_type = 0;
if (! layer_mask_type)
{
GtkTypeInfo layer_mask_info =
{
"GimpLayerMask",
sizeof (GimpLayerMask),
sizeof (GimpLayerMaskClass),
(GtkClassInitFunc) gimp_layer_mask_class_init,
(GtkObjectInitFunc) gimp_layer_mask_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
layer_mask_type = gtk_type_unique (GIMP_TYPE_CHANNEL, &layer_mask_info);
}
return layer_mask_type;
}
static void
gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_CHANNEL);
/*
gtk_object_class_add_signals (object_class, layer_mask_signals, LAST_SIGNAL);
*/
object_class->destroy = gimp_layer_mask_destroy;
}
static void
gimp_layer_mask_init (GimpLayerMask *layer_mask)
{
layer_mask->layer = NULL;
}
static void
gimp_layer_mask_destroy (GtkObject *object)
{
GimpLayerMask *layer_mask;
g_return_if_fail (object != NULL);
g_return_if_fail (GIMP_IS_LAYER_MASK (object));
layer_mask = GIMP_LAYER_MASK (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
GimpLayerMask *
gimp_layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color)
{
GimpLayerMask *layer_mask;
layer_mask = gtk_type_new (GIMP_TYPE_LAYER_MASK);
gimp_drawable_configure (GIMP_DRAWABLE (layer_mask),
gimage, width, height, GRAY_GIMAGE, name);
/* set the layer_mask color and opacity */
GIMP_CHANNEL (layer_mask)->color = *color;
GIMP_CHANNEL (layer_mask)->show_masked = TRUE;
/* selection mask variables */
GIMP_CHANNEL (layer_mask)->empty = TRUE;
GIMP_CHANNEL (layer_mask)->segs_in = NULL;
GIMP_CHANNEL (layer_mask)->segs_out = NULL;
GIMP_CHANNEL (layer_mask)->num_segs_in = 0;
GIMP_CHANNEL (layer_mask)->num_segs_out = 0;
GIMP_CHANNEL (layer_mask)->bounds_known = TRUE;
GIMP_CHANNEL (layer_mask)->boundary_known = TRUE;
GIMP_CHANNEL (layer_mask)->x1 = 0;
GIMP_CHANNEL (layer_mask)->y1 = 0;
GIMP_CHANNEL (layer_mask)->x2 = width;
GIMP_CHANNEL (layer_mask)->y2 = height;
return layer_mask;
}
GimpLayerMask *
gimp_layer_mask_copy (GimpLayerMask *layer_mask)
{
gchar *layer_mask_name;
GimpLayerMask *new_layer_mask;
PixelRegion srcPR, destPR;
/* formulate the new layer_mask name */
layer_mask_name =
g_strdup_printf (_("%s copy"),
gimp_object_get_name (GIMP_OBJECT (layer_mask)));
/* allocate a new layer_mask object */
new_layer_mask = gimp_layer_mask_new (GIMP_DRAWABLE (layer_mask)->gimage,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
layer_mask_name,
&GIMP_CHANNEL (layer_mask)->color);
GIMP_DRAWABLE(new_layer_mask)->visible =
GIMP_DRAWABLE(layer_mask)->visible;
GIMP_DRAWABLE(new_layer_mask)->offset_x =
GIMP_DRAWABLE(layer_mask)->offset_x;
GIMP_DRAWABLE(new_layer_mask)->offset_y =
GIMP_DRAWABLE(layer_mask)->offset_y;
GIMP_CHANNEL(new_layer_mask)->show_masked =
GIMP_CHANNEL(layer_mask)->show_masked;
/* copy the contents across layer masks */
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer_mask)->tiles,
0, 0,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (new_layer_mask)->tiles,
0, 0,
GIMP_DRAWABLE (layer_mask)->width,
GIMP_DRAWABLE (layer_mask)->height,
TRUE);
copy_region (&srcPR, &destPR);
/* free up the layer_mask_name memory */
g_free (layer_mask_name);
return new_layer_mask;
}
void
gimp_layer_mask_set_layer (GimpLayerMask *mask,
GimpLayer *layer)
{
mask->layer = layer;
}
GimpLayer *
gimp_layer_mask_get_layer (GimpLayerMask *mask)
{
return mask->layer;
}

81
app/gimplayermask.h Normal file
View File

@ -0,0 +1,81 @@
/* 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 __GIMP_LAYER_MASK_H__
#define __GIMP_LAYER_MASK_H__
#include "channel.h"
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())
#define GIMP_LAYER_MASK(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask))
#define GIMP_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass))
#define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK))
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK))
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
struct _GimpLayerMask
{
GimpChannel parent_instance;
GimpLayer *layer;
};
struct _GimpLayerMaskClass
{
GimpChannelClass parent_class;
};
/* Special undo type */
struct _LayerMaskUndo
{
GimpLayer *layer; /* the layer */
gboolean apply_mask; /* apply mask? */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show the mask? */
GimpLayerMask *mask; /* the layer mask */
gint mode; /* the application mode */
};
/* function declarations */
GtkType gimp_layer_mask_get_type (void);
GimpLayerMask * gimp_layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpLayerMask * gimp_layer_mask_copy (GimpLayerMask *layer_mask);
void gimp_layer_mask_set_layer (GimpLayerMask *layer_mask,
GimpLayer *layer);
Layer * gimp_layer_mask_get_layer (GimpLayerMask *layer_mask);
#endif /* __GIMP_LAYER_MASK_H__ */

View File

@ -34,6 +34,7 @@
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimplayermask.h"
#include "global_edit.h" #include "global_edit.h"
#include "layer.h" #include "layer.h"
#include "paint_funcs.h" #include "paint_funcs.h"

View File

@ -34,6 +34,7 @@
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "image_render.h" #include "image_render.h"
#include "layer.h" #include "layer.h"
@ -92,9 +93,9 @@ struct _LayersDialog
gint gimage_width, gimage_height; gint gimage_width, gimage_height;
gdouble ratio; gdouble ratio;
Layer *active_layer; GimpLayer *active_layer;
Channel *active_channel; Channel *active_channel;
Layer *floating_sel; GimpLayer *floating_sel;
GSList *layer_widgets; GSList *layer_widgets;
}; };
@ -116,7 +117,7 @@ struct _LayerWidget
/* state information */ /* state information */
GimpImage *gimage; GimpImage *gimage;
Layer *layer; GimpLayer *layer;
gint width, height; gint width, height;
gint active_preview; gint active_preview;
@ -1339,7 +1340,7 @@ layers_dialog_add_layer_mask (Layer *layer)
if (! GTK_WIDGET_VISIBLE (layer_widget->mask_preview)) if (! GTK_WIDGET_VISIBLE (layer_widget->mask_preview))
{ {
gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview), gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview),
"gimp_layer_mask", layer_get_mask (layer)); "gimp_layer_mask", gimp_layer_get_mask (layer));
gtk_widget_show (layer_widget->mask_preview); gtk_widget_show (layer_widget->mask_preview);
} }
@ -2021,13 +2022,16 @@ layers_dialog_drag_trashcan_callback (GtkWidget *widget,
if ((src_widget = gtk_drag_get_source_widget (context))) if ((src_widget = gtk_drag_get_source_widget (context)))
{ {
Layer *layer; GimpLayer *layer;
LayerMask *layer_mask; GimpLayerMask *layer_mask;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer =
"gimp_layer"); (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer");
"gimp_layer_mask");
layer_mask =
(GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask");
if (layer && if (layer &&
layer == layersD->active_layer) layer == layersD->active_layer)
@ -2037,7 +2041,7 @@ layers_dialog_drag_trashcan_callback (GtkWidget *widget,
return_val = TRUE; return_val = TRUE;
} }
else if (layer_mask && else if (layer_mask &&
layer_mask_get_layer (layer_mask) == layersD->active_layer) gimp_layer_mask_get_layer (layer_mask) == layersD->active_layer)
{ {
layers_dialog_delete_layer_mask_callback (widget, NULL); layers_dialog_delete_layer_mask_callback (widget, NULL);
@ -2097,7 +2101,7 @@ layer_widget_create (GimpImage *gimage,
layer_widget->mask_pixmap = NULL; layer_widget->mask_pixmap = NULL;
layer_widget->width = -1; layer_widget->width = -1;
layer_widget->height = -1; layer_widget->height = -1;
layer_widget->layer_mask = (layer_get_mask (layer) != NULL); layer_widget->layer_mask = (gimp_layer_get_mask (layer) != NULL);
layer_widget->apply_mask = layer->apply_mask; layer_widget->apply_mask = layer->apply_mask;
layer_widget->edit_mask = layer->edit_mask; layer_widget->edit_mask = layer->edit_mask;
layer_widget->show_mask = layer->show_mask; layer_widget->show_mask = layer->show_mask;
@ -2196,7 +2200,7 @@ layer_widget_create (GimpImage *gimage,
if (layer_get_mask (layer) != NULL) if (layer_get_mask (layer) != NULL)
{ {
gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview), gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview),
"gimp_layer_mask", layer_get_mask (layer)); "gimp_layer_mask", gimp_layer_get_mask (layer));
gtk_widget_show (layer_widget->mask_preview); gtk_widget_show (layer_widget->mask_preview);
} }
@ -3031,17 +3035,17 @@ layer_widget_preview_redraw (LayerWidget *layer_widget,
switch (preview_type) switch (preview_type)
{ {
case LAYER_PREVIEW: case LAYER_PREVIEW:
preview_buf = layer_preview (layer_widget->layer, preview_buf = gimp_layer_preview (layer_widget->layer,
layer_widget->width, layer_widget->width,
layer_widget->height); layer_widget->height);
layer_widget->layer_pixmap_valid = TRUE; layer_widget->layer_pixmap_valid = TRUE;
break; break;
case MASK_PREVIEW: case MASK_PREVIEW:
preview_buf = layer_mask_preview (layer_widget->layer, preview_buf = gimp_layer_mask_preview (layer_widget->layer,
layer_widget->width, layer_widget->width,
layer_widget->height); layer_widget->height);
break; break;
} }
@ -3797,8 +3801,8 @@ add_mask_query_ok_callback (GtkWidget *widget,
{ {
AddMaskOptions *options; AddMaskOptions *options;
GimpImage *gimage; GimpImage *gimage;
LayerMask *mask; GimpLayerMask *mask;
Layer *layer; GimpLayer *layer;
options = (AddMaskOptions *) data; options = (AddMaskOptions *) data;
if ((layer = (options->layer)) && if ((layer = (options->layer)) &&

View File

@ -908,7 +908,7 @@ prefs_cancel_callback (GtkWidget *widget,
transparency_size = old_transparency_size; transparency_size = old_transparency_size;
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();
@ -995,7 +995,7 @@ prefs_toggle_callback (GtkWidget *widget,
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();

View File

@ -657,19 +657,19 @@ toolbox_drag_drop (GtkWidget *widget,
if ((src_widget = gtk_drag_get_source_widget (context))) if ((src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
@ -694,12 +694,12 @@ toolbox_drag_drop (GtkWidget *widget,
if (drawable) if (drawable)
{ {
GImage *gimage; GimpImage *gimage;
GImage *new_gimage; GimpImage *new_gimage;
Layer *new_layer; GimpLayer *new_layer;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
gint bytes; gint bytes;
GimpImageBaseType type; GimpImageBaseType type;
@ -735,7 +735,7 @@ toolbox_drag_drop (GtkWidget *widget,
if (layer) if (layer)
{ {
new_layer = layer_copy (layer, FALSE); new_layer = gimp_layer_copy (layer, FALSE);
} }
else else
{ {
@ -754,26 +754,27 @@ toolbox_drag_drop (GtkWidget *widget,
add_alpha_region (&srcPR, &destPR); add_alpha_region (&srcPR, &destPR);
new_layer = layer_new_from_tiles (new_gimage, new_layer =
gimp_image_base_type_with_alpha(new_gimage), gimp_layer_new_from_tiles (new_gimage,
tiles, gimp_image_base_type_with_alpha (new_gimage),
"", OPAQUE_OPACITY, NORMAL_MODE); tiles,
"", OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles); tile_manager_destroy (tiles);
} }
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer), gimp_layer_set_name (GIMP_LAYER (new_layer),
gimp_object_get_name (GIMP_OBJECT (drawable))); gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer) if (layer)
{ {
LayerMask *mask; GimpLayerMask *mask;
LayerMask *new_mask; GimpLayerMask *new_mask;
mask = layer_get_mask (layer); mask = gimp_layer_get_mask (layer);
new_mask = layer_get_mask (new_layer); new_mask = gimp_layer_get_mask (new_layer);
if (new_mask) if (new_mask)
{ {
@ -783,7 +784,7 @@ toolbox_drag_drop (GtkWidget *widget,
} }
gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y);
layer_translate (new_layer, -off_x, -off_y); gimp_layer_translate (new_layer, -off_x, -off_y);
gimp_image_add_layer (new_gimage, new_layer, 0); gimp_image_add_layer (new_gimage, new_layer, 0);

File diff suppressed because it is too large Load Diff

View File

@ -16,29 +16,55 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __LAYER_H__ #ifndef __GIMP_LAYER_H__
#define __LAYER_H__ #define __GIMP_LAYER_H__
#include "channel.h"
#include "gimpdrawable.h" #include "gimpdrawable.h"
#define GIMP_TYPE_LAYER (gimp_layer_get_type ()) /* EEK */
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ()) #define layer_new gimp_layer_new
#define GIMP_LAYER_MASK(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER_MASK, GimpLayerMask)) #define layer_copy gimp_layer_copy
#define GIMP_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER_MASK, GimpLayerMaskClass)) #define layer_create_mask gimp_layer_create_mask
#define GIMP_IS_LAYER_MASK(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER_MASK)) #define layer_scale gimp_layer_scale
#define GIMP_IS_LAYER_MASK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER_MASK)) #define layer_resize gimp_layer_resize
#define layer_delete gimp_layer_delete
#define layer_translate gimp_layer_translate
#define layer_get_name gimp_layer_get_name
#define layer_set_name gimp_layer_set_name
#define layer_get_tattoo gimp_layer_get_tattoo
#define layer_set_tattoo gimp_layer_set_tattoo
#define layer_add_alpha gimp_layer_add_alpha
#define layer_has_alpha gimp_layer_has_alpha
#define layer_preview gimp_layer_preview
#define layer_is_floating_sel gimp_layer_is_floating_sel
#define layer_invalidate_previews gimp_layer_invalidate_previews
#define layer_linked gimp_layer_linked
#define layer_get_mask gimp_layer_get_mask
#define layer_new_from_tiles gimp_layer_new_from_tiles
#define layer_resize_to_image gimp_layer_resize_to_image
#define layer_invalidate_boundary gimp_layer_invalidate_boundary
#define layer_scale_by_factors gimp_layer_scale_by_factors
#define layer_boundary gimp_layer_boundary
#define layer_pick_correlate gimp_layer_pick_correlate
#define layer_apply_mask gimp_layer_apply_mask
#define layer_add_mask gimp_layer_add_mask
#define layer_check_scaling gimp_layer_check_scaling
#define gimp_drawable_layer GIMP_IS_LAYER
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
typedef struct _GimpLayerClass GimpLayerClass; typedef struct _GimpLayerClass GimpLayerClass;
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
struct _GimpLayer struct _GimpLayer
{ {
@ -47,7 +73,7 @@ struct _GimpLayer
gboolean linked; /* control linkage */ gboolean linked; /* control linkage */
gboolean preserve_trans; /* preserve transparency */ gboolean preserve_trans; /* preserve transparency */
LayerMask *mask; /* possible layer mask */ GimpLayerMask *mask; /* possible layer mask */
gint apply_mask; /* controls mask application */ gint apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */ gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */ gboolean show_mask; /* show mask or layer? */
@ -73,142 +99,94 @@ struct _GimpLayerClass
GimpDrawableClass parent_class; GimpDrawableClass parent_class;
}; };
struct _GimpLayerMask
{
GimpChannel parent_instance;
Layer *layer;
};
struct _GimpLayerMaskClass
{
GimpChannelClass parent_class;
};
/* Special undo types */ /* Special undo types */
struct _layer_undo struct _LayerUndo
{ {
Layer *layer; /* the actual layer */ GimpLayer *layer; /* the actual layer */
gint prev_position; /* former position in list */ gint prev_position; /* former position in list */
Layer *prev_layer; /* previous active layer */ GimpLayer *prev_layer; /* previous active layer */
}; };
struct _layer_mask_undo struct _FStoLayerUndo
{ {
Layer *layer; /* the layer */ GimpLayer *layer; /* the layer */
gboolean apply_mask; /* apply mask? */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show the mask? */
LayerMask *mask; /* the layer mask */
gint mode; /* the application mode */
};
struct _fs_to_layer_undo
{
Layer *layer; /* the layer */
GimpDrawable *drawable; /* drawable of floating sel */ GimpDrawable *drawable; /* drawable of floating sel */
}; };
/* function declarations */ /* function declarations */
GtkType gimp_layer_get_type (void); GtkType gimp_layer_get_type (void);
Layer * layer_new (GimpImage *gimage, GimpLayer * gimp_layer_new (GimpImage *gimage,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
const gchar *name, const gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
Layer * layer_copy (Layer *layer, GimpLayer * gimp_layer_copy (GimpLayer *layer,
gboolean add_alpha); gboolean add_alpha);
Layer * layer_new_from_tiles (GimpImage *gimage, GimpLayer * gimp_layer_new_from_tiles (GimpImage *gimage,
GimpImageType layer_type, GimpImageType layer_type,
TileManager *tiles, TileManager *tiles,
gchar *name, gchar *name,
gint opacity, gint opacity,
LayerModeEffects mode); LayerModeEffects mode);
gboolean layer_check_scaling (Layer *layer, gboolean gimp_layer_check_scaling (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height); gint new_height);
LayerMask * layer_create_mask (Layer *layer, GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
AddMaskType add_mask_type); AddMaskType add_mask_type);
LayerMask * layer_add_mask (Layer *layer, GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
LayerMask *mask); GimpLayerMask *mask);
void layer_delete (Layer *layer); void gimp_layer_delete (GimpLayer *layer);
void layer_apply_mask (Layer *layer, void gimp_layer_apply_mask (GimpLayer *layer,
MaskApplyMode mode); MaskApplyMode mode);
void layer_translate (Layer *layer, void gimp_layer_translate (GimpLayer *layer,
gint off_x, gint off_x,
gint off_y); gint off_y);
void layer_add_alpha (Layer *layer); void gimp_layer_add_alpha (GimpLayer *layer);
gboolean layer_scale_by_factors (Layer *layer, gboolean gimp_layer_scale_by_factors (GimpLayer *layer,
gdouble w_factor, gdouble w_factor,
gdouble h_factor); gdouble h_factor);
void layer_scale (Layer *layer, void gimp_layer_scale (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gboolean local_origin); gboolean local_origin);
void layer_resize (Layer *layer, void gimp_layer_resize (GimpLayer *layer,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offx, gint offx,
gint offy); gint offy);
void layer_resize_to_image (Layer *layer); void gimp_layer_resize_to_image (GimpLayer *layer);
BoundSeg * layer_boundary (Layer *layer, BoundSeg * gimp_layer_boundary (GimpLayer *layer,
gint *num_segs); gint *num_segs);
void layer_invalidate_boundary (Layer *layer); void gimp_layer_invalidate_boundary (GimpLayer *layer);
gint layer_pick_correlate (Layer *layer, gint gimp_layer_pick_correlate (GimpLayer *layer,
gint x, gint x,
gint y); gint y);
void gimp_layer_set_name (GimpLayer *layer,
const gchar *name);
const gchar * gimp_layer_get_name (const GimpLayer *layer);
GimpLayerMask * gimp_layer_get_mask (GimpLayer *layer);
gboolean gimp_layer_has_alpha (GimpLayer *layer);
gboolean gimp_layer_is_floating_sel (GimpLayer *layer);
gboolean gimp_layer_linked (GimpLayer *layer);
Tattoo gimp_layer_get_tattoo (const GimpLayer *layer);
void gimp_layer_set_tattoo (GimpLayer *layer,
Tattoo value);
TempBuf * gimp_layer_preview (GimpLayer *layer,
gint width,
gint height);
TempBuf * gimp_layer_mask_preview (GimpLayer *layer,
gint width,
gint height);
GtkType gimp_layer_mask_get_type (void); #endif /* __GIMP_LAYER_H__ */
LayerMask * layer_mask_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
LayerMask * layer_mask_copy (LayerMask *layer_mask);
void layer_mask_delete (LayerMask *layer_mask);
LayerMask * layer_mask_ref (LayerMask *layer_mask);
void layer_mask_unref (LayerMask *layer_mask);
void layer_mask_set_layer (LayerMask *layer_mask,
Layer *layer);
Layer * layer_mask_get_layer (LayerMask *layer_mask);
/* access functions */
void layer_set_name (Layer *layer,
const gchar *name);
const gchar * layer_get_name (const Layer *layer);
guchar * layer_data (Layer *layer);
LayerMask * layer_get_mask (Layer *layer);
gboolean layer_has_alpha (Layer *layer);
gboolean layer_is_floating_sel (Layer *layer);
gboolean layer_linked (Layer *layer);
TempBuf * layer_preview (Layer *layer,
gint width,
gint height);
TempBuf * layer_mask_preview (Layer *layer,
gint width,
gint height);
void layer_invalidate_previews (GimpImage *gimage);
Tattoo layer_get_tattoo (const Layer *layer);
void layer_set_tattoo (Layer *layer,
Tattoo value);
#define gimp_drawable_layer GIMP_IS_LAYER
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
void channel_layer_alpha (Channel *mask,
Layer *layer);
/* from channel.c */
void channel_layer_mask (Channel *mask,
Layer *layer);
#endif /* __LAYER_H__ */

View File

@ -34,6 +34,7 @@
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "image_render.h" #include "image_render.h"
#include "layer.h" #include "layer.h"
@ -92,9 +93,9 @@ struct _LayersDialog
gint gimage_width, gimage_height; gint gimage_width, gimage_height;
gdouble ratio; gdouble ratio;
Layer *active_layer; GimpLayer *active_layer;
Channel *active_channel; Channel *active_channel;
Layer *floating_sel; GimpLayer *floating_sel;
GSList *layer_widgets; GSList *layer_widgets;
}; };
@ -116,7 +117,7 @@ struct _LayerWidget
/* state information */ /* state information */
GimpImage *gimage; GimpImage *gimage;
Layer *layer; GimpLayer *layer;
gint width, height; gint width, height;
gint active_preview; gint active_preview;
@ -1339,7 +1340,7 @@ layers_dialog_add_layer_mask (Layer *layer)
if (! GTK_WIDGET_VISIBLE (layer_widget->mask_preview)) if (! GTK_WIDGET_VISIBLE (layer_widget->mask_preview))
{ {
gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview), gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview),
"gimp_layer_mask", layer_get_mask (layer)); "gimp_layer_mask", gimp_layer_get_mask (layer));
gtk_widget_show (layer_widget->mask_preview); gtk_widget_show (layer_widget->mask_preview);
} }
@ -2021,13 +2022,16 @@ layers_dialog_drag_trashcan_callback (GtkWidget *widget,
if ((src_widget = gtk_drag_get_source_widget (context))) if ((src_widget = gtk_drag_get_source_widget (context)))
{ {
Layer *layer; GimpLayer *layer;
LayerMask *layer_mask; GimpLayerMask *layer_mask;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer =
"gimp_layer"); (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer");
"gimp_layer_mask");
layer_mask =
(GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask");
if (layer && if (layer &&
layer == layersD->active_layer) layer == layersD->active_layer)
@ -2037,7 +2041,7 @@ layers_dialog_drag_trashcan_callback (GtkWidget *widget,
return_val = TRUE; return_val = TRUE;
} }
else if (layer_mask && else if (layer_mask &&
layer_mask_get_layer (layer_mask) == layersD->active_layer) gimp_layer_mask_get_layer (layer_mask) == layersD->active_layer)
{ {
layers_dialog_delete_layer_mask_callback (widget, NULL); layers_dialog_delete_layer_mask_callback (widget, NULL);
@ -2097,7 +2101,7 @@ layer_widget_create (GimpImage *gimage,
layer_widget->mask_pixmap = NULL; layer_widget->mask_pixmap = NULL;
layer_widget->width = -1; layer_widget->width = -1;
layer_widget->height = -1; layer_widget->height = -1;
layer_widget->layer_mask = (layer_get_mask (layer) != NULL); layer_widget->layer_mask = (gimp_layer_get_mask (layer) != NULL);
layer_widget->apply_mask = layer->apply_mask; layer_widget->apply_mask = layer->apply_mask;
layer_widget->edit_mask = layer->edit_mask; layer_widget->edit_mask = layer->edit_mask;
layer_widget->show_mask = layer->show_mask; layer_widget->show_mask = layer->show_mask;
@ -2196,7 +2200,7 @@ layer_widget_create (GimpImage *gimage,
if (layer_get_mask (layer) != NULL) if (layer_get_mask (layer) != NULL)
{ {
gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview), gtk_object_set_data (GTK_OBJECT (layer_widget->mask_preview),
"gimp_layer_mask", layer_get_mask (layer)); "gimp_layer_mask", gimp_layer_get_mask (layer));
gtk_widget_show (layer_widget->mask_preview); gtk_widget_show (layer_widget->mask_preview);
} }
@ -3031,17 +3035,17 @@ layer_widget_preview_redraw (LayerWidget *layer_widget,
switch (preview_type) switch (preview_type)
{ {
case LAYER_PREVIEW: case LAYER_PREVIEW:
preview_buf = layer_preview (layer_widget->layer, preview_buf = gimp_layer_preview (layer_widget->layer,
layer_widget->width, layer_widget->width,
layer_widget->height); layer_widget->height);
layer_widget->layer_pixmap_valid = TRUE; layer_widget->layer_pixmap_valid = TRUE;
break; break;
case MASK_PREVIEW: case MASK_PREVIEW:
preview_buf = layer_mask_preview (layer_widget->layer, preview_buf = gimp_layer_mask_preview (layer_widget->layer,
layer_widget->width, layer_widget->width,
layer_widget->height); layer_widget->height);
break; break;
} }
@ -3797,8 +3801,8 @@ add_mask_query_ok_callback (GtkWidget *widget,
{ {
AddMaskOptions *options; AddMaskOptions *options;
GimpImage *gimage; GimpImage *gimage;
LayerMask *mask; GimpLayerMask *mask;
Layer *layer; GimpLayer *layer;
options = (AddMaskOptions *) data; options = (AddMaskOptions *) data;
if ((layer = (options->layer)) && if ((layer = (options->layer)) &&

View File

@ -29,6 +29,7 @@
#include "channel.h" #include "channel.h"
#include "drawable.h" #include "drawable.h"
#include "gimplayermask.h"
#include "layer.h" #include "layer.h"
#include "temp_buf.h" #include "temp_buf.h"
#include "tile.h" #include "tile.h"

View File

@ -1338,7 +1338,7 @@ image_add_layer_mask_invoker (Argument *args)
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
GimpLayer *layer; GimpLayer *layer;
LayerMask *mask; GimpLayerMask *mask;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)

View File

@ -293,7 +293,7 @@ layer_create_mask_invoker (Argument *args)
Argument *return_args; Argument *return_args;
GimpLayer *layer; GimpLayer *layer;
gint32 mask_type; gint32 mask_type;
LayerMask *mask = NULL; GimpLayerMask *mask = NULL;
layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (layer == NULL) if (layer == NULL)

View File

@ -908,7 +908,7 @@ prefs_cancel_callback (GtkWidget *widget,
transparency_size = old_transparency_size; transparency_size = old_transparency_size;
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();
@ -995,7 +995,7 @@ prefs_toggle_callback (GtkWidget *widget,
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
render_setup (transparency_type, transparency_size); render_setup (transparency_type, transparency_size);
gimage_foreach ((GFunc) layer_invalidate_previews, NULL); gimage_foreach ((GFunc) gimp_image_invalidate_layer_previews, NULL);
gimage_invalidate_previews (); gimage_invalidate_previews ();
gdisplays_expose_full (); gdisplays_expose_full ();
gdisplays_flush (); gdisplays_flush ();

View File

@ -657,19 +657,19 @@ toolbox_drag_drop (GtkWidget *widget,
if ((src_widget = gtk_drag_get_source_widget (context))) if ((src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
@ -694,12 +694,12 @@ toolbox_drag_drop (GtkWidget *widget,
if (drawable) if (drawable)
{ {
GImage *gimage; GimpImage *gimage;
GImage *new_gimage; GimpImage *new_gimage;
Layer *new_layer; GimpLayer *new_layer;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
gint bytes; gint bytes;
GimpImageBaseType type; GimpImageBaseType type;
@ -735,7 +735,7 @@ toolbox_drag_drop (GtkWidget *widget,
if (layer) if (layer)
{ {
new_layer = layer_copy (layer, FALSE); new_layer = gimp_layer_copy (layer, FALSE);
} }
else else
{ {
@ -754,26 +754,27 @@ toolbox_drag_drop (GtkWidget *widget,
add_alpha_region (&srcPR, &destPR); add_alpha_region (&srcPR, &destPR);
new_layer = layer_new_from_tiles (new_gimage, new_layer =
gimp_image_base_type_with_alpha(new_gimage), gimp_layer_new_from_tiles (new_gimage,
tiles, gimp_image_base_type_with_alpha (new_gimage),
"", OPAQUE_OPACITY, NORMAL_MODE); tiles,
"", OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles); tile_manager_destroy (tiles);
} }
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer), gimp_layer_set_name (GIMP_LAYER (new_layer),
gimp_object_get_name (GIMP_OBJECT (drawable))); gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer) if (layer)
{ {
LayerMask *mask; GimpLayerMask *mask;
LayerMask *new_mask; GimpLayerMask *new_mask;
mask = layer_get_mask (layer); mask = gimp_layer_get_mask (layer);
new_mask = layer_get_mask (new_layer); new_mask = gimp_layer_get_mask (new_layer);
if (new_mask) if (new_mask)
{ {
@ -783,7 +784,7 @@ toolbox_drag_drop (GtkWidget *widget,
} }
gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y);
layer_translate (new_layer, -off_x, -off_y); gimp_layer_translate (new_layer, -off_x, -off_y);
gimp_image_add_layer (new_gimage, new_layer, 0); gimp_image_add_layer (new_gimage, new_layer, 0);

View File

@ -997,12 +997,13 @@ crop_image (GImage *gimage,
crop_adjust_guides (gimage, x1, y1, x2, y2); crop_adjust_guides (gimage, x1, y1, x2, y2);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
channel_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
layer_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);
gdisplays_shrink_wrap (gimage); gdisplays_shrink_wrap (gimage);
} }
gimp_remove_busy_cursors (NULL); gimp_remove_busy_cursors (NULL);
gdisplays_flush (); gdisplays_flush ();
} }

View File

@ -997,12 +997,13 @@ crop_image (GImage *gimage,
crop_adjust_guides (gimage, x1, y1, x2, y2); crop_adjust_guides (gimage, x1, y1, x2, y2);
/* shrink wrap and update all views */ /* shrink wrap and update all views */
channel_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
layer_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);
gdisplays_shrink_wrap (gimage); gdisplays_shrink_wrap (gimage);
} }
gimp_remove_busy_cursors (NULL); gimp_remove_busy_cursors (NULL);
gdisplays_flush (); gdisplays_flush ();
} }

View File

@ -35,6 +35,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "drawable.h" #include "drawable.h"
#include "errors.h" #include "errors.h"
#include "floating_sel.h" #include "floating_sel.h"

View File

@ -35,6 +35,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "channel.h"
#include "drawable.h" #include "drawable.h"
#include "errors.h" #include "errors.h"
#include "floating_sel.h" #include "floating_sel.h"

View File

@ -28,6 +28,7 @@
#include "apptypes.h" #include "apptypes.h"
#include "appenv.h" #include "appenv.h"
#include "channel.h"
#include "cursorutil.h" #include "cursorutil.h"
#include "draw_core.h" #include "draw_core.h"
#include "drawable.h" #include "drawable.h"

View File

@ -34,6 +34,7 @@
#include "gdisplay_ops.h" #include "gdisplay_ops.h"
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimplayermask.h"
#include "gimpparasite.h" #include "gimpparasite.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
@ -72,7 +73,7 @@ typedef enum
} UndoState; } UndoState;
typedef gboolean (* UndoPopFunc) (GImage *, UndoState, UndoType, gpointer); typedef gboolean (* UndoPopFunc) (GimpImage *, UndoState, UndoType, gpointer);
typedef void (* UndoFreeFunc) (UndoState, UndoType, gpointer); typedef void (* UndoFreeFunc) (UndoState, UndoType, gpointer);
typedef struct _Undo Undo; typedef struct _Undo Undo;
@ -91,47 +92,47 @@ struct _Undo
/* Pop functions */ /* Pop functions */
static gboolean undo_pop_image (GImage *, static gboolean undo_pop_image (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_mask (GImage *, static gboolean undo_pop_mask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_displace (GImage *, static gboolean undo_pop_layer_displace (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_transform (GImage *, static gboolean undo_pop_transform (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_paint (GImage *, static gboolean undo_pop_paint (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer (GImage *, static gboolean undo_pop_layer (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_mod (GImage *, static gboolean undo_pop_layer_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_mask (GImage *, static gboolean undo_pop_layer_mask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_channel (GImage *, static gboolean undo_pop_channel (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_channel_mod (GImage *, static gboolean undo_pop_channel_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_to_layer (GImage *, static gboolean undo_pop_fs_to_layer (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_rigor (GImage *, static gboolean undo_pop_fs_rigor (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_fs_relax (GImage *, static gboolean undo_pop_fs_relax (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_gimage_mod (GImage *, static gboolean undo_pop_gimage_mod (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_guide (GImage *, static gboolean undo_pop_guide (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_parasite (GImage *, static gboolean undo_pop_parasite (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_qmask (GImage *, static gboolean undo_pop_qmask (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_resolution (GImage *, static gboolean undo_pop_resolution (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_rename (GImage *, static gboolean undo_pop_layer_rename (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_layer_reposition (GImage *, static gboolean undo_pop_layer_reposition (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
static gboolean undo_pop_cantundo (GImage *, static gboolean undo_pop_cantundo (GimpImage *,
UndoState, UndoType, gpointer); UndoState, UndoType, gpointer);
@ -207,9 +208,9 @@ channel_size (Channel *channel)
static void static void
undo_free_list (GImage *gimage, undo_free_list (GimpImage *gimage,
UndoState state, UndoState state,
GSList *list) GSList *list)
{ {
GSList *orig; GSList *orig;
Undo *undo; Undo *undo;
@ -234,7 +235,7 @@ undo_free_list (GImage *gimage,
static GSList * static GSList *
remove_stack_bottom (GImage *gimage) remove_stack_bottom (GimpImage *gimage)
{ {
GSList *list; GSList *list;
GSList *last; GSList *last;
@ -303,7 +304,7 @@ undo_new (UndoType type,
static gboolean static gboolean
undo_free_up_space (GImage *gimage) undo_free_up_space (GimpImage *gimage)
{ {
/* If there are 0 levels of undo return FALSE. */ /* If there are 0 levels of undo return FALSE. */
if (levels_of_undo == 0) if (levels_of_undo == 0)
@ -320,10 +321,10 @@ undo_free_up_space (GImage *gimage)
static Undo * static Undo *
undo_push (GImage *gimage, undo_push (GimpImage *gimage,
glong size, glong size,
UndoType type, UndoType type,
gboolean dirties_image) gboolean dirties_image)
{ {
Undo *new; Undo *new;
@ -376,7 +377,7 @@ undo_push (GImage *gimage,
static gboolean static gboolean
pop_stack (GImage *gimage, pop_stack (GimpImage *gimage,
GSList **stack_ptr, GSList **stack_ptr,
GSList **unstack_ptr, GSList **unstack_ptr,
UndoState state) UndoState state)
@ -490,7 +491,7 @@ pop_stack (GImage *gimage,
gboolean gboolean
undo_pop (GImage *gimage) undo_pop (GimpImage *gimage)
{ {
/* Very bad idea to pop an action off the undo stack if we're in the /* Very bad idea to pop an action off the undo stack if we're in the
* middle of a group, since the whole group won't be popped. Might * middle of a group, since the whole group won't be popped. Might
@ -504,7 +505,7 @@ undo_pop (GImage *gimage)
gboolean gboolean
undo_redo (GImage *gimage) undo_redo (GimpImage *gimage)
{ {
/* ditto for redo stack */ /* ditto for redo stack */
g_return_val_if_fail (gimage->pushing_undo_group == UNDO_NULL, FALSE); g_return_val_if_fail (gimage->pushing_undo_group == UNDO_NULL, FALSE);
@ -558,7 +559,7 @@ undo_get_topitem_type (GSList *stack)
const gchar * const gchar *
undo_get_undo_name (GImage *gimage) undo_get_undo_name (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, NULL); g_return_val_if_fail (gimage != NULL, NULL);
@ -570,7 +571,7 @@ undo_get_undo_name (GImage *gimage)
} }
UndoType UndoType
undo_get_undo_top_type (GImage *gimage) undo_get_undo_top_type (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, UNDO_NULL); g_return_val_if_fail (gimage != NULL, UNDO_NULL);
@ -583,7 +584,7 @@ undo_get_undo_top_type (GImage *gimage)
const gchar * const gchar *
undo_get_redo_name (GImage *gimage) undo_get_redo_name (GimpImage *gimage)
{ {
g_return_val_if_fail (gimage != NULL, NULL); g_return_val_if_fail (gimage != NULL, NULL);
@ -631,7 +632,7 @@ undo_map_over_stack (GSList *stack,
} }
void void
undo_map_over_undo_stack (GImage *gimage, undo_map_over_undo_stack (GimpImage *gimage,
undo_map_fn fn, undo_map_fn fn,
gpointer data) gpointer data)
{ {
@ -641,7 +642,7 @@ undo_map_over_undo_stack (GImage *gimage,
} }
void void
undo_map_over_redo_stack (GImage *gimage, undo_map_over_redo_stack (GimpImage *gimage,
undo_map_fn fn, undo_map_fn fn,
gpointer data) gpointer data)
{ {
@ -652,7 +653,7 @@ undo_map_over_redo_stack (GImage *gimage,
void void
undo_free (GImage *gimage) undo_free (GimpImage *gimage)
{ {
undo_free_list (gimage, UNDO, gimage->undo_stack); undo_free_list (gimage, UNDO, gimage->undo_stack);
undo_free_list (gimage, REDO, gimage->redo_stack); undo_free_list (gimage, REDO, gimage->redo_stack);
@ -683,7 +684,7 @@ undo_free (GImage *gimage)
/* group Undo funcs */ /* group Undo funcs */
gboolean gboolean
undo_push_group_start (GImage *gimage, undo_push_group_start (GimpImage *gimage,
UndoType type) UndoType type)
{ {
Undo *boundary_marker; Undo *boundary_marker;
@ -733,7 +734,7 @@ undo_push_group_start (GImage *gimage,
gboolean gboolean
undo_push_group_end (GImage *gimage) undo_push_group_end (GimpImage *gimage)
{ {
Undo *boundary_marker; Undo *boundary_marker;
@ -778,7 +779,7 @@ struct _ImageUndo
gboolean gboolean
undo_push_image (GImage *gimage, undo_push_image (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gint x1, gint x1,
gint y1, gint y1,
@ -834,7 +835,7 @@ undo_push_image (GImage *gimage,
gboolean gboolean
undo_push_image_mod (GImage *gimage, undo_push_image_mod (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gint x1, gint x1,
gint y1, gint y1,
@ -893,7 +894,7 @@ undo_push_image_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_image (GImage *gimage, undo_pop_image (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer image_undo_ptr) gpointer image_undo_ptr)
@ -984,8 +985,8 @@ undo_free_image (UndoState state,
/* Mask Undo functions */ /* Mask Undo functions */
gboolean gboolean
undo_push_mask (GImage *gimage, undo_push_mask (GimpImage *gimage,
gpointer mask_ptr) gpointer mask_ptr)
{ {
Undo *new; Undo *new;
MaskUndo *mask_undo; MaskUndo *mask_undo;
@ -1019,19 +1020,19 @@ undo_push_mask (GImage *gimage,
static gboolean static gboolean
undo_pop_mask (GImage *gimage, undo_pop_mask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer mask_ptr) gpointer mask_ptr)
{ {
MaskUndo *mask_undo; MaskUndo *mask_undo;
TileManager *new_tiles; TileManager *new_tiles;
Channel *sel_mask; Channel *sel_mask;
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
gint selection; gint selection;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gint width, height; gint width, height;
guchar empty = 0; guchar empty = 0;
width = height = 0; width = height = 0;
@ -1135,7 +1136,7 @@ struct _LayerDisplayUndo
}; };
gboolean gboolean
undo_push_layer_displace (GImage *gimage, undo_push_layer_displace (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -1161,13 +1162,13 @@ undo_push_layer_displace (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_displace (GImage *gimage, undo_pop_layer_displace (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer info_ptr) gpointer info_ptr)
{ {
Layer *layer; GimpLayer *layer;
gint old_offsets[2]; gint old_offsets[2];
LayerDisplaceUndo *ldu; LayerDisplaceUndo *ldu;
ldu = (LayerDisplaceUndo *) info_ptr; ldu = (LayerDisplaceUndo *) info_ptr;
@ -1234,8 +1235,8 @@ undo_free_layer_displace (UndoState state,
/* Transform Undo */ /* Transform Undo */
gboolean gboolean
undo_push_transform (GImage *gimage, undo_push_transform (GimpImage *gimage,
gpointer tu_ptr) gpointer tu_ptr)
{ {
Undo *new; Undo *new;
@ -1257,7 +1258,7 @@ undo_push_transform (GImage *gimage,
static gboolean static gboolean
undo_pop_transform (GImage *gimage, undo_pop_transform (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer tu_ptr) gpointer tu_ptr)
@ -1265,8 +1266,8 @@ undo_pop_transform (GImage *gimage,
TransformCore *tc; TransformCore *tc;
TransformUndo *tu; TransformUndo *tu;
TileManager *temp; TileManager *temp;
gdouble d; gdouble d;
gint i; gint i;
/* Can't have ANY tool selected - maybe a plugin running */ /* Can't have ANY tool selected - maybe a plugin running */
if (active_tool == NULL) if (active_tool == NULL)
@ -1325,8 +1326,8 @@ undo_free_transform (UndoState state,
/* Paint Undo */ /* Paint Undo */
gboolean gboolean
undo_push_paint (GImage *gimage, undo_push_paint (GimpImage *gimage,
gpointer pu_ptr) gpointer pu_ptr)
{ {
Undo *new; Undo *new;
@ -1348,7 +1349,7 @@ undo_push_paint (GImage *gimage,
static gboolean static gboolean
undo_pop_paint (GImage *gimage, undo_pop_paint (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer pu_ptr) gpointer pu_ptr)
@ -1409,9 +1410,9 @@ undo_free_paint (UndoState state,
/* New Layer Undo */ /* New Layer Undo */
gboolean gboolean
undo_push_layer (GImage *gimage, undo_push_layer (GimpImage *gimage,
UndoType type, UndoType type,
gpointer lu_ptr) gpointer lu_ptr)
{ {
LayerUndo *lu; LayerUndo *lu;
Undo *new; Undo *new;
@ -1445,7 +1446,7 @@ undo_push_layer (GImage *gimage,
static gboolean static gboolean
undo_pop_layer (GImage *gimage, undo_pop_layer (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer lu_ptr) gpointer lu_ptr)
@ -1533,10 +1534,10 @@ undo_free_layer (UndoState state,
/* Layer Mod Undo */ /* Layer Mod Undo */
gboolean gboolean
undo_push_layer_mod (GImage *gimage, undo_push_layer_mod (GimpImage *gimage,
gpointer layer_ptr) gpointer layer_ptr)
{ {
Layer *layer; GimpLayer *layer;
Undo *new; Undo *new;
TileManager *tiles; TileManager *tiles;
gpointer *data; gpointer *data;
@ -1574,7 +1575,7 @@ undo_push_layer_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_mod (GImage *gimage, undo_pop_layer_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -1583,10 +1584,10 @@ undo_pop_layer_mod (GImage *gimage,
gint layer_type; gint layer_type;
TileManager *tiles; TileManager *tiles;
TileManager *temp; TileManager *temp;
Layer *layer; GimpLayer *layer;
data = (gpointer *) data_ptr; data = (gpointer *) data_ptr;
layer = (Layer *) data[0]; layer = (GimpLayer *) data[0];
tiles = (TileManager *) data[1]; tiles = (TileManager *) data[1];
@ -1656,9 +1657,9 @@ undo_free_layer_mod (UndoState state,
/* Layer Mask Undo */ /* Layer Mask Undo */
gboolean gboolean
undo_push_layer_mask (GImage *gimage, undo_push_layer_mask (GimpImage *gimage,
UndoType type, UndoType type,
gpointer lmu_ptr) gpointer lmu_ptr)
{ {
LayerMaskUndo *lmu; LayerMaskUndo *lmu;
Undo *new; Undo *new;
@ -1683,7 +1684,8 @@ undo_push_layer_mask (GImage *gimage,
else else
{ {
if (type == LAYER_MASK_REMOVE_UNDO) if (type == LAYER_MASK_REMOVE_UNDO)
layer_mask_delete (lmu->mask); gtk_object_unref (GTK_OBJECT (lmu->mask));
g_free (lmu); g_free (lmu);
return FALSE; return FALSE;
} }
@ -1691,7 +1693,7 @@ undo_push_layer_mask (GImage *gimage,
static gboolean static gboolean
undo_pop_layer_mask (GImage *gimage, undo_pop_layer_mask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer lmu_ptr) gpointer lmu_ptr)
@ -1758,7 +1760,7 @@ undo_free_layer_mask (UndoState state,
*/ */
if ((state == REDO && type == LAYER_MASK_ADD_UNDO) || if ((state == REDO && type == LAYER_MASK_ADD_UNDO) ||
(state == UNDO && type == LAYER_MASK_REMOVE_UNDO)) (state == UNDO && type == LAYER_MASK_REMOVE_UNDO))
layer_mask_delete (lmu->mask); gtk_object_unref (GTK_OBJECT (lmu->mask));
g_free (lmu); g_free (lmu);
} }
@ -1768,13 +1770,13 @@ undo_free_layer_mask (UndoState state,
/* New Channel Undo */ /* New Channel Undo */
gboolean gboolean
undo_push_channel (GImage *gimage, undo_push_channel (GimpImage *gimage,
UndoType type, UndoType type,
gpointer cu_ptr) gpointer cu_ptr)
{ {
ChannelUndo *cu; ChannelUndo *cu;
Undo *new; Undo *new;
gint size; gint size;
g_return_val_if_fail (type == CHANNEL_ADD_UNDO || g_return_val_if_fail (type == CHANNEL_ADD_UNDO ||
type == CHANNEL_REMOVE_UNDO, type == CHANNEL_REMOVE_UNDO,
@ -1803,7 +1805,7 @@ undo_push_channel (GImage *gimage,
static gboolean static gboolean
undo_pop_channel (GImage *gimage, undo_pop_channel (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer cu_ptr) gpointer cu_ptr)
@ -1879,8 +1881,8 @@ undo_free_channel (UndoState state,
/* Channel Mod Undo */ /* Channel Mod Undo */
gboolean gboolean
undo_push_channel_mod (GImage *gimage, undo_push_channel_mod (GimpImage *gimage,
gpointer channel_ptr) gpointer channel_ptr)
{ {
Channel *channel; Channel *channel;
TileManager *tiles; TileManager *tiles;
@ -1915,7 +1917,7 @@ undo_push_channel_mod (GImage *gimage,
static gboolean static gboolean
undo_pop_channel_mod (GImage *gimage, undo_pop_channel_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -1972,11 +1974,11 @@ undo_free_channel_mod (UndoState state,
/* Floating Selection to Layer Undo */ /* Floating Selection to Layer Undo */
gboolean gboolean
undo_push_fs_to_layer (GImage *gimage, undo_push_fs_to_layer (GimpImage *gimage,
gpointer fsu_ptr) gpointer fsu_ptr)
{ {
FStoLayerUndo *fsu; FStoLayerUndo *fsu;
Undo *new; Undo *new;
fsu = (FStoLayerUndo *) fsu_ptr; fsu = (FStoLayerUndo *) fsu_ptr;
@ -1999,7 +2001,7 @@ undo_push_fs_to_layer (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_to_layer (GImage *gimage, undo_pop_fs_to_layer (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer fsu_ptr) gpointer fsu_ptr)
@ -2079,8 +2081,8 @@ undo_free_fs_to_layer (UndoState state,
/* Floating Selection Rigor Undo */ /* Floating Selection Rigor Undo */
gboolean gboolean
undo_push_fs_rigor (GImage *gimage, undo_push_fs_rigor (GimpImage *gimage,
gint layer_ID) gint layer_ID)
{ {
Undo *new; Undo *new;
@ -2101,7 +2103,7 @@ undo_push_fs_rigor (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_rigor (GImage *gimage, undo_pop_fs_rigor (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer layer_ptr) gpointer layer_ptr)
@ -2158,8 +2160,8 @@ undo_free_fs_rigor (UndoState state,
/* Floating Selection Relax Undo */ /* Floating Selection Relax Undo */
gboolean gboolean
undo_push_fs_relax (GImage *gimage, undo_push_fs_relax (GimpImage *gimage,
gint32 layer_ID) gint32 layer_ID)
{ {
Undo *new; Undo *new;
@ -2180,7 +2182,7 @@ undo_push_fs_relax (GImage *gimage,
static gboolean static gboolean
undo_pop_fs_relax (GImage *gimage, undo_pop_fs_relax (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer layer_ptr) gpointer layer_ptr)
@ -2237,7 +2239,7 @@ undo_free_fs_relax (UndoState state,
/* GImage Mod Undo */ /* GImage Mod Undo */
gboolean gboolean
undo_push_gimage_mod (GImage *gimage) undo_push_gimage_mod (GimpImage *gimage)
{ {
Undo *new; Undo *new;
gint *data; gint *data;
@ -2262,7 +2264,7 @@ undo_push_gimage_mod (GImage *gimage)
static gboolean static gboolean
undo_pop_gimage_mod (GImage *gimage, undo_pop_gimage_mod (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2284,8 +2286,8 @@ undo_pop_gimage_mod (GImage *gimage,
gimp_image_projection_realloc (gimage); gimp_image_projection_realloc (gimage);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
channel_invalidate_previews (gimage); gimp_image_invalidate_layer_previews (gimage);
layer_invalidate_previews (gimage); gimp_image_invalidate_channel_previews (gimage);
gimp_image_invalidate_preview (gimage); gimp_image_invalidate_preview (gimage);
gdisplays_update_full (gimage); gdisplays_update_full (gimage);
gdisplays_update_title (gimage); gdisplays_update_title (gimage);
@ -2314,13 +2316,13 @@ typedef struct _QmaskUndo QmaskUndo;
struct _QmaskUndo struct _QmaskUndo
{ {
GImage *gimage; GimpImage *gimage;
gboolean qmask; gboolean qmask;
}; };
gboolean gboolean
undo_push_qmask (GImage *gimage) undo_push_qmask (GimpImage *gimage)
{ {
Undo *new; Undo *new;
QmaskUndo *data; QmaskUndo *data;
@ -2343,7 +2345,7 @@ undo_push_qmask (GImage *gimage)
} }
static gboolean static gboolean
undo_pop_qmask (GImage *gimage, undo_pop_qmask (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2379,14 +2381,14 @@ typedef struct _GuideUndo GuideUndo;
struct _GuideUndo struct _GuideUndo
{ {
GImage *gimage; GimpImage *gimage;
Guide *guide; Guide *guide;
Guide orig; Guide orig;
}; };
gboolean gboolean
undo_push_guide (GImage *gimage, undo_push_guide (GimpImage *gimage,
gpointer guide) gpointer guide)
{ {
Undo *new; Undo *new;
GuideUndo *data; GuideUndo *data;
@ -2413,7 +2415,7 @@ undo_push_guide (GImage *gimage,
static gboolean static gboolean
undo_pop_guide (GImage *gimage, undo_pop_guide (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2469,7 +2471,7 @@ struct _ResolutionUndo
}; };
gboolean gboolean
undo_push_resolution (GImage *gimage) undo_push_resolution (GimpImage *gimage)
{ {
Undo *new; Undo *new;
ResolutionUndo *data; ResolutionUndo *data;
@ -2493,7 +2495,7 @@ undo_push_resolution (GImage *gimage)
} }
static gboolean static gboolean
undo_pop_resolution (GImage *gimage, undo_pop_resolution (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2541,15 +2543,15 @@ typedef struct _ParasiteUndo ParasiteUndo;
struct _ParasiteUndo struct _ParasiteUndo
{ {
GImage *gimage; GimpImage *gimage;
GimpDrawable *drawable; GimpDrawable *drawable;
GimpParasite *parasite; GimpParasite *parasite;
gchar *name; gchar *name;
}; };
gboolean gboolean
undo_push_image_parasite (GImage *gimage, undo_push_image_parasite (GimpImage *gimage,
gpointer parasite) gpointer parasite)
{ {
Undo *new; Undo *new;
ParasiteUndo *data; ParasiteUndo *data;
@ -2574,7 +2576,7 @@ undo_push_image_parasite (GImage *gimage,
} }
gboolean gboolean
undo_push_image_parasite_remove (GImage *gimage, undo_push_image_parasite_remove (GimpImage *gimage,
const gchar *name) const gchar *name)
{ {
Undo *new; Undo *new;
@ -2600,7 +2602,7 @@ undo_push_image_parasite_remove (GImage *gimage,
} }
gboolean gboolean
undo_push_drawable_parasite (GImage *gimage, undo_push_drawable_parasite (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
gpointer parasite) gpointer parasite)
{ {
@ -2626,7 +2628,7 @@ undo_push_drawable_parasite (GImage *gimage,
} }
gboolean gboolean
undo_push_drawable_parasite_remove (GImage *gimage, undo_push_drawable_parasite_remove (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
const gchar *name) const gchar *name)
{ {
@ -2653,7 +2655,7 @@ undo_push_drawable_parasite_remove (GImage *gimage,
static gboolean static gboolean
undo_pop_parasite (GImage *gimage, undo_pop_parasite (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)
@ -2732,7 +2734,7 @@ struct _LayerRepositionUndo
}; };
gboolean gboolean
undo_push_layer_reposition (GImage *gimage, undo_push_layer_reposition (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -2756,13 +2758,13 @@ undo_push_layer_reposition (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_layer_reposition (GImage *gimage, undo_pop_layer_reposition (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
void *data_ptr) void *data_ptr)
{ {
LayerRepositionUndo *data = data_ptr; LayerRepositionUndo *data = data_ptr;
gint tmp; gint tmp;
/* what's the layer's current index? */ /* what's the layer's current index? */
tmp = g_slist_index (gimage->layers, data->layer); tmp = g_slist_index (gimage->layers, data->layer);
@ -2795,7 +2797,7 @@ struct _LayerRenameUndo
}; };
gboolean gboolean
undo_push_layer_rename (GImage *gimage, undo_push_layer_rename (GimpImage *gimage,
GimpLayer *layer) GimpLayer *layer)
{ {
Undo *new; Undo *new;
@ -2819,13 +2821,13 @@ undo_push_layer_rename (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_layer_rename (GImage *gimage, undo_pop_layer_rename (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
void *data_ptr) void *data_ptr)
{ {
LayerRenameUndo *data = data_ptr; LayerRenameUndo *data = data_ptr;
gchar *tmp; gchar *tmp;
tmp = g_strdup (layer_get_name (data->layer)); tmp = g_strdup (layer_get_name (data->layer));
layer_set_name (data->layer, data->old_name); layer_set_name (data->layer, data->old_name);
@ -2854,7 +2856,7 @@ undo_free_layer_rename (UndoState state,
*/ */
gboolean gboolean
undo_push_cantundo (GImage *gimage, undo_push_cantundo (GimpImage *gimage,
const gchar *action) const gchar *action)
{ {
Undo *new; Undo *new;
@ -2875,7 +2877,7 @@ undo_push_cantundo (GImage *gimage,
} }
static gboolean static gboolean
undo_pop_cantundo (GImage *gimage, undo_pop_cantundo (GimpImage *gimage,
UndoState state, UndoState state,
UndoType type, UndoType type,
gpointer data_ptr) gpointer data_ptr)

View File

@ -35,6 +35,7 @@
#include "gimpcontextpreview.h" #include "gimpcontextpreview.h"
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimpbrushlist.h" #include "gimpbrushlist.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "gradient.h" #include "gradient.h"
#include "gradient_header.h" #include "gradient_header.h"
@ -1090,8 +1091,9 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
else if (GIMP_IS_LAYER_MASK (drawable)) else if (GIMP_IS_LAYER_MASK (drawable))
{ {
tmpbuf = tmpbuf =
layer_mask_preview (layer_mask_get_layer (GIMP_LAYER_MASK (drawable)), gimp_layer_mask_preview
width, height); (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)),
width, height);
} }
else if (GIMP_IS_CHANNEL (drawable)) else if (GIMP_IS_CHANNEL (drawable))
{ {

View File

@ -657,19 +657,19 @@ toolbox_drag_drop (GtkWidget *widget,
if ((src_widget = gtk_drag_get_source_widget (context))) if ((src_widget = gtk_drag_get_source_widget (context)))
{ {
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
Layer *layer = NULL; GimpLayer *layer = NULL;
Channel *channel = NULL; Channel *channel = NULL;
LayerMask *layer_mask = NULL; GimpLayerMask *layer_mask = NULL;
GImage *component = NULL; GimpImage *component = NULL;
ChannelType component_type = -1; ChannelType component_type = -1;
layer = (Layer *) gtk_object_get_data (GTK_OBJECT (src_widget), layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer"); "gimp_layer");
channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_channel"); "gimp_channel");
layer_mask = (LayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_layer_mask"); "gimp_layer_mask");
component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget),
"gimp_component"); "gimp_component");
@ -694,12 +694,12 @@ toolbox_drag_drop (GtkWidget *widget,
if (drawable) if (drawable)
{ {
GImage *gimage; GimpImage *gimage;
GImage *new_gimage; GimpImage *new_gimage;
Layer *new_layer; GimpLayer *new_layer;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
gint bytes; gint bytes;
GimpImageBaseType type; GimpImageBaseType type;
@ -735,7 +735,7 @@ toolbox_drag_drop (GtkWidget *widget,
if (layer) if (layer)
{ {
new_layer = layer_copy (layer, FALSE); new_layer = gimp_layer_copy (layer, FALSE);
} }
else else
{ {
@ -754,26 +754,27 @@ toolbox_drag_drop (GtkWidget *widget,
add_alpha_region (&srcPR, &destPR); add_alpha_region (&srcPR, &destPR);
new_layer = layer_new_from_tiles (new_gimage, new_layer =
gimp_image_base_type_with_alpha(new_gimage), gimp_layer_new_from_tiles (new_gimage,
tiles, gimp_image_base_type_with_alpha (new_gimage),
"", OPAQUE_OPACITY, NORMAL_MODE); tiles,
"", OPAQUE_OPACITY, NORMAL_MODE);
tile_manager_destroy (tiles); tile_manager_destroy (tiles);
} }
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
layer_set_name (GIMP_LAYER (new_layer), gimp_layer_set_name (GIMP_LAYER (new_layer),
gimp_object_get_name (GIMP_OBJECT (drawable))); gimp_object_get_name (GIMP_OBJECT (drawable)));
if (layer) if (layer)
{ {
LayerMask *mask; GimpLayerMask *mask;
LayerMask *new_mask; GimpLayerMask *new_mask;
mask = layer_get_mask (layer); mask = gimp_layer_get_mask (layer);
new_mask = layer_get_mask (new_layer); new_mask = gimp_layer_get_mask (new_layer);
if (new_mask) if (new_mask)
{ {
@ -783,7 +784,7 @@ toolbox_drag_drop (GtkWidget *widget,
} }
gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y); gimp_drawable_offsets (GIMP_DRAWABLE (new_layer), &off_x, &off_y);
layer_translate (new_layer, -off_x, -off_y); gimp_layer_translate (new_layer, -off_x, -off_y);
gimp_image_add_layer (new_gimage, new_layer, 0); gimp_image_add_layer (new_gimage, new_layer, 0);

107
app/xcf.c
View File

@ -43,6 +43,7 @@
#include "floating_sel.h" #include "floating_sel.h"
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
#include "plug_in.h" #include "plug_in.h"
@ -136,33 +137,33 @@ static void xcf_save_tile_rle (XcfInfo *info,
Tile *tile, Tile *tile,
guchar *rlebuf); guchar *rlebuf);
static GImage* xcf_load_image (XcfInfo *info); static GimpImage * xcf_load_image (XcfInfo *info);
static gboolean xcf_load_image_props (XcfInfo *info, static gboolean xcf_load_image_props (XcfInfo *info,
GImage *gimage); GImage *gimage);
static gboolean xcf_load_layer_props (XcfInfo *info, static gboolean xcf_load_layer_props (XcfInfo *info,
GImage *gimage, GImage *gimage,
Layer *layer); Layer *layer);
static gboolean xcf_load_channel_props (XcfInfo *info, static gboolean xcf_load_channel_props (XcfInfo *info,
GImage *gimage, GImage *gimage,
Channel *channel); Channel *channel);
static gboolean xcf_load_prop (XcfInfo *info, static gboolean xcf_load_prop (XcfInfo *info,
PropType *prop_type, PropType *prop_type,
guint32 *prop_size); guint32 *prop_size);
static Layer* xcf_load_layer (XcfInfo *info, static GimpLayer * xcf_load_layer (XcfInfo *info,
GImage *gimage); GImage *gimage);
static Channel* xcf_load_channel (XcfInfo *info, static Channel * xcf_load_channel (XcfInfo *info,
GImage *gimage); GImage *gimage);
static LayerMask* xcf_load_layer_mask (XcfInfo *info, static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info,
GImage *gimage); GImage *gimage);
static gboolean xcf_load_hierarchy (XcfInfo *info, static gboolean xcf_load_hierarchy (XcfInfo *info,
TileManager *tiles); TileManager *tiles);
static gboolean xcf_load_level (XcfInfo *info, static gboolean xcf_load_level (XcfInfo *info,
TileManager *tiles); TileManager *tiles);
static gboolean xcf_load_tile (XcfInfo *info, static gboolean xcf_load_tile (XcfInfo *info,
Tile *tile); Tile *tile);
static gboolean xcf_load_tile_rle (XcfInfo *info, static gboolean xcf_load_tile_rle (XcfInfo *info,
Tile *tile, Tile *tile,
gint data_length); gint data_length);
#ifdef SWAP_FROM_FILE #ifdef SWAP_FROM_FILE
static gboolean xcf_swap_func (gint fd, static gboolean xcf_swap_func (gint fd,
@ -2225,22 +2226,22 @@ xcf_load_prop (XcfInfo *info,
return TRUE; return TRUE;
} }
static Layer* static GimpLayer *
xcf_load_layer (XcfInfo *info, xcf_load_layer (XcfInfo *info,
GImage *gimage) GImage *gimage)
{ {
Layer *layer; GimpLayer *layer;
LayerMask *layer_mask; GimpLayerMask *layer_mask;
guint32 hierarchy_offset; guint32 hierarchy_offset;
guint32 layer_mask_offset; guint32 layer_mask_offset;
gboolean apply_mask; gboolean apply_mask;
gboolean edit_mask; gboolean edit_mask;
gboolean show_mask; gboolean show_mask;
gint width; gint width;
gint height; gint height;
gint type; gint type;
gint add_floating_sel; gint add_floating_sel;
gchar *name; gchar *name;
/* check and see if this is the drawable the floating selection /* check and see if this is the drawable the floating selection
* is attached to. if it is then we'll do the attachment at * is attached to. if it is then we'll do the attachment at
@ -2283,14 +2284,14 @@ xcf_load_layer (XcfInfo *info,
goto error; goto error;
/* set the offsets of the layer_mask */ /* set the offsets of the layer_mask */
GIMP_DRAWABLE(layer_mask)->offset_x = GIMP_DRAWABLE(layer)->offset_x; GIMP_DRAWABLE (layer_mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE(layer_mask)->offset_y = GIMP_DRAWABLE(layer)->offset_y; GIMP_DRAWABLE (layer_mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
apply_mask = layer->apply_mask; apply_mask = layer->apply_mask;
edit_mask = layer->edit_mask; edit_mask = layer->edit_mask;
show_mask = layer->show_mask; show_mask = layer->show_mask;
layer_add_mask (layer, layer_mask); gimp_layer_add_mask (layer, layer_mask);
layer->apply_mask = apply_mask; layer->apply_mask = apply_mask;
layer->edit_mask = edit_mask; layer->edit_mask = edit_mask;
@ -2370,17 +2371,17 @@ error:
return NULL; return NULL;
} }
static LayerMask* static GimpLayerMask *
xcf_load_layer_mask (XcfInfo *info, xcf_load_layer_mask (XcfInfo *info,
GImage *gimage) GImage *gimage)
{ {
LayerMask *layer_mask; GimpLayerMask *layer_mask;
guint32 hierarchy_offset; guint32 hierarchy_offset;
gint width; gint width;
gint height; gint height;
gint add_floating_sel; gint add_floating_sel;
gchar *name; gchar *name;
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
/* check and see if this is the drawable the floating selection /* check and see if this is the drawable the floating selection
* is attached to. if it is then we'll do the attachment at * is attached to. if it is then we'll do the attachment at
@ -2394,7 +2395,7 @@ xcf_load_layer_mask (XcfInfo *info,
info->cp += xcf_read_string (info->fp, &name, 1); info->cp += xcf_read_string (info->fp, &name, 1);
/* create a new layer mask */ /* create a new layer mask */
layer_mask = layer_mask_new (gimage, width, height, name, &color); layer_mask = gimp_layer_mask_new (gimage, width, height, name, &color);
g_free (name); g_free (name);
if (!layer_mask) if (!layer_mask)
return NULL; return NULL;
@ -2423,7 +2424,7 @@ xcf_load_layer_mask (XcfInfo *info,
return layer_mask; return layer_mask;
error: error:
layer_mask_delete (layer_mask); gtk_object_unref (GTK_OBJECT (layer_mask));
return NULL; return NULL;
} }

View File

@ -43,6 +43,7 @@
#include "floating_sel.h" #include "floating_sel.h"
#include "gimage.h" #include "gimage.h"
#include "gimage_mask.h" #include "gimage_mask.h"
#include "gimplayermask.h"
#include "gimprc.h" #include "gimprc.h"
#include "layer.h" #include "layer.h"
#include "plug_in.h" #include "plug_in.h"
@ -136,33 +137,33 @@ static void xcf_save_tile_rle (XcfInfo *info,
Tile *tile, Tile *tile,
guchar *rlebuf); guchar *rlebuf);
static GImage* xcf_load_image (XcfInfo *info); static GimpImage * xcf_load_image (XcfInfo *info);
static gboolean xcf_load_image_props (XcfInfo *info, static gboolean xcf_load_image_props (XcfInfo *info,
GImage *gimage); GImage *gimage);
static gboolean xcf_load_layer_props (XcfInfo *info, static gboolean xcf_load_layer_props (XcfInfo *info,
GImage *gimage, GImage *gimage,
Layer *layer); Layer *layer);
static gboolean xcf_load_channel_props (XcfInfo *info, static gboolean xcf_load_channel_props (XcfInfo *info,
GImage *gimage, GImage *gimage,
Channel *channel); Channel *channel);
static gboolean xcf_load_prop (XcfInfo *info, static gboolean xcf_load_prop (XcfInfo *info,
PropType *prop_type, PropType *prop_type,
guint32 *prop_size); guint32 *prop_size);
static Layer* xcf_load_layer (XcfInfo *info, static GimpLayer * xcf_load_layer (XcfInfo *info,
GImage *gimage); GImage *gimage);
static Channel* xcf_load_channel (XcfInfo *info, static Channel * xcf_load_channel (XcfInfo *info,
GImage *gimage); GImage *gimage);
static LayerMask* xcf_load_layer_mask (XcfInfo *info, static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info,
GImage *gimage); GImage *gimage);
static gboolean xcf_load_hierarchy (XcfInfo *info, static gboolean xcf_load_hierarchy (XcfInfo *info,
TileManager *tiles); TileManager *tiles);
static gboolean xcf_load_level (XcfInfo *info, static gboolean xcf_load_level (XcfInfo *info,
TileManager *tiles); TileManager *tiles);
static gboolean xcf_load_tile (XcfInfo *info, static gboolean xcf_load_tile (XcfInfo *info,
Tile *tile); Tile *tile);
static gboolean xcf_load_tile_rle (XcfInfo *info, static gboolean xcf_load_tile_rle (XcfInfo *info,
Tile *tile, Tile *tile,
gint data_length); gint data_length);
#ifdef SWAP_FROM_FILE #ifdef SWAP_FROM_FILE
static gboolean xcf_swap_func (gint fd, static gboolean xcf_swap_func (gint fd,
@ -2225,22 +2226,22 @@ xcf_load_prop (XcfInfo *info,
return TRUE; return TRUE;
} }
static Layer* static GimpLayer *
xcf_load_layer (XcfInfo *info, xcf_load_layer (XcfInfo *info,
GImage *gimage) GImage *gimage)
{ {
Layer *layer; GimpLayer *layer;
LayerMask *layer_mask; GimpLayerMask *layer_mask;
guint32 hierarchy_offset; guint32 hierarchy_offset;
guint32 layer_mask_offset; guint32 layer_mask_offset;
gboolean apply_mask; gboolean apply_mask;
gboolean edit_mask; gboolean edit_mask;
gboolean show_mask; gboolean show_mask;
gint width; gint width;
gint height; gint height;
gint type; gint type;
gint add_floating_sel; gint add_floating_sel;
gchar *name; gchar *name;
/* check and see if this is the drawable the floating selection /* check and see if this is the drawable the floating selection
* is attached to. if it is then we'll do the attachment at * is attached to. if it is then we'll do the attachment at
@ -2283,14 +2284,14 @@ xcf_load_layer (XcfInfo *info,
goto error; goto error;
/* set the offsets of the layer_mask */ /* set the offsets of the layer_mask */
GIMP_DRAWABLE(layer_mask)->offset_x = GIMP_DRAWABLE(layer)->offset_x; GIMP_DRAWABLE (layer_mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x;
GIMP_DRAWABLE(layer_mask)->offset_y = GIMP_DRAWABLE(layer)->offset_y; GIMP_DRAWABLE (layer_mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y;
apply_mask = layer->apply_mask; apply_mask = layer->apply_mask;
edit_mask = layer->edit_mask; edit_mask = layer->edit_mask;
show_mask = layer->show_mask; show_mask = layer->show_mask;
layer_add_mask (layer, layer_mask); gimp_layer_add_mask (layer, layer_mask);
layer->apply_mask = apply_mask; layer->apply_mask = apply_mask;
layer->edit_mask = edit_mask; layer->edit_mask = edit_mask;
@ -2370,17 +2371,17 @@ error:
return NULL; return NULL;
} }
static LayerMask* static GimpLayerMask *
xcf_load_layer_mask (XcfInfo *info, xcf_load_layer_mask (XcfInfo *info,
GImage *gimage) GImage *gimage)
{ {
LayerMask *layer_mask; GimpLayerMask *layer_mask;
guint32 hierarchy_offset; guint32 hierarchy_offset;
gint width; gint width;
gint height; gint height;
gint add_floating_sel; gint add_floating_sel;
gchar *name; gchar *name;
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
/* check and see if this is the drawable the floating selection /* check and see if this is the drawable the floating selection
* is attached to. if it is then we'll do the attachment at * is attached to. if it is then we'll do the attachment at
@ -2394,7 +2395,7 @@ xcf_load_layer_mask (XcfInfo *info,
info->cp += xcf_read_string (info->fp, &name, 1); info->cp += xcf_read_string (info->fp, &name, 1);
/* create a new layer mask */ /* create a new layer mask */
layer_mask = layer_mask_new (gimage, width, height, name, &color); layer_mask = gimp_layer_mask_new (gimage, width, height, name, &color);
g_free (name); g_free (name);
if (!layer_mask) if (!layer_mask)
return NULL; return NULL;
@ -2423,7 +2424,7 @@ xcf_load_layer_mask (XcfInfo *info,
return layer_mask; return layer_mask;
error: error:
layer_mask_delete (layer_mask); gtk_object_unref (GTK_OBJECT (layer_mask));
return NULL; return NULL;
} }

View File

@ -66,7 +66,7 @@ package Gimp::CodeGen::pdb;
id_func => '(GimpChannel *) gimp_drawable_get_by_ID', id_func => '(GimpChannel *) gimp_drawable_get_by_ID',
id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' },
layer_mask => { name => 'CHANNEL', layer_mask => { name => 'CHANNEL',
type => 'LayerMask *', type => 'GimpLayerMask *',
headers => [ qw("drawable.h" "channel.h") ], headers => [ qw("drawable.h" "channel.h") ],
id_func => '(GimpLayerMask *) gimp_drawable_get_by_ID', id_func => '(GimpLayerMask *) gimp_drawable_get_by_ID',
id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' },

View File

@ -499,7 +499,8 @@ CODE
); );
} }
@headers = qw("drawable.h" "tile.h" "tile_manager.h" "temp_buf.h"); @headers = qw("gimplayermask.h" "drawable.h" "tile.h" "tile_manager.h"
"temp_buf.h");
@procs = qw(drawable_merge_shadow drawable_fill drawable_update @procs = qw(drawable_merge_shadow drawable_fill drawable_update
drawable_mask_bounds drawable_image drawable_type drawable_mask_bounds drawable_image drawable_type