Commit a3bb0b0d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Started to get rid of the gdisplays_foo() functions in

2002-05-08  Michael Natterer  <mitch@gimp.org>

	Started to get rid of the gdisplays_foo() functions in
	app/display/gimpdisplay-foreach.[ch]. Work in progress...

	* app/core/gimp.[ch]: added the display list to the Gimp object
	(as a GimpList of GimpObjects). This way we get more independent
	from whether there is GUI or not, as gimp->displays will simply
	be an empty list for the --no-interface case.

	* app/display/gimpdisplay.[ch]: Removed the global "display_list"
	and "display_num" variables. Use gimp->displays instead.

	* app/display/gimpdisplay-foreach.[ch]: renamed most functions
	from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp
	pointer.

	* app/core/gimpimage.[ch]: added a "flush" signal.

	* app/display/gimpdisplay-handlers.c: connect to "flush" and call
	gimp_display_flush() in the callback.

	* tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp)
	here and only here.

	* app/pdb/display_cmds.c: regenerated.

	* app/app_procs.c
	* app/gui/gui.c
	* app/gui/preferences-dialog.c:
	s/gdislays_foo()/gimp_displays_foo(gimp)/

	* app/image_map.c
	* app/undo_history.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-layer-select.c
	* app/display/gimpdisplayshell-scale.c
	* app/gui/channels-commands.c
	* app/gui/colormap-editor-commands.c
	* app/gui/convert-dialog.c
	* app/gui/drawable-commands.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/offset-dialog.c
	* app/gui/qmask-commands.c
	* app/gui/select-commands.c
	* app/gui/vectors-commands.c
	* app/paint/gimpairbrush.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimprectselecttool.c
	* app/tools/gimptexttool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpbufferview.c
	* app/widgets/gimpchannellistview.c
	* app/widgets/gimpcomponentlistitem.c
	* app/widgets/gimpdocumentview.c
	* app/widgets/gimpdrawablelistitem.c
	* app/widgets/gimpdrawablelistview.c
	* app/widgets/gimpimageview.c
	* app/widgets/gimpitemlistitem.c
	* app/widgets/gimpitemlistview.c
	* app/widgets/gimplayerlistitem.c
	* app/widgets/gimplayerlistview.c
	* app/widgets/gimpvectorslistview.c: replaced gdisplays_flush()
	with calls to gimp_image_flush(gimage). Removed inclusion of
	"display/gimpdisplay-foreach.h" from most files.
