gimp/app/gui/offset-dialog.c

274 lines
8.3 KiB
C
Raw Normal View History

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-offset.h"
#include "core/gimplayer.h"
#include "core/gimplayermask.h"
#include "core/gimpimage.h"
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
use the passed Gimp pointer instead of using "the_gimp". 2001-12-03 Michael Natterer <mitch@gimp.org> * app/devices.c: use the passed Gimp pointer instead of using "the_gimp". * app/base/temp-buf.c: indentation. * app/gui/preferences-dialog.c: prefs_toggle_callback(): fixed segfault when trying to find the prefs_dlg widget from a menu item callback (Fixes #65757). * app/gui/offset-dialog.[ch]: fixed public prototype, include the header in the .c file. * app/gui/menus.c: some menu cleanup: moved all functions which operate on the active layer/drawable to <Image>/Layer. Renamed "Layers" to "Layer". * app/display/gimpdisplayshell.c: changed menu update function accordingly. * app/gui/image-commands.[ch] * app/gui/layers-commands.[ch]: moved stuff from image-commands.* to layers-commads.*- * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/transform_options.c * plug-ins/common/align_layers.c * plug-ins/common/autocrop.c * plug-ins/common/autostretch_hsv.c * plug-ins/common/c_astretch.c * plug-ins/common/color_enhance.c * plug-ins/common/guillotine.c * plug-ins/common/normalize.c * plug-ins/common/rotate.c * plug-ins/common/threshold_alpha.c * plug-ins/common/zealouscrop.c * plug-ins/rcm/rcm.c * plug-ins/fp/fp.c: register under <Image>/Layer, some cosmetic fixes.
2001-12-04 01:59:48 +08:00
#include "offset-dialog.h"
#include "gimp-intl.h"
#define ENTRY_WIDTH 60
typedef struct _OffsetDialog OffsetDialog;
struct _OffsetDialog
{
GtkWidget *dlg;
GtkWidget *off_se;
gboolean wrap_around;
GimpOffsetType fill_type;
GimpImage *gimage;
};
/* local function prototypes */
static void offset_ok_callback (GtkWidget *widget,
gpointer data);
static void offset_halfheight_callback (GtkWidget *widget,
gpointer data);
/* public functions */
void
offset_dialog_create (GimpDrawable *drawable)
{
OffsetDialog *off_d;
GtkWidget *check;
GtkWidget *button;
GtkWidget *vbox;
GtkWidget *abox;
GtkObject *adjustment;
GtkWidget *spinbutton;
GtkWidget *frame;
GtkWidget *radio_button;
const gchar *title = NULL;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
off_d = g_new0 (OffsetDialog, 1);
off_d->wrap_around = TRUE;
off_d->fill_type = gimp_drawable_has_alpha (drawable);
app/core/Makefile.am app/core/core-types.h new base class for something 2002-02-25 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimpitem.[ch]: new base class for something which is a child of an image, has a PDB ID, a tattoo, parasites and emits a "removed" signal. * app/core/gimpdrawable.[ch] * app/vectors/gimpvectors.[ch]: derive from GimpItem. Removed lots of stuff from GimpDrawable. * app/core/gimp.[ch]: changed gimp->drawable_table and gimp->next_drawable_ID to gimp->item_table and gimp->next_item_id. * app/undo.[ch]: s/undo_push_drawable_parasite/undo_push_item_parasite/, minor cleanups. * app/core/gimplayer.[ch]: changed gimp_layer_new_from_tiles() and gimp_layer_new_from_drawable() to take the "dest_gimage" as second, not first parameter. * app/image_map.c * app/core/gimpchannel.c * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/display/gimpdisplayshell-dnd.c * app/file/file-save.c * app/gui/channels-commands.c * app/gui/file-save-dialog.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/paths-dialog.c * app/gui/toolbox.c * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/plug-in/plug-in.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpinktool.c * app/tools/gimppainttool.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/widgets/gimpdrawablepreview.c: changed accordingly. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpitemlistview.[ch]: new widget implementing most of the stuff formerly done by GimpDrawableListView. * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimplayerlistview.c: changed accordingly. * app/widgets/gimpdnd.[ch]: added a vectors DND type. * app/gui/menus.c * app/gui/dialogs.c * app/gui/dialogs-constructors.[ch]: added a vectors dialog and a vectors item_factory. * app/gui/Makefile.am * app/gui/vectors-commands.[ch]: new files implementing the callbacks for the new vectors dialog and item_factory. * app/pdb/pdb_glue.h: some more ugly hacks to keep intermediate perl code working... * tools/pdbgen/pdb.pl: added a vectors type, use GimpItem for all ID lookups. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/misc_tools.pdb * tools/pdbgen/pdb/parasite.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: misc changes according to stuff above. * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/misc_tools_cmds.c * app/pdb/paint_tools_cmds.c * app/pdb/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/transform_tools_cmds.c: regenerated.
2002-02-26 01:58:50 +08:00
off_d->gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (GIMP_IS_LAYER (drawable))
title = _("Offset Layer");
else if (GIMP_IS_LAYER_MASK (drawable))
title = _("Offset Layer Mask");
else if (GIMP_IS_CHANNEL (drawable))
title = _("Offset Channel");
else
g_warning ("%s: unexpected drawable type", G_STRLOC);
off_d->dlg =
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
_("Offset"), "offset",
GIMP_STOCK_TOOL_MOVE,
title,
gimp_standard_help_func,
app/widgets/Makefile.am new file defining the available help topics. Work 2003-08-21 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/gimphelp-ids.h: new file defining the available help topics. Work in progress and totally unusable for matching to the help system. Stay tuned... * app/gui/about-dialog.c * app/gui/brushes-menu.c * app/gui/buffers-menu.c * app/gui/channels-commands.[ch] * app/gui/channels-menu.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradients-commands.c * app/gui/gradients-menu.c * app/gui/image-menu.c * app/gui/layers-commands.[ch] * app/gui/layers-menu.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palettes-menu.c * app/gui/patterns-menu.c * app/gui/resize-dialog.c * app/gui/select-commands.c * app/gui/templates-menu.c * app/gui/tips-dialog.c * app/gui/toolbox-menu.c * app/gui/vectors-commands.[ch] * app/gui/vectors-menu.c: replaced literal HTML file paths by help IDs from gimphelp-ids.h. Renamed some menu callbacks to be consistent with similar ones. This is just an intermediate commit and not finished. While browsing all the menus, I noticed that our "x to selection" functions are not consistent at all. They should all offer the REPLACE,ADD,SUBTRACT,INTERSECT options: * app/core/gimpchannel.[ch]: added new function gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha() and gimp_channel_layer_mask(). * app/core/gimpimage-mask.[ch]: added gimp_image_mask_select_alpha() and gimp_image_mask_select_component() which offer the full set of operation, feather and feather_radius parameters as the other selection functions. * app/core/gimpimage-mask-select.[ch]: removed gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask(). * app/gui/channels-commands.c (channels_channel_to_selection): use gimp_image_mask_select_component() instead of implementing it here. * app/gui/image-menu.c * app/gui/layers-commands.[ch]: offer the full choice of REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask to Selection". * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/selection_cmds.c: regenerated.
2003-08-21 23:54:47 +08:00
GIMP_HELP_LAYER_OFFSET,
GTK_STOCK_CANCEL, gtk_widget_destroy,
NULL, (gpointer) 1, NULL, FALSE, TRUE,
GTK_STOCK_OK, offset_ok_callback,
off_d, NULL, NULL, TRUE, FALSE,
NULL);
g_object_weak_ref (G_OBJECT (off_d->dlg), (GWeakNotify) g_free, off_d);
/* The vbox for first column of options */
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (off_d->dlg)->vbox), vbox);
/* The offset sizeentry */
abox = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), abox, FALSE, FALSE, 0);
gtk_widget_show (abox);
spinbutton = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 1,
1, 2);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
off_d->off_se = gimp_size_entry_new (1, off_d->gimage->unit, "%a",
TRUE, TRUE, FALSE, 10,
GIMP_SIZE_ENTRY_UPDATE_SIZE);
gtk_table_set_col_spacing (GTK_TABLE (off_d->off_se), 0, 4);
gtk_table_set_col_spacing (GTK_TABLE (off_d->off_se), 1, 4);
gtk_table_set_row_spacing (GTK_TABLE (off_d->off_se), 0, 2);
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (off_d->off_se),
GTK_SPIN_BUTTON (spinbutton), NULL);
gtk_table_attach_defaults (GTK_TABLE (off_d->off_se), spinbutton,
1, 2, 0, 1);
gtk_widget_show (spinbutton);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (off_d->off_se),
app/widgets/gimplayerlistview.c some more auto-sizing spinbuttons. 2002-09-08 Michael Natterer <mitch@gimp.org> * app/widgets/gimplayerlistview.c * app/gui/channels-commands.c: some more auto-sizing spinbuttons. * app/gui/offset-dialog.c: added mnemonics for "X" and "Y". Dialog auto-hide cleanup: * app/widgets/gimpviewabledialog.c: close the dialog when the GimpViewable goes away (special cased GimpItems which become invisible on "removed"). Close the dialog by syntesizing a "delete_event" instead of simply hiding or destroying it so the closing method of the dialog's user gets invoked. * app/gui/resize-dialog.[ch]: don't do the same here. Simplifies the API even more as we don't have to pass the object to watch any more. * app/gui/image-commands.c * app/gui/layers-commands.c: changed accordingly. * app/undo_history.c * app/gui/convert-dialog.c * app/gui/qmask-commands.c * app/gui/vectors-commands.c: removed all dialog auto-hiding which is now done by GimpViewableDialog. Also connect more close callbacks to gtk_widget_destroy() and handle shell destruction accordingly, so these pseudo widgets behave more like real ones. Tool-dialog auto-hide fix: * app/tools/tool_manager.c: never call a tool's initialize() method with a NULL gdisp (I can't follow why we did this before because it's conceptually broken and makes the semantics of initialize() more than unclear). To be sure, added g_return_if_fail(GIMP_IS_DISPLAY(gdisp)) to tool_manager_initialize_active(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpimagemaptool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimpthresholdtool.c: removed the recently added code for handling NULL displays in initialize().
2002-09-08 20:18:23 +08:00
_("Offset _X:"), 0, 0, 1.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (off_d->off_se),
app/widgets/gimplayerlistview.c some more auto-sizing spinbuttons. 2002-09-08 Michael Natterer <mitch@gimp.org> * app/widgets/gimplayerlistview.c * app/gui/channels-commands.c: some more auto-sizing spinbuttons. * app/gui/offset-dialog.c: added mnemonics for "X" and "Y". Dialog auto-hide cleanup: * app/widgets/gimpviewabledialog.c: close the dialog when the GimpViewable goes away (special cased GimpItems which become invisible on "removed"). Close the dialog by syntesizing a "delete_event" instead of simply hiding or destroying it so the closing method of the dialog's user gets invoked. * app/gui/resize-dialog.[ch]: don't do the same here. Simplifies the API even more as we don't have to pass the object to watch any more. * app/gui/image-commands.c * app/gui/layers-commands.c: changed accordingly. * app/undo_history.c * app/gui/convert-dialog.c * app/gui/qmask-commands.c * app/gui/vectors-commands.c: removed all dialog auto-hiding which is now done by GimpViewableDialog. Also connect more close callbacks to gtk_widget_destroy() and handle shell destruction accordingly, so these pseudo widgets behave more like real ones. Tool-dialog auto-hide fix: * app/tools/tool_manager.c: never call a tool's initialize() method with a NULL gdisp (I can't follow why we did this before because it's conceptually broken and makes the semantics of initialize() more than unclear). To be sure, added g_return_if_fail(GIMP_IS_DISPLAY(gdisp)) to tool_manager_initialize_active(). * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpimagemaptool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimpthresholdtool.c: removed the recently added code for handling NULL displays in initialize().
2002-09-08 20:18:23 +08:00
_("_Y:"), 1, 0, 1.0);
gtk_container_add (GTK_CONTAINER (abox), off_d->off_se);
gtk_widget_show (off_d->off_se);
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (off_d->off_se), GIMP_UNIT_PIXEL);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (off_d->off_se), 0,
off_d->gimage->xresolution, FALSE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (off_d->off_se), 1,
off_d->gimage->yresolution, FALSE);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (off_d->off_se), 0,
-off_d->gimage->width,
off_d->gimage->width);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (off_d->off_se), 1,
-off_d->gimage->height,
off_d->gimage->height);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (off_d->off_se), 0,
0, off_d->gimage->width);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (off_d->off_se), 1,
0, off_d->gimage->height);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0, 0);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1, 0);
/* The by half height and half width option */
button = gtk_button_new_with_mnemonic (_("Offset by (x/_2),(y/2)"));
gtk_container_set_border_width (GTK_CONTAINER (button), 2);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (offset_halfheight_callback),
off_d);
/* The wrap around option */
check = gtk_check_button_new_with_mnemonic (_("_Wrap"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), off_d->wrap_around);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
gtk_widget_show (check);
g_signal_connect (check, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&off_d->wrap_around);
/* The fill options */
frame =
gimp_radio_group_new2 (TRUE, _("Fill Type"),
G_CALLBACK (gimp_radio_button_update),
&off_d->fill_type,
GINT_TO_POINTER (off_d->fill_type),
_("_Background"),
GINT_TO_POINTER (GIMP_OFFSET_BACKGROUND), NULL,
_("_Transparent"),
GINT_TO_POINTER (GIMP_OFFSET_TRANSPARENT),
&radio_button,
NULL);
if (! gimp_drawable_has_alpha (drawable))
gtk_widget_set_sensitive (radio_button, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
g_object_set_data (G_OBJECT (check), "inverse_sensitive", frame);
gtk_widget_set_sensitive (frame, ! off_d->wrap_around);
gtk_widget_show (vbox);
gtk_widget_show (off_d->dlg);
}
/* private functions */
static void
offset_ok_callback (GtkWidget *widget,
gpointer data)
{
OffsetDialog *off_d;
GimpImage *gimage;
GimpDrawable *drawable;
gint offset_x;
gint offset_y;
off_d = (OffsetDialog *) data;
if ((gimage = off_d->gimage) != NULL)
{
drawable = gimp_image_active_drawable (gimage);
offset_x = (gint)
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
offset_y = (gint)
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 1));
gimp_drawable_offset (drawable,
off_d->wrap_around, off_d->fill_type,
offset_x, offset_y);
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.
2002-05-09 01:48:24 +08:00
gimp_image_flush (gimage);
}
gtk_widget_destroy (off_d->dlg);
}
static void
offset_halfheight_callback (GtkWidget *widget,
gpointer data)
{
OffsetDialog *off_d;
GimpImage *gimage;
off_d = (OffsetDialog *) data;
gimage = off_d->gimage;
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se),
0, gimage->width / 2);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (off_d->off_se),
1, gimage->height / 2);
}