renamed these files...

2007-01-30  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannelundo.[ch]: renamed these files...

	* app/core/gimpmaskundo.[ch]: ...to these. We'll need the name
	GimpChannelUndo for something else later.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpimage-undo-push.c: changed accordingly.


svn path=/trunk/; revision=21819
This commit is contained in:
Michael Natterer 2007-01-30 22:53:18 +00:00 committed by Michael Natterer
parent f71d884bda
commit 9020afcf22
6 changed files with 93 additions and 84 deletions

View file

@ -1,3 +1,14 @@
2007-01-30 Michael Natterer <mitch@gimp.org>
* app/core/gimpchannelundo.[ch]: renamed these files...
* app/core/gimpmaskundo.[ch]: ...to these. We'll need the name
GimpChannelUndo for something else later.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpimage-undo-push.c: changed accordingly.
2007-01-30 Michael Natterer <mitch@gimp.org>
* app/vectors/Makefile.am

View file

@ -78,8 +78,6 @@ libappcore_a_sources = \
gimpchannel-select.h \
gimpchannelpropundo.c \
gimpchannelpropundo.h \
gimpchannelundo.c \
gimpchannelundo.h \
gimpcontainer.c \
gimpcontainer.h \
gimpcontainer-filter.c \
@ -216,6 +214,8 @@ libappcore_a_sources = \
gimplayerpropundo.h \
gimplist.c \
gimplist.h \
gimpmaskundo.c \
gimpmaskundo.h \
gimpobject.c \
gimpobject.h \
gimppaintinfo.c \

View file

@ -113,10 +113,10 @@ typedef struct _GimpUndo GimpUndo;
typedef struct _GimpImageUndo GimpImageUndo;
typedef struct _GimpItemUndo GimpItemUndo;
typedef struct _GimpItemPropUndo GimpItemPropUndo;
typedef struct _GimpChannelUndo GimpChannelUndo;
typedef struct _GimpChannelPropUndo GimpChannelPropUndo;
typedef struct _GimpDrawableUndo GimpDrawableUndo;
typedef struct _GimpLayerPropUndo GimpLayerPropUndo;
typedef struct _GimpMaskUndo GimpMaskUndo;
typedef struct _GimpGuideUndo GimpGuideUndo;
typedef struct _GimpSamplePointUndo GimpSamplePointUndo;
typedef struct _GimpUndoStack GimpUndoStack;

View file

