2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-06-26 20:09:43 +08:00
|
|
|
* 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 "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "actions-types.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
|
|
|
|
2003-12-09 05:56:22 +08:00
|
|
|
#include "core/core-enums.h"
|
2001-08-14 22:53:55 +08:00
|
|
|
#include "core/gimp.h"
|
2003-09-04 01:17:18 +08:00
|
|
|
#include "core/gimpchannel.h"
|
2001-10-17 19:33:43 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "core/gimpimage.h"
|
2004-04-20 21:44:19 +08:00
|
|
|
#include "core/gimpimage-convert.h"
|
2002-03-15 23:09:58 +08:00
|
|
|
#include "core/gimpimage-crop.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
#include "core/gimpimage-duplicate.h"
|
2003-05-19 02:48:36 +08:00
|
|
|
#include "core/gimpimage-flip.h"
|
2002-02-13 22:41:35 +08:00
|
|
|
#include "core/gimpimage-merge.h"
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
#include "core/gimpimage-resize.h"
|
2003-05-20 18:36:29 +08:00
|
|
|
#include "core/gimpimage-rotate.h"
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
#include "core/gimpimage-scale.h"
|
2003-02-13 19:23:50 +08:00
|
|
|
#include "core/gimpimage-undo.h"
|
2004-08-11 02:47:21 +08:00
|
|
|
#include "core/gimpprogress.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-05-25 20:02:54 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2004-02-01 04:23:53 +08:00
|
|
|
#include "widgets/gimpdock.h"
|
2004-10-27 18:33:08 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2002-08-31 05:00:42 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2002-06-27 06:16:59 +08:00
|
|
|
#include "display/gimpdisplayshell.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs/convert-dialog.h"
|
|
|
|
#include "dialogs/dialogs.h"
|
|
|
|
#include "dialogs/grid-dialog.h"
|
2004-10-24 00:42:37 +08:00
|
|
|
#include "dialogs/image-merge-layers-dialog.h"
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs/image-new-dialog.h"
|
2005-04-05 06:34:29 +08:00
|
|
|
#include "dialogs/image-properties-dialog.h"
|
2004-10-27 09:20:07 +08:00
|
|
|
#include "dialogs/image-scale-dialog.h"
|
2004-11-14 06:27:39 +08:00
|
|
|
#include "dialogs/print-size-dialog.h"
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs/resize-dialog.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
|
2004-05-03 22:03:51 +08:00
|
|
|
#include "actions.h"
|
2002-02-13 22:41:35 +08:00
|
|
|
#include "image-commands.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
|
2004-05-25 22:37:02 +08:00
|
|
|
typedef struct _ImageResizeOptions ImageResizeOptions;
|
|
|
|
|
|
|
|
struct _ImageResizeOptions
|
2001-11-17 01:08:41 +08:00
|
|
|
{
|
2004-05-25 22:37:02 +08:00
|
|
|
GimpContext *context;
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-05-25 22:37:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-05-03 22:46:29 +08:00
|
|
|
/* local function prototypes */
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-10-27 18:33:08 +08:00
|
|
|
static void image_resize_callback (GtkWidget *dialog,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
2005-08-25 01:22:07 +08:00
|
|
|
GimpUnit unit,
|
2004-10-27 18:33:08 +08:00
|
|
|
gint offset_x,
|
|
|
|
gint offset_y,
|
2006-05-19 22:50:46 +08:00
|
|
|
GimpItemSet layer_set,
|
2004-10-24 00:42:37 +08:00
|
|
|
gpointer data);
|
2004-11-14 06:27:39 +08:00
|
|
|
static void image_print_size_callback (GtkWidget *dialog,
|
|
|
|
GimpImage *image,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
GimpUnit resolution_unit,
|
|
|
|
gpointer data);
|
2006-10-15 00:51:30 +08:00
|
|
|
static void image_scale_callback (GtkWidget *dialog,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpUnit unit,
|
|
|
|
GimpInterpolationType interpolation,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
GimpUnit resolution_unit,
|
|
|
|
gpointer user_data);
|
2004-10-27 18:33:08 +08:00
|
|
|
|
2004-10-24 00:42:37 +08:00
|
|
|
static void image_merge_layers_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
|
|
|
ImageMergeLayersDialog *dialog);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
|
|
|
|
2004-10-24 03:13:17 +08:00
|
|
|
/* private variables */
|
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
static GimpMergeType image_merge_layers_type = GIMP_EXPAND_AS_NECESSARY;
|
|
|
|
static gboolean image_merge_layers_discard_invisible = FALSE;
|
|
|
|
static GimpUnit image_resize_unit = GIMP_UNIT_PIXEL;
|
|
|
|
static GimpUnit image_scale_unit = GIMP_UNIT_PIXEL;
|
|
|
|
static GimpInterpolationType image_scale_interp = -1;
|
2004-10-24 03:13:17 +08:00
|
|
|
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
/* public functions */
|
|
|
|
|
2004-05-25 20:02:54 +08:00
|
|
|
void
|
|
|
|
image_new_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
|
|
|
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
|
|
|
gtk_widget_get_screen (widget),
|
2004-09-13 23:15:23 +08:00
|
|
|
"gimp-image-new-dialog", -1, FALSE);
|
2004-09-01 06:41:15 +08:00
|
|
|
|
2004-06-01 16:41:28 +08:00
|
|
|
if (dialog)
|
2004-09-01 06:41:15 +08:00
|
|
|
{
|
2004-09-13 23:15:23 +08:00
|
|
|
image_new_dialog_set (dialog, NULL, NULL);
|
2004-09-01 06:41:15 +08:00
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
2004-05-25 20:02:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
image_new_from_image_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
|
|
|
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
|
|
|
gtk_widget_get_screen (widget),
|
2004-09-13 23:15:23 +08:00
|
|
|
"gimp-image-new-dialog", -1, FALSE);
|
2004-05-25 20:02:54 +08:00
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image = action_data_get_image (data);
|
2004-05-25 20:02:54 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
image_new_dialog_set (dialog, image, NULL);
|
2004-09-01 06:41:15 +08:00
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
2004-05-25 20:02:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-16 17:16:49 +08:00
|
|
|
static void
|
|
|
|
image_convert_dialog_unset (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_object_set_data (G_OBJECT (widget), "image-convert-dialog", NULL);
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-06-10 22:25:04 +08:00
|
|
|
image_convert_cmd_callback (GtkAction *action,
|
2006-06-14 22:36:34 +08:00
|
|
|
GtkAction *current,
|
2004-06-10 22:25:04 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-06-14 22:36:34 +08:00
|
|
|
GimpImage *image;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GimpDisplay *display;
|
|
|
|
GimpImageBaseType value;
|
2006-03-29 01:08:36 +08:00
|
|
|
return_if_no_image (image, data);
|
2004-05-03 22:46:29 +08:00
|
|
|
return_if_no_widget (widget, data);
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-06-14 22:36:34 +08:00
|
|
|
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
|
|
|
|
|
|
|
|
if (value == gimp_image_base_type (image))
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (value)
|
2004-06-10 22:25:04 +08:00
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
|
|
|
case GIMP_GRAY:
|
2006-06-14 22:36:34 +08:00
|
|
|
gimp_image_convert (image, value, 0, 0, FALSE, FALSE, 0, NULL, NULL);
|
2004-06-10 22:25:04 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_INDEXED:
|
2006-06-16 17:16:49 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
|
|
|
|
dialog = g_object_get_data (G_OBJECT (widget), "image-convert-dialog");
|
|
|
|
|
|
|
|
if (! dialog)
|
|
|
|
{
|
2006-09-01 19:26:54 +08:00
|
|
|
dialog = convert_dialog_new (image,
|
|
|
|
action_data_get_context (data),
|
|
|
|
widget,
|
2006-06-16 17:16:49 +08:00
|
|
|
GIMP_PROGRESS (display));
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (widget),
|
|
|
|
"image-convert-dialog", dialog);
|
|
|
|
|
|
|
|
g_signal_connect_object (dialog, "destroy",
|
|
|
|
G_CALLBACK (image_convert_dialog_unset),
|
|
|
|
widget, G_CONNECT_SWAPPED);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
2004-06-10 22:25:04 +08:00
|
|
|
break;
|
|
|
|
}
|
2006-06-16 17:16:49 +08:00
|
|
|
|
|
|
|
gimp_image_flush (image);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_resize_cmd_callback (GtkAction *action,
|
2006-04-12 20:49:29 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2004-05-25 22:37:02 +08:00
|
|
|
ImageResizeOptions *options;
|
2005-08-25 01:22:07 +08:00
|
|
|
GimpImage *image;
|
2004-10-27 18:33:08 +08:00
|
|
|
GtkWidget *widget;
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-10-27 18:33:08 +08:00
|
|
|
GtkWidget *dialog;
|
2005-08-25 01:22:07 +08:00
|
|
|
return_if_no_image (image, data);
|
2004-10-27 18:33:08 +08:00
|
|
|
return_if_no_widget (widget, data);
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-05-25 22:37:02 +08:00
|
|
|
options = g_new0 (ImageResizeOptions, 1);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
options->display = display;
|
2004-10-27 18:33:08 +08:00
|
|
|
options->context = action_data_get_context (data);
|
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
if (image_resize_unit != GIMP_UNIT_PERCENT)
|
|
|
|
image_resize_unit = GIMP_DISPLAY_SHELL (display->shell)->unit;
|
2005-08-25 01:22:07 +08:00
|
|
|
|
|
|
|
dialog = resize_dialog_new (GIMP_VIEWABLE (image),
|
2006-09-01 19:26:54 +08:00
|
|
|
action_data_get_context (data),
|
2004-10-27 18:33:08 +08:00
|
|
|
_("Set Image Canvas Size"), "gimp-image-resize",
|
|
|
|
widget,
|
|
|
|
gimp_standard_help_func, GIMP_HELP_IMAGE_RESIZE,
|
2006-10-15 00:51:30 +08:00
|
|
|
image_resize_unit,
|
2004-10-27 18:33:08 +08:00
|
|
|
image_resize_callback,
|
|
|
|
options);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
g_signal_connect_object (display, "disconnect",
|
2002-09-08 20:18:23 +08:00
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
2004-10-27 18:33:08 +08:00
|
|
|
dialog, G_CONNECT_SWAPPED);
|
2002-09-08 20:18:23 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_free, options);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2004-10-27 18:33:08 +08:00
|
|
|
gtk_widget_show (dialog);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2004-09-05 06:08:43 +08:00
|
|
|
void
|
|
|
|
image_resize_to_layers_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-09-05 06:08:43 +08:00
|
|
|
GimpProgress *progress;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-09-05 06:08:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
2005-10-01 01:50:50 +08:00
|
|
|
_("Resizing"), FALSE);
|
2004-09-05 06:08:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_resize_to_layers (display->image,
|
2004-09-05 06:08:43 +08:00
|
|
|
action_data_get_context (data),
|
|
|
|
progress);
|
|
|
|
|
|
|
|
if (progress)
|
|
|
|
gimp_progress_end (progress);
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_flush (display->image);
|
2004-09-05 06:08:43 +08:00
|
|
|
}
|
|
|
|
|
2004-11-14 06:27:39 +08:00
|
|
|
void
|
|
|
|
image_print_size_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-11-14 06:27:39 +08:00
|
|
|
GtkWidget *widget;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-11-14 06:27:39 +08:00
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
dialog = print_size_dialog_new (display->image,
|
2006-09-01 19:26:54 +08:00
|
|
|
action_data_get_context (data),
|
2004-11-14 06:27:39 +08:00
|
|
|
_("Set Image Print Resolution"),
|
|
|
|
"gimp-image-print-size",
|
|
|
|
widget,
|
|
|
|
gimp_standard_help_func,
|
|
|
|
GIMP_HELP_IMAGE_PRINT_SIZE,
|
|
|
|
image_print_size_callback,
|
|
|
|
NULL);
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
g_signal_connect_object (display, "disconnect",
|
2004-11-14 06:27:39 +08:00
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
dialog, G_CONNECT_SWAPPED);
|
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_scale_cmd_callback (GtkAction *action,
|
2006-04-12 20:49:29 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-10-15 00:51:30 +08:00
|
|
|
GimpDisplay *display;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkWidget *dialog;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-10-27 09:20:07 +08:00
|
|
|
return_if_no_widget (widget, data);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
if (image_scale_unit != GIMP_UNIT_PERCENT)
|
|
|
|
image_scale_unit = GIMP_DISPLAY_SHELL (display->shell)->unit;
|
|
|
|
|
|
|
|
if (image_scale_interp == -1)
|
|
|
|
image_scale_interp = display->image->gimp->config->interpolation_type;
|
|
|
|
|
|
|
|
dialog = image_scale_dialog_new (display->image,
|
2004-10-27 09:20:07 +08:00
|
|
|
action_data_get_context (data),
|
|
|
|
widget,
|
2006-10-15 00:51:30 +08:00
|
|
|
image_scale_unit,
|
|
|
|
image_scale_interp,
|
|
|
|
image_scale_callback,
|
|
|
|
display);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
g_signal_connect_object (display, "disconnect",
|
2004-10-31 02:11:16 +08:00
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
2006-10-15 00:51:30 +08:00
|
|
|
dialog, G_CONNECT_SWAPPED);
|
2004-10-31 02:11:16 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
gtk_widget_show (dialog);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2003-05-19 02:48:36 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_flip_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
2003-05-19 02:48:36 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-05-19 02:48:36 +08:00
|
|
|
GimpProgress *progress;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-05-19 02:48:36 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
2005-10-01 01:50:50 +08:00
|
|
|
_("Flipping"), FALSE);
|
2003-05-19 02:48:36 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_flip (display->image, action_data_get_context (data),
|
2004-08-11 02:47:21 +08:00
|
|
|
(GimpOrientationType) value, progress);
|
2003-05-19 02:48:36 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (progress)
|
|
|
|
gimp_progress_end (progress);
|
2003-05-19 02:48:36 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_flush (display->image);
|
2003-05-19 02:48:36 +08:00
|
|
|
}
|
|
|
|
|
2003-05-20 18:36:29 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_rotate_cmd_callback (GtkAction *action,
|
|
|
|
gint value,
|
|
|
|
gpointer data)
|
2003-05-20 18:36:29 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-05-20 18:36:29 +08:00
|
|
|
GimpProgress *progress;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-05-20 18:36:29 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
2005-10-01 01:50:50 +08:00
|
|
|
_("Rotating"), FALSE);
|
2003-05-20 18:36:29 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_rotate (display->image, action_data_get_context (data),
|
2004-08-11 02:47:21 +08:00
|
|
|
(GimpRotationType) value, progress);
|
2003-05-20 18:36:29 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (progress)
|
|
|
|
gimp_progress_end (progress);
|
2003-05-20 18:36:29 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
gimp_image_flush (display->image);
|
2003-05-20 18:36:29 +08:00
|
|
|
}
|
|
|
|
|
2002-03-15 23:09:58 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_crop_cmd_callback (GtkAction *action,
|
2002-03-15 23:09:58 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2006-10-10 02:49:15 +08:00
|
|
|
GtkWidget *widget;
|
2004-05-03 22:46:29 +08:00
|
|
|
gint x1, y1, x2, y2;
|
2006-03-29 01:08:36 +08:00
|
|
|
return_if_no_image (image, data);
|
2006-10-10 02:49:15 +08:00
|
|
|
return_if_no_widget (widget, data);
|
2002-03-15 23:09:58 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (! gimp_channel_bounds (gimp_image_get_mask (image),
|
2003-09-04 01:17:18 +08:00
|
|
|
&x1, &y1, &x2, &y2))
|
2002-03-15 23:09:58 +08:00
|
|
|
{
|
2006-10-10 02:49:15 +08:00
|
|
|
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
|
|
|
|
_("Cannot crop because the current selection is empty."));
|
2002-03-15 23:09:58 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_crop (image, action_data_get_context (data),
|
2004-04-15 07:37:34 +08:00
|
|
|
x1, y1, x2, y2, FALSE, TRUE);
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_flush (image);
|
2002-03-15 23:09:58 +08:00
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_duplicate_cmd_callback (GtkAction *action,
|
2006-04-12 20:49:29 +08:00
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2004-06-02 06:04:20 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *new_image;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2004-06-02 06:04:20 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
new_image = gimp_image_duplicate (display->image);
|
2004-06-02 06:04:20 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_create_display (new_image->gimp,
|
|
|
|
new_image,
|
2005-09-26 01:03:03 +08:00
|
|
|
shell->unit,
|
|
|
|
gimp_zoom_model_get_factor (shell->zoom));
|
2004-06-02 06:04:20 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_object_unref (new_image);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
|
2002-02-13 22:41:35 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_merge_layers_cmd_callback (GtkAction *action,
|
2002-02-13 22:41:35 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2004-10-24 00:42:37 +08:00
|
|
|
ImageMergeLayersDialog *dialog;
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2004-10-24 00:42:37 +08:00
|
|
|
GtkWidget *widget;
|
2006-03-29 01:08:36 +08:00
|
|
|
return_if_no_image (image, data);
|
2004-05-03 22:46:29 +08:00
|
|
|
return_if_no_widget (widget, data);
|
2002-02-13 22:41:35 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
dialog = image_merge_layers_dialog_new (image,
|
2004-10-24 00:42:37 +08:00
|
|
|
action_data_get_context (data),
|
|
|
|
widget,
|
2006-04-07 16:01:02 +08:00
|
|
|
image_merge_layers_type,
|
|
|
|
image_merge_layers_discard_invisible);
|
2004-05-25 22:37:02 +08:00
|
|
|
|
2004-10-24 00:42:37 +08:00
|
|
|
g_signal_connect (dialog->dialog, "response",
|
2004-05-25 22:37:02 +08:00
|
|
|
G_CALLBACK (image_merge_layers_response),
|
2004-10-24 00:42:37 +08:00
|
|
|
dialog);
|
2004-05-25 22:37:02 +08:00
|
|
|
|
2004-10-24 00:42:37 +08:00
|
|
|
gtk_widget_show (dialog->dialog);
|
2002-02-13 22:41:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_flatten_image_cmd_callback (GtkAction *action,
|
2002-02-13 22:41:35 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
|
|
|
return_if_no_image (image, data);
|
2002-02-13 22:41:35 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_flatten (image, action_data_get_context (data));
|
|
|
|
gimp_image_flush (image);
|
2002-02-13 22:41:35 +08:00
|
|
|
}
|
2003-01-11 01:55:53 +08:00
|
|
|
|
2003-07-27 18:34:15 +08:00
|
|
|
void
|
2004-04-29 20:52:29 +08:00
|
|
|
image_configure_grid_cmd_callback (GtkAction *action,
|
2003-07-27 18:34:15 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2003-07-27 18:34:15 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2003-07-27 18:34:15 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
|
|
|
image = display->image;
|
2003-07-27 18:34:15 +08:00
|
|
|
|
|
|
|
if (! shell->grid_dialog)
|
|
|
|
{
|
2006-09-01 19:26:54 +08:00
|
|
|
shell->grid_dialog = grid_dialog_new (display->image,
|
|
|
|
action_data_get_context (data),
|
|
|
|
display->shell);
|
2003-07-27 18:34:15 +08:00
|
|
|
|
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
|
2006-03-29 01:55:52 +08:00
|
|
|
GTK_WINDOW (display->shell));
|
2003-07-27 18:34:15 +08:00
|
|
|
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
|
|
|
|
TRUE);
|
|
|
|
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
|
2006-06-16 03:37:15 +08:00
|
|
|
(gpointer) &shell->grid_dialog);
|
2003-07-27 18:34:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
|
|
|
|
}
|
|
|
|
|
2005-04-05 06:34:29 +08:00
|
|
|
void
|
|
|
|
image_properties_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display;
|
2005-04-05 06:34:29 +08:00
|
|
|
GimpDisplayShell *shell;
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image;
|
2005-04-05 06:34:29 +08:00
|
|
|
GtkWidget *dialog;
|
2006-03-29 01:55:52 +08:00
|
|
|
return_if_no_display (display, data);
|
2005-04-05 06:34:29 +08:00
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
|
|
|
image = display->image;
|
2005-04-05 06:34:29 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
dialog = image_properties_dialog_new (display->image,
|
|
|
|
action_data_get_context (data),
|
|
|
|
display->shell);
|
2005-04-05 06:34:29 +08:00
|
|
|
|
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
2006-03-29 01:55:52 +08:00
|
|
|
GTK_WINDOW (display->shell));
|
2005-04-05 06:34:29 +08:00
|
|
|
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog),
|
|
|
|
TRUE);
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
|
|
|
|
2003-01-11 01:55:53 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static void
|
2006-05-19 22:50:46 +08:00
|
|
|
image_resize_callback (GtkWidget *dialog,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpUnit unit,
|
|
|
|
gint offset_x,
|
|
|
|
gint offset_y,
|
|
|
|
GimpItemSet layer_set,
|
|
|
|
gpointer data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2004-05-25 22:37:02 +08:00
|
|
|
ImageResizeOptions *options = data;
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
image_resize_unit = unit;
|
|
|
|
|
2004-10-27 18:33:08 +08:00
|
|
|
if (width > 0 && height > 0)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2004-10-27 18:33:08 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display = options->display;
|
2004-10-27 18:33:08 +08:00
|
|
|
GimpContext *context = options->context;
|
2003-06-04 00:42:46 +08:00
|
|
|
GimpProgress *progress;
|
|
|
|
|
2004-10-27 18:33:08 +08:00
|
|
|
gtk_widget_destroy (dialog);
|
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
if (width == image->width &&
|
|
|
|
height == image->height)
|
2004-10-27 18:33:08 +08:00
|
|
|
return;
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
2005-10-01 01:50:50 +08:00
|
|
|
_("Resizing"), FALSE);
|
2003-06-04 00:42:46 +08:00
|
|
|
|
2005-02-25 00:39:12 +08:00
|
|
|
gimp_image_resize_with_layers (image,
|
|
|
|
context,
|
|
|
|
width, height, offset_x, offset_y,
|
2006-05-19 22:50:46 +08:00
|
|
|
layer_set,
|
2005-02-25 00:39:12 +08:00
|
|
|
progress);
|
2003-06-04 00:42:46 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (progress)
|
|
|
|
gimp_progress_end (progress);
|
2003-06-04 00:42:46 +08:00
|
|
|
|
2004-10-27 18:33:08 +08:00
|
|
|
gimp_image_flush (image);
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
2003-08-22 09:42:57 +08:00
|
|
|
else
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2004-11-15 06:01:13 +08:00
|
|
|
g_warning ("Resize Error: "
|
|
|
|
"Both width and height must be greater than zero.");
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-11-14 06:27:39 +08:00
|
|
|
static void
|
|
|
|
image_print_size_callback (GtkWidget *dialog,
|
|
|
|
GimpImage *image,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
GimpUnit resolution_unit,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (dialog);
|
|
|
|
|
2004-11-15 06:01:13 +08:00
|
|
|
if (xresolution == image->xresolution &&
|
|
|
|
yresolution == image->yresolution &&
|
|
|
|
resolution_unit == image->resolution_unit)
|
|
|
|
return;
|
|
|
|
|
2004-11-14 06:27:39 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_SCALE,
|
|
|
|
_("Change Print Size"));
|
|
|
|
|
|
|
|
gimp_image_set_resolution (image, xresolution, yresolution);
|
|
|
|
gimp_image_set_unit (image, resolution_unit);
|
|
|
|
|
|
|
|
gimp_image_undo_group_end (image);
|
|
|
|
|
|
|
|
gimp_image_flush (image);
|
|
|
|
}
|
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
static void
|
2006-10-15 00:51:30 +08:00
|
|
|
image_scale_callback (GtkWidget *dialog,
|
|
|
|
GimpViewable *viewable,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpUnit unit,
|
|
|
|
GimpInterpolationType interpolation,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution,
|
|
|
|
GimpUnit resolution_unit,
|
|
|
|
gpointer user_data)
|
2001-06-26 20:09:43 +08:00
|
|
|
{
|
2006-10-15 00:51:30 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
2003-12-09 19:49:47 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
image_scale_unit = unit;
|
|
|
|
image_scale_interp = interpolation;
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
if (width > 0 && height > 0)
|
|
|
|
{
|
|
|
|
if (width == image->width &&
|
|
|
|
height == image->height &&
|
|
|
|
xresolution == image->xresolution &&
|
|
|
|
yresolution == image->yresolution &&
|
|
|
|
resolution_unit == image->resolution_unit)
|
|
|
|
return;
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_SCALE,
|
|
|
|
_("Scale Image"));
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
gimp_image_set_resolution (image, xresolution, yresolution);
|
|
|
|
gimp_image_set_unit (image, resolution_unit);
|
|
|
|
|
|
|
|
if (width != image->width ||
|
|
|
|
height != image->height)
|
2004-10-27 09:20:07 +08:00
|
|
|
{
|
2001-11-17 01:08:41 +08:00
|
|
|
GimpProgress *progress;
|
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
progress = gimp_progress_start (GIMP_PROGRESS (user_data),
|
2005-10-01 01:50:50 +08:00
|
|
|
_("Scaling"), FALSE);
|
2001-11-17 01:08:41 +08:00
|
|
|
|
2007-02-27 02:53:07 +08:00
|
|
|
gimp_image_scale (image, width, height, interpolation, progress);
|
2001-11-17 01:08:41 +08:00
|
|
|
|
2004-08-11 02:47:21 +08:00
|
|
|
if (progress)
|
|
|
|
gimp_progress_end (progress);
|
2004-10-27 09:20:07 +08:00
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
2003-06-04 00:42:46 +08:00
|
|
|
|
2006-10-15 00:51:30 +08:00
|
|
|
gimp_image_flush (image);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("Scale Error: "
|
|
|
|
"Both width and height must be greater than zero.");
|
|
|
|
}
|
2001-06-26 20:09:43 +08:00
|
|
|
}
|
2004-05-25 22:37:02 +08:00
|
|
|
|
|
|
|
static void
|
2004-10-24 00:42:37 +08:00
|
|
|
image_merge_layers_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
|
|
|
ImageMergeLayersDialog *dialog)
|
2004-05-25 22:37:02 +08:00
|
|
|
{
|
|
|
|
if (response_id == GTK_RESPONSE_OK)
|
|
|
|
{
|
2006-04-07 16:01:02 +08:00
|
|
|
image_merge_layers_type = dialog->merge_type;
|
|
|
|
image_merge_layers_discard_invisible = dialog->discard_invisible;
|
2004-10-24 03:13:17 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_merge_visible_layers (dialog->image,
|
2004-10-24 00:42:37 +08:00
|
|
|
dialog->context,
|
2006-04-07 16:01:02 +08:00
|
|
|
image_merge_layers_type,
|
|
|
|
image_merge_layers_discard_invisible);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_flush (dialog->image);
|
2004-05-25 22:37:02 +08:00
|
|
|
}
|
|
|
|
|
2004-10-27 09:20:07 +08:00
|
|
|
gtk_widget_destroy (widget);
|
2004-05-25 22:37:02 +08:00
|
|
|
}
|