gimp/app/core/gimpitem.c

2165 lines
62 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
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
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
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
* (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, see <http://www.gnu.org/licenses/>.
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
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gegl.h>
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
#include "libgimpbase/gimpbase.h"
#include "libgimpmath/gimpmath.h"
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
#include "core-types.h"
#include "gimp.h"
#include "gimp-parasites.h"
#include "gimpchannel.h"
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
#include "gimpimage.h"
#include "gimpimage-undo.h"
Moved the undo step implementations to the core and pass around lots of 2003-02-14 Michael Natterer <mitch@gimp.org> Moved the undo step implementations to the core and pass around lots of "const gchar *undo_desc". Fixes bug #104367. * app/Makefile.am * app/undo.[ch]: removed... * app/core/Makefile.am * app/core/gimpimage-undo-push.[ch]: ...and added here. * app/paint/Makefile.am * app/tools/Makefile.am * app/paint/gimppaintcore-undo.[ch] * app/tools/gimptransformtool-undo.[ch]: new files for the paint and transform undos. * app/core/gimppaintinfo.[ch]: added a blurb. * 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/paint/paint-types.h * app/paint/paint.c: pass the blurb when registering the core. * app/core/gimpdrawable.[ch] * app/core/gimpimage.[ch] * app/core/gimpimage-mask-select.[ch] * app/core/gimpimage-mask.[ch] * app/core/gimpimagemap.[ch] * app/core/gimplayer-floating-sel.[ch]: added "undo_desc" parameters to all undo pushing helper functions. * app/undo_history.c * app/core/gimpchannel.c * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-guides.c * app/core/gimpimage-merge.c * app/core/gimpimage-qmask.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage-undo.c * app/core/gimpitem.c * app/core/gimplayer.c * app/core/gimplayermask.c * app/display/gimpdisplayshell-dnd.c * app/file/file-open.c * app/file/file-save.c * app/gui/channels-commands.c * app/gui/file-commands.c * app/gui/file-open-dialog.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/paths-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/text/gimptext-compat.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpimagemaptool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpselectioneditor.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly: pass "undo_desc" strings, changed includes or simply removed inclusion of "undo.h". Some random cleanups. * tools/pdbgen/pdb/guides.pdb: cleaned up a lot. Fixed gimp_image_find_next_guide() to not return guides with position < 0 (and made it shorter and readable). * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/guides_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-02-14 22:14:29 +08:00
#include "gimpimage-undo-push.h"
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
#include "gimpitem.h"
#include "gimpitem-preview.h"
#include "gimpitemtree.h"
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
#include "gimplist.h"
#include "gimpmarshal.h"
#include "gimpparasitelist.h"
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
#include "gimpprogress.h"
#include "gimpstrokeoptions.h"
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
#include "gimp-intl.h"
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
enum
{
REMOVED,
VISIBILITY_CHANGED,
LINKED_CHANGED,
LOCK_CONTENT_CHANGED,
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
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_ID,
PROP_WIDTH,
PROP_HEIGHT,
PROP_OFFSET_X,
PROP_OFFSET_Y,
PROP_VISIBLE,
PROP_LINKED,
PROP_LOCK_CONTENT
};
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
typedef struct _GimpItemPrivate GimpItemPrivate;
struct _GimpItemPrivate
{
gint ID; /* provides a unique ID */
guint32 tattoo; /* provides a permanent ID */
GimpImage *image; /* item owner */
GimpParasiteList *parasites; /* Plug-in parasite data */
#if 0
gint width, height; /* size in pixels */
#endif
gint offset_x, offset_y; /* pixel offset in image */
guint visible : 1; /* control visibility */
guint linked : 1; /* control linkage */
guint lock_content : 1; /* content editability */
guint removed : 1; /* removed from the image? */
GeglNode *node; /* the GEGL node to plug
into the graph */
GeglNode *offset_node; /* the offset as a node */
};
#define GET_PRIVATE(item) G_TYPE_INSTANCE_GET_PRIVATE (item, \
GIMP_TYPE_ITEM, \
GimpItemPrivate)
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
/* local function prototypes */
static void gimp_item_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_item_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_item_finalize (GObject *object);
static gint64 gimp_item_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_item_real_visibility_changed (GimpItem *item);
static gboolean gimp_item_real_is_content_locked (const GimpItem *item);
static GimpItem * gimp_item_real_duplicate (GimpItem *item,
GType new_type);
static void gimp_item_real_convert (GimpItem *item,
GimpImage *dest_image);
static gboolean gimp_item_real_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
GError **error);
static void gimp_item_real_translate (GimpItem *item,
gint offset_x,
gint offset_y,
gboolean push_undo);
static void gimp_item_real_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interpolation,
GimpProgress *progress);
static void gimp_item_real_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
static GeglNode * gimp_item_real_get_node (GimpItem *item);
static void gimp_item_sync_offset_node (GimpItem *item);
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
G_DEFINE_TYPE (GimpItem, gimp_item, GIMP_TYPE_VIEWABLE)
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
#define parent_class gimp_item_parent_class
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
static guint gimp_item_signals[LAST_SIGNAL] = { 0 };
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
static void
gimp_item_class_init (GimpItemClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
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
gimp_item_signals[REMOVED] =
g_signal_new ("removed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpItemClass, removed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
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
gimp_item_signals[VISIBILITY_CHANGED] =
g_signal_new ("visibility-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpItemClass, visibility_changed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_item_signals[LINKED_CHANGED] =
g_signal_new ("linked-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpItemClass, linked_changed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_item_signals[LOCK_CONTENT_CHANGED] =
g_signal_new ("lock-content-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpItemClass, lock_content_changed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->set_property = gimp_item_set_property;
object_class->get_property = gimp_item_get_property;
object_class->finalize = gimp_item_finalize;
gimp_object_class->get_memsize = gimp_item_get_memsize;
viewable_class->get_preview_size = gimp_item_get_preview_size;
viewable_class->get_popup_size = gimp_item_get_popup_size;
klass->removed = NULL;
klass->visibility_changed = gimp_item_real_visibility_changed;
klass->linked_changed = NULL;
klass->lock_content_changed = NULL;
klass->is_attached = NULL;
klass->is_content_locked = gimp_item_real_is_content_locked;
klass->get_tree = NULL;
klass->duplicate = gimp_item_real_duplicate;
klass->convert = gimp_item_real_convert;
klass->rename = gimp_item_real_rename;
klass->translate = gimp_item_real_translate;
klass->scale = gimp_item_real_scale;
klass->resize = gimp_item_real_resize;
klass->flip = NULL;
klass->rotate = NULL;
klass->transform = NULL;
klass->stroke = NULL;
klass->to_selection = NULL;
klass->get_node = gimp_item_real_get_node;
klass->default_name = NULL;
klass->rename_desc = NULL;
klass->translate_desc = NULL;
klass->scale_desc = NULL;
klass->resize_desc = NULL;
klass->flip_desc = NULL;
klass->rotate_desc = NULL;
klass->transform_desc = NULL;
g_object_class_install_property (object_class, PROP_ID,
g_param_spec_int ("id", NULL, NULL,
0, G_MAXINT, 0,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_WIDTH,
g_param_spec_int ("width", NULL, NULL,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_HEIGHT,
g_param_spec_int ("height", NULL, NULL,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_OFFSET_X,
g_param_spec_int ("offset-x", NULL, NULL,
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_OFFSET_Y,
g_param_spec_int ("offset-y", NULL, NULL,
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_VISIBLE,
g_param_spec_boolean ("visible", NULL, NULL,
TRUE,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_LINKED,
g_param_spec_boolean ("linked", NULL, NULL,
FALSE,
GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_LOCK_CONTENT,
g_param_spec_boolean ("lock-content",
NULL, NULL,
FALSE,
GIMP_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GimpItemPrivate));
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
}
static void
gimp_item_init (GimpItem *item)
{
GimpItemPrivate *private = GET_PRIVATE (item);
g_object_force_floating (G_OBJECT (item));
private->ID = 0;
private->tattoo = 0;
private->image = NULL;
private->parasites = gimp_parasite_list_new ();
item->width = 0;
item->height = 0;
private->offset_x = 0;
private->offset_y = 0;
private->visible = TRUE;
private->linked = FALSE;
private->lock_content = FALSE;
private->removed = FALSE;
private->node = NULL;
private->offset_node = NULL;
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
}
static void
gimp_item_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_item_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpItem *item = GIMP_ITEM (object);
GimpItemPrivate *private = GET_PRIVATE (object);
switch (property_id)
{
case PROP_ID:
g_value_set_int (value, private->ID);
break;
case PROP_WIDTH:
g_value_set_int (value, item->width);
break;
case PROP_HEIGHT:
g_value_set_int (value, item->height);
break;
case PROP_OFFSET_X:
g_value_set_int (value, private->offset_x);
break;
case PROP_OFFSET_Y:
g_value_set_int (value, private->offset_y);
break;
case PROP_VISIBLE:
g_value_set_boolean (value, private->visible);
break;
case PROP_LINKED:
g_value_set_boolean (value, private->linked);
break;
case PROP_LOCK_CONTENT:
g_value_set_boolean (value, private->lock_content);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
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
static void
gimp_item_finalize (GObject *object)
{
GimpItemPrivate *private = GET_PRIVATE (object);
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
if (private->node)
{
g_object_unref (private->node);
private->node = NULL;
}
if (private->image && private->image->gimp)
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
{
g_hash_table_remove (private->image->gimp->item_table,
GINT_TO_POINTER (private->ID));
private->image = NULL;
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
}
if (private->parasites)
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
{
g_object_unref (private->parasites);
private->parasites = NULL;
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
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gint64
changed GimpObject::get_memsize() to return a second value named 2003-08-25 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.[ch]: changed GimpObject::get_memsize() to return a second value named "gui_size", where the primary return value is the "constant" actual size (as long as no operation is performed on the object), and the second "gui_size" return value is the size of temporary stuff like preview caches or boundary segments (which may change asynchronously, even if the object is on the undo stack). * app/core/gimp.c * app/core/gimpbrush.c * app/core/gimpbrushpipe.c * app/core/gimpbuffer.c * app/core/gimpchannel.c * app/core/gimpcontainer.c * app/core/gimpcontext.c * app/core/gimpdata.c * app/core/gimpdatafactory.c * app/core/gimpdrawable.c * app/core/gimpgradient.c * app/core/gimpimage-undo.c * app/core/gimpimage.c * app/core/gimpitem.c * app/core/gimplayer.c * app/core/gimplist.c * app/core/gimppalette.c * app/core/gimpparasitelist.c * app/core/gimppattern.c * app/core/gimpundo.c * app/core/gimpundostack.c * app/core/gimpviewable.c * app/text/gimptextlayer.c * app/vectors/gimpstroke.c * app/vectors/gimpvectors.c: changed get_memsize() implementations accordingly. * app/display/gimpdisplayshell-title.c * app/gui/debug-commands.c * app/widgets/gimppreview.c: changed callers accordingly. * app/core/gimpimage-undo-push.c: changed layer, channel, vectors and layer_mask undo steps to add/subtract the size of the resp. objects whenever they take/drop ownership of them. Ignore the objects' "gui_size" to get identical sizes on adding/subtracting. Fixes bug #120429.
2003-08-25 18:49:33 +08:00
gimp_item_get_memsize (GimpObject *object,
gint64 *gui_size)
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
{
GimpItemPrivate *private = GET_PRIVATE (object);
gint64 memsize = 0;
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
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->parasites),
gui_size);
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
changed GimpObject::get_memsize() to return a second value named 2003-08-25 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.[ch]: changed GimpObject::get_memsize() to return a second value named "gui_size", where the primary return value is the "constant" actual size (as long as no operation is performed on the object), and the second "gui_size" return value is the size of temporary stuff like preview caches or boundary segments (which may change asynchronously, even if the object is on the undo stack). * app/core/gimp.c * app/core/gimpbrush.c * app/core/gimpbrushpipe.c * app/core/gimpbuffer.c * app/core/gimpchannel.c * app/core/gimpcontainer.c * app/core/gimpcontext.c * app/core/gimpdata.c * app/core/gimpdatafactory.c * app/core/gimpdrawable.c * app/core/gimpgradient.c * app/core/gimpimage-undo.c * app/core/gimpimage.c * app/core/gimpitem.c * app/core/gimplayer.c * app/core/gimplist.c * app/core/gimppalette.c * app/core/gimpparasitelist.c * app/core/gimppattern.c * app/core/gimpundo.c * app/core/gimpundostack.c * app/core/gimpviewable.c * app/text/gimptextlayer.c * app/vectors/gimpstroke.c * app/vectors/gimpvectors.c: changed get_memsize() implementations accordingly. * app/display/gimpdisplayshell-title.c * app/gui/debug-commands.c * app/widgets/gimppreview.c: changed callers accordingly. * app/core/gimpimage-undo-push.c: changed layer, channel, vectors and layer_mask undo steps to add/subtract the size of the resp. objects whenever they take/drop ownership of them. Ignore the objects' "gui_size" to get identical sizes on adding/subtracting. Fixes bug #120429.
2003-08-25 18:49:33 +08:00
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
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
}
static void
gimp_item_real_visibility_changed (GimpItem *item)
{
GimpItemPrivate *private = GET_PRIVATE (item);
if (! private->node)
return;
if (gimp_item_get_visible (item))
{
/* Leave this up to subclasses */
}
else
{
GeglNode *input = gegl_node_get_input_proxy (private->node, "input");
GeglNode *output = gegl_node_get_output_proxy (private->node, "output");
gegl_node_connect_to (input, "output",
output, "input");
}
}
static gboolean
gimp_item_real_is_content_locked (const GimpItem *item)
{
GimpItem *parent = gimp_item_get_parent (item);
if (parent && gimp_item_is_content_locked (parent))
return TRUE;
return GET_PRIVATE (item)->lock_content;
}
static GimpItem *
gimp_item_real_duplicate (GimpItem *item,
GType new_type)
{
GimpItemPrivate *private;
GimpItem *new_item;
gchar *new_name;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
private = GET_PRIVATE (item);
g_return_val_if_fail (GIMP_IS_IMAGE (private->image), NULL);
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL);
/* formulate the new name */
{
const gchar *name;
gchar *ext;
gint number;
gint len;
name = gimp_object_get_name (item);
g_return_val_if_fail (name != NULL, NULL);
ext = strrchr (name, '#');
len = strlen (_("copy"));
if ((strlen (name) >= len &&
strcmp (&name[strlen (name) - len], _("copy")) == 0) ||
(ext && (number = atoi (ext + 1)) > 0 &&
((int)(log10 (number) + 1)) == strlen (ext + 1)))
{
/* don't have redundant "copy"s */
new_name = g_strdup (name);
}
else
{
new_name = g_strdup_printf (_("%s copy"), name);
}
}
new_item = g_object_new (new_type, NULL);
gimp_item_configure (new_item, gimp_item_get_image (item),
private->offset_x, private->offset_y,
gimp_item_get_width (item),
gimp_item_get_height (item),
new_name);
g_free (new_name);
g_object_unref (GET_PRIVATE (new_item)->parasites);
GET_PRIVATE (new_item)->parasites = gimp_parasite_list_copy (private->parasites);
gimp_item_set_visible (new_item, gimp_item_get_visible (item), FALSE);
gimp_item_set_linked (new_item, gimp_item_get_linked (item), FALSE);
if (gimp_item_can_lock_content (new_item))
gimp_item_set_lock_content (new_item, gimp_item_get_lock_content (item),
FALSE);
return new_item;
}
static void
gimp_item_real_convert (GimpItem *item,
GimpImage *dest_image)
{
gimp_item_set_image (item, dest_image);
}
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
static gboolean
gimp_item_real_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
GError **error)
{
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
if (gimp_item_is_attached (item))
gimp_item_tree_rename_item (gimp_item_get_tree (item), item,
new_name, TRUE, undo_desc);
else
gimp_object_set_name (GIMP_OBJECT (item), new_name);
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
return TRUE;
}
static void
gimp_item_real_translate (GimpItem *item,
gint offset_x,
gint offset_y,
gboolean push_undo)
{
GimpItemPrivate *private = GET_PRIVATE (item);
gimp_item_set_offset (item,
private->offset_x + offset_x,
private->offset_y + offset_y);
}
static void
gimp_item_real_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interpolation,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
GimpProgress *progress)
{
if (item->width != new_width)
{
item->width = new_width;
g_object_notify (G_OBJECT (item), "width");
}
if (item->height != new_height)
{
item->height = new_height;
g_object_notify (G_OBJECT (item), "height");
}
gimp_item_set_offset (item, new_offset_x, new_offset_y);
}
static void
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
gimp_item_real_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y)
{
GimpItemPrivate *private = GET_PRIVATE (item);
if (item->width != new_width)
{
item->width = new_width;
g_object_notify (G_OBJECT (item), "width");
}
if (item->height != new_height)
{
item->height = new_height;
g_object_notify (G_OBJECT (item), "height");
}
gimp_item_set_offset (item,
private->offset_x - offset_x,
private->offset_y - offset_y);
}
static GeglNode *
gimp_item_real_get_node (GimpItem *item)
{
GimpItemPrivate *private = GET_PRIVATE (item);
private->node = gegl_node_new ();
return private->node;
}
static void
gimp_item_sync_offset_node (GimpItem *item)
{
GimpItemPrivate *private = GET_PRIVATE (item);
if (private->offset_node)
gegl_node_set (private->offset_node,
"x", (gdouble) private->offset_x,
"y", (gdouble) private->offset_y,
NULL);
}
/**
* gimp_item_remove:
* @item: the #GimpItem to remove.
*
* This function sets the 'removed' flag on @item to #TRUE, and emits
* a 'removed' signal on the item.
*/
void
gimp_item_removed (GimpItem *item)
{
GimpContainer *children;
g_return_if_fail (GIMP_IS_ITEM (item));
GET_PRIVATE (item)->removed = TRUE;
children = gimp_viewable_get_children (GIMP_VIEWABLE (item));
if (children)
gimp_container_foreach (children, (GFunc) gimp_item_removed, NULL);
g_signal_emit (item, gimp_item_signals[REMOVED], 0);
}
/**
* gimp_item_is_removed:
* @item: the #GimpItem to check.
*
* Returns: %TRUE if the 'removed' flag is set for @item, %FALSE otherwise.
*/
gboolean
gimp_item_is_removed (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GET_PRIVATE (item)->removed;
}
/**
* gimp_item_unset_removed:
* @item: a #GimpItem which was on the undo stack
*
* Unsets an item's "removed" state. This function is called when an
* item was on the undo stack and is added back to its parent
* container during and undo or redo. It must never be called from
* anywhere else.
**/
void
gimp_item_unset_removed (GimpItem *item)
{
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_removed (item));
GET_PRIVATE (item)->removed = FALSE;
}
/**
* gimp_item_configure:
* @item: The #GimpItem to configure.
* @image: The #GimpImage to which the item belongs.
* @offset_x: The X offset to assign the item.
* @offset_y: The Y offset to assign the item.
* @width: The width to assign the item.
* @height: The height to assign the item.
* @name: The name to assign the item.
*
* This function is used to configure a new item. First, if the item
* does not already have an ID, it is assigned the next available
* one, and then inserted into the Item Hash Table. Next, it is
* given basic item properties as specified by the arguments.
*/
void
gimp_item_configure (GimpItem *item,
GimpImage *image,
gint offset_x,
gint offset_y,
gint width,
gint height,
const gchar *name)
{
GimpItemPrivate *private;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_IMAGE (image));
private = GET_PRIVATE (item);
g_object_freeze_notify (G_OBJECT (item));
if (private->ID == 0)
{
do
{
private->ID = image->gimp->next_item_ID++;
if (image->gimp->next_item_ID == G_MAXINT)
image->gimp->next_item_ID = 1;
}
while (g_hash_table_lookup (image->gimp->item_table,
GINT_TO_POINTER (private->ID)));
g_hash_table_insert (image->gimp->item_table,
GINT_TO_POINTER (private->ID),
item);
gimp_item_set_image (item, image);
g_object_notify (G_OBJECT (item), "id");
}
if (item->width != width)
{
item->width = width;
g_object_notify (G_OBJECT (item), "width");
}
if (item->height != height)
{
item->height = height;
g_object_notify (G_OBJECT (item), "height");
}
gimp_item_set_offset (item, offset_x, offset_y);
if (name && strlen (name))
gimp_object_set_name (GIMP_OBJECT (item), name);
else
gimp_object_set_static_name (GIMP_OBJECT (item),
GIMP_ITEM_GET_CLASS (item)->default_name);
g_object_thaw_notify (G_OBJECT (item));
}
/**
* gimp_item_is_attached:
* @item: The #GimpItem to check.
*
* Returns: %TRUE if the item is attached to an image, %FALSE otherwise.
*/
gboolean
gimp_item_is_attached (const GimpItem *item)
{
GimpItem *parent;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
parent = gimp_item_get_parent (item);
if (parent)
return gimp_item_is_attached (parent);
return GIMP_ITEM_GET_CLASS (item)->is_attached (item);
}
GimpItem *
gimp_item_get_parent (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
return GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (item)));
}
GimpItemTree *
gimp_item_get_tree (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
if (GIMP_ITEM_GET_CLASS (item)->get_tree)
return GIMP_ITEM_GET_CLASS (item)->get_tree (item);
return NULL;
}
GimpContainer *
gimp_item_get_container (GimpItem *item)
{
GimpItem *parent;
GimpItemTree *tree;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
parent = gimp_item_get_parent (item);
if (parent)
return gimp_viewable_get_children (GIMP_VIEWABLE (parent));
tree = gimp_item_get_tree (item);
if (tree)
return tree->container;
return NULL;
}
GList *
gimp_item_get_container_iter (GimpItem *item)
{
GimpContainer *container;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
2009-08-02 04:53:31 +08:00
container = gimp_item_get_container (item);
if (container)
return GIMP_LIST (container)->list;
return NULL;
}
gint
gimp_item_get_index (GimpItem *item)
{
GimpContainer *container;
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
container = gimp_item_get_container (item);
if (container)
return gimp_container_get_child_index (container, GIMP_OBJECT (item));
return -1;
}
GList *
gimp_item_get_path (GimpItem *item)
{
GimpContainer *container;
GList *path = NULL;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
g_return_val_if_fail (gimp_item_is_attached (item), NULL);
container = gimp_item_get_container (item);
while (container)
{
guint32 index = gimp_container_get_child_index (container,
GIMP_OBJECT (item));
path = g_list_prepend (path, GUINT_TO_POINTER (index));
item = gimp_item_get_parent (item);
if (item)
container = gimp_item_get_container (item);
else
container = NULL;
}
return path;
}
/**
* gimp_item_duplicate:
* @item: The #GimpItem to duplicate.
* @new_type: The type to make the new item.
*
* Returns: the newly created item.
*/
GimpItem *
gimp_item_duplicate (GimpItem *item,
GType new_type)
{
GimpItemPrivate *private;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
private = GET_PRIVATE (item);
g_return_val_if_fail (GIMP_IS_IMAGE (private->image), NULL);
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL);
return GIMP_ITEM_GET_CLASS (item)->duplicate (item, new_type);
}
/**
* gimp_item_convert:
* @item: The #GimpItem to convert.
* @dest_image: The #GimpImage in which to place the converted item.
* @new_type: The type to convert the item to.
*
* Returns: the new item that results from the conversion.
*/
GimpItem *
gimp_item_convert (GimpItem *item,
GimpImage *dest_image,
GType new_type)
{
GimpItem *new_item;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (GET_PRIVATE (item)->image), NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL);
new_item = gimp_item_duplicate (item, new_type);
if (new_item)
GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, dest_image);
return new_item;
}
/**
* gimp_item_rename:
* @item: The #GimpItem to rename.
* @new_name: The new name to give the item.
* @error: Return location for error message.
*
* This function assigns a new name to the item, if the desired name is
* different from the name it already has, and pushes an entry onto the
* undo stack for the item's image. If @new_name is NULL or empty, the
* default name for the item's class is used. If the name is changed,
* the GimpObject::name-changed signal is emitted for the item.
*
* Returns: %TRUE if the @item could be renamed, %FALSE otherwise.
*/
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
gboolean
gimp_item_rename (GimpItem *item,
const gchar *new_name,
GError **error)
{
GimpItemClass *item_class;
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
item_class = GIMP_ITEM_GET_CLASS (item);
if (! new_name || ! *new_name)
new_name = item_class->default_name;
if (strcmp (new_name, gimp_object_get_name (item)))
return item_class->rename (item, new_name, item_class->rename_desc, error);
Disallow to rename the layer mask. Instead, always name the mask "<layer 2004-02-01 Michael Natterer <mitch@gimp.org> Disallow to rename the layer mask. Instead, always name the mask "<layer name> mask". Fixes bug #133112 along with some other unreported ones. * app/core/gimpitem.[ch]: added a boolean return value indicating success to GimpItem::rename(). (gimp_item_real_rename): push an undo step only if the item is attached. * app/core/gimplayer.c (gimp_layer_rename): refuse renaming if the layer is a floating selection floated from a channel (renaming a layer's floating selection makes a new layer out of the floating selection). (gimp_layer_duplicate): use gimp_layer_add_mask() to attach the mask's duplicate. Fixes mask refcount brokenness for duplicated layer masks. (gimp_layer_name_changed): new function. Automatically renames the layer mask when the layer's name changes. * app/core/gimplayermask.c (gimp_layer_mask_rename): new function which refuses renaming. (gimp_layer_mask_name_changed): skip the unique name voodoo GimpItem does by not chaining up. (gimp_layer_mask_set_layer): change the mask's name whenever it is attached to a layer. * app/text/gimptextlayer.c (gimp_text_layer_rename): fiddle with text_layer->auto_rename only if renaming was successful. * app/widgets/gimpitemtreeview.c (gimp_item_tree_view_name_edited): restore the old name if renaming failed. * tools/pdbgen/pdb/drawable.pdb (set_name): return an execution error if renaming failed. * app/pdb/drawable_cmds.c: regenerated.
2004-02-02 04:38:26 +08:00
return TRUE;
}
/**
* gimp_item_get_width:
* @item: The #GimpItem to check.
*
* Returns: The width of the item.
*/
removed gimp_drawable_width,height(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_width,height(). * app/core/gimpitem.[ch]: added gimp_item_width,height(). * app/core/gimpchannel.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-contiguous-region.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimpimagemap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimplayermask.c * app/core/gimpscanconvert.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimppaintcore.c * app/paint/gimpsmudge.c * app/text/gimptextlayer.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimpinktool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/drawable_cmds.c * app/pdb/selection_cmds.c: regenerated.
2003-05-08 21:12:46 +08:00
gint
gimp_item_get_width (const GimpItem *item)
removed gimp_drawable_width,height(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_width,height(). * app/core/gimpitem.[ch]: added gimp_item_width,height(). * app/core/gimpchannel.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-contiguous-region.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimpimagemap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimplayermask.c * app/core/gimpscanconvert.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimppaintcore.c * app/paint/gimpsmudge.c * app/text/gimptextlayer.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimpinktool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/drawable_cmds.c * app/pdb/selection_cmds.c: regenerated.
2003-05-08 21:12:46 +08:00
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return item->width;
}
/**
* gimp_item_get_height:
* @item: The #GimpItem to check.
*
* Returns: The height of the item.
*/
removed gimp_drawable_width,height(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_width,height(). * app/core/gimpitem.[ch]: added gimp_item_width,height(). * app/core/gimpchannel.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-contiguous-region.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimpimagemap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimplayermask.c * app/core/gimpscanconvert.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimppaintcore.c * app/paint/gimpsmudge.c * app/text/gimptextlayer.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimpinktool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/drawable_cmds.c * app/pdb/selection_cmds.c: regenerated.
2003-05-08 21:12:46 +08:00
gint
gimp_item_get_height (const GimpItem *item)
removed gimp_drawable_width,height(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_width,height(). * app/core/gimpitem.[ch]: added gimp_item_width,height(). * app/core/gimpchannel.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-preview.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-contiguous-region.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimpimagemap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimplayermask.c * app/core/gimpscanconvert.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimppaintcore.c * app/paint/gimpsmudge.c * app/text/gimptextlayer.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimpinktool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/drawable_cmds.c * app/pdb/selection_cmds.c: regenerated.
2003-05-08 21:12:46 +08:00
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return item->height;
}
void
gimp_item_set_size (GimpItem *item,
gint width,
gint height)
{
g_return_if_fail (GIMP_IS_ITEM (item));
if (item->width != width ||
item->height != height)
{
g_object_freeze_notify (G_OBJECT (item));
if (item->width != width)
{
item->width = width;
g_object_notify (G_OBJECT (item), "width");
}
if (item->height != height)
{
item->height = height;
g_object_notify (G_OBJECT (item), "height");
}
g_object_thaw_notify (G_OBJECT (item));
gimp_viewable_size_changed (GIMP_VIEWABLE (item));
}
}
/**
* gimp_item_get_offset:
* @item: The #GimpItem to check.
* @offset_x: Return location for the item's X offset.
* @offset_y: Return location for the item's Y offset.
*
* Reveals the X and Y offsets of the item.
*/
removed gimp_drawable_offsets(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_offsets(). * app/core/gimpitem.[ch]: added gimp_item_offsets(). * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask-select.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimppaintcore.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c: regenerated.
2003-05-08 22:06:03 +08:00
void
gimp_item_get_offset (const GimpItem *item,
gint *offset_x,
gint *offset_y)
removed gimp_drawable_offsets(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_offsets(). * app/core/gimpitem.[ch]: added gimp_item_offsets(). * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask-select.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimppaintcore.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c: regenerated.
2003-05-08 22:06:03 +08:00
{
GimpItemPrivate *private;
removed gimp_drawable_offsets(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_offsets(). * app/core/gimpitem.[ch]: added gimp_item_offsets(). * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask-select.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimppaintcore.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c: regenerated.
2003-05-08 22:06:03 +08:00
g_return_if_fail (GIMP_IS_ITEM (item));
private = GET_PRIVATE (item);
if (offset_x) *offset_x = private->offset_x;
if (offset_y) *offset_y = private->offset_y;
removed gimp_drawable_offsets(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_offsets(). * app/core/gimpitem.[ch]: added gimp_item_offsets(). * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask-select.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimppaintcore.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c: regenerated.
2003-05-08 22:06:03 +08:00
}
void
gimp_item_set_offset (GimpItem *item,
gint offset_x,
gint offset_y)
{
GimpItemPrivate *private;
g_return_if_fail (GIMP_IS_ITEM (item));
private = GET_PRIVATE (item);
g_object_freeze_notify (G_OBJECT (item));
if (private->offset_x != offset_x)
{
private->offset_x = offset_x;
g_object_notify (G_OBJECT (item), "offset-x");
}
if (private->offset_y != offset_y)
{
private->offset_y = offset_y;
g_object_notify (G_OBJECT (item), "offset-y");
}
gimp_item_sync_offset_node (item);
g_object_thaw_notify (G_OBJECT (item));
}
gint
gimp_item_get_offset_x (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), 0);
return GET_PRIVATE (item)->offset_x;
}
gint
gimp_item_get_offset_y (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), 0);
return GET_PRIVATE (item)->offset_y;
}
/**
* gimp_item_translate:
* @item: The #GimpItem to move.
* @offset_x: Increment to the X offset of the item.
* @offset_y: Increment to the Y offset of the item.
* @push_undo: If #TRUE, create an entry in the image's undo stack
* for this action.
*
* Adds the specified increments to the X and Y offsets for the item.
*/
void
gimp_item_translate (GimpItem *item,
gint offset_x,
gint offset_y,
gboolean push_undo)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
if (! gimp_item_is_attached (item))
push_undo = FALSE;
if (push_undo)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
item_class->translate_desc);
item_class->translate (item, offset_x, offset_y, push_undo);
if (push_undo)
gimp_image_undo_group_end (image);
}
/**
* gimp_item_check_scaling:
* @item: Item to check
* @new_width: proposed width of item, in pixels
* @new_height: proposed height of item, in pixels
*
* Scales item dimensions, then snaps them to pixel centers
*
* Returns: #FALSE if any dimension reduces to zero as a result
* of this; otherwise, returns #TRUE.
**/
gboolean
gimp_item_check_scaling (const GimpItem *item,
gint new_width,
gint new_height)
{
GimpImage *image;
gdouble img_scale_w;
gdouble img_scale_h;
gint new_item_width;
gint new_item_height;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
image = gimp_item_get_image (item);
app/actions/channels-commands.c app/actions/colormap-actions.c 2007-12-25 Michael Natterer <mitch@gimp.org> * app/actions/channels-commands.c * app/actions/colormap-actions.c * app/actions/colormap-commands.c * app/actions/image-commands.c * app/core/gimp-edit.c * app/core/gimpdrawable-preview.c * app/core/gimpimage-colorhash.c * app/core/gimpimage-colormap.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-flip.c * app/core/gimpimage-guides.c * app/core/gimpimage-merge.c * app/core/gimpimage-preview.c * app/core/gimpimage-quick-mask.c * app/core/gimpimage-resize.c * app/core/gimpimage-rotate.c * app/core/gimpimage-sample-points.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/core/gimpimage.c * app/core/gimpimagefile.c * app/core/gimpimageundo.c * app/core/gimpitem-preview.c * app/core/gimpitem.c * app/core/gimplayer.c * app/core/gimppalette-import.c * app/core/gimpprojection-construct.c * app/core/gimpprojection.c * app/core/gimpselection.c * app/core/gimpundo.c * app/dialogs/layer-options-dialog.c * app/dialogs/print-size-dialog.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-draw.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-title.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/display/gimpstatusbar.c * app/file/file-open.c * app/paint/gimppaintoptions.c * app/tools/gimpaligntool.c * app/tools/gimpcolortool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimpperspectiveclonetool.c * app/tools/gimprectangleselecttool.c * app/tools/gimprectangletool.c * app/tools/gimprotatetool.c * app/vectors/gimpvectors-export.c * app/vectors/gimpvectors-import.c * app/vectors/gimpvectors.c * app/widgets/gimpimagepropview.c * app/widgets/gimpnavigationview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrendererimage.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/image.pdb: use accessors for many image properties. * app/pdb/guides_cmds.c * app/pdb/image_cmds.c: regenerated. svn path=/trunk/; revision=24432
2007-12-26 00:21:40 +08:00
img_scale_w = ((gdouble) new_width /
(gdouble) gimp_image_get_width (image));
img_scale_h = ((gdouble) new_height /
(gdouble) gimp_image_get_height (image));
new_item_width = ROUND (img_scale_w * (gdouble) gimp_item_get_width (item));
new_item_height = ROUND (img_scale_h * (gdouble) gimp_item_get_height (item));
return (new_item_width > 0 && new_item_height > 0);
}
void
gimp_item_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interpolation,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
GimpProgress *progress)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (new_width < 1 || new_height < 1)
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_SCALE,
item_class->scale_desc);
g_object_freeze_notify (G_OBJECT (item));
item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
interpolation, progress);
g_object_thaw_notify (G_OBJECT (item));
if (gimp_item_is_attached (item))
gimp_image_undo_group_end (image);
}
/**
* gimp_item_scale_by_factors:
* @item: Item to be transformed by explicit width and height factors.
* @w_factor: scale factor to apply to width and horizontal offset
* @h_factor: scale factor to apply to height and vertical offset
* @interpolation:
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
* @progress:
*
* Scales item dimensions and offsets by uniform width and
* height factors.
*
* Use gimp_item_scale_by_factors() in circumstances when the same
* width and height scaling factors are to be uniformly applied to a
* set of items. In this context, the item's dimensions and offsets
* from the sides of the containing image all change by these
* predetermined factors. By fiat, the fixed point of the transform is
* the upper left hand corner of the image. Returns #FALSE if a
* requested scale factor is zero or if a scaling zero's out a item
* dimension; returns #TRUE otherwise.
*
* Use gimp_item_scale() in circumstances where new item width
* and height dimensions are predetermined instead.
*
* Side effects: Undo set created for item. Old item imagery
* scaled & painted to new item tiles.
*
* Returns: #TRUE, if the scaled item has positive dimensions
* #FALSE if the scaled item has at least one zero dimension
**/
gboolean
gimp_item_scale_by_factors (GimpItem *item,
gdouble w_factor,
gdouble h_factor,
GimpInterpolationType interpolation,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
GimpProgress *progress)
{
GimpItemPrivate *private;
gint new_width, new_height;
gint new_offset_x, new_offset_y;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
private = GET_PRIVATE (item);
if (w_factor == 0.0 || h_factor == 0.0)
{
g_warning ("%s: requested width or height scale equals zero", G_STRFUNC);
return FALSE;
}
new_offset_x = ROUND (w_factor * (gdouble) private->offset_x);
new_offset_y = ROUND (h_factor * (gdouble) private->offset_y);
new_width = ROUND (w_factor * (gdouble) gimp_item_get_width (item));
new_height = ROUND (h_factor * (gdouble) gimp_item_get_height (item));
if (new_width != 0 && new_height != 0)
{
gimp_item_scale (item,
new_width, new_height,
new_offset_x, new_offset_y,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
interpolation, progress);
return TRUE;
}
return FALSE;
}
/**
* gimp_item_scale_by_origin:
* @item: The item to be transformed by width & height scale factors
* @new_width: The width that item will acquire
* @new_height: The height that the item will acquire
* @interpolation:
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
* @progress:
* @local_origin: sets fixed point of the scaling transform. See below.
*
* Sets item dimensions to new_width and
* new_height. Derives vertical and horizontal scaling
* transforms from new width and height. If local_origin is
* #TRUE, the fixed point of the scaling transform coincides
* with the item's center point. Otherwise, the fixed
* point is taken to be [-GimpItem::offset_x, -GimpItem::->offset_y].
*
* Since this function derives scale factors from new and
* current item dimensions, these factors will vary from
* item to item because of aliasing artifacts; factor
* variations among items can be quite large where item
* dimensions approach pixel dimensions. Use
* gimp_item_scale_by_factors() where constant scales are to
* be uniformly applied to a number of items.
*
* Side effects: undo set created for item.
* Old item imagery scaled
* & painted to new item tiles
**/
void
gimp_item_scale_by_origin (GimpItem *item,
gint new_width,
gint new_height,
GimpInterpolationType interpolation,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
GimpProgress *progress,
gboolean local_origin)
{
GimpItemPrivate *private;
gint new_offset_x, new_offset_y;
g_return_if_fail (GIMP_IS_ITEM (item));
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
private = GET_PRIVATE (item);
if (new_width == 0 || new_height == 0)
{
g_warning ("%s: requested width or height equals zero", G_STRFUNC);
return;
}
if (local_origin)
{
new_offset_x = (private->offset_x +
((gimp_item_get_width (item) - new_width) / 2.0));
new_offset_y = (private->offset_y +
((gimp_item_get_height (item) - new_height) / 2.0));
}
else
{
new_offset_x = (gint) (((gdouble) new_width *
(gdouble) private->offset_x /
(gdouble) gimp_item_get_width (item)));
new_offset_y = (gint) (((gdouble) new_height *
(gdouble) private->offset_y /
(gdouble) gimp_item_get_height (item)));
}
gimp_item_scale (item,
new_width, new_height,
new_offset_x, new_offset_y,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
interpolation, progress);
}
void
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
gimp_item_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
g_return_if_fail (GIMP_IS_CONTEXT (context));
if (new_width < 1 || new_height < 1)
return;
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
if (gimp_item_is_attached (item))
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
item_class->resize_desc);
g_object_freeze_notify (G_OBJECT (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
item_class->resize (item, context, new_width, new_height, offset_x, offset_y);
g_object_thaw_notify (G_OBJECT (item));
if (gimp_item_is_attached (item))
gimp_image_undo_group_end (image);
}
void
gimp_item_flip (GimpItem *item,
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
GimpContext *context,
GimpOrientationType flip_type,
gdouble axis,
gboolean clip_result)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
g_return_if_fail (GIMP_IS_CONTEXT (context));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->flip_desc);
g_object_freeze_notify (G_OBJECT (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
item_class->flip (item, context, flip_type, axis, clip_result);
g_object_thaw_notify (G_OBJECT (item));
gimp_image_undo_group_end (image);
}
void
gimp_item_rotate (GimpItem *item,
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
GimpContext *context,
GimpRotationType rotate_type,
gdouble center_x,
gdouble center_y,
gboolean clip_result)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
g_return_if_fail (GIMP_IS_CONTEXT (context));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->rotate_desc);
g_object_freeze_notify (G_OBJECT (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
item_class->rotate (item, context, rotate_type, center_x, center_y,
clip_result);
g_object_thaw_notify (G_OBJECT (item));
gimp_image_undo_group_end (image);
}
void
gimp_item_transform (GimpItem *item,
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation,
gint recursion_level,
GimpTransformResize clip_result,
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
GimpProgress *progress)
{
GimpItemClass *item_class;
GimpImage *image;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
g_return_if_fail (GIMP_IS_CONTEXT (context));
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
g_return_if_fail (matrix != NULL);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
item_class = GIMP_ITEM_GET_CLASS (item);
image = gimp_item_get_image (item);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
item_class->transform_desc);
g_object_freeze_notify (G_OBJECT (item));
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.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/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-15 07:37:34 +08:00
item_class->transform (item, context, matrix, direction, interpolation,
recursion_level, clip_result, progress);
g_object_thaw_notify (G_OBJECT (item));
gimp_image_undo_group_end (image);
}
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
gboolean
gimp_item_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpContext *context,
GimpStrokeOptions *stroke_options,
gboolean use_default_values,
gboolean push_undo,
GimpProgress *progress,
GError **error)
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
{
GimpItemClass *item_class;
gboolean retval = FALSE;
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (gimp_item_is_attached (item), FALSE);
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE_OPTIONS (stroke_options), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
item_class = GIMP_ITEM_GET_CLASS (item);
if (item_class->stroke)
{
GimpImage *image = gimp_item_get_image (item);
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
gimp_stroke_options_prepare (stroke_options, context, use_default_values);
if (push_undo)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
item_class->stroke_desc);
retval = item_class->stroke (item, drawable, stroke_options, push_undo,
progress, error);
if (push_undo)
gimp_image_undo_group_end (image);
gimp_stroke_options_finish (stroke_options);
}
return retval;
added new virtual function GimpItem::stroke(). 2003-09-01 Michael Natterer <mitch@gimp.org> * app/core/gimpitem.[ch]: added new virtual function GimpItem::stroke(). * app/core/gimpchannel.c * app/vectors/gimpvectors.c: implement GimpItem::stroke(). * app/core/gimpimage-mask.[ch] (gimp_image_mask_stroke): changed signature to match gimp_item_stroke() (the selection mask *really* should be a GimpChannel subclass). Removed global variable "gboolean gimp_image_mask_stroking"... * app/core/gimpimage.[ch]: ...and added "gboolean mask_stroking" to the GimpImage struct. * app/gui/vectors-commands.[ch]: removed vectors_stroke_vectors(). * app/widgets/widgets-types.h: removed GimpStrokeItemFunc typedef. * app/widgets/gimpvectorstreeview.[ch]: removed "stroke_item_func" member and use gimp_item_stroke() instead. * app/gui/dialogs-constructors.c (dialogs_vectors_list_view_new) * app/gui/edit-commands.c (edit_stroke_cmd_callback) * app/gui/vectors-commands. (vectors_stroke_cmd_callback) * app/widgets/gimpselectioneditor.c (gimp_selection_editor_stroke_clicked) * tools/pdbgen/pdb/edit.pdb (gimp_edit_stroke): changed accordingly. * app/pdb/edit_cmds.c: regenerated. Note that there is no GUI for "stroke channel", although it would be utterly cool to have one, since currently slelection stroking cannot be masked by a selection (because we stroke the selection). Anyway, if anyone has an idea how to trigger "stroke channel" with another drawable active (the one to stroke to), please let me know...
2003-09-02 01:56:44 +08:00
}
void
gimp_item_to_selection (GimpItem *item,
GimpChannelOps op,
gboolean antialias,
gboolean feather,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpItemClass *item_class;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
item_class = GIMP_ITEM_GET_CLASS (item);
if (item_class->to_selection)
item_class->to_selection (item, op, antialias,
feather, feather_radius_x, feather_radius_y);
}
GeglNode *
gimp_item_get_node (GimpItem *item)
{
GimpItemPrivate *private;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
private = GET_PRIVATE (item);
if (private->node)
return private->node;
return GIMP_ITEM_GET_CLASS (item)->get_node (item);
}
GeglNode *
gimp_item_peek_node (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
return GET_PRIVATE (item)->node;
}
GeglNode *
gimp_item_get_offset_node (GimpItem *item)
{
GimpItemPrivate *private;
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
private = GET_PRIVATE (item);
if (! private->offset_node)
{
GeglNode *node = gimp_item_get_node (item);
private->offset_node =
gegl_node_new_child (node,
"operation", "gegl:translate",
"x", (gdouble) private->offset_x,
"y", (gdouble) private->offset_y,
NULL);
}
return private->offset_node;
}
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
gint
gimp_item_get_ID (GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), -1);
return GET_PRIVATE (item)->ID;
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
}
GimpItem *
gimp_item_get_by_ID (Gimp *gimp,
gint item_id)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (gimp->item_table == NULL)
return NULL;
return (GimpItem *) g_hash_table_lookup (gimp->item_table,
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
GINT_TO_POINTER (item_id));
}
GimpTattoo
gimp_item_get_tattoo (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), 0);
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
return GET_PRIVATE (item)->tattoo;
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
}
void
gimp_item_set_tattoo (GimpItem *item,
GimpTattoo tattoo)
{
g_return_if_fail (GIMP_IS_ITEM (item));
GET_PRIVATE (item)->tattoo = tattoo;
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
}
GimpImage *
gimp_item_get_image (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
return GET_PRIVATE (item)->image;
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
}
void
gimp_item_set_image (GimpItem *item,
GimpImage *image)
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
{
GimpItemPrivate *private;
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
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (! gimp_item_is_attached (item));
g_return_if_fail (! gimp_item_is_removed (item));
g_return_if_fail (GIMP_IS_IMAGE (image));
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
private = GET_PRIVATE (item);
if (private->tattoo == 0 || private->image != image)
{
private->tattoo = gimp_image_get_new_tattoo (image);
}
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
private->image = image;
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
}
/**
* gimp_item_replace_item:
* @item: a newly allocated #GimpItem
* @replace: the #GimpItem to be replaced by @item
*
* This function shouly only be called right after @item has been
* newly allocated.
*
* Replaces @replace by @item, as far as possible within the #GimpItem
* class. The new @item takes over @replace's ID, tattoo, offset, size
* etc. and all these properties are set to %NULL on @replace.
*
* This function *only* exists to allow subclasses to do evil hacks
* like in XCF text layer loading. Don't ever use this function if you
* are not sure.
*
* After this function returns, @replace has become completely
* unusable, should only be used to steal everything it has (like its
* drawable properties if it's a drawable), and then be destroyed.
**/
void
gimp_item_replace_item (GimpItem *item,
GimpItem *replace)
{
GimpItemPrivate *private;
gint offset_x;
gint offset_y;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (! gimp_item_is_attached (item));
g_return_if_fail (! gimp_item_is_removed (item));
g_return_if_fail (GIMP_IS_ITEM (replace));
private = GET_PRIVATE (item);
gimp_object_set_name (GIMP_OBJECT (item), gimp_object_get_name (replace));
if (private->ID)
g_hash_table_remove (gimp_item_get_image (item)->gimp->item_table,
GINT_TO_POINTER (gimp_item_get_ID (item)));
private->ID = gimp_item_get_ID (replace);
g_hash_table_replace (gimp_item_get_image (item)->gimp->item_table,
GINT_TO_POINTER (gimp_item_get_ID (item)),
item);
/* Set image before tatoo so that the explicitly set tatoo overrides
* the one implicitly set when setting the image
*/
gimp_item_set_image (item, gimp_item_get_image (replace));
GET_PRIVATE (replace)->image = NULL;
gimp_item_set_tattoo (item, gimp_item_get_tattoo (replace));
gimp_item_set_tattoo (replace, 0);
g_object_unref (private->parasites);
private->parasites = GET_PRIVATE (replace)->parasites;
GET_PRIVATE (replace)->parasites = NULL;
gimp_item_get_offset (replace, &offset_x, &offset_y);
gimp_item_set_offset (item, offset_x, offset_y);
gimp_item_set_size (item,
gimp_item_get_width (replace),
gimp_item_get_height (replace));
gimp_item_set_visible (item, gimp_item_get_visible (replace), FALSE);
gimp_item_set_linked (item, gimp_item_get_linked (replace), FALSE);
gimp_item_set_lock_content (item, gimp_item_get_lock_content (replace), FALSE);
}
/**
* gimp_item_set_parasites:
* @item: a #GimpItem
* @parasites: a #GimpParasiteList
*
* Set an @item's #GimpParasiteList. It's usually never needed to
* fiddle with an item's parasite list directly. This function exists
* for special purposes only, like when creating items from unusual
* sources.
**/
void
gimp_item_set_parasites (GimpItem *item,
GimpParasiteList *parasites)
{
GimpItemPrivate *private;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_PARASITE_LIST (parasites));
private = GET_PRIVATE (item);
if (parasites != private->parasites)
{
g_object_unref (private->parasites);
private->parasites = g_object_ref (parasites);
}
}
/**
* gimp_item_get_parasites:
* @item: a #GimpItem
*
* Get an @item's #GimpParasiteList. It's usually never needed to
* fiddle with an item's parasite list directly. This function exists
* for special purposes only, like when saving an item to XCF.
*
* Return value: The @item's #GimpParasiteList.
**/
GimpParasiteList *
gimp_item_get_parasites (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
return GET_PRIVATE (item)->parasites;
}
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
void
gimp_item_parasite_attach (GimpItem *item,
const GimpParasite *parasite,
gboolean push_undo)
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
{
GimpItemPrivate *private;
GimpParasite copy;
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
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (parasite != NULL);
private = GET_PRIVATE (item);
/* make a temporary copy of the GimpParasite struct because
* gimp_parasite_shift_parent() changes it
*/
copy = *parasite;
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
if (! gimp_item_is_attached (item))
push_undo = FALSE;
if (push_undo)
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
{
/* only set the dirty bit manually if we can be saved and the new
* parasite differs from the current one and we aren't undoable
*/
if (gimp_parasite_is_undoable (&copy))
{
/* do a group in case we have attach_parent set */
gimp_image_undo_group_start (private->image,
GIMP_UNDO_GROUP_PARASITE_ATTACH,
C_("undo-type", "Attach Parasite"));
gimp_image_undo_push_item_parasite (private->image, NULL, item, &copy);
}
else if (gimp_parasite_is_persistent (&copy) &&
! gimp_parasite_compare (&copy,
gimp_item_parasite_find
(item, gimp_parasite_name (&copy))))
{
gimp_image_undo_push_cantundo (private->image,
C_("undo-type", "Attach Parasite to Item"));
}
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
}
gimp_parasite_list_add (private->parasites, &copy);
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
if (gimp_parasite_has_flag (&copy, GIMP_PARASITE_ATTACH_PARENT))
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
{
gimp_parasite_shift_parent (&copy);
gimp_image_parasite_attach (private->image, &copy);
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
}
else if (gimp_parasite_has_flag (&copy, GIMP_PARASITE_ATTACH_GRANDPARENT))
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
{
gimp_parasite_shift_parent (&copy);
gimp_parasite_shift_parent (&copy);
gimp_parasite_attach (private->image->gimp, &copy);
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
}
if (gimp_item_is_attached (item) &&
gimp_parasite_is_undoable (&copy))
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
{
gimp_image_undo_group_end (private->image);
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
}
}
void
gimp_item_parasite_detach (GimpItem *item,
const gchar *name,
gboolean push_undo)
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
{
GimpItemPrivate *private;
const GimpParasite *parasite;
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
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (name != NULL);
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
private = GET_PRIVATE (item);
parasite = gimp_parasite_list_find (private->parasites, name);
if (! parasite)
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
return;
if (! gimp_item_is_attached (item))
push_undo = FALSE;
if (push_undo)
{
if (gimp_parasite_is_undoable (parasite))
{
gimp_image_undo_push_item_parasite_remove (private->image,
C_("undo-type", "Remove Parasite from Item"),
item,
gimp_parasite_name (parasite));
}
else if (gimp_parasite_is_persistent (parasite))
{
gimp_image_undo_push_cantundo (private->image,
C_("undo-type", "Remove Parasite from Item"));
}
}
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
gimp_parasite_list_remove (private->parasites, name);
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
}
const GimpParasite *
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
gimp_item_parasite_find (const GimpItem *item,
const gchar *name)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
return gimp_parasite_list_find (GET_PRIVATE (item)->parasites, name);
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
}
static void
gimp_item_parasite_list_foreach_func (gchar *name,
GimpParasite *parasite,
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
gchar ***cur)
{
*(*cur)++ = (gchar *) g_strdup (name);
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
}
gchar **
gimp_item_parasite_list (const GimpItem *item,
gint *count)
{
GimpItemPrivate *private;
gchar **list;
gchar **cur;
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
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
g_return_val_if_fail (count != NULL, NULL);
private = GET_PRIVATE (item);
*count = gimp_parasite_list_length (private->parasites);
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
cur = list = g_new (gchar *, *count);
gimp_parasite_list_foreach (private->parasites,
(GHFunc) gimp_item_parasite_list_foreach_func,
&cur);
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
return list;
}
void
gimp_item_set_visible (GimpItem *item,
gboolean visible,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_ITEM (item));
visible = visible ? TRUE : FALSE;
if (gimp_item_get_visible (item) != visible)
{
if (push_undo && gimp_item_is_attached (item))
{
GimpImage *image = gimp_item_get_image (item);
if (image)
gimp_image_undo_push_item_visibility (image, NULL, item);
}
GET_PRIVATE (item)->visible = visible;
g_signal_emit (item, gimp_item_signals[VISIBILITY_CHANGED], 0);
g_object_notify (G_OBJECT (item), "visible");
}
}
gboolean
gimp_item_get_visible (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GET_PRIVATE (item)->visible;
}
void
gimp_item_set_linked (GimpItem *item,
gboolean linked,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_ITEM (item));
linked = linked ? TRUE : FALSE;
if (gimp_item_get_linked (item) != linked)
{
if (push_undo && gimp_item_is_attached (item))
{
GimpImage *image = gimp_item_get_image (item);
if (image)
gimp_image_undo_push_item_linked (image, NULL, item);
}
GET_PRIVATE (item)->linked = linked;
g_signal_emit (item, gimp_item_signals[LINKED_CHANGED], 0);
g_object_notify (G_OBJECT (item), "linked");
}
}
gboolean
gimp_item_get_linked (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GET_PRIVATE (item)->linked;
}
void
gimp_item_set_lock_content (GimpItem *item,
gboolean lock_content,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_can_lock_content (item));
lock_content = lock_content ? TRUE : FALSE;
if (gimp_item_get_lock_content (item) != lock_content)
{
if (push_undo && gimp_item_is_attached (item))
{
/* Right now I don't think this should be pushed. */
#if 0
GimpImage *image = gimp_item_get_image (item);
gimp_image_undo_push_item_lock_content (image, NULL, item);
#endif
}
GET_PRIVATE (item)->lock_content = lock_content;
g_signal_emit (item, gimp_item_signals[LOCK_CONTENT_CHANGED], 0);
g_object_notify (G_OBJECT (item), "lock-content");
}
}
gboolean
gimp_item_get_lock_content (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GET_PRIVATE (item)->lock_content;
}
gboolean
gimp_item_can_lock_content (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return TRUE;
}
gboolean
gimp_item_is_content_locked (const GimpItem *item)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
return GIMP_ITEM_GET_CLASS (item)->is_content_locked (item);
}
gboolean
gimp_item_mask_bounds (GimpItem *item,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpImage *image;
GimpChannel *selection;
gint tmp_x1, tmp_y1;
gint tmp_x2, tmp_y2;
gboolean retval;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (gimp_item_is_attached (item), FALSE);
image = gimp_item_get_image (item);
selection = gimp_image_get_mask (image);
if (GIMP_ITEM (selection) != item &&
gimp_channel_bounds (selection, &tmp_x1, &tmp_y1, &tmp_x2, &tmp_y2))
{
gint off_x, off_y;
gimp_item_get_offset (item, &off_x, &off_y);
tmp_x1 = CLAMP (tmp_x1 - off_x, 0, gimp_item_get_width (item));
tmp_y1 = CLAMP (tmp_y1 - off_y, 0, gimp_item_get_height (item));
tmp_x2 = CLAMP (tmp_x2 - off_x, 0, gimp_item_get_width (item));
tmp_y2 = CLAMP (tmp_y2 - off_y, 0, gimp_item_get_height (item));
retval = TRUE;
}
else
{
tmp_x1 = 0;
tmp_y1 = 0;
tmp_x2 = gimp_item_get_width (item);
tmp_y2 = gimp_item_get_height (item);
retval = FALSE;
}
if (x1) *x1 = tmp_x1;
if (y1) *y1 = tmp_y1;
if (x2) *x2 = tmp_x2;
if (y2) *y2 = tmp_y2;
return retval;;
}
gboolean
gimp_item_mask_intersect (GimpItem *item,
gint *x,
gint *y,
gint *width,
gint *height)
{
GimpImage *image;
GimpChannel *selection;
gint tmp_x, tmp_y;
gint tmp_width, tmp_height;
gboolean retval;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (gimp_item_is_attached (item), FALSE);
image = gimp_item_get_image (item);
selection = gimp_image_get_mask (image);
if (GIMP_ITEM (selection) != item &&
gimp_channel_bounds (selection, &tmp_x, &tmp_y, &tmp_width, &tmp_height))
{
gint off_x, off_y;
gimp_item_get_offset (item, &off_x, &off_y);
tmp_width -= tmp_x;
tmp_height -= tmp_y;
retval = gimp_rectangle_intersect (tmp_x - off_x, tmp_y - off_y,
tmp_width, tmp_height,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
&tmp_x, &tmp_y,
&tmp_width, &tmp_height);
}
else
{
tmp_x = 0;
tmp_y = 0;
tmp_width = gimp_item_get_width (item);
tmp_height = gimp_item_get_height (item);
retval = TRUE;
}
if (x) *x = tmp_x;
if (y) *y = tmp_y;
if (width) *width = tmp_width;
if (height) *height = tmp_height;
return retval;
}
gboolean
gimp_item_is_in_set (GimpItem *item,
GimpItemSet set)
{
GimpItemPrivate *private;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
private = GET_PRIVATE (item);
switch (set)
{
case GIMP_ITEM_SET_NONE:
return FALSE;
case GIMP_ITEM_SET_ALL:
return TRUE;
case GIMP_ITEM_SET_IMAGE_SIZED:
return (gimp_item_get_width (item) == gimp_image_get_width (private->image) &&
gimp_item_get_height (item) == gimp_image_get_height (private->image));
case GIMP_ITEM_SET_VISIBLE:
return gimp_item_get_visible (item);
case GIMP_ITEM_SET_LINKED:
return gimp_item_get_linked (item);
}
return FALSE;
}