parent afdb263b
2002-05-08 Michael Natterer <mitch@gimp.org>
Started to get rid of the gdisplays_foo() functions in
app/display/gimpdisplay-foreach.[ch]. Work in progress...
* app/core/gimp.[ch]: added the display list to the Gimp object
(as a GimpList of GimpObjects). This way we get more independent
from whether there is GUI or not, as gimp->displays will simply
be an empty list for the --no-interface case.
* app/display/gimpdisplay.[ch]: Removed the global "display_list"
and "display_num" variables. Use gimp->displays instead.
* app/display/gimpdisplay-foreach.[ch]: renamed most functions
from gdisplays_foo() to gimp_displays_foo() and pass them a Gimp
pointer.
* app/core/gimpimage.[ch]: added a "flush" signal.
* app/display/gimpdisplay-handlers.c: connect to "flush" and call
gimp_display_flush() in the callback.
* tools/pdbgen/pdb/display.pdb: use gimp_displays_flush(gimp)
here and only here.
* app/pdb/display_cmds.c: regenerated.
* app/app_procs.c
* app/gui/gui.c
* app/gui/preferences-dialog.c:
s/gdislays_foo()/gimp_displays_foo(gimp)/
* app/image_map.c
* app/undo_history.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-layer-select.c
* app/display/gimpdisplayshell-scale.c
* app/gui/channels-commands.c
* app/gui/colormap-editor-commands.c
* app/gui/convert-dialog.c
* app/gui/drawable-commands.c
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/image-commands.c
* app/gui/layers-commands.c
* app/gui/offset-dialog.c
* app/gui/qmask-commands.c
* app/gui/select-commands.c
* app/gui/vectors-commands.c
* app/paint/gimpairbrush.c
* app/tools/gimpbezierselecttool.c
* app/tools/gimpblendtool.c
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimpinktool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimplevelstool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* app/tools/gimpposterizetool.c
* app/tools/gimprectselecttool.c
* app/tools/gimptexttool.c
* app/tools/gimpthresholdtool.c
* app/tools/gimptransformtool.c
* app/tools/gimpvectortool.c
* app/widgets/gimpbufferview.c
* app/widgets/gimpchannellistview.c
* app/widgets/gimpcomponentlistitem.c
* app/widgets/gimpdocumentview.c
* app/widgets/gimpdrawablelistitem.c
* app/widgets/gimpdrawablelistview.c
* app/widgets/gimpimageview.c
* app/widgets/gimpitemlistitem.c
* app/widgets/gimpitemlistview.c
* app/widgets/gimplayerlistitem.c
* app/widgets/gimplayerlistview.c
* app/widgets/gimpvectorslistview.c: replaced gdisplays_flush()
with calls to gimp_image_flush(gimage). Removed inclusion of
"display/gimpdisplay-foreach.h" from most files.
2002-05-08 Sven Neumann <sven@gimp.org>
* plug-ins/print/gimp_color_window.c
......
......@@ -35,8 +35,6 @@
#include "core/gimpimage-mask-select.h"
#include "core/gimplist.h"
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -91,7 +89,7 @@ channels_raise_channel_cmd_callback (GtkWidget *widget,
return_if_no_channel (gimage, active_channel);
gimp_image_raise_channel (gimage, active_channel);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -103,7 +101,7 @@ channels_lower_channel_cmd_callback (GtkWidget *widget,
return_if_no_channel (gimage, active_channel);
gimp_image_lower_channel (gimage, active_channel);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -119,7 +117,7 @@ channels_duplicate_channel_cmd_callback (GtkWidget *widget,
G_TYPE_FROM_INSTANCE (active_channel),
TRUE);
gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -131,7 +129,7 @@ channels_delete_channel_cmd_callback (GtkWidget *widget,
return_if_no_channel (gimage, active_channel);
gimp_image_remove_channel (gimage, active_channel);
gdisplays_flush ();
gimp_image_flush (gimage);
}
static void
......@@ -148,7 +146,7 @@ channels_channel_to_sel (GtkWidget *widget,
0, 0,
op,
FALSE, 0, 0);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -237,7 +235,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush ();
gimp_image_flush (gimage);
}
gtk_widget_destroy (options->query_box);
......@@ -281,7 +279,7 @@ channels_new_channel_query (GimpImage *gimage,
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
return;
}
......@@ -413,7 +411,7 @@ edit_channel_query_ok_callback (GtkWidget *widget,
{
gimp_channel_set_color (channel, &color);
gdisplays_flush ();
gimp_image_flush (options->gimage);
}
}
......
......@@ -30,8 +30,6 @@
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -171,7 +169,7 @@ colormap_editor_color_notebook_callback (ColorNotebook *color_notebook,
&gimage->cmap[editor->col_index * 3 + 2]);
gimp_image_colormap_changed (gimage, editor->col_index);
gdisplays_flush ();
gimp_image_flush (gimage);
/* Fall through */
case COLOR_NOTEBOOK_CANCEL:
color_notebook_hide (editor->color_notebook);
......
......@@ -30,8 +30,6 @@
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -171,7 +169,7 @@ colormap_editor_color_notebook_callback (ColorNotebook *color_notebook,
&gimage->cmap[editor->col_index * 3 + 2]);
gimp_image_colormap_changed (gimage, editor->col_index);
gdisplays_flush ();
gimp_image_flush (gimage);
/* Fall through */
case COLOR_NOTEBOOK_CANCEL:
color_notebook_hide (editor->color_notebook);
......
......@@ -34,8 +34,6 @@
#include "core/gimpdrawable-invert.h"
#include "core/gimpimage.h"
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -76,7 +74,7 @@ drawable_desaturate_cmd_callback (GtkWidget *widget,
}
gimp_drawable_desaturate (active_drawable);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -94,7 +92,7 @@ drawable_invert_cmd_callback (GtkWidget *widget,
}
gimp_drawable_invert (active_drawable);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -112,7 +110,7 @@ drawable_equalize_cmd_callback (GtkWidget *widget,
}
gimp_drawable_equalize (active_drawable, TRUE);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......
......@@ -36,7 +36,6 @@
#include "core/gimpimage-mask.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "tools/tool_manager.h"
......@@ -81,9 +80,7 @@ edit_undo_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
if (undo_pop (gimage))
{
gdisplays_flush ();
}
gimp_image_flush (gimage);
}
void
......@@ -94,9 +91,7 @@ edit_redo_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
if (undo_redo (gimage))
{
gdisplays_flush ();
}
gimp_image_flush (gimage);
}
void
......@@ -112,7 +107,7 @@ edit_cut_cmd_callback (GtkWidget *widget,
if (gimp_edit_cut (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage)))
{
gdisplays_flush ();
gimp_image_flush (gdisp->gimage);
}
}
......@@ -125,7 +120,7 @@ edit_copy_cmd_callback (GtkWidget *widget,
if (gimp_edit_copy (gimage, gimp_image_active_drawable (gimage)))
{
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -146,7 +141,7 @@ edit_paste_cmd_callback (GtkWidget *widget,
gdisp->gimage->gimp->global_buffer,
FALSE))
{
gdisplays_flush ();
gimp_image_flush (gdisp->gimage);
}
}
}
......@@ -168,7 +163,7 @@ edit_paste_into_cmd_callback (GtkWidget *widget,
gdisp->gimage->gimp->global_buffer,
TRUE))
{
gdisplays_flush ();
gimp_image_flush (gdisp->gimage);
}
}
}
......@@ -245,7 +240,7 @@ edit_clear_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
gimp_edit_clear (gimage, gimp_image_active_drawable (gimage));
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -262,8 +257,7 @@ edit_fill_cmd_callback (GtkWidget *widget,
gimp_edit_fill (gimage,
gimp_image_active_drawable (gimage),
fill_type);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -276,8 +270,7 @@ edit_stroke_cmd_callback (GtkWidget *widget,
gimp_image_mask_stroke (gimage,
gimp_image_active_drawable (gimage),
gimp_get_current_context (gimage->gimp));
gdisplays_flush ();
gimp_image_flush (gimage);
}
......@@ -309,7 +302,7 @@ cut_named_buffer_callback (GtkWidget *widget,
GIMP_OBJECT (new_buffer));
}
gdisplays_flush ();
gimp_image_flush (gimage);
}
static void
......
......@@ -310,7 +310,7 @@ file_revert_confirm_callback (GtkWidget *widget,
gimp_image_clean_all (new_gimage);
gdisplays_flush ();
gimp_image_flush (new_gimage);
}
else if (status != GIMP_PDB_CANCEL)
{
......
......@@ -35,7 +35,6 @@
#include "core/gimpimage-scale.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpprogress.h"
#include "convert-dialog.h"
......@@ -234,7 +233,7 @@ image_flatten_image_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
gimp_image_flatten (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
}
/****************************/
/* The layer merge dialog */
......@@ -264,7 +263,7 @@ image_layers_merge_query_ok_callback (GtkWidget *widget,
if (options->merge_visible)
gimp_image_merge_visible_layers (gimage, options->merge_type);
gdisplays_flush ();
gimp_image_flush (gimage);
gtk_widget_destroy (options->query_box);
}
......@@ -358,7 +357,7 @@ image_resize_callback (GtkWidget *widget,
image_resize->resize->height,
image_resize->resize->offset_x,
image_resize->resize->offset_y);
gdisplays_flush ();
gimp_image_flush (image_resize->gimage);
}
else
{
......@@ -506,6 +505,6 @@ image_scale_implement (ImageResize *image_scale)
if (display_flush)
{
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -40,8 +40,6 @@
#include "pdb/procedural_db.h"
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
......@@ -98,7 +96,7 @@ layers_previous_cmd_callback (GtkWidget *widget,
if (new_layer)
{
gimp_image_set_active_layer (gimage, new_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
}
......@@ -122,7 +120,7 @@ layers_next_cmd_callback (GtkWidget *widget,
if (new_layer)
{
gimp_image_set_active_layer (gimage, new_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -135,7 +133,7 @@ layers_raise_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage,active_layer);
gimp_image_raise_layer (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -147,7 +145,7 @@ layers_lower_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage,active_layer);
gimp_image_lower_layer (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -159,7 +157,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage,active_layer);
gimp_image_raise_layer_to_top (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -171,7 +169,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage, active_layer);
gimp_image_lower_layer_to_bottom (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -198,7 +196,7 @@ layers_duplicate_cmd_callback (GtkWidget *widget,
TRUE);
gimp_image_add_layer (gimage, new_layer, -1);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -221,7 +219,7 @@ layers_merge_down_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage, active_layer);
gimp_image_merge_down (gimage, active_layer, GIMP_EXPAND_AS_NECESSARY);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -237,7 +235,7 @@ layers_delete_cmd_callback (GtkWidget *widget,
else
gimp_image_remove_layer (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -260,7 +258,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage, active_layer);
gimp_layer_resize_to_image (active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -307,7 +305,7 @@ layers_crop_cmd_callback (GtkWidget *widget,
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -338,7 +336,7 @@ layers_apply_layer_mask_cmd_callback (GtkWidget *widget,
gimp_layer_apply_mask (active_layer, GIMP_MASK_APPLY, TRUE);
if (flush)
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -359,7 +357,7 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
gimp_layer_apply_mask (active_layer, GIMP_MASK_DISCARD, TRUE);
if (flush)
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -374,7 +372,7 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
if (gimp_layer_get_mask (active_layer))
{
gimp_image_mask_layer_mask (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -387,7 +385,7 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
return_if_no_layer (gimage, active_layer);
gimp_image_mask_layer_alpha (gimage, active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
void
......@@ -401,7 +399,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (active_layer)))
{
gimp_layer_add_alpha (active_layer);
gdisplays_flush ();
gimp_image_flush (gimage);
}
}
......@@ -437,7 +435,7 @@ layers_anchor_layer (GimpLayer *layer)
if (gimp_layer_is_floating_sel (layer))
{
floating_sel_anchor (layer);
gdisplays_flush ();
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (layer)));
}
}
......@@ -500,7 +498,7 @@ new_layer_query_ok_callback (GtkWidget *widget,
fill_type);
gimp_image_add_layer (gimage, layer, -1);
gdisplays_flush ();
gimp_image_flush (gimage);
}
else
{
......@@ -534,8 +532,7 @@ layers_new_layer_query (GimpImage *gimage,
if ((floating_sel = gimp_image_floating_sel (gimage)))
{
floating_sel_to_layer (floating_sel);
gdisplays_flush ();
gimp_image_flush (gimage);
return;
}
......@@ -567,7 +564,7 @@ layers_new_layer_query (GimpImage *gimage,
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
return;
}
......@@ -749,7 +746,7 @@ edit_layer_query_ok_callback (GtkWidget *widget,
}
}
gdisplays_flush ();
gimp_image_flush (options->gimage);
gtk_widget_destroy (options->query_box);
}
......@@ -852,7 +849,7 @@ add_mask_query_ok_callback (GtkWidget *widget,
{
mask = gimp_layer_create_mask (layer, options->add_mask_type);
gimp_layer_add_mask (layer, mask, TRUE);
gdisplays_flush ();
gimp_image_flush (gimage);
}
gtk_widget_destroy (options->query_box);
......@@ -1007,7 +1004,7 @@ scale_layer_query_ok_callback (GtkWidget *widget,
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
}
gtk_widget_destroy (options->resize->resize_shell);
......@@ -1099,7 +1096,7 @@ resize_layer_query_ok_callback (GtkWidget *widget,
undo_push_group_end (gimage);
gdisplays_flush ();
gimp_image_flush (gimage);
}
gtk_widget_destroy (options->resize->resize_shell);
......
......@@ -34,7 +34,6 @@
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h"
#include "qmask-commands.h"
......@@ -84,7 +83,7 @@ qmask_toggle_cmd_callback (GtkWidget *widget,
gimp_image_set_qmask_state (shell->gdisp->gimage,
GTK_CHECK_MENU_ITEM (widget)->active);
gdisplays_flush ();
gimp_image_flush (shell->gdisp->gimage);
}
void
......@@ -104,7 +103,7 @@ qmask_invert_cmd_callback (GtkWidget *widget,
gimp_image_qmask_invert (shell->gdisp->gimage);
if (shell->gdisp->gimage->qmask_state)
gdisplays_flush ();
gimp_image_flush (shell->gdisp->gimage);
}
}
......@@ -255,7 +254,7 @@ qmask_query_ok_callback (GtkWidget *widget,
{
gimp_channel_set_color (channel, &color);