Commit df0bbb26 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed channel_update() because channel.c should not call

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

	* app/channel.[ch]: removed channel_update() because channel.c
	should not call gdisplays_update(). Use drawable_update() and
	a subsequent gdisplays_update() instead.

	* app/qmask.c: do as described above.

	* app/channel_ops.c
	* app/channels_dialog.c
	* app/commands.c
	* app/convert.c
	* app/disp_callbacks.c
	* app/equalize.c
	* app/fileops.c
	* app/floating_sel.c
	* app/gdisplay.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/gimpdnd.c
	* app/gimpdrawablepreview.c
	* app/gimphistogram.c
	* app/gimplayermask.c
	* app/global_edit.c
	* app/histogramwidget.c
	* app/histogramwidget.h
	* app/image_map.c
	* app/image_new.c
	* app/invert.c
	* app/layer.c
	* app/layer_select.c
	* app/paths_dialog.c
	* app/plug_in.c
	* app/scan_convert.c
	* app/undo_history.c
	* app/xcf.c: include gimpdrawable.h instead of drawable.h where
	possible, removed useless includes, minor other cleanups.
parent bd7a4bf1
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/channel.[ch]: removed channel_update() because channel.c
should not call gdisplays_update(). Use drawable_update() and
a subsequent gdisplays_update() instead.
* app/qmask.c: do as described above.
* app/channel_ops.c
* app/channels_dialog.c
* app/commands.c
* app/convert.c
* app/disp_callbacks.c
* app/equalize.c
* app/fileops.c
* app/floating_sel.c
* app/gdisplay.c
* app/gimage.c
* app/gimage_mask.c
* app/gimpdnd.c
* app/gimpdrawablepreview.c
* app/gimphistogram.c
* app/gimplayermask.c
* app/global_edit.c
* app/histogramwidget.c
* app/histogramwidget.h
* app/image_map.c
* app/image_new.c
* app/invert.c
* app/layer.c
* app/layer_select.c
* app/paths_dialog.c
* app/plug_in.c
* app/scan_convert.c
* app/undo_history.c
* app/xcf.c: include gimpdrawable.h instead of drawable.h where
possible, removed useless includes, minor other cleanups.
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
......
......@@ -41,7 +41,6 @@
#include "devices.h"
#include "docindex.h"
#include "channel_ops.h"
#include "drawable.h"
#include "equalize.h"
#include "errorconsole.h"
#include "fileops.h"
......@@ -49,6 +48,7 @@
#include "gdisplay_ops.h"
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimprc.h"
......
......@@ -82,11 +82,11 @@
#include "app_procs.h"
#include "appenv.h"
#include "brush_select.h"
#include "drawable.h"
#include "datafiles.h"
#include "errors.h"
#include "gdisplay.h"
#include "general.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimpprogress.h"
#include "gimprc.h"
......
......@@ -364,7 +364,13 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
channel->color = color;
gimp_channel_update (channel);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
}
......
......@@ -364,7 +364,13 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
channel->color = color;
gimp_channel_update (channel);
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
}
......
......@@ -31,21 +31,20 @@
#include "apptypes.h"
#include "drawable.h"
#include "gimphistogram.h"
#include "pixel_region.h"
#include "gimpdrawable.h"
#include "channel.h"
#include "gimpdrawable.h"
#include "gimphistogram.h"
#include "gimpimage.h"
#include "gimprc.h"
#include "pixel_processor.h"
#include "pixel_region.h"
struct _GimpHistogram
{
gint bins;
gdouble **values;
gint nchannels;
gint n_channels;
#ifdef ENABLE_MP
pthread_mutex_t mutex;
......@@ -62,9 +61,9 @@ gimp_histogram_new (void)
GimpHistogram *histogram;
histogram = g_new0 (GimpHistogram, 1);
histogram->bins = 0;
histogram->values = NULL;
histogram->nchannels = 0;
histogram->bins = 0;
histogram->values = NULL;
histogram->n_channels = 0;
#ifdef ENABLE_MP
histogram->nthreads = 0;
......@@ -82,7 +81,7 @@ gimp_histogram_free (GimpHistogram *histogram)
if (histogram->values)
{
for (i = 0; i < histogram->nchannels; i++)
for (i = 0; i < histogram->n_channels; i++)
g_free (histogram->values[i]);
g_free (histogram->values);
}
......@@ -274,19 +273,19 @@ gimp_histogram_alloc (GimpHistogram *histogram,
{
gint i;
if (bytes + 1 != histogram->nchannels)
if (bytes + 1 != histogram->n_channels)
{
if (histogram->values)
{
for (i = 0; i < histogram->nchannels; i++)
for (i = 0; i < histogram->n_channels; i++)
g_free (histogram->values[i]);
g_free (histogram->values);
}
histogram->nchannels = bytes + 1;
histogram->values = g_new0 (gdouble *, histogram->nchannels);
histogram->n_channels = bytes + 1;
histogram->values = g_new0 (gdouble *, histogram->n_channels);
for (i = 0; i < histogram->nchannels; i++)
for (i = 0; i < histogram->n_channels; i++)
histogram->values[i] = g_new (double, 256);
}
}
......@@ -310,10 +309,10 @@ gimp_histogram_calculate (GimpHistogram *histogram,
for (i = 0; i < num_processors; i++)
{
histogram->tmp_values[i] = g_new0 (double *, histogram->nchannels);
histogram->tmp_values[i] = g_new0 (double *, histogram->n_channels);
histogram->tmp_slots[i] = 0;
for (j = 0; j < histogram->nchannels; j++)
for (j = 0; j < histogram->n_channels; j++)
{
histogram->tmp_values[i][j] = g_new0 (gdouble, 256);
......@@ -323,7 +322,7 @@ gimp_histogram_calculate (GimpHistogram *histogram,
}
#endif
for (i = 0; i < histogram->nchannels; i++)
for (i = 0; i < histogram->n_channels; i++)
for (j = 0; j < 256; j++)
histogram->values[i][j] = 0.0;
......@@ -334,7 +333,7 @@ gimp_histogram_calculate (GimpHistogram *histogram,
/* add up all the tmp buffers and free their memmory */
for (i = 0; i < num_processors; i++)
{
for (j = 0; j < histogram->nchannels; j++)
for (j = 0; j < histogram->n_channels; j++)
{
for (k = 0; k < 256; k++)
histogram->values[j][k] += histogram->tmp_values[i][j][k];
......@@ -401,7 +400,7 @@ gimp_histogram_get_value (GimpHistogram *histogram,
GimpHistogramChannel channel,
gint bin)
{
if (channel < histogram->nchannels && bin >= 0 && bin < 256)
if (channel < histogram->n_channels && bin >= 0 && bin < 256)
return histogram->values[channel][bin];
return 0.0;
......@@ -412,7 +411,7 @@ gimp_histogram_get_channel (GimpHistogram *histogram,
GimpHistogramChannel channel,
gint bin)
{
if (histogram->nchannels > 3)
if (histogram->n_channels > 3)
return gimp_histogram_get_value (histogram, channel + 1, bin);
else
return gimp_histogram_get_value (histogram, channel , bin);
......@@ -421,7 +420,7 @@ gimp_histogram_get_channel (GimpHistogram *histogram,
gint
gimp_histogram_nchannels (GimpHistogram *histogram)
{
return histogram->nchannels - 1;
return histogram->n_channels - 1;
}
gdouble
......
......@@ -32,7 +32,6 @@
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimppreviewcache.h"
......@@ -415,20 +414,6 @@ gimp_channel_resize (GimpChannel *channel,
GIMP_DRAWABLE (channel)->height);
}
void
gimp_channel_update (GimpChannel *channel)
{
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
/**********************/
/* access functions */
/**********************/
gboolean
gimp_channel_toggle_visibility (GimpChannel *channel)
{
......@@ -437,6 +422,7 @@ gimp_channel_toggle_visibility (GimpChannel *channel)
return GIMP_DRAWABLE (channel)->visible;
}
/******************************/
/* selection mask functions */
/******************************/
......
......@@ -108,7 +108,6 @@ void gimp_channel_resize (GimpChannel *channel,
gint new_height,
gint offx,
gint offy);
void gimp_channel_update (GimpChannel *channel);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
......
......@@ -486,17 +486,20 @@ offset (GimpImage *gimage,
}
/* push an undo */
drawable_apply_image (drawable, 0, 0,
drawable_apply_image (drawable,
0, 0,
gimp_drawable_width (drawable),
gimp_drawable_height (drawable),
gimp_drawable_data (drawable), FALSE);
gimp_drawable_data (drawable),
FALSE);
/* swap the tiles */
drawable->tiles = new_tiles;
/* update the drawable */
drawable_update (drawable, 0, 0,
drawable_update (drawable,
0, 0,
gimp_drawable_width (drawable),
gimp_drawable_height (drawable));
}
......@@ -512,8 +515,8 @@ offset_ok_callback (GtkWidget *widget,
OffsetDialog *off_d;
GImage *gimage;
GimpDrawable *drawable;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
off_d = (OffsetDialog *) data;
......
......@@ -1772,9 +1772,11 @@ channel_widget_drop_color (GtkWidget *widget,
{
channel->color = *color;
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
}
......@@ -2680,9 +2682,12 @@ edit_channel_query_ok_callback (GtkWidget *widget,
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
channel->color = color;
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
}
......
......@@ -41,7 +41,6 @@
#include "devices.h"
#include "docindex.h"
#include "channel_ops.h"
#include "drawable.h"
#include "equalize.h"
#include "errorconsole.h"
#include "fileops.h"
......@@ -49,6 +48,7 @@
#include "gdisplay_ops.h"
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimprc.h"
......
......@@ -99,18 +99,18 @@
#include "convert.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "fsdither.h"
#include "gdisplay.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimppalette.h"
#include "layer.h"
#include "undo.h"
#include "palette.h"
#include "gimppalette.h"
#include "palette_select.h"
#include "pixel_region.h"
#include "tile_manager.h"
#include "undo.h"
#include "tools/brightness_contrast.h"
#include "tools/color_balance.h"
......
......@@ -26,9 +26,7 @@
#include "apptypes.h"
#include "appenv.h"
#include "drawable.h"
#include "image_new.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage.h"
......@@ -36,6 +34,7 @@
#include "gimpcontext.h"
#include "gimplayermask.h"
#include "global_edit.h"
#include "image_new.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
......@@ -446,7 +445,9 @@ edit_clear (GimpImage *gimage,
ERASE_MODE, NULL, x1, y1);
/* update the image */
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
drawable_update (drawable,
x1, y1,
(x2 - x1), (y2 - y1));
/* free the temporary tiles */
tile_manager_destroy (buf_tiles);
......@@ -518,7 +519,9 @@ edit_fill (GimpImage *gimage,
NORMAL_MODE, NULL, x1, y1);
/* update the image */
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
drawable_update (drawable,
x1, y1,
(x2 - x1), (y2 - y1));
/* free the temporary tiles */
tile_manager_destroy (buf_tiles);
......
......@@ -32,7 +32,6 @@
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimppreviewcache.h"
......@@ -415,20 +414,6 @@ gimp_channel_resize (GimpChannel *channel,
GIMP_DRAWABLE (channel)->height);
}
void
gimp_channel_update (GimpChannel *channel)
{
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
/**********************/
/* access functions */
/**********************/
gboolean
gimp_channel_toggle_visibility (GimpChannel *channel)
{
......@@ -437,6 +422,7 @@ gimp_channel_toggle_visibility (GimpChannel *channel)
return GIMP_DRAWABLE (channel)->visible;
}
/******************************/
/* selection mask functions */
/******************************/
......
......@@ -108,7 +108,6 @@ void gimp_channel_resize (GimpChannel *channel,
gint new_height,
gint offx,
gint offy);
void gimp_channel_update (GimpChannel *channel);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
......
......@@ -32,7 +32,6 @@
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimppreviewcache.h"
......@@ -415,20 +414,6 @@ gimp_channel_resize (GimpChannel *channel,
GIMP_DRAWABLE (channel)->height);
}
void
gimp_channel_update (GimpChannel *channel)
{
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
GIMP_DRAWABLE (channel)->width,
GIMP_DRAWABLE (channel)->height);
gdisplays_flush ();
}
/**********************/
/* access functions */
/**********************/
gboolean
gimp_channel_toggle_visibility (GimpChannel *channel)
{
......@@ -437,6 +422,7 @@ gimp_channel_toggle_visibility (GimpChannel *channel)
return GIMP_DRAWABLE (channel)->visible;
}
/******************************/
/* selection mask functions */
/******************************/
......
......@@ -108,7 +108,6 @@ void gimp_channel_resize (GimpChannel *channel,
gint new_height,
gint offx,
gint offy);
void gimp_channel_update (GimpChannel *channel);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
......
......@@ -73,7 +73,6 @@ equalize (GimpImage *gimage,
hist = gimp_histogram_new ();
gimp_histogram_calculate_drawable (hist, drawable);
/* Build equalization LUT */
lut = eq_histogram_lut_new (hist, bytes);
......@@ -92,5 +91,8 @@ equalize (GimpImage *gimage,
gimp_histogram_free (hist);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
drawable_update (drawable,
x1, y1,
(x2 - x1), (y2 - y1));
}
......@@ -22,11 +22,10 @@
#include "apptypes.h"
#include "appenv.h"
#include "drawable.h"
#include "invert.h"
#include "gimpimage.h"
#include "gimplut.h"
#include "invert.h"
#include "lut_funcs.h"
#include "pixel_processor.h"
#include "pixel_region.h"
......@@ -40,8 +39,8 @@ void
image_invert (GimpImage *gimage)
{
GimpDrawable *drawable;
Argument *return_vals;
gint nreturn_vals;
Argument *return_vals;
gint nreturn_vals;
drawable = gimp_image_active_drawable (gimage);
......@@ -69,9 +68,9 @@ image_invert (GimpImage *gimage)
void
invert (GimpDrawable *drawable)
{
PixelRegion srcPR, destPR;
gint x1, y1, x2, y2;
GimpLut *lut;
PixelRegion srcPR, destPR;
gint x1, y1, x2, y2;
GimpLut *lut;
lut = invert_lut_new (gimp_drawable_bytes (drawable));
......@@ -87,5 +86,8 @@ invert (GimpDrawable *drawable)
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
drawable_update (drawable,
x1, y1,
(x2 - x1), (y2 - y1));
}
......@@ -486,17 +486,20 @@ offset (GimpImage *gimage,
}
/* push an undo */
drawable_apply_image (drawable, 0, 0,
drawable_apply_image (drawable,
0, 0,
gimp_drawable_width (drawable),
gimp_drawable_height (drawable),
gimp_drawable_data (drawable), FALSE);
gimp_drawable_data (drawable),
FALSE);
/* swap the tiles */
drawable->tiles = new_tiles;
/* update the drawable */
drawable_update (drawable, 0, 0,
drawable_update (drawable,
0, 0,
gimp_drawable_width (drawable),
gimp_drawable_height (drawable));
}
......@@ -512,8 +515,8 @@ offset_ok_callback (GtkWidget *widget,
OffsetDialog *off_d;
GImage *gimage;
GimpDrawable *drawable;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
off_d = (OffsetDialog *) data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment