added a default implementation of GimpImage::mode_changed() which

2003-12-01  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage.c: added a default implementation of
	GimpImage::mode_changed() which reallocates the projection.

	* app/core/gimpimage-convert.c (gimp_image_convert)
	* app/core/gimpimage-undo-push.c (undo_pop_image_type): removed
	explicit calls to gimp_image_projection_allocate().
This commit is contained in:
Michael Natterer 2003-12-01 13:34:43 +00:00 committed by Michael Natterer
parent f74d5de747
commit 8842730435
4 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,12 @@
2003-12-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c: added a default implementation of
GimpImage::mode_changed() which reallocates the projection.
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimpimage-undo-push.c (undo_pop_image_type): removed
explicit calls to gimp_image_projection_allocate().
2003-12-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-flip.c (gimp_image_flip): no need to

View File

@ -1038,9 +1038,6 @@ gimp_image_convert (GimpImage *gimage,
if (quantobj)
quantobj->delete_func (quantobj);
/* Make sure the projection is up to date */
gimp_image_projection_allocate (gimage);
/* Rigor the floating selection */
if (floating_layer)
floating_sel_rigor (floating_layer, TRUE);

View File

@ -361,7 +361,6 @@ undo_pop_image_type (GimpUndo *undo,
itu->base_type = undo->gimage->base_type;
undo->gimage->base_type = tmp;
gimp_image_projection_allocate (undo->gimage);
gimp_image_colormap_changed (undo->gimage, -1);
if (itu->base_type != undo->gimage->base_type)

View File

@ -115,6 +115,7 @@ static void gimp_image_invalidate_preview (GimpViewable *viewable);
static void gimp_image_size_changed (GimpViewable *viewable);
static gchar * gimp_image_get_description (GimpViewable *viewable,
gchar **tooltip);
static void gimp_image_real_mode_changed (GimpImage *gimage);
static void gimp_image_real_colormap_changed (GimpImage *gimage,
gint ncol);
static void gimp_image_real_flush (GimpImage *gimage);
@ -421,7 +422,7 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->get_new_preview = gimp_image_get_new_preview;
viewable_class->get_description = gimp_image_get_description;
klass->mode_changed = NULL;
klass->mode_changed = gimp_image_real_mode_changed;
klass->alpha_changed = NULL;
klass->floating_selection_changed = NULL;
klass->active_layer_changed = NULL;
@ -742,13 +743,11 @@ gimp_image_get_memsize (GimpObject *object,
static void
gimp_image_invalidate_preview (GimpViewable *viewable)
{
GimpImage *gimage;
GimpImage *gimage = GIMP_IMAGE (viewable);
if (GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview)
GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable);
gimage = GIMP_IMAGE (viewable);
gimage->comp_preview_valid = FALSE;
if (gimage->comp_preview)
@ -761,14 +760,12 @@ gimp_image_invalidate_preview (GimpViewable *viewable)
static void
gimp_image_size_changed (GimpViewable *viewable)
{
GimpImage *gimage;
GimpImage *gimage = GIMP_IMAGE (viewable);
GList *list;
if (GIMP_VIEWABLE_CLASS (parent_class)->size_changed)
GIMP_VIEWABLE_CLASS (parent_class)->size_changed (viewable);
gimage = GIMP_IMAGE (viewable);
gimp_container_foreach (gimage->layers,
(GFunc) gimp_viewable_size_changed,
NULL);
@ -794,13 +791,11 @@ static gchar *
gimp_image_get_description (GimpViewable *viewable,
gchar **tooltip)
{
GimpImage *gimage;
GimpImage *gimage = GIMP_IMAGE (viewable);
const gchar *uri;
gchar *basename;
gchar *retval;
gimage = GIMP_IMAGE (viewable);
uri = gimp_image_get_uri (GIMP_IMAGE (gimage));
basename = file_utils_uri_to_utf8_basename (uri);
@ -815,6 +810,12 @@ gimp_image_get_description (GimpViewable *viewable,
return retval;
}
static void
gimp_image_real_mode_changed (GimpImage *gimage)
{
gimp_image_projection_allocate (gimage);
}
static void
gimp_image_real_colormap_changed (GimpImage *gimage,
gint ncol)