new function image_map_clear that removes the preview without freeing the

* app/image_map.[ch]: new function image_map_clear that removes
	the preview without freeing the image_map.

	* app/brightness_contrast.c
	* app/color_balance.c
	* app/curves.c
	* app/hue_saturation.c
	* app/levels.c
	* app/posterize.c
	* app/threshold.c: Add a call to image_map_clear in the
	preview toggle button callback.  This makes the preview toggle
	button behave as expected.

	* app/histogram_tool: remove an unnecessary include.
This commit is contained in:
jaycox 2000-05-09 05:43:29 +00:00
parent 84ec7a802e
commit af0c94abf6
16 changed files with 147 additions and 15 deletions

View File

@ -1,3 +1,20 @@
2000-05-08 Jay Cox <jaycox@earthlink.net>
* app/image_map.[ch]: new function image_map_clear that removes
the preview without freeing the image_map.
* app/brightness_contrast.c
* app/color_balance.c
* app/curves.c
* app/hue_saturation.c
* app/levels.c
* app/posterize.c
* app/threshold.c: Add a call to image_map_clear in the
preview toggle button callback. This makes the preview toggle
button behave as expected.
* app/histogram_tool: remove an unnecessary include.
2000-05-09 Nick Lamb <njl195@zepler.org.uk>
* plug-ins/common/png.c: tRNS expansion using transforms for

View File

@ -657,7 +657,16 @@ color_balance_preview_update (GtkWidget *widget,
color_balance_preview (cbd);
}
else
cbd->preview = FALSE;
{
cbd->preview = FALSE;
if (cbd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cbd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -1303,7 +1303,16 @@ curves_preview_update (GtkWidget *widget,
curves_preview (cd);
}
else
cd->preview = FALSE;
{
cd->preview = FALSE;
if (cd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static gint

View File

@ -433,7 +433,16 @@ brightness_contrast_preview_update (GtkWidget *widget,
brightness_contrast_preview (bcd);
}
else
bcd->preview = FALSE;
{
bcd->preview = FALSE;
if (bcd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (bcd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -657,7 +657,16 @@ color_balance_preview_update (GtkWidget *widget,
color_balance_preview (cbd);
}
else
cbd->preview = FALSE;
{
cbd->preview = FALSE;
if (cbd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cbd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -240,7 +240,7 @@ image_map_commit (ImageMap image_map)
}
void
image_map_abort (ImageMap image_map)
image_map_clear (ImageMap image_map)
{
_ImageMap *_image_map;
PixelRegion srcPR, destPR;
@ -254,6 +254,7 @@ image_map_abort (ImageMap image_map)
_image_map->pr = NULL;
}
_image_map->state = WAITING;
/* Make sure the drawable is still valid */
if (! drawable_gimage ( (_image_map->drawable)))
return;
@ -291,9 +292,15 @@ image_map_abort (ImageMap image_map)
/* Free the undo_tiles tile manager */
tile_manager_destroy (_image_map->undo_tiles);
_image_map->undo_tiles = NULL;
}
}
g_free (_image_map);
void
image_map_abort (ImageMap image_map)
{
image_map_clear(image_map);
g_free (image_map);
}
unsigned char *

View File

@ -34,6 +34,7 @@ typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *);
ImageMap image_map_create (void *, GimpDrawable *);
void image_map_apply (ImageMap, ImageMapApplyFunc, void *);
void image_map_commit (ImageMap);
void image_map_clear (ImageMap);
void image_map_abort (ImageMap);
unsigned char *image_map_get_color_at (ImageMap, int, int);

View File

@ -1303,7 +1303,16 @@ curves_preview_update (GtkWidget *widget,
curves_preview (cd);
}
else
cd->preview = FALSE;
{
cd->preview = FALSE;
if (cd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static gint

View File

@ -240,7 +240,7 @@ image_map_commit (ImageMap image_map)
}
void
image_map_abort (ImageMap image_map)
image_map_clear (ImageMap image_map)
{
_ImageMap *_image_map;
PixelRegion srcPR, destPR;
@ -254,6 +254,7 @@ image_map_abort (ImageMap image_map)
_image_map->pr = NULL;
}
_image_map->state = WAITING;
/* Make sure the drawable is still valid */
if (! drawable_gimage ( (_image_map->drawable)))
return;
@ -291,9 +292,15 @@ image_map_abort (ImageMap image_map)
/* Free the undo_tiles tile manager */
tile_manager_destroy (_image_map->undo_tiles);
_image_map->undo_tiles = NULL;
}
}
g_free (_image_map);
void
image_map_abort (ImageMap image_map)
{
image_map_clear(image_map);
g_free (image_map);
}
unsigned char *

View File

@ -34,6 +34,7 @@ typedef void (* ImageMapApplyFunc) (PixelRegion *, PixelRegion *, void *);
ImageMap image_map_create (void *, GimpDrawable *);
void image_map_apply (ImageMap, ImageMapApplyFunc, void *);
void image_map_commit (ImageMap);
void image_map_clear (ImageMap);
void image_map_abort (ImageMap);
unsigned char *image_map_get_color_at (ImageMap, int, int);

View File

@ -433,7 +433,16 @@ brightness_contrast_preview_update (GtkWidget *widget,
brightness_contrast_preview (bcd);
}
else
bcd->preview = FALSE;
{
bcd->preview = FALSE;
if (bcd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (bcd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -657,7 +657,16 @@ color_balance_preview_update (GtkWidget *widget,
color_balance_preview (cbd);
}
else
cbd->preview = FALSE;
{
cbd->preview = FALSE;
if (cbd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cbd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -1303,7 +1303,16 @@ curves_preview_update (GtkWidget *widget,
curves_preview (cd);
}
else
cd->preview = FALSE;
{
cd->preview = FALSE;
if (cd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static gint

View File

@ -433,7 +433,16 @@ brightness_contrast_preview_update (GtkWidget *widget,
brightness_contrast_preview (bcd);
}
else
bcd->preview = FALSE;
{
bcd->preview = FALSE;
if (bcd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (bcd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -657,7 +657,16 @@ color_balance_preview_update (GtkWidget *widget,
color_balance_preview (cbd);
}
else
cbd->preview = FALSE;
{
cbd->preview = FALSE;
if (cbd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cbd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static void

View File

@ -1303,7 +1303,16 @@ curves_preview_update (GtkWidget *widget,
curves_preview (cd);
}
else
cd->preview = FALSE;
{
cd->preview = FALSE;
if (cd->image_map)
{
active_tool->preserve = TRUE;
image_map_clear (cd->image_map);
active_tool->preserve = FALSE;
gdisplays_flush ();
}
}
}
static gint