@ -30,7 +30,6 @@
#include "gimp.h"
#include "gimp-parasites.h"
#include "gimpchannelpropundo.h"
#include "gimpchannelundo.h"
#include "gimpdrawableundo.h"
#include "gimpgrid.h"
#include "gimpguide.h"
@ -45,6 +44,7 @@
#include "gimplayermask.h"
#include "gimplayerpropundo.h"
#include "gimplist.h"
#include "gimpmaskundo.h"
#include "gimpparasitelist.h"
#include "gimpsamplepoint.h"
#include "gimpsamplepointundo.h"
@ -340,7 +340,7 @@ gimp_image_undo_push_mask (GimpImage *image,
g_return_val_if_fail (GIMP_IS_CHANNEL (mask), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (mask)), NULL);
return gimp_image_undo_push (image, GIMP_TYPE_CHANNEL_UNDO,
return gimp_image_undo_push (image, GIMP_TYPE_MASK_UNDO,
0, 0,
GIMP_UNDO_MASK, undo_desc,
GIMP_IS_SELECTION (mask) ?

View file

@ -20,8 +20,6 @@
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "core-types.h"
#include "base/pixel-region.h"
@ -31,55 +29,55 @@
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpchannelundo.h"
#include "gimpmaskundo.h"
static GObject * gimp_channel_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static GObject * gimp_mask_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_channel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_channel_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_mask_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_mask_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpChannelUndo, gimp_channel_undo, GIMP_TYPE_ITEM_UNDO)
G_DEFINE_TYPE (GimpMaskUndo, gimp_mask_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_channel_undo_parent_class
#define parent_class gimp_mask_undo_parent_class
static void
gimp_channel_undo_class_init (GimpChannelUndoClass *klass)
gimp_mask_undo_class_init (GimpMaskUndoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_channel_undo_constructor;
object_class->constructor = gimp_mask_undo_constructor;
undo_class->pop = gimp_channel_undo_pop;
undo_class->free = gimp_channel_undo_free;
undo_class->pop = gimp_mask_undo_pop;
undo_class->free = gimp_mask_undo_free;
}
static void
gimp_channel_undo_init (GimpChannelUndo *undo)
gimp_mask_undo_init (GimpMaskUndo *undo)
{
}
static GObject *
gimp_channel_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
gimp_mask_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GimpChannelUndo *channel_undo;
GimpChannel *channel;
gint x1, y1, x2, y2;
GObject *object;
GimpMaskUndo *mask_undo;
GimpChannel *channel;
gint x1, y1, x2, y2;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
channel_undo = GIMP_CHANNEL_UNDO (object);
mask_undo = GIMP_MASK_UNDO (object);
g_assert (GIMP_IS_CHANNEL (GIMP_ITEM_UNDO (object)->item));
@ -90,42 +88,42 @@ gimp_channel_undo_constructor (GType type,
GimpDrawable *drawable = GIMP_DRAWABLE (channel);
PixelRegion srcPR, destPR;
channel_undo->tiles = tile_manager_new (x2 - x1, y2 - y1,
gimp_drawable_bytes (drawable));
channel_undo->x = x1;
channel_undo->y = y1;
mask_undo->tiles = tile_manager_new (x2 - x1, y2 - y1,
gimp_drawable_bytes (drawable));
mask_undo->x = x1;
mask_undo->y = y1;
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
x1, y1, x2 - x1, y2 - y1, FALSE);
pixel_region_init (&destPR, channel_undo->tiles,
pixel_region_init (&destPR, mask_undo->tiles,
0, 0, x2 - x1, y2 - y1, TRUE);
copy_region (&srcPR, &destPR);
GIMP_UNDO (object)->size +=
tile_manager_get_memsize (channel_undo->tiles, FALSE);
tile_manager_get_memsize (mask_undo->tiles, FALSE);
}
return object;
}
static void
gimp_channel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
gimp_mask_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpChannelUndo *channel_undo = GIMP_CHANNEL_UNDO (undo);
GimpChannel *channel = GIMP_CHANNEL (GIMP_ITEM_UNDO (undo)->item);
TileManager *new_tiles;
PixelRegion srcPR, destPR;
gint x1, y1, x2, y2;
gint width = 0;
gint height = 0;
GimpMaskUndo *mask_undo = GIMP_MASK_UNDO (undo);
GimpChannel *channel = GIMP_CHANNEL (GIMP_ITEM_UNDO (undo)->item);
TileManager *new_tiles;
PixelRegion srcPR, destPR;
gint x1, y1, x2, y2;
gint width = 0;
gint height = 0;
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
if (channel_undo->tiles)
undo->size -= tile_manager_get_memsize (channel_undo->tiles, FALSE);
if (mask_undo->tiles)
undo->size -= tile_manager_get_memsize (mask_undo->tiles, FALSE);
if (gimp_channel_bounds (channel, &x1, &y1, &x2, &y2))
{
@ -150,31 +148,31 @@ gimp_channel_undo_pop (GimpUndo *undo,
new_tiles = NULL;
}
if (channel_undo->tiles)
if (mask_undo->tiles)
{
width = tile_manager_width (channel_undo->tiles);
height = tile_manager_height (channel_undo->tiles);
width = tile_manager_width (mask_undo->tiles);
height = tile_manager_height (mask_undo->tiles);
pixel_region_init (&srcPR, channel_undo->tiles,
pixel_region_init (&srcPR, mask_undo->tiles,
0, 0, width, height, FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE (channel)->tiles,
channel_undo->x, channel_undo->y, width, height, TRUE);
mask_undo->x, mask_undo->y, width, height, TRUE);
copy_region (&srcPR, &destPR);
tile_manager_unref (channel_undo->tiles);
tile_manager_unref (mask_undo->tiles);
}
/* invalidate the current bounds and boundary of the mask */
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (channel));
if (channel_undo->tiles)
if (mask_undo->tiles)
{
channel->empty = FALSE;
channel->x1 = channel_undo->x;
channel->y1 = channel_undo->y;
channel->x2 = channel_undo->x + width;
channel->y2 = channel_undo->y + height;
channel->x1 = mask_undo->x;
channel->y1 = mask_undo->y;
channel->x2 = mask_undo->x + width;
channel->y2 = mask_undo->y + height;
}
else
{
@ -189,29 +187,29 @@ gimp_channel_undo_pop (GimpUndo *undo,
channel->bounds_known = TRUE;
/* set the new mask undo parameters */
channel_undo->tiles = new_tiles;
channel_undo->x = x1;
channel_undo->y = y1;
mask_undo->tiles = new_tiles;
mask_undo->x = x1;
mask_undo->y = y1;
gimp_drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_ITEM (channel)->width,
GIMP_ITEM (channel)->height);
if (channel_undo->tiles)
undo->size += tile_manager_get_memsize (channel_undo->tiles, FALSE);
if (mask_undo->tiles)
undo->size += tile_manager_get_memsize (mask_undo->tiles, FALSE);
}
static void
gimp_channel_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode)
gimp_mask_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode)
{
GimpChannelUndo *channel_undo = GIMP_CHANNEL_UNDO (undo);
GimpMaskUndo *mask_undo = GIMP_MASK_UNDO (undo);
if (channel_undo->tiles)
if (mask_undo->tiles)
{
tile_manager_unref (channel_undo->tiles);
channel_undo->tiles = NULL;
tile_manager_unref (mask_undo->tiles);
mask_undo->tiles = NULL;
}
GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);

View file

@ -16,24 +16,24 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_CHANNEL_UNDO_H__
#define __GIMP_CHANNEL_UNDO_H__
#ifndef __GIMP_MASK_UNDO_H__
#define __GIMP_MASK_UNDO_H__
#include "gimpitemundo.h"
#define GIMP_TYPE_CHANNEL_UNDO (gimp_channel_undo_get_type ())
#define GIMP_CHANNEL_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CHANNEL_UNDO, GimpChannelUndo))
#define GIMP_CHANNEL_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL_UNDO, GimpChannelUndoClass))
#define GIMP_IS_CHANNEL_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CHANNEL_UNDO))
#define GIMP_IS_CHANNEL_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL_UNDO))
#define GIMP_CHANNEL_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CHANNEL_UNDO, GimpChannelUndoClass))
#define GIMP_TYPE_MASK_UNDO (gimp_mask_undo_get_type ())
#define GIMP_MASK_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MASK_UNDO, GimpMaskUndo))
#define GIMP_MASK_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MASK_UNDO, GimpMaskUndoClass))
#define GIMP_IS_MASK_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MASK_UNDO))
#define GIMP_IS_MASK_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MASK_UNDO))
#define GIMP_MASK_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MASK_UNDO, GimpMaskUndoClass))
typedef struct _GimpChannelUndoClass GimpChannelUndoClass;
typedef struct _GimpMaskUndoClass GimpMaskUndoClass;
struct _GimpChannelUndo
struct _GimpMaskUndo
{
GimpItemUndo parent_instance;
@ -42,13 +42,13 @@ struct _GimpChannelUndo
gint y;
};
struct _GimpChannelUndoClass
struct _GimpMaskUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_channel_undo_get_type (void) G_GNUC_CONST;
GType gimp_mask_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_CHANNEL_UNDO_H__ */
#endif /* __GIMP_MASK_UNDO_H__ */