gimp/app/core/gimpdrawable.c

1640 lines
55 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "core-types.h"
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
new directory app/base/ 2001-05-15 Michael Natterer <mitch@gimp.org> * configure.in: new directory app/base/ * app/Makefile.am * app/boundary.[ch] * app/brush_scale.[ch] * app/gimpchecks.h * app/gimplut.[ch] * app/pixel_processor.[ch] * app/pixel_region.[ch] * app/pixel_surround.[ch] * app/temp_buf.[ch] * app/tile.[ch] * app/tile_cache.[ch] * app/tile_manager.[ch] * app/tile_manager_pvt.h * app/tile_pvt.h * app/tile_swap.[ch]: moved to base/ * app/base/Makefile.am * app/base/base-types.h * app/base/*: new directory for the sub-object pixel maniplation and storage stuff. Does not include Gtk+ or anything outside base/. Did some cleanup in all files. * app/appenums.h * app/apptypes.h * app/core/gimpimage.h: removed types which are now in base/base-types.h. * app/base/base-config.[ch] * app/gimprc.[ch]: put the config variables for base/ to their own file so base/ doesn not have to include gimprc.h (does not yet work, i.e. the variables are un-configurable right now) * app/main.c: set a log handler for "Gimp-Base". * app/paint-funcs/Makefile.am * app/paint-funcs/paint-funcs.[ch]: removed the color hash which maps RGB to color indices because it's a totally standalone system which has nothing to do with the paint-funcs and introduced a GimpImage dependency. paint-funcs/ should be considered on the same sub-object (glib-only) level as base/, only in a different directory. * app/core/Makefile.am * app/core/gimpimage-colorhash.[ch]: put the color hash here. * app/gimage.c: don't invalidate the color hash here... * app/core/gimpimage.c: ... but in the colormap_changed() default inplementation. Initialize the hash in class_init(). * tools/pdbgen/Makefile.am: scan app/base/base-types.h for enums. * tools/pdbgen/enums.pl: regenerated. * app/[lots] * app/core/[of] * app/gui/[files] * app/pdb/[all] * app/tools/[over] * app/widgets/[the] * tools/pdbgen/pdb/[place]: changed #includes accordingly. And use base_config->value instead of the stuff from gimprc.h.
2001-05-15 19:25:25 +08:00
#include "base/pixel-region.h"
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
#include "base/temp-buf.h"
new directory app/base/ 2001-05-15 Michael Natterer <mitch@gimp.org> * configure.in: new directory app/base/ * app/Makefile.am * app/boundary.[ch] * app/brush_scale.[ch] * app/gimpchecks.h * app/gimplut.[ch] * app/pixel_processor.[ch] * app/pixel_region.[ch] * app/pixel_surround.[ch] * app/temp_buf.[ch] * app/tile.[ch] * app/tile_cache.[ch] * app/tile_manager.[ch] * app/tile_manager_pvt.h * app/tile_pvt.h * app/tile_swap.[ch]: moved to base/ * app/base/Makefile.am * app/base/base-types.h * app/base/*: new directory for the sub-object pixel maniplation and storage stuff. Does not include Gtk+ or anything outside base/. Did some cleanup in all files. * app/appenums.h * app/apptypes.h * app/core/gimpimage.h: removed types which are now in base/base-types.h. * app/base/base-config.[ch] * app/gimprc.[ch]: put the config variables for base/ to their own file so base/ doesn not have to include gimprc.h (does not yet work, i.e. the variables are un-configurable right now) * app/main.c: set a log handler for "Gimp-Base". * app/paint-funcs/Makefile.am * app/paint-funcs/paint-funcs.[ch]: removed the color hash which maps RGB to color indices because it's a totally standalone system which has nothing to do with the paint-funcs and introduced a GimpImage dependency. paint-funcs/ should be considered on the same sub-object (glib-only) level as base/, only in a different directory. * app/core/Makefile.am * app/core/gimpimage-colorhash.[ch]: put the color hash here. * app/gimage.c: don't invalidate the color hash here... * app/core/gimpimage.c: ... but in the colormap_changed() default inplementation. Initialize the hash in class_init(). * tools/pdbgen/Makefile.am: scan app/base/base-types.h for enums. * tools/pdbgen/enums.pl: regenerated. * app/[lots] * app/core/[of] * app/gui/[files] * app/pdb/[all] * app/tools/[over] * app/widgets/[the] * tools/pdbgen/pdb/[place]: changed #includes accordingly. And use base_config->value instead of the stuff from gimprc.h.
2001-05-15 19:25:25 +08:00
#include "base/tile.h"
#include "base/tile-manager.h"
#include "paint-funcs/paint-funcs.h"
#include "paint-funcs/scale-region.h"
#include "gimpchannel.h"
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
#include "gimpcontext.h"
#include "gimpdrawable-combine.h"
#include "gimpdrawable-preview.h"
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
#include "gimpdrawable-shadow.h"
#include "gimpdrawable-transform.h"
#include "gimpimage.h"
#include "gimpimage-colormap.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"
#include "gimplayer.h"
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
#include "gimpmarshal.h"
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
#include "gimppattern.h"
#include "gimppickable.h"
#include "gimppreviewcache.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 "gimp-intl.h"
enum
{
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
UPDATE,
ALPHA_CHANGED,
LAST_SIGNAL
};
app/Makefile.am app/gimpunit.c removed... 2001-07-11 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimpunit.c * app/unitrc.h: removed... * app/core/Makefile.am * app/core/gimpunit.[ch]: ...re-added here. * app/core/gimp.[ch]: added the image and drawable hash tables, next_image_ID, next_guide_ID and next_drawable_ID, added a GimpCoreConfig pointer which is now initalized dynamically. * app/core/gimpcoreconfig.[ch]: don't provide a global core_config variable any more (need to access gimp->config now). * app/gdisplay.[ch] * app/core/gimpdrawable.[ch] * app/core/gimpimage.[ch]: removed all global variables from gimpimage.c and gimpdrawable.c, pass a Gimp* to all *_get_by_ID() functions. * tools/pdbgen/app.pl: pass Gimp* to all _get_by_ID() functions. * app/app_procs.c * app/file-open.c * app/file-save.c * app/gimprc.c * app/libgimp_glue.c * app/module_db.c * app/plug_in.c * app/undo.c * app/user_install.c * app/core/core-types.h * app/core/gimpcontext.c * app/core/gimpimage-crop.c * app/core/gimpimage-new.c * app/core/gimpparasite.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/info-window.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c * app/widgets/gimpdnd.c * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/convert_cmds.c * app/pdb/display_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/fileops_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/guides_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * app/pdb/undo_cmds.c * app/pdb/unit_cmds.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/unit.pdb: changed accordingly.
2001-07-11 20:39:49 +08:00
/* local function prototypes */
static void gimp_drawable_pickable_iface_init (GimpPickableInterface *iface);
static void gimp_drawable_finalize (GObject *object);
static gint64 gimp_drawable_get_memsize (GimpObject *object,
gint64 *gui_size);
static gboolean gimp_drawable_get_size (GimpViewable *viewable,
gint *width,
gint *height);
static void gimp_drawable_invalidate_preview (GimpViewable *viewable);
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
static void gimp_drawable_removed (GimpItem *item);
static void gimp_drawable_visibility_changed (GimpItem *item);
static GimpItem * gimp_drawable_duplicate (GimpItem *item,
GType new_type);
static void gimp_drawable_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interp_type,
GimpProgress *progress);
static void gimp_drawable_resize (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,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
static void gimp_drawable_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);
static void gimp_drawable_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);
static void gimp_drawable_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_type,
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);
static gboolean gimp_drawable_get_pixel_at (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel);
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
static void gimp_drawable_real_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
static gint64 gimp_drawable_real_estimate_memsize (const GimpDrawable *drawable,
gint width,
gint height);
static TileManager * gimp_drawable_real_get_tiles (GimpDrawable *drawable);
static void gimp_drawable_real_set_tiles (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
TileManager *tiles,
GimpImageType type,
gint offset_x,
gint offset_y);
static GeglNode * gimp_drawable_get_node (GimpItem *item);
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
static void gimp_drawable_real_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
TileManager *tiles,
gboolean sparse,
gint x,
gint y,
gint width,
gint height);
static void gimp_drawable_real_swap_pixels (GimpDrawable *drawable,
TileManager *tiles,
gboolean sparse,
gint x,
gint y,
gint width,
gint height);
G_DEFINE_TYPE_WITH_CODE (GimpDrawable, gimp_drawable, GIMP_TYPE_ITEM,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
gimp_drawable_pickable_iface_init))
#define parent_class gimp_drawable_parent_class
static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 };
static void
gimp_drawable_class_init (GimpDrawableClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
GimpItemClass *item_class = GIMP_ITEM_CLASS (klass);
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
gimp_drawable_signals[UPDATE] =
g_signal_new ("update",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpDrawableClass, update),
NULL, NULL,
gimp_marshal_VOID__INT_INT_INT_INT,
G_TYPE_NONE, 4,
G_TYPE_INT,
G_TYPE_INT,
G_TYPE_INT,
G_TYPE_INT);
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
gimp_drawable_signals[ALPHA_CHANGED] =
g_signal_new ("alpha-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpDrawableClass, alpha_changed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->finalize = gimp_drawable_finalize;
gimp_object_class->get_memsize = gimp_drawable_get_memsize;
viewable_class->get_size = gimp_drawable_get_size;
viewable_class->invalidate_preview = gimp_drawable_invalidate_preview;
viewable_class->get_preview = gimp_drawable_get_preview;
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
item_class->removed = gimp_drawable_removed;
item_class->visibility_changed = gimp_drawable_visibility_changed;
item_class->duplicate = gimp_drawable_duplicate;
item_class->scale = gimp_drawable_scale;
item_class->resize = gimp_drawable_resize;
item_class->flip = gimp_drawable_flip;
item_class->rotate = gimp_drawable_rotate;
item_class->transform = gimp_drawable_transform;
item_class->get_node = gimp_drawable_get_node;
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
klass->update = gimp_drawable_real_update;
klass->alpha_changed = NULL;
klass->estimate_memsize = gimp_drawable_real_estimate_memsize;
klass->invalidate_boundary = NULL;
klass->get_active_components = NULL;
klass->apply_region = gimp_drawable_real_apply_region;
klass->replace_region = gimp_drawable_real_replace_region;
klass->get_tiles = gimp_drawable_real_get_tiles;
klass->set_tiles = gimp_drawable_real_set_tiles;
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
klass->push_undo = gimp_drawable_real_push_undo;
klass->swap_pixels = gimp_drawable_real_swap_pixels;
}
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->tiles = NULL;
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
drawable->shadow = NULL;
drawable->bytes = 0;
drawable->type = -1;
drawable->has_alpha = FALSE;
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
}
/* sorry for the evil casts */
static void
gimp_drawable_pickable_iface_init (GimpPickableInterface *iface)
{
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
iface->get_image_type = (GimpImageType (*) (GimpPickable *pickable)) gimp_drawable_type;
iface->get_bytes = (gint (*) (GimpPickable *pickable)) gimp_drawable_bytes;
iface->get_tiles = (TileManager * (*) (GimpPickable *pickable)) gimp_drawable_get_tiles;
iface->get_pixel_at = gimp_drawable_get_pixel_at;
}
static void
gimp_drawable_finalize (GObject *object)
{
GimpDrawable *drawable = GIMP_DRAWABLE (object);
if (drawable->tiles)
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
{
2003-05-27 01:02:06 +08:00
tile_manager_unref (drawable->tiles);
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
drawable->tiles = NULL;
}
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
gimp_drawable_free_shadow_tiles (drawable);
if (drawable->source_node)
{
g_object_unref (drawable->source_node);
drawable->source_node = NULL;
}
if (drawable->preview_cache)
gimp_preview_cache_invalidate (&drawable->preview_cache);
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_drawable_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpDrawable *drawable = GIMP_DRAWABLE (object);
gint64 memsize = 0;
memsize += tile_manager_get_memsize (gimp_drawable_get_tiles (drawable),
FALSE);
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
memsize += tile_manager_get_memsize (drawable->shadow, FALSE);
*gui_size += gimp_preview_cache_get_memsize (drawable->preview_cache);
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);
}
static gboolean
gimp_drawable_get_size (GimpViewable *viewable,
gint *width,
gint *height)
{
GimpItem *item = GIMP_ITEM (viewable);
*width = gimp_item_get_width (item);
*height = gimp_item_get_height (item);
return TRUE;
}
static void
gimp_drawable_invalidate_preview (GimpViewable *viewable)
{
GimpDrawable *drawable = GIMP_DRAWABLE (viewable);
added GimpDropMode... ...removed from here. 2001-05-06 Michael Natterer <mitch@gimp.org> * app/appenums.h: added GimpDropMode... * app/gimpdnd.h: ...removed from here. * app/gimpimage.[ch]: - New signal "mode_changed". - removed "const GimpImage*" from gimp_image_colormap_changed() because a signal emission is never "const" for the object which emits the signal. - Fixed gimp_image_[set|get]_component_[active|visible](): ALPHA_CHANNEL maps to ALPHA_PIX only in RGB mode, use ALPHA_G_PIX/ALPHA_I_PIX in GRAY/INDEXED mode. * app/gimpimage-convert.c * app/undo.c: call gimp_image_mode_changed(). * app/gimpviewable.c: added an implementation of "invalidate_preview" which frees the preview temp_buf which may be attached to the viewable. Subclasses need to chain up now. * app/gimpdrawable.c * app/gimpimage.c: chain up in invalidate_preview(). * app/widgets/gimpchannellistview.c: connect to the image's "mode_changed" signal and rebuild the channel list in the callback. * app/widgets/gimpcontainerview.h: indentation. * app/widgets/gimpdockbook.c: set the dockable's context to NULL in gimp_dockbook_remove() * app/widgets/gimpimagedock.c: forgot to actually set the dock's image in gimp_image_dock_new(). * app/gui/dialogs-constructors.c: added a get_name_func() for tool views which returns the tool's "blurb". It's safe to assume now that a dockable's context will exist as long as the dockable exists unless it's explicitely set to NULL, so remove ugly hacks handling context destruction. * app/tools/gimptool.c: removed COMPAT_CRUFT and useless #include's.
2001-05-07 00:14:34 +08:00
if (GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview)
GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable);
drawable->preview_valid = FALSE;
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
if (drawable->preview_cache)
gimp_preview_cache_invalidate (&drawable->preview_cache);
}
Move the shadow tiles from the image to the drawable. Fixes bug #100469. 2008-04-21 Michael Natterer <mitch@gimp.org> Move the shadow tiles from the image to the drawable. Fixes bug #100469. * app/core/Makefile.am * app/core/gimpdrawable-shadow.[ch]: new files implementing the shadow tiles. * app/core/gimpimage.[ch]: remove the shadow tile manager from the GimpImage struct. Remove gimp_image_get_shadow_tiles() and _free_shadow_tiles(). * app/core/gimpdrawable.[ch]: add the shadow tile manager here. Remove get_shadow_tiles() and merge_shadow(). Free the shadow tiles in finalize and when the drawable gets removed from the image. * app/core/gimpdrawable-brightness-contrast.c * app/core/gimpdrawable-color-balance.c * app/core/gimpdrawable-colorize.c * app/core/gimpdrawable-curves.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-hue-saturation.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-levels.c * app/core/gimpdrawable-operation.c * app/core/gimpdrawable-posterize.c * app/core/gimpdrawable-threshold.c * app/core/gimpimagemap.c: changed accordingly. Free the shadow tiles after using them. * app/plug-in/gimpplugin-cleanup.[ch]: add gimp_plug_in_cleanup_add_shadow() and _remove_shadow() which keep track of whether shadow tiles were created on behalf of a plug-in procedure. (gimp_plug_in_cleanup): free shadow tiles which were created but not destroyed by a plug-in procedure. * app/plug-in/gimpplugin-message.c (plug_in_handle_tile_request): call gimp_plug_in_cleanup_add_shadow() whenever a plug-in requests shadow tiles. * tools/pdbgen/pdb/drawable.pdb: use the new drawable shadow API. Add new procedure gimp-drawable-free-shadow. Call gimp_plug_in_cleaup_remove_shadow() when it gets called. * tools/pdbgen/pdb/image.pdb: deprecate gimp-image-free-shadow. Calling it has no effect any longer. * app/pdb/drawable-cmds.c * app/pdb/image-cmds.c * app/pdb/internal-procs.c * libgimp/gimpimage_pdb.[ch] * libgimp/gimpdrawable_pdb.[ch]: regenerated. svn path=/trunk/; revision=25510
2008-04-22 01:20:51 +08:00
static void
gimp_drawable_removed (GimpItem *item)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
gimp_drawable_free_shadow_tiles (drawable);
if (GIMP_ITEM_CLASS (parent_class)->removed)
GIMP_ITEM_CLASS (parent_class)->removed (item);
}
static void
gimp_drawable_visibility_changed (GimpItem *item)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GeglNode *node = gimp_item_get_node (item);
if (node)
{
GeglNode *input;
GeglNode *output;
input = gegl_node_get_input_proxy (node, "input");
output = gegl_node_get_output_proxy (node, "output");
if (gimp_item_get_visible (item))
{
gegl_node_connect_to (input, "output",
drawable->mode_node, "input");
gegl_node_connect_to (drawable->mode_node, "output",
output, "input");
}
else
{
gegl_node_disconnect (drawable->mode_node, "input");
}
}
GIMP_ITEM_CLASS (parent_class)->visibility_changed (item);
}
static GimpItem *
gimp_drawable_duplicate (GimpItem *item,
GType new_type)
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
{
GimpItem *new_item;
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type);
if (GIMP_IS_DRAWABLE (new_item))
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GimpDrawable *new_drawable = GIMP_DRAWABLE (new_item);
PixelRegion srcPR;
PixelRegion destPR;
gint offset_x;
gint offset_y;
gimp_item_get_offset (item, &offset_x, &offset_y);
gimp_drawable_configure (new_drawable,
gimp_item_get_image (item),
offset_x,
offset_y,
gimp_item_get_width (item),
gimp_item_get_height (item),
gimp_drawable_type (drawable),
GIMP_OBJECT (new_drawable)->name);
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
FALSE);
pixel_region_init (&destPR, gimp_drawable_get_tiles (new_drawable),
0, 0,
gimp_item_get_width (new_item),
gimp_item_get_height (new_item),
TRUE);
copy_region (&srcPR, &destPR);
}
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
return new_item;
}
static void
gimp_drawable_scale (GimpItem *item,
gint new_width,
gint new_height,
gint new_offset_x,
gint new_offset_y,
GimpInterpolationType interpolation_type,
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)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *new_tiles;
PixelRegion srcPR, destPR;
new_tiles = tile_manager_new (new_width, new_height, drawable->bytes);
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
FALSE);
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
/* Scale the drawable -
* If the drawable is indexed, then we don't use pixel-value
* resampling because that doesn't necessarily make sense for indexed
* images.
*/
scale_region (&srcPR, &destPR,
gimp_drawable_is_indexed (drawable) ?
GIMP_INTERPOLATION_NONE : interpolation_type,
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 ? gimp_progress_update_and_flush : NULL,
progress);
gimp_drawable_set_tiles_full (drawable, gimp_item_is_attached (item), NULL,
new_tiles, gimp_drawable_type (drawable),
new_offset_x, new_offset_y);
tile_manager_unref (new_tiles);
}
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_drawable_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
PixelRegion srcPR, destPR;
TileManager *new_tiles;
gint new_offset_x;
gint new_offset_y;
gint copy_x, copy_y;
gint copy_width, copy_height;
/* if the size doesn't change, this is a nop */
if (new_width == gimp_item_get_width (item) &&
new_height == gimp_item_get_height (item) &&
offset_x == 0 &&
offset_y == 0)
return;
new_offset_x = item->offset_x - offset_x;
new_offset_y = item->offset_y - offset_y;
gimp_rectangle_intersect (item->offset_x, item->offset_y,
gimp_item_get_width (item),
gimp_item_get_height (item),
new_offset_x, new_offset_y,
new_width, new_height,
&copy_x, &copy_y,
&copy_width, &copy_height);
new_tiles = tile_manager_new (new_width, new_height, drawable->bytes);
/* Determine whether the new tiles need to be initially cleared */
if (copy_width != new_width ||
copy_height != new_height)
{
guchar bg[MAX_CHANNELS] = { 0, };
pixel_region_init (&destPR, new_tiles,
0, 0,
new_width, new_height,
TRUE);
if (! gimp_drawable_has_alpha (drawable) && ! GIMP_IS_CHANNEL (drawable))
gimp_image_get_background (gimp_item_get_image (item), context,
gimp_drawable_type (drawable), bg);
color_region (&destPR, bg);
}
/* Determine whether anything needs to be copied */
if (copy_width && copy_height)
{
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
copy_x - item->offset_x, copy_y - item->offset_y,
copy_width, copy_height,
FALSE);
pixel_region_init (&destPR, new_tiles,
copy_x - new_offset_x, copy_y - new_offset_y,
copy_width, copy_height,
TRUE);
copy_region (&srcPR, &destPR);
}
gimp_drawable_set_tiles_full (drawable, gimp_item_is_attached (item), NULL,
new_tiles, gimp_drawable_type (drawable),
new_offset_x, new_offset_y);
tile_manager_unref (new_tiles);
}
static void
gimp_drawable_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)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
gimp_item_get_offset (item, &off_x, &off_y);
tile_manager_get_offsets (gimp_drawable_get_tiles (drawable),
&old_off_x, &old_off_y);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
off_x, off_y);
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
tiles = gimp_drawable_transform_tiles_flip (drawable, context,
gimp_drawable_get_tiles (drawable),
flip_type, axis,
clip_result);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
old_off_x, old_off_y);
if (tiles)
2003-05-27 01:02:06 +08:00
{
gimp_drawable_transform_paste (drawable, tiles, FALSE);
tile_manager_unref (tiles);
}
}
static void
gimp_drawable_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)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
gimp_item_get_offset (item, &off_x, &off_y);
tile_manager_get_offsets (gimp_drawable_get_tiles (drawable),
&old_off_x, &old_off_y);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
off_x, off_y);
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
tiles = gimp_drawable_transform_tiles_rotate (drawable, context,
gimp_drawable_get_tiles (drawable),
rotate_type, center_x, center_y,
clip_result);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
old_off_x, old_off_y);
if (tiles)
2003-05-27 01:02:06 +08:00
{
gimp_drawable_transform_paste (drawable, tiles, FALSE);
tile_manager_unref (tiles);
}
}
static void
gimp_drawable_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_type,
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)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
gimp_item_get_offset (item, &off_x, &off_y);
tile_manager_get_offsets (gimp_drawable_get_tiles (drawable),
&old_off_x, &old_off_y);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
off_x, off_y);
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
tiles = gimp_drawable_transform_tiles_affine (drawable, context,
gimp_drawable_get_tiles (drawable),
matrix, direction,
interpolation_type,
recursion_level,
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
progress);
tile_manager_set_offsets (gimp_drawable_get_tiles (drawable),
old_off_x, old_off_y);
if (tiles)
2003-05-27 01:02:06 +08:00
{
gimp_drawable_transform_paste (drawable, tiles, FALSE);
tile_manager_unref (tiles);
}
}
static gboolean
gimp_drawable_get_pixel_at (GimpPickable *pickable,
gint x,
gint y,
guchar *pixel)
{
GimpDrawable *drawable = GIMP_DRAWABLE (pickable);
/* do not make this a g_return_if_fail() */
if (x < 0 || x >= gimp_item_get_width (GIMP_ITEM (drawable)) ||
y < 0 || y >= gimp_item_get_height (GIMP_ITEM (drawable)))
return FALSE;
read_pixel_data_1 (gimp_drawable_get_tiles (drawable), x, y, pixel);
return TRUE;
}
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
static void
gimp_drawable_real_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height)
{
if (drawable->source_node)
{
GObject *operation;
GeglRectangle rect;
g_object_get (drawable->source_node,
"gegl-operation", &operation,
NULL);
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
gegl_operation_invalidate (operation, &rect);
g_object_unref (operation);
}
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable));
}
static gint64
gimp_drawable_real_estimate_memsize (const GimpDrawable *drawable,
gint width,
gint height)
{
return (gint64) gimp_drawable_bytes (drawable) * width * height;
}
static TileManager *
gimp_drawable_real_get_tiles (GimpDrawable *drawable)
{
return drawable->tiles;
}
static void
gimp_drawable_real_set_tiles (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
TileManager *tiles,
GimpImageType type,
gint offset_x,
gint offset_y)
{
GimpItem *item;
gboolean old_has_alpha;
g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type));
item = GIMP_ITEM (drawable);
old_has_alpha = gimp_drawable_has_alpha (drawable);
gimp_drawable_invalidate_boundary (drawable);
if (push_undo)
gimp_image_undo_push_drawable_mod (gimp_item_get_image (item), undo_desc,
drawable);
/* ref new before unrefing old, they might be the same */
tile_manager_ref (tiles);
if (drawable->tiles)
tile_manager_unref (drawable->tiles);
drawable->tiles = tiles;
drawable->type = type;
drawable->bytes = tile_manager_bpp (tiles);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
gimp_item_set_offset (item, offset_x, offset_y);
if (gimp_item_get_width (item) != tile_manager_width (tiles) ||
gimp_item_get_height (item) != tile_manager_height (tiles))
{
item->width = tile_manager_width (tiles);
item->height = tile_manager_height (tiles);
gimp_viewable_size_changed (GIMP_VIEWABLE (drawable));
}
if (old_has_alpha != gimp_drawable_has_alpha (drawable))
gimp_drawable_alpha_changed (drawable);
if (drawable->source_node)
gegl_node_set (drawable->source_node,
"tile-manager", drawable->tiles,
NULL);
}
static GeglNode *
gimp_drawable_get_node (GimpItem *item)
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GeglNode *node;
GeglNode *input;
GeglNode *output;
node = GIMP_ITEM_CLASS (parent_class)->get_node (item);
drawable->mode_node = gegl_node_new_child (node,
"operation", "gegl:normal",
NULL);
input = gegl_node_get_input_proxy (node, "input");
output = gegl_node_get_output_proxy (node, "output");
if (gimp_item_get_visible (GIMP_ITEM (drawable)))
{
gegl_node_connect_to (input, "output",
drawable->mode_node, "input");
gegl_node_connect_to (drawable->mode_node, "output",
output, "input");
}
else
{
gegl_node_connect_to (input, "output",
output, "input");
}
return node;
}
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
static void
gimp_drawable_real_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
TileManager *tiles,
gboolean sparse,
gint x,
gint y,
gint width,
gint height)
{
gboolean new_tiles = FALSE;
if (! tiles)
{
PixelRegion srcPR, destPR;
tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
x, y, width, height, FALSE);
pixel_region_init (&destPR, tiles,
0, 0, width, height, TRUE);
copy_region (&srcPR, &destPR);
new_tiles = TRUE;
}
gimp_image_undo_push_drawable (gimp_item_get_image (GIMP_ITEM (drawable)),
undo_desc, drawable,
tiles, sparse,
x, y, width, height);
if (new_tiles)
tile_manager_unref (tiles);
}
static void
gimp_drawable_real_swap_pixels (GimpDrawable *drawable,
TileManager *tiles,
gboolean sparse,
gint x,
gint y,
gint width,
gint height)
{
if (sparse)
{
gint i, j;
for (i = y; i < (y + height); i += (TILE_HEIGHT - (i % TILE_HEIGHT)))
{
for (j = x; j < (x + width); j += (TILE_WIDTH - (j % TILE_WIDTH)))
{
Tile *src_tile;
Tile *dest_tile;
src_tile = tile_manager_get_tile (tiles, j, i, FALSE, FALSE);
if (tile_is_valid (src_tile))
{
/* swap tiles, not pixels! */
src_tile = tile_manager_get_tile (tiles,
j, i, TRUE, FALSE /*TRUE*/);
dest_tile = tile_manager_get_tile (gimp_drawable_get_tiles (drawable),
j, i, TRUE, FALSE /* TRUE */);
tile_manager_map_tile (tiles,
j, i, dest_tile);
tile_manager_map_tile (gimp_drawable_get_tiles (drawable),
j, i, src_tile);
tile_release (dest_tile, FALSE);
tile_release (src_tile, FALSE);
}
}
}
}
else
{
PixelRegion PR1, PR2;
pixel_region_init (&PR1, tiles,
0, 0, width, height, TRUE);
pixel_region_init (&PR2, gimp_drawable_get_tiles (drawable),
x, y, width, height, TRUE);
swap_region (&PR1, &PR2);
}
gimp_drawable_update (drawable, x, y, width, height);
}
/* public functions */
gint64
gimp_drawable_estimate_memsize (const GimpDrawable *drawable,
gint width,
gint height)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return GIMP_DRAWABLE_GET_CLASS (drawable)->estimate_memsize (drawable,
width, height);
}
void
gimp_drawable_configure (GimpDrawable *drawable,
GimpImage *image,
gint offset_x,
gint offset_y,
gint width,
gint height,
GimpImageType type,
const gchar *name)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (width > 0 && height > 0);
gimp_item_configure (GIMP_ITEM (drawable), image,
offset_x, offset_y, width, height, name);
drawable->type = type;
drawable->bytes = GIMP_IMAGE_TYPE_BYTES (type);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
if (drawable->tiles)
2003-05-27 01:02:06 +08:00
tile_manager_unref (drawable->tiles);
drawable->tiles = tile_manager_new (width, height, drawable->bytes);
/* preview variables */
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
if (drawable->source_node)
gegl_node_set (drawable->source_node,
"tile-manager", drawable->tiles,
NULL);
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
void
gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height)
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
To optimize duplicate and/or wrong image updates away, introduced new 2003-09-06 Michael Natterer <mitch@gimp.org> To optimize duplicate and/or wrong image updates away, introduced new policy that a child object must never explicitly update or invalidate its parent object (just like the GUI is not updated explicitly by the core): * app/core/gimpdrawable.[ch]: added new signal GimpDrawable::update(). Never update or invalidate the image when the drawable is updated or invalidated. (gimp_drawable_set_visible): don't gimp_drawable_update() the drawable since its pixels have not changed. * app/core/gimpimage.[ch]: connect to the "add" and "remove" signals of the layers and channels containers. Also connect to the "update" and "visibility_changed" signals of all drawables in these containers (optimizes away updates issued by drawables which are not yet added to the image and updates of the selection mask). Also, don't propagate updates to the image if the emitting drawable is invisible (optimizes away updates issued by invisible drawables). (gimp_image_add_layer,channel) (gimp_image_remove_layer,channel): don't update the image since that's done by our "add" and "remove" handlers now. (gimp_image_position_layer,channel): update just the image, not the drawable since its pixels have not changed. (gimp_image_real_colormap_changed) (gimp_image_set_component_visible): always call gimp_image_update() *and* gimp_viewable_invalidate_preview() to get everything updated, since update and invalidate of images are not connected. * app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't update the drawable since (a) its pixels don't change and (b) the image updates itself upon adding/removing now. (undo_pop_layer_mod): replaced gimp_image_update() by gimp_drawable_update() (just for consistency with other similar functions). * app/core/gimplayer.c: connect to "update" of the layer mask and issue updates on the layer if the mask update has any effect on the projection. (gimp_layer_create_mask): don't set the mask's offsets here since they may be different when we later add the mask to the layer. * app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the mask offsets here instead. * app/core/gimpchannel.c (gimp_channel_translate): update the channel even if push_undo == FALSE. * app/paint/gimppaintcore.c (gimp_paint_core_finish) * app/tools/gimpinktool.c (ink_finish): invalidate both the drawable and the image preview since invalidating the drawable doesn't invalidate the image any more. * app/text/gimptextlayer.c (gimp_text_layer_render_now): also update the new extents of the text layer, not only the old one. (gimp_text_layer_render_layout): don't update the drawable since gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
g_signal_emit (drawable, gimp_drawable_signals[UPDATE], 0,
x, y, width, height);
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
}
void
gimp_drawable_alpha_changed (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_signal_emit (drawable, gimp_drawable_signals[ALPHA_CHANGED], 0);
}
void
gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
{
GimpDrawableClass *drawable_class;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable_class = GIMP_DRAWABLE_GET_CLASS (drawable);
if (drawable_class->invalidate_boundary)
drawable_class->invalidate_boundary (drawable);
}
void
gimp_drawable_get_active_components (const GimpDrawable *drawable,
gboolean *active)
{
GimpDrawableClass *drawable_class;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (active != NULL);
drawable_class = GIMP_DRAWABLE_GET_CLASS (drawable);
if (drawable_class->get_active_components)
drawable_class->get_active_components (drawable, active);
}
void
gimp_drawable_apply_region (GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
PixelRegion *destPR,
gint x,
gint y)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (src2PR != NULL);
GIMP_DRAWABLE_GET_CLASS (drawable)->apply_region (drawable, src2PR,
push_undo, undo_desc,
opacity, mode,
src1_tiles, destPR,
x, y);
}
void
gimp_drawable_replace_region (GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
PixelRegion *maskPR,
gint x,
gint y)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (src2PR != NULL);
g_return_if_fail (maskPR != NULL);
GIMP_DRAWABLE_GET_CLASS (drawable)->replace_region (drawable, src2PR,
push_undo, undo_desc,
opacity, maskPR,
x, y);
}
void
gimp_drawable_project_region (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height,
PixelRegion *projPR,
gboolean combine)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (projPR != NULL);
GIMP_DRAWABLE_GET_CLASS (drawable)->project_region (drawable,
x, y, width, height,
projPR, combine);
}
void
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
gimp_drawable_init_src_region (GimpDrawable *drawable,
PixelRegion *srcPR,
gint x,
gint y,
gint width,
gint height,
TileManager **temp_tiles)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (srcPR != NULL);
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
g_return_if_fail (temp_tiles != NULL);
if (gimp_drawable_has_floating_sel (drawable))
{
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GimpLayer *fs = gimp_image_get_floating_selection (image);
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
gint off_x, off_y;
gint fs_off_x, fs_off_y;
gint combine_x, combine_y;
gint combine_width, combine_height;
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
gimp_item_get_offset (GIMP_ITEM (fs), &fs_off_x, &fs_off_y);
if (gimp_item_get_visible (GIMP_ITEM (fs)) &&
gimp_rectangle_intersect (x + off_x, y + off_y,
width, height,
fs_off_x, fs_off_y,
gimp_item_get_width (GIMP_ITEM (fs)),
gimp_item_get_height (GIMP_ITEM (fs)),
&combine_x, &combine_y,
&combine_width, &combine_height))
{
PixelRegion tempPR;
PixelRegion destPR;
PixelRegion fsPR;
gboolean lock_alpha = FALSE;
/* a temporary buffer for the compisition of the drawable and
* its floating selection
*/
*temp_tiles = tile_manager_new (width, height,
gimp_drawable_bytes (drawable));
/* first, initialize the entire buffer with the drawable's
* contents
*/
pixel_region_init (&tempPR, gimp_drawable_get_tiles (drawable),
x, y, width, height,
FALSE);
pixel_region_init (&destPR, *temp_tiles,
0, 0, width, height,
TRUE);
copy_region (&tempPR, &destPR);
/* then, apply the floating selection onto the buffer just as
* we apply it onto the drawable when anchoring the floating
* selection
*/
pixel_region_init (&fsPR,
gimp_drawable_get_tiles (GIMP_DRAWABLE (fs)),
combine_x - fs_off_x,
combine_y - fs_off_y,
combine_width, combine_height,
FALSE);
pixel_region_init (&destPR, *temp_tiles,
combine_x - x - off_x,
combine_y - y - off_y,
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
combine_width, combine_height,
TRUE);
if (GIMP_IS_LAYER (drawable))
{
lock_alpha = gimp_layer_get_lock_alpha (GIMP_LAYER (drawable));
if (lock_alpha)
gimp_layer_set_lock_alpha (GIMP_LAYER (drawable), FALSE, FALSE);
}
gimp_drawable_apply_region (drawable, &fsPR,
FALSE, NULL,
gimp_layer_get_opacity (fs),
gimp_layer_get_mode (fs),
NULL, &destPR,
combine_x - off_x,
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
combine_y - off_y);
if (lock_alpha)
gimp_layer_set_lock_alpha (GIMP_LAYER (drawable), TRUE, FALSE);
/* finally, return a PixelRegion on the composited buffer instead
* of the drawable's tiles
*/
pixel_region_init (srcPR, *temp_tiles,
0, 0, width, height,
FALSE);
return;
}
}
Bye bye floating_sel_rigor() and floating_sel_relax(): 2008-11-09 Michael Natterer <mitch@gimp.org> Bye bye floating_sel_rigor() and floating_sel_relax(): * app/core/gimpdrawable.[ch] (gimp_drawable_init_src_region): implement compositing the floating selection on the fly. Add return parameter "TileManager **temp_tiles" which returns the temp buffer used for compositing; the caller has to unref the tiles. * app/core/gimpchannel-project.c * app/core/gimplayer-project.c: unref the temp_tiles. * app/core/gimplayer.[ch]: remove members fs.backing_store and fs.initial. * app/core/gimplayer-floating-sel.[ch]: remove functions rigor(), relax(), store() and restore(), they are not needed any longer. Some minor cleanup, more to come. * app/core/gimpprojection-construct.c: don't composite the floating selection before projecting because that happens on the fly now. * app/core/core-enums.[ch] * app/core/gimpfloatingselundo.c * app/core/gimpimage-undo-push.[ch]: remove the rigor and relax undos. * app/core/gimpdrawable.c * app/core/gimpimage-convert.c * app/core/gimpimage-duplicate.c * app/core/gimpimage.c * app/core/gimplayer.c * app/xcf/xcf-save.c: remove all calls to rigor and relax and all implementations of virtual functions that were just there to rigor/releax around chaining up. * tools/pdbgen/pdb/floating_sel.pdb: remove all code from the rigor and relax wrappers and deprecate the API. * app/pdb/floating-sel-cmds.c * libgimp/gimpfloatingsel_pdb.[ch]: regenerated. * plug-ins/file-xjt/xjt.c: don't call rigor and relax. svn path=/trunk/; revision=27579
2008-11-10 00:49:37 +08:00
pixel_region_init (srcPR, gimp_drawable_get_tiles (drawable),
x, y, width, height,
FALSE);
*temp_tiles = NULL;
}
TileManager *
gimp_drawable_get_tiles (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return GIMP_DRAWABLE_GET_CLASS (drawable)->get_tiles (drawable);
}
void
gimp_drawable_set_tiles (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
TileManager *tiles,
GimpImageType type)
{
gint offset_x, offset_y;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (tiles != NULL);
if (! gimp_item_is_attached (GIMP_ITEM (drawable)))
push_undo = FALSE;
gimp_item_get_offset (GIMP_ITEM (drawable), &offset_x, &offset_y);
gimp_drawable_set_tiles_full (drawable, push_undo, undo_desc, tiles, type,
offset_x, offset_y);
}
void
gimp_drawable_set_tiles_full (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
TileManager *tiles,
GimpImageType type,
gint offset_x,
gint offset_y)
{
GimpItem *item;
GimpImage *image;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (tiles != NULL);
g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type));
item = GIMP_ITEM (drawable);
image = gimp_item_get_image (item);
if (! gimp_item_is_attached (GIMP_ITEM (drawable)))
push_undo = FALSE;
if (gimp_item_get_width (item) != tile_manager_width (tiles) ||
gimp_item_get_height (item) != tile_manager_height (tiles) ||
item->offset_x != offset_x ||
item->offset_y != offset_y)
{
gimp_drawable_update (drawable,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item));
}
GIMP_DRAWABLE_GET_CLASS (drawable)->set_tiles (drawable,
push_undo, undo_desc,
tiles, type,
offset_x, offset_y);
gimp_drawable_update (drawable,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item));
}
GeglNode *
gimp_drawable_get_source_node (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (drawable->source_node)
return drawable->source_node;
drawable->source_node = g_object_new (GEGL_TYPE_NODE,
"operation", "gimp:tilemanager-source",
NULL);
gegl_node_set (drawable->source_node,
"tile-manager", drawable->tiles,
"linear", TRUE,
NULL);
return drawable->source_node;
}
GeglNode *
gimp_drawable_get_mode_node (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (! drawable->mode_node)
gimp_drawable_get_node (GIMP_ITEM (drawable));
return drawable->mode_node;
}
void
gimp_drawable_swap_pixels (GimpDrawable *drawable,
TileManager *tiles,
gboolean sparse,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (tiles != NULL);
GIMP_DRAWABLE_GET_CLASS (drawable)->swap_pixels (drawable, tiles, sparse,
x, y, width, height);
}
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
void
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
gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
gint x1,
gint y1,
gint x2,
gint y2,
TileManager *tiles,
gboolean sparse)
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
{
GimpItem *item;
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
gint x, y;
gint width, height;
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (sparse == FALSE || tiles != NULL);
item = GIMP_ITEM (drawable);
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (sparse == FALSE ||
tile_manager_width (tiles) == gimp_item_get_width (item));
g_return_if_fail (sparse == FALSE ||
tile_manager_height (tiles) == gimp_item_get_height (item));
#if 0
g_printerr ("gimp_drawable_push_undo (%s, %d, %d, %d, %d)\n",
sparse ? "TRUE" : "FALSE", x1, y1, x2 - x1, y2 - y1);
#endif
if (! gimp_rectangle_intersect (x1, y1,
x2 - x1, y2 - y1,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
&x, &y, &width, &height))
{
g_warning ("%s: tried to push empty region", G_STRFUNC);
return;
}
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types 2004-04-01 Michael Natterer <mitch@gimp.org> * app/core/core-enums.[ch] (enum GimpUndoType): added undo type GIMP_UNDO_TEXT_LAYER_MODIFIED and undo group types GIMP_UNDO_GROUP_DRAWABLE and GIMP_UNDO_GROUP_DRAWABLE_MOD. * app/core/gimpimage-undo-push.[ch]: added new new function gimp_image_undo_push_text_layer_modified() which makes modifications of the text_layer's "modified" boolean undoable. * app/core/gimpdrawable.[ch]: added new virtual function GimpDrawable::push_undo() and moved the actual undo pushing into the default implementation gimp_drawable_real_push_undo(). * app/text/gimptextlayer.c (gimp_text_layer_push_undo): new function. Pushes the text_layer's modified state to the undo stack after upchaining and sets modified to TRUE. (gimp_text_layer_set_tiles): ditto. (gimp_lext_layer_apply_region) (gimp_text_layer_replace_region): removed because their default implementations already call gimp_drawable_push_undo(). (gimp_text_layer_swap_pixels): removed because swap_pixels() is used by undo only and doesn't need to care about the text_layer's modified state. (gimp_text_layer_render): don't set modified to FALSE here because we can't push an undo step here. (gimp_text_layer_set): push the modified state to the undo stack and set it to FALSE here. Also push the layer's tiles if the layer was modified. * app/tools/gimptexttool.c (gimp_text_tool_apply): push "modified" to the undo stack and set it to FALSE here, too. Fixes bug #137767.
2004-04-01 22:51:58 +08:00
GIMP_DRAWABLE_GET_CLASS (drawable)->push_undo (drawable, undo_desc,
tiles, sparse,
x, y, width, height);
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
}
void
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
gimp_drawable_fill (GimpDrawable *drawable,
const GimpRGB *color,
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
const GimpPattern *pattern)
{
GimpItem *item;
GimpImage *image;
GimpImageType drawable_type;
PixelRegion destPR;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
g_return_if_fail (color != NULL || pattern != NULL);
g_return_if_fail (pattern == NULL || GIMP_IS_PATTERN (pattern));
item = GIMP_ITEM (drawable);
image = gimp_item_get_image (item);
drawable_type = gimp_drawable_type (drawable);
pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable),
0, 0, gimp_item_get_width (item), gimp_item_get_height (item),
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
TRUE);
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
if (color)
{
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
guchar tmp[MAX_CHANNELS];
guchar c[MAX_CHANNELS];
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
gimp_rgba_get_uchar (color,
&tmp[RED],
&tmp[GREEN],
&tmp[BLUE],
&tmp[ALPHA]);
gimp_image_transform_color (image, drawable_type, c, GIMP_RGB, tmp);
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
if (GIMP_IMAGE_TYPE_HAS_ALPHA (drawable_type))
c[GIMP_IMAGE_TYPE_BYTES (drawable_type) - 1] = tmp[ALPHA];
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
else
c[GIMP_IMAGE_TYPE_BYTES (drawable_type)] = OPAQUE_OPACITY;
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
color_region (&destPR, c);
}
else
{
TempBuf *pat_buf;
gboolean new_buf;
pat_buf = gimp_image_transform_temp_buf (image, drawable_type,
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
pattern->mask, &new_buf);
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
pattern_region (&destPR, NULL, pat_buf, 0, 0);
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
if (new_buf)
temp_buf_free (pat_buf);
}
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
gimp_drawable_update (drawable,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item));
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
}
void
gimp_drawable_fill_by_type (GimpDrawable *drawable,
GimpContext *context,
GimpFillType fill_type)
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
{
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
GimpRGB color;
GimpPattern *pattern = NULL;
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
switch (fill_type)
{
case GIMP_FOREGROUND_FILL:
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
gimp_context_get_foreground (context, &color);
break;
case GIMP_BACKGROUND_FILL:
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
gimp_context_get_background (context, &color);
break;
case GIMP_WHITE_FILL:
gimp_rgba_set (&color, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
break;
case GIMP_TRANSPARENT_FILL:
gimp_rgba_set (&color, 0.0, 0.0, 0.0, GIMP_OPACITY_TRANSPARENT);
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
break;
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
case GIMP_PATTERN_FILL:
pattern = gimp_context_get_pattern (context);
break;
case GIMP_NO_FILL:
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
return;
default:
g_warning ("%s: unknown fill type %d", G_STRFUNC, fill_type);
app/Makefile.am removed. 2001-07-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/drawable.[ch]: removed. * app/core/gimpdrawable.[ch]: added the functions here. Made an end to the myth that FG/BG and the undo system (!!!) are not really part of the core. * app/disp_callbacks.c * app/floating_sel.c * app/image_map.c * app/qmask.c * app/undo.c * app/core/gimpchannel.c * app/core/gimpdrawable-desaturate.c * app/core/gimpdrawable-equalize.c * app/core/gimpdrawable-invert.c * app/core/gimpdrawable-offset.c * app/core/gimpedit.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimpimage-new.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/core/gimplayermask.c * app/gui/channels-commands.c * app/gui/gui.c * app/gui/layers-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcurvestool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpscaletool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/tool_manager.c * app/widgets/gimpchannellistitem.c * app/widgets/gimpchannellistview.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplayerlistview.c * 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/parasite_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. Misc small fixes and cleanups.
2001-07-08 06:49:01 +08:00
return;
}
Enabled skipping enum values for either the PDB or GType registration 2004-01-06 Michael Natterer <mitch@gimp.org> Enabled skipping enum values for either the PDB or GType registration (don't always skip both targets): * tools/gimp-mkenums: skip enum values only if there is a literal "skip" (don't match "pdb-skip"). * tools/pdbgen/enumgen.pl: skip only "pdb-skip" values, not "skip" ones. * app/base/base-enums.h * app/core/core-enums.h * app/paint/paint-enums.h * libgimpbase/gimpbaseenums.h: use the right "pdb-skip"/"skip" combination to skip enum values. Changed comments accordingly. Cleaned up the fill functions: * app/core/core-enums.[ch]: added GIMP_PATTERN_FILL enum value to the GimpFillType enum. Don't export GIMP_NO_FILL to the PDB because it's completely useless to export a NOP. * app/core/gimp-edit.c (gimp_edit_fill, gimp_edit_fill_internal): handle pattern fill requests. * app/core/gimpdrawable.[ch] (gimp_drawable_fill): added GimpPattern parameter and fill with it if it's non-NULL. (gimp_drawable_fill_by_type): handle pattern fill and pass the current pattern to gimp_drawable_fill(). * app/text/gimptextlayer.c: changed accordingly. * app/gui/edit-commands.c * app/gui/image-menu.c: use gimp_edit_fill() instead of gimp_drawable_bucket_fill() for FG, BG and pattern filling. * libgimp/gimpcompat.h * plug-ins/script-fu/siod-wrapper.c: removed NO_IMAGE_FILL compat enum value. It should have never been exported to the PDB. * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated.
2004-01-06 22:02:08 +08:00
gimp_drawable_fill (drawable, pattern ? NULL : &color, pattern);
}
gboolean
gimp_drawable_mask_bounds (GimpDrawable *drawable,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpItem *item;
GimpImage *image;
GimpChannel *selection;
gint tmp_x1, tmp_y1;
gint tmp_x2, tmp_y2;
gboolean retval;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
item = GIMP_ITEM (drawable);
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_DRAWABLE (selection) != drawable &&
gimp_channel_bounds (selection, &tmp_x1, &tmp_y1, &tmp_x2, &tmp_y2))
{
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 off_x, off_y;
gimp_item_get_offset (item, &off_x, &off_y);
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
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_drawable_mask_intersect (GimpDrawable *drawable,
gint *x,
gint *y,
gint *width,
gint *height)
{
GimpItem *item;
GimpImage *image;
GimpChannel *selection;
gint tmp_x, tmp_y;
gint tmp_width, tmp_height;
gboolean retval;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
item = GIMP_ITEM (drawable);
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_DRAWABLE (selection) != drawable &&
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);
retval = gimp_rectangle_intersect (tmp_x - off_x, tmp_y - off_y,
tmp_width - tmp_x, tmp_height - tmp_y,
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_drawable_has_alpha (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
}
Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h app/channel_cmds.c app/channel_cmds.h app/drawable_cmds.c app/gimage_cmds.c app/gimpdrawable.c app/gimpdrawable.h app/gimpdrawableP.h app/gimpimage.c app/gimpimage.h app/gimpimageP.h app/internal_procs.c app/layer.c app/layer.h app/layer_cmds.c app/layer_cmds.h app/parasite_cmds.c app/perspective_tool.c app/plug_in.c app/procedural_db.c app/rotate_tool.c app/scale_tool.c app/shear_tool.c app/transform_core.c app/transform_core.h docs/parasites.txt libgimp/Makefile.am libgimp/gimp.c libgimp/gimp.h libgimp/gimpdrawable.c libgimp/gimpimage.c libgimp/gimpprotocol.c libgimp/gimpprotocol.h plug-ins/gif/gif.c plug-ins/script-fu/script-fu.c plug-ins/tiff/tiff.c Added Files: libgimp/gimpmatrix.c libgimp/gimpmatrix.h libgimp/parasite.c libgimp/parasite.h libgimp/parasiteF.h libgimp/parasiteP.h Removed Files: app/parasite.c app/parasite.h app/parasiteF.h app/parasiteP.h libgimp/gimpparasite.c libgimp/gimpparasite.h Tue Oct 13 19:24:03 1998 Jay Cox (jaycox@earthlink.net) * app/parasite.c * app/parasite.h * app/parasiteF.h * app/parasiteP.h : use a single name field instead of seperate creator/type fields. moved to libgimp/parasite* * libgimp/Makefile.am * libgimp/gimp.c * libgimp/gimp.h * libgimp/gimpdrawable.c * libgimp/gimpimage.c * libgimp/gimpprotocol.c * libgimp/gimpprotocol.h * app/Makefile.am * app/channel.c * app/channel.h * app/channel_cmds.c * app/channel_cmds.h * app/drawable_cmds.c * app/gimage_cmds.c * app/gimpdrawable.c * app/gimpdrawable.h * app/gimpdrawableP.h * app/gimpimage.c * app/gimpimage.h * app/gimpimageP.h * app/internal_procs.c * app/layer.c * app/layer.h * app/layer_cmds.c * app/layer_cmds.h * app/parasite_cmds.c * app/plug_in.c * app/procedural_db.c: Add tattoos to layers and drawables. Use new style parasites. * libgimp/gimpmatrix.c * libgimp/gimpmatrix.h: new files for matrix math. * app/perspective_tool.c * app/rotate_tool.c * app/scale_tool.c * app/shear_tool.c * app/transform_core.c * app/transform_core.h: use GimpMatrix instead of the old matrix code from transform_core. * ligimp/gimpparasite*: removed. now useing the same source for plug-ins and the core. * plug-ins/script-fu/script-fu.c * plug-ins/tiff/tiff.c * plug-ins/gif/gif.c: updated to use new style parasites.
1998-10-14 10:54:02 +08:00
GimpImageType
gimp_drawable_type (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->type;
}
GimpImageType
gimp_drawable_type_with_alpha (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return GIMP_IMAGE_TYPE_WITH_ALPHA (gimp_drawable_type (drawable));
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
GimpImageType
gimp_drawable_type_without_alpha (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return GIMP_IMAGE_TYPE_WITHOUT_ALPHA (gimp_drawable_type (drawable));
}
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
gboolean
gimp_drawable_is_rgb (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return GIMP_IMAGE_TYPE_IS_RGB (gimp_drawable_type (drawable));
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
gboolean
gimp_drawable_is_gray (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return GIMP_IMAGE_TYPE_IS_GRAY (gimp_drawable_type (drawable));
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
gboolean
gimp_drawable_is_indexed (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return GIMP_IMAGE_TYPE_IS_INDEXED (gimp_drawable_type (drawable));
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
gint
gimp_drawable_bytes (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->bytes;
}
gint
gimp_drawable_bytes_with_alpha (const GimpDrawable *drawable)
{
GimpImageType type;
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = GIMP_IMAGE_TYPE_WITH_ALPHA (gimp_drawable_type (drawable));
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
return GIMP_IMAGE_TYPE_BYTES (type);
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}
gint
gimp_drawable_bytes_without_alpha (const GimpDrawable *drawable)
{
GimpImageType type;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = GIMP_IMAGE_TYPE_WITHOUT_ALPHA (gimp_drawable_type (drawable));
return GIMP_IMAGE_TYPE_BYTES (type);
}
gboolean
gimp_drawable_has_floating_sel (const GimpDrawable *drawable)
{
GimpImage *image;
GimpLayer *floating_sel;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
image = gimp_item_get_image (GIMP_ITEM (drawable));
floating_sel = gimp_image_get_floating_selection (image);
return (floating_sel && floating_sel->fs.drawable == drawable);
}
const guchar *
gimp_drawable_get_colormap (const GimpDrawable *drawable)
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
{
GimpImage *image;
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
image = gimp_item_get_image (GIMP_ITEM (drawable));
return image ? gimp_image_get_colormap (image) : NULL;
made gimp->global_buffer a GimpBuffer, not TileManager. 2001-12-13 Michael Natterer <mitch@gimp.org> * app/core/gimp.[ch]: made gimp->global_buffer a GimpBuffer, not TileManager. * app/core/gimpbuffer.[ch]: added a "gboolean copy_pixels" to gimp_buffer_new(). * app/core/gimpimage-new.c * app/core/gimpedit.[ch] * app/core/gimpimage-qmask.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c: chaned accordingly, don't include "base/tile-manager.h". * app/core/gimpdrawable.[ch]: added gimp_drawable_copy(). * app/core/gimpchannel.[ch] * app/core/gimplayer.[ch] * app/core/gimplayermask.[ch]: use it in gimp_[channel|layer|layer_mask]_copy(), added "GType new_type" as paramater to all of them. * app/core/gimpimage-duplicate.c * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/layers-commands.c * app/widgets/gimpchannellistview.c * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/selection.pdb: changed accordingly. * app/pdb/channel_cmds.c * app/pdb/layer_cmds.c * app/pdb/selection_cmds.c: regenerated. * app/core/gimplayer.[ch]: removed the "layer_type" parameter from gimp_layer_new_from_tiles() because it always needed to be equal to gimp_image_base_type_with_alpha() of the passed image. * app/core/gimpdrawable-transform.c * app/core/gimpedit.c * app/core/gimpimage-mask.c: cahanged accordingly. * app/core/gimpimage.[ch]: added some new GIMP_IMAGE_TYPE_FOO() marcos to get rid of magic values like "pixels = 3" all over the place. * app/core/gimplayer.[ch]: added gimp_layer_new_from_drawable() which creates a layer from an other image's drawable. * app/core/gimpimage-convert.[ch]: made the RGB and GRAY converters public to use them above, use the new GIMP_IMAGE_TYPE() macros. * app/display/gimpdisplayshell-dnd.c * app/gui/toolbox.c: removed tile manager stuff and use the new functions. * app/widgets/gimpdrawablelistview.[ch]: added a "convert_drawable_func" which is used to handle drops from other images. * app/widgets/gimpdrawablelistitem.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch]: implemented DND of layers between images using gimp_layer_new_from_drawable(). * app/gui/dialogs-constructors.c: changed accordingly.
2001-12-13 07:48:18 +08:00
}