2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2000-02-17 04:44:39 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2013-10-15 07:58:39 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core-types.h"
|
|
|
|
|
2013-11-22 04:43:28 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "gimp.h"
|
2001-02-02 02:44:22 +08:00
|
|
|
#include "gimpchannel.h"
|
2006-06-07 06:48:57 +08:00
|
|
|
#include "gimpguide.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "gimpimage.h"
|
2003-12-10 04:20:45 +08:00
|
|
|
#include "gimpimage-colormap.h"
|
2001-04-19 03:14:20 +08:00
|
|
|
#include "gimpimage-duplicate.h"
|
2003-12-10 04:20:45 +08:00
|
|
|
#include "gimpimage-grid.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 "gimpimage-guides.h"
|
2013-11-22 04:43:28 +08:00
|
|
|
#include "gimpimage-metadata.h"
|
2010-02-04 06:42:32 +08:00
|
|
|
#include "gimpimage-private.h"
|
2010-02-08 18:11:33 +08:00
|
|
|
#include "gimpimage-undo.h"
|
2005-03-05 00:34:59 +08:00
|
|
|
#include "gimpimage-sample-points.h"
|
2010-08-08 23:50:08 +08:00
|
|
|
#include "gimpitemstack.h"
|
2001-02-02 02:44:22 +08:00
|
|
|
#include "gimplayer.h"
|
2010-08-08 23:50:08 +08:00
|
|
|
#include "gimplayermask.h"
|
2002-02-22 06:19:45 +08:00
|
|
|
#include "gimplayer-floating-sel.h"
|
2001-07-10 03:48:30 +08:00
|
|
|
#include "gimpparasitelist.h"
|
2007-01-30 18:34:59 +08:00
|
|
|
#include "gimpsamplepoint.h"
|
2001-07-06 00:21:36 +08:00
|
|
|
|
2003-12-10 04:20:45 +08:00
|
|
|
#include "vectors/gimpvectors.h"
|
1998-12-16 08:37:09 +08:00
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
|
2009-05-01 23:04:06 +08:00
|
|
|
static void gimp_image_duplicate_resolution (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_save_source_uri (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_colormap (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2010-08-09 00:00:08 +08:00
|
|
|
static GimpItem * gimp_image_duplicate_item (GimpItem *item,
|
|
|
|
GimpImage *new_image);
|
2009-05-01 23:04:06 +08:00
|
|
|
static GimpLayer * gimp_image_duplicate_layers (GimpImage *image,
|
2010-08-08 23:50:08 +08:00
|
|
|
GimpImage *new_image);
|
2009-05-01 23:04:06 +08:00
|
|
|
static GimpChannel * gimp_image_duplicate_channels (GimpImage *image,
|
2010-08-08 23:50:08 +08:00
|
|
|
GimpImage *new_image);
|
2009-05-01 23:04:06 +08:00
|
|
|
static GimpVectors * gimp_image_duplicate_vectors (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2010-08-08 23:50:08 +08:00
|
|
|
static void gimp_image_duplicate_floating_sel (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2009-05-01 23:04:06 +08:00
|
|
|
static void gimp_image_duplicate_mask (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_components (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_guides (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_sample_points (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_grid (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2013-11-22 04:43:28 +08:00
|
|
|
static void gimp_image_duplicate_metadata (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2009-05-01 23:04:06 +08:00
|
|
|
static void gimp_image_duplicate_quick_mask (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
|
|
|
static void gimp_image_duplicate_parasites (GimpImage *image,
|
|
|
|
GimpImage *new_image);
|
2008-11-26 15:20:04 +08:00
|
|
|
|
|
|
|
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
GimpImage *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_duplicate (GimpImage *image)
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *new_image;
|
2008-11-26 15:20:04 +08:00
|
|
|
GimpLayer *active_layer;
|
|
|
|
GimpChannel *active_channel;
|
|
|
|
GimpVectors *active_vectors;
|
2003-12-10 04:20:45 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2001-04-19 03:14:20 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_set_busy_until_idle (image->gimp);
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
|
|
|
/* Create a new image */
|
2006-03-29 01:08:36 +08:00
|
|
|
new_image = gimp_create_image (image->gimp,
|
2007-12-26 00:21:40 +08:00
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image),
|
2012-05-08 03:57:33 +08:00
|
|
|
gimp_image_get_base_type (image),
|
2012-04-22 23:31:32 +08:00
|
|
|
gimp_image_get_precision (image),
|
2006-08-29 17:55:34 +08:00
|
|
|
FALSE);
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_disable (new_image);
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2009-05-01 23:04:06 +08:00
|
|
|
/* Store the source uri to be used by the save dialog */
|
|
|
|
gimp_image_duplicate_save_source_uri (image, new_image);
|
2008-11-26 15:20:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Copy the colormap if necessary */
|
|
|
|
gimp_image_duplicate_colormap (image, new_image);
|
|
|
|
|
|
|
|
/* Copy resolution information */
|
|
|
|
gimp_image_duplicate_resolution (image, new_image);
|
|
|
|
|
|
|
|
/* Copy the layers */
|
2010-08-08 23:50:08 +08:00
|
|
|
active_layer = gimp_image_duplicate_layers (image, new_image);
|
2008-11-26 15:20:04 +08:00
|
|
|
|
|
|
|
/* Copy the channels */
|
2010-08-08 23:50:08 +08:00
|
|
|
active_channel = gimp_image_duplicate_channels (image, new_image);
|
2008-11-26 15:20:04 +08:00
|
|
|
|
|
|
|
/* Copy any vectors */
|
|
|
|
active_vectors = gimp_image_duplicate_vectors (image, new_image);
|
|
|
|
|
2010-08-08 23:50:08 +08:00
|
|
|
/* Copy floating layer */
|
|
|
|
gimp_image_duplicate_floating_sel (image, new_image);
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
/* Copy the selection mask */
|
|
|
|
gimp_image_duplicate_mask (image, new_image);
|
|
|
|
|
|
|
|
/* Set active layer, active channel, active vectors */
|
|
|
|
if (active_layer)
|
|
|
|
gimp_image_set_active_layer (new_image, active_layer);
|
|
|
|
|
|
|
|
if (active_channel)
|
|
|
|
gimp_image_set_active_channel (new_image, active_channel);
|
|
|
|
|
|
|
|
if (active_vectors)
|
|
|
|
gimp_image_set_active_vectors (new_image, active_vectors);
|
|
|
|
|
2009-08-25 22:25:26 +08:00
|
|
|
/* Copy state of all color components */
|
2008-11-26 15:20:04 +08:00
|
|
|
gimp_image_duplicate_components (image, new_image);
|
|
|
|
|
|
|
|
/* Copy any guides */
|
|
|
|
gimp_image_duplicate_guides (image, new_image);
|
|
|
|
|
|
|
|
/* Copy any sample points */
|
|
|
|
gimp_image_duplicate_sample_points (image, new_image);
|
|
|
|
|
|
|
|
/* Copy the grid */
|
|
|
|
gimp_image_duplicate_grid (image, new_image);
|
|
|
|
|
2013-11-22 04:43:28 +08:00
|
|
|
/* Copy the metadata */
|
|
|
|
gimp_image_duplicate_metadata (image, new_image);
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
/* Copy the quick mask info */
|
|
|
|
gimp_image_duplicate_quick_mask (image, new_image);
|
|
|
|
|
|
|
|
/* Copy parasites */
|
|
|
|
gimp_image_duplicate_parasites (image, new_image);
|
|
|
|
|
|
|
|
gimp_image_undo_enable (new_image);
|
|
|
|
|
|
|
|
return new_image;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_duplicate_resolution (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
gdouble xres;
|
|
|
|
gdouble yres;
|
|
|
|
|
|
|
|
gimp_image_get_resolution (image, &xres, &yres);
|
|
|
|
gimp_image_set_resolution (new_image, xres, yres);
|
|
|
|
gimp_image_set_unit (new_image, gimp_image_get_unit (image));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-05-01 23:04:06 +08:00
|
|
|
gimp_image_duplicate_save_source_uri (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
2008-11-26 15:20:04 +08:00
|
|
|
{
|
2009-05-01 23:04:06 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (new_image), "gimp-image-source-uri",
|
2011-01-26 15:19:39 +08:00
|
|
|
g_strdup (gimp_image_get_uri (image)),
|
2009-05-01 23:04:06 +08:00
|
|
|
(GDestroyNotify) g_free);
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2006-08-29 17:55:34 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_colormap (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2012-05-08 03:57:33 +08:00
|
|
|
if (gimp_image_get_base_type (new_image) == GIMP_INDEXED)
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_colormap (new_image,
|
|
|
|
gimp_image_get_colormap (image),
|
|
|
|
gimp_image_get_colormap_size (image),
|
2003-12-10 04:20:45 +08:00
|
|
|
FALSE);
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2003-12-10 04:20:45 +08:00
|
|
|
|
2010-08-09 00:00:08 +08:00
|
|
|
static GimpItem *
|
|
|
|
gimp_image_duplicate_item (GimpItem *item,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GimpItem *new_item;
|
|
|
|
|
|
|
|
new_item = gimp_item_convert (item, new_image,
|
|
|
|
G_TYPE_FROM_INSTANCE (item));
|
|
|
|
|
|
|
|
/* Make sure the copied item doesn't say: "<old item> copy" */
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (new_item),
|
|
|
|
gimp_object_get_name (item));
|
|
|
|
|
|
|
|
return new_item;
|
|
|
|
}
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static GimpLayer *
|
2010-08-08 23:50:08 +08:00
|
|
|
gimp_image_duplicate_layers (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
2008-11-26 15:20:04 +08:00
|
|
|
{
|
|
|
|
GimpLayer *active_layer = NULL;
|
|
|
|
GList *list;
|
|
|
|
gint count;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
2009-08-25 22:25:26 +08:00
|
|
|
for (list = gimp_image_get_layer_iter (image), count = 0;
|
2001-02-19 21:06:09 +08:00
|
|
|
list;
|
2002-10-08 21:25:50 +08:00
|
|
|
list = g_list_next (list))
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
{
|
2003-09-29 04:47:14 +08:00
|
|
|
GimpLayer *layer = list->data;
|
2003-12-10 04:20:45 +08:00
|
|
|
GimpLayer *new_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2010-08-08 23:50:08 +08:00
|
|
|
if (gimp_layer_is_floating_sel (layer))
|
|
|
|
continue;
|
|
|
|
|
2010-08-09 00:00:08 +08:00
|
|
|
new_layer = GIMP_LAYER (gimp_image_duplicate_item (GIMP_ITEM (layer),
|
|
|
|
new_image));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-10-08 21:25:50 +08:00
|
|
|
/* Make sure that if the layer has a layer mask,
|
2003-12-10 04:20:45 +08:00
|
|
|
* its name isn't screwed up
|
|
|
|
*/
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
if (new_layer->mask)
|
2002-10-08 21:25:50 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (new_layer->mask),
|
2009-09-01 04:47:18 +08:00
|
|
|
gimp_object_get_name (layer->mask));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_active_layer (image) == layer)
|
2006-04-12 20:49:29 +08:00
|
|
|
active_layer = new_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2010-08-08 23:50:08 +08:00
|
|
|
gimp_image_add_layer (new_image, new_layer,
|
|
|
|
NULL, count++, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
return active_layer;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpChannel *
|
2010-08-08 23:50:08 +08:00
|
|
|
gimp_image_duplicate_channels (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
2008-11-26 15:20:04 +08:00
|
|
|
{
|
|
|
|
GimpChannel *active_channel = NULL;
|
|
|
|
GList *list;
|
|
|
|
gint count;
|
|
|
|
|
2009-08-25 22:25:26 +08:00
|
|
|
for (list = gimp_image_get_channel_iter (image), count = 0;
|
2001-02-19 21:06:09 +08:00
|
|
|
list;
|
2002-10-08 21:25:50 +08:00
|
|
|
list = g_list_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpChannel *channel = list->data;
|
|
|
|
GimpChannel *new_channel;
|
2003-09-29 04:47:14 +08:00
|
|
|
|
2010-08-09 00:00:08 +08:00
|
|
|
new_channel = GIMP_CHANNEL (gimp_image_duplicate_item (GIMP_ITEM (channel),
|
|
|
|
new_image));
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_active_channel (image) == channel)
|
2009-08-02 23:44:05 +08:00
|
|
|
active_channel = new_channel;
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2009-08-04 01:21:51 +08:00
|
|
|
gimp_image_add_channel (new_image, new_channel,
|
2009-08-25 22:25:26 +08:00
|
|
|
NULL, count++, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
return active_channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpVectors *
|
|
|
|
gimp_image_duplicate_vectors (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GimpVectors *active_vectors = NULL;
|
|
|
|
GList *list;
|
|
|
|
gint count;
|
|
|
|
|
2009-08-25 22:25:26 +08:00
|
|
|
for (list = gimp_image_get_vectors_iter (image), count = 0;
|
2003-09-29 04:47:14 +08:00
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
|
|
|
{
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpVectors *vectors = list->data;
|
|
|
|
GimpVectors *new_vectors;
|
2003-09-29 04:47:14 +08:00
|
|
|
|
2010-08-09 00:00:08 +08:00
|
|
|
new_vectors = GIMP_VECTORS (gimp_image_duplicate_item (GIMP_ITEM (vectors),
|
|
|
|
new_image));
|
2003-09-29 04:47:14 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_active_vectors (image) == vectors)
|
2006-04-12 20:49:29 +08:00
|
|
|
active_vectors = new_vectors;
|
2003-09-29 04:47:14 +08:00
|
|
|
|
2009-08-04 01:21:51 +08:00
|
|
|
gimp_image_add_vectors (new_image, new_vectors,
|
2009-08-25 22:25:26 +08:00
|
|
|
NULL, count++, FALSE);
|
2003-09-29 04:47:14 +08:00
|
|
|
}
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
return active_vectors;
|
|
|
|
}
|
2001-02-25 22:37:12 +08:00
|
|
|
|
2010-08-08 23:50:08 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_floating_sel (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GimpLayer *floating_sel;
|
|
|
|
GimpDrawable *floating_sel_drawable;
|
|
|
|
GList *floating_sel_path;
|
|
|
|
GimpItemStack *new_item_stack;
|
|
|
|
GimpLayer *new_floating_sel;
|
|
|
|
GimpDrawable *new_floating_sel_drawable;
|
|
|
|
|
|
|
|
floating_sel = gimp_image_get_floating_selection (image);
|
|
|
|
|
|
|
|
if (! floating_sel)
|
|
|
|
return;
|
|
|
|
|
|
|
|
floating_sel_drawable = gimp_layer_get_floating_sel_drawable (floating_sel);
|
|
|
|
|
|
|
|
if (GIMP_IS_LAYER_MASK (floating_sel_drawable))
|
|
|
|
{
|
|
|
|
GimpLayer *layer;
|
|
|
|
|
|
|
|
layer = gimp_layer_mask_get_layer (GIMP_LAYER_MASK (floating_sel_drawable));
|
|
|
|
|
|
|
|
floating_sel_path = gimp_item_get_path (GIMP_ITEM (layer));
|
|
|
|
|
|
|
|
new_item_stack = GIMP_ITEM_STACK (gimp_image_get_layers (new_image));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
floating_sel_path = gimp_item_get_path (GIMP_ITEM (floating_sel_drawable));
|
|
|
|
|
|
|
|
if (GIMP_IS_LAYER (floating_sel_drawable))
|
|
|
|
new_item_stack = GIMP_ITEM_STACK (gimp_image_get_layers (new_image));
|
|
|
|
else
|
|
|
|
new_item_stack = GIMP_ITEM_STACK (gimp_image_get_channels (new_image));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* adjust path[0] for the floating layer missing in new_image */
|
|
|
|
floating_sel_path->data =
|
|
|
|
GUINT_TO_POINTER (GPOINTER_TO_UINT (floating_sel_path->data) - 1);
|
|
|
|
|
|
|
|
if (GIMP_IS_LAYER (floating_sel_drawable))
|
|
|
|
{
|
2010-08-09 00:00:08 +08:00
|
|
|
new_floating_sel =
|
|
|
|
GIMP_LAYER (gimp_image_duplicate_item (GIMP_ITEM (floating_sel),
|
|
|
|
new_image));
|
2010-08-08 23:50:08 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* can't use gimp_item_convert() for floating selections of channels
|
|
|
|
* or layer masks because they maybe don't have a normal layer's type
|
|
|
|
*/
|
2010-08-09 00:00:08 +08:00
|
|
|
new_floating_sel =
|
|
|
|
GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (floating_sel),
|
|
|
|
G_TYPE_FROM_INSTANCE (floating_sel)));
|
2010-08-08 23:50:08 +08:00
|
|
|
gimp_item_set_image (GIMP_ITEM (new_floating_sel), new_image);
|
2010-08-09 00:00:08 +08:00
|
|
|
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (new_floating_sel),
|
|
|
|
gimp_object_get_name (floating_sel));
|
2010-08-08 23:50:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure the copied layer doesn't say: "<old layer> copy" */
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (new_floating_sel),
|
|
|
|
gimp_object_get_name (floating_sel));
|
|
|
|
|
|
|
|
new_floating_sel_drawable =
|
|
|
|
GIMP_DRAWABLE (gimp_item_stack_get_item_by_path (new_item_stack,
|
|
|
|
floating_sel_path));
|
|
|
|
|
|
|
|
if (GIMP_IS_LAYER_MASK (floating_sel_drawable))
|
|
|
|
new_floating_sel_drawable =
|
|
|
|
GIMP_DRAWABLE (gimp_layer_get_mask (GIMP_LAYER (new_floating_sel_drawable)));
|
|
|
|
|
|
|
|
floating_sel_attach (new_floating_sel, new_floating_sel_drawable);
|
|
|
|
|
|
|
|
g_list_free (floating_sel_path);
|
|
|
|
}
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_mask (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2012-03-15 18:45:27 +08:00
|
|
|
GimpDrawable *mask;
|
|
|
|
GimpDrawable *new_mask;
|
|
|
|
|
|
|
|
mask = GIMP_DRAWABLE (gimp_image_get_mask (image));
|
|
|
|
new_mask = GIMP_DRAWABLE (gimp_image_get_mask (new_image));
|
|
|
|
|
2012-03-21 07:42:44 +08:00
|
|
|
gegl_buffer_copy (gimp_drawable_get_buffer (mask), NULL,
|
|
|
|
gimp_drawable_get_buffer (new_mask), NULL);
|
2012-03-15 18:45:27 +08:00
|
|
|
|
|
|
|
GIMP_CHANNEL (new_mask)->bounds_known = FALSE;
|
|
|
|
GIMP_CHANNEL (new_mask)->boundary_known = FALSE;
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2001-02-25 22:37:12 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_components (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GimpImagePrivate *new_private = GIMP_IMAGE_GET_PRIVATE (new_image);
|
|
|
|
gint count;
|
2003-09-29 04:47:14 +08:00
|
|
|
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
for (count = 0; count < MAX_CHANNELS; count++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
new_private->visible[count] = private->visible[count];
|
|
|
|
new_private->active[count] = private->active[count];
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_duplicate_guides (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GList *list;
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2009-08-02 23:44:05 +08:00
|
|
|
for (list = gimp_image_get_guides (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-07 23:49:59 +08:00
|
|
|
GimpGuide *guide = list->data;
|
|
|
|
gint position = gimp_guide_get_position (guide);
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
|
2006-06-07 23:49:59 +08:00
|
|
|
switch (gimp_guide_get_orientation (guide))
|
2006-04-12 20:49:29 +08:00
|
|
|
{
|
|
|
|
case GIMP_ORIENTATION_HORIZONTAL:
|
2006-06-07 23:49:59 +08:00
|
|
|
gimp_image_add_hguide (new_image, position, FALSE);
|
2006-04-12 20:49:29 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_ORIENTATION_VERTICAL:
|
2006-06-07 23:49:59 +08:00
|
|
|
gimp_image_add_vguide (new_image, position, FALSE);
|
2006-04-12 20:49:29 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_error ("Unknown guide orientation.\n");
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_sample_points (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = gimp_image_get_sample_points (image);
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
2005-03-05 00:34:59 +08:00
|
|
|
{
|
|
|
|
GimpSamplePoint *sample_point = list->data;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_add_sample_point_at_pos (new_image,
|
2005-03-05 00:34:59 +08:00
|
|
|
sample_point->x,
|
|
|
|
sample_point->y,
|
|
|
|
FALSE);
|
|
|
|
}
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2005-03-05 00:34:59 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_grid (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2010-02-04 05:16:02 +08:00
|
|
|
if (gimp_image_get_grid (image))
|
|
|
|
gimp_image_set_grid (new_image, gimp_image_get_grid (image), FALSE);
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
2003-09-29 04:47:14 +08:00
|
|
|
|
2013-11-22 04:43:28 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_metadata (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
|
|
|
GimpMetadata *metadata = gimp_image_get_metadata (image);
|
|
|
|
|
|
|
|
if (metadata)
|
|
|
|
{
|
|
|
|
metadata = gimp_metadata_duplicate (metadata);
|
|
|
|
gimp_image_set_metadata (new_image, metadata, FALSE);
|
|
|
|
g_object_unref (metadata);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_quick_mask (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2010-02-04 16:49:45 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GimpImagePrivate *new_private = GIMP_IMAGE_GET_PRIVATE (new_image);
|
|
|
|
|
|
|
|
new_private->quick_mask_state = private->quick_mask_state;
|
|
|
|
new_private->quick_mask_inverted = private->quick_mask_inverted;
|
|
|
|
new_private->quick_mask_color = private->quick_mask_color;
|
2008-11-26 15:20:04 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-11-26 15:20:04 +08:00
|
|
|
static void
|
|
|
|
gimp_image_duplicate_parasites (GimpImage *image,
|
|
|
|
GimpImage *new_image)
|
|
|
|
{
|
2010-02-04 06:42:32 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GimpImagePrivate *new_private = GIMP_IMAGE_GET_PRIVATE (new_image);
|
|
|
|
|
|
|
|
if (private->parasites)
|
2002-03-22 23:21:18 +08:00
|
|
|
{
|
2010-02-04 06:42:32 +08:00
|
|
|
g_object_unref (new_private->parasites);
|
|
|
|
new_private->parasites = gimp_parasite_list_copy (private->parasites);
|
2002-03-22 23:21:18 +08:00
|
|
|
}
|
gave parasite undo a MISC_UNDO class for now so it compiles
* app/gimpdrawable.c: gave parasite undo a MISC_UNDO class for now
so it compiles
* app/tools_cmds.c: fix crop invoker to give correct args to
crop_image
* app/color_cmds.c: s/GRAY/GRAY_LUT/g;
* app/brush_select.[ch]: removed PDB procs, export brush_active_dialogs,
brush_select_dialog, s/active_dialogs/brush_active_dialogs/
* app/gimage_cmds.[ch]
* app/channel_ops.[ch]: removed channel ops PDB procs, moved duplicate
function from gimage_cmds to channel_ops, export offset and duplicate
* app/gimpbrushlist.[ch]: removed PDB procs
* app/gradient.[ch]: removed PDB procs,
* app/gradient_header.h: exported G_SAMPLE, GradSelect, num_gradients,
grad_active_dialogs, gradient_select_dialog
* app/gradient_select.c: removed PDB procs,
s/active_dialogs/grad_active_dialogs/
* app/patterns.[ch]: removed PDB procs
* app/pattern_select.[ch]: removed PDB procs,
s/active_dialogs/pattern_active_dialogs/
* app/procedural_db.c: removed PDB procs and supporting functions
* app/procedrual_db.h: fiddled with enums
* app/channel_cmds.[ch]
* app/drawable_cmds.[ch]
* app/parasite_cmds.[ch]: pdbgenned now, removed header files
* app/gimpparasite.c: minor cleanup
* app/internal_procs.c: use pdbgen stuff
* app/tools_cmds.c
* app/text_tool_cmds.c: updated from pdbgen
* app/brushes_cmds.c
* app/brush_select_cmds.c
* app/gradient_cmds.c
* app/gradient_select_cmds.c
* app/patterns_cmds.c
* app/pattern_select_cmds.c
* app/procedural_db_cmds.c: new pdbgen files
* app/Makefile.am: file shuffle (see above)
-Yosh
1999-04-24 04:54:02 +08:00
|
|
|
}
|