- The image *must* now be passed to g_object_new() when creating items
- Remove the "image" parameter from all item configure() functions
- Set the item's ID in gimp_item_set_image() if it has none yet
There is nothing drawable-specific in there, and having them on
GimpItem enables some simplifications, esp. in upcoming PDB
wrappers. None of these refactorings is in this commit though.
* app/core/gimpdrawable.[ch]: add "gboolean push_undo" to
GimpDrawable::convert_type().
* app/core/gimpdrawable-convert.[ch]: same here for the gray and rgb
conversion functions.
* app/core/gimpchannel.c
* app/core/gimplayer.c: pass FALSE when called from GimpItem::convert()
because it can be called on unattached items only.
* app/core/gimpimage-convert.c: pass TRUE.
* app/core/core-enums.[ch]
* app/core/gimpgrouplayerundo.[ch]
* app/core/gimpimage-undo-push.[ch]: add GIMP_UNDO_GROUP_LAYER_CONVERT
which simply calls gimp_drawable_convert_type() with the old type
when undone/redone.
* app/core/gimpgrouplayer.c: push a group layer convert undo so this
can be properly undone/redone.
This may look like duplication of GimpItem::convert() but in fact will
fix the longstanding uglyness that GimpItem::convert() both transfers
an item to another image *and* converts the image type of drawables.
When this refactoring is done, GimpItem::convert() will only move an
item to another image, and its implementation in GimpDrawable classes
will call GimpDrawable::convert_type() to convert the pixels to
whatever format.
Takes a "dest_image" parameter anyway because for converting to
indexed we need the destination colormap. The default impl in
GimpDrawable can only convert to gray and rgb however.
2009-02-05 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.h
* app/core/gimpdrawable-preview.c: move the preview related
members to the private struct.
* app/core/gimpdrawable.c
* app/core/gimpdrawable-private.h
* app/core/gimpselection.c: changed accordingly.
svn path=/trunk/; revision=27986
2009-02-04 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/gimpdrawable-private.h: new file which contains struct
GimpDrawablePrivate. Move some stuff from GimpDrawable here.
* app/core/gimpdrawable.[ch]
* app/core/gimpdrawable-shadow.c: changed accordingly.
* app/text/gimptextlayer-xcf.c
* app/xcf/xcf-load.c: include the private struct for these ugly
corner cases.
svn path=/trunk/; revision=27982
2009-01-26 Michael Natterer <mitch@gimp.org>
The GEGL projection does floating selections now:
* app/core/gimpdrawable.[ch] (struct GimpDrawable): add a couple
of GeglNodes which are used to create a sub-graph for this
drawable's floating selection.
(gimp_drawable_detach_floating_sel)
(gimp_drawable_attach_floating_sel): new functions to call
whenever a floating selection gets attached or detached.
Change the role of the drawable's "source_node": it's no longer a
direct tile source but an arbitrary graph. Add new internal
function gimp_drawable_sync_source_node() which creates a
sub-graph for the floating selection within the source node, and
uses the new "tile_source_node" directly otherwise. Connect to
"notify" of the floating selection and reconfigure its sub-graph
when its properties change. This is also one more refactoring in
the direction of layer trees.
* app/core/gimpfloatingselundo.c
* app/core/gimpimage.c
* app/core/gimplayer-floating-sel.c: call the new attach/detach
API whenever a floating selection is attached or detached from a
drawable. This will need more refactoring i guess...
svn path=/trunk/; revision=27961
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
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-08 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: add optional parameter "PixelRegion
*destPR" to GimpDrawable::apply_region().
* app/core/gimpdrawable-combine.[ch]: if the passed destPR is !=
NULL, write the result of the combination into that region instead
of the drawable's tiles. The region must have the exact size of
the result.
* app/core/gimp-edit.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-shadow.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpimagemap.c
* app/core/gimplayer-floating-sel.c
* app/paint/gimppaintcore.c: pass NULL as destPR. Code actually
using this feature follows.
svn path=/trunk/; revision=27574
2008-11-08 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: add new function
gimp_drawable_init_src_region() which will initialize a
PixelRegion on this drawable's "projection" (with the floating
selection combined), but for now just uses drawable->tiles.
* app/core/gimpchannel-project.c
* app/core/gimplayer-project.c: use it instead of
pixel_region_init() on the drawable's tiles.
svn path=/trunk/; revision=27573
2008-11-08 Michael Natterer <mitch@gimp.org>
Abstract the legacy projection code away into a virtual function
of GimpDrawable:
* app/core/gimpdrawable.[ch]: add new virtual function
GimpDrawable::project_region() which projects an area of a
drawable onto a passed in PixelRegion.
* app/core/Makefile.am
* app/core/gimpchannel-project.[ch]
* app/core/gimplayer-project.[ch]: new files which implement it.
* app/core/gimpchannel.c
* app/core/gimplayer.c: hook it in.
* app/core/gimpprojection-construct.c: get rid all the projection
code moved to above new files and project all drawables in one
loop.
* app/core/gimpprojectable.[ch]: remove the legacy methods
get_colormap() and get_components(), they are not needed any
longer.
* app/core/gimpimage.c: changed accordingly.
svn path=/trunk/; revision=27571
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
"GimpImageType type" parameter because there are only a few calls
to this function which (can easily pass the current type); however
most calls to gimp_drawable_set_tiles_full() were just using the
function because of the type argument and passed in the item's
current offsets (which means peeking into the item struct or using
temp variables).
* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
* app/text/gimptextlayer.c (gimp_text_layer_render)
* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
the type to set_tiles().
* app/core/gimpchannel.c (gimp_channel_convert)
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
change calls to set_tiles_full() into set_tiles() because the
offset doesn't change.
svn path=/trunk/; revision=27535
* app/core/gimpitem.[ch]: Move the base GeglNode here in
preparation for moving the GimpLayer gegl:shift op to here as
well. After all, the offsets are properties of GimpItem and not
GimpLayer.
* app/core/gimpdrawable.[ch]: Delegate appropriate stuff to the
GimpItem base class, like part of the visibility toggling and the
creation and destruction of the GimpItem node.
* app/core/gimplayer.c
* app/core/gimpchannel.c
* app/core/gimpdrawablestack.c: Changed accordingly, use the new
function names.
* app/core/gimpitempropundo.c
* app/vectors/gimpvectors-warp.c
* app/vectors/gimpvectorsmodundo.c: Include gegl.h instead of
glib-object.h
svn path=/trunk/; revision=27521
2008-10-14 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: add a default implementation of
GimpDrawable::get_node() which contains a layer mode node.
Implement GimpItem::visibility_changed() and turn the node into a
nop when the drawable is invisible. Added public function
gimp_drawable_get_mode_node() so subclasses can plug stuff
into its "aux" pad.
* app/core/gimplayer.[ch]
* app/core/gimpchannel.[ch]: changed accordingly (remove
duplicated member and code that is now in GimpDrawable).
svn path=/trunk/; revision=27277
2008-10-10 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: add virtual function
GimpDrawable::get_node() which returns a node to be plugged into
the projection.
* app/core/gimplayer.[ch]: remove public get_node() api and
implement the virtual function instead.
* app/core/gimpimage.c: changed accordingly.
svn path=/trunk/; revision=27211
2008-10-09 Michael Natterer <mitch@gimp.org>
Address Bug 554983 – Layers Projection using GEGL
* app/gegl/gimp-gegl-utils.[ch]: add (imcomplete) function
gimp_layer_mode_to_gegl_operation() from bug #554983.
* app/core/gimpdrawable.[ch]: add gimp_drawable_get_source_node()
which returns a GimpOperationTileSource for the drawable's
tiles.
(gimp_drawable_real_set_tiles)
(gimp_drawable_configure): set the node's "tiles" property.
* app/core/gimplayer.[ch]: add gimp_layer_get_node() which returns
a GeglNode with proxy "input" and "output" pads to be plugged
into the projection graph. The node has children for opacity,
mask, layer mode and layer offset.
(gimp_layer_translate)
(gimp_layer_add_mask)
(gimp_layer_apply_mask)
(gimp_layer_set_opacity)
(gimp_layer_set_mode): reconfigure the respective nodes.
* app/core/gimpimage.[ch]: keep a "graph" node around and destroy
it in finalize(). Not even a stub, just a silly GEGL dependency.
svn path=/trunk/; revision=27204
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
2007-12-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added new API
gimp_drawable_estimate_memsize() and virtual function
GimpDrawable::estimate_memsize() which estimate the memsize of a
drawable after scaling/resizing.
* app/core/gimplayer.c: implement the virtual function and take
the layer mask into account.
* app/core/gimpimage-item-list.[ch] (gimp_image_item_list_get_list):
added const qualifiers.
* app/core/gimpimage-scale.c (gimp_image_scale_check): use the new
function to correctly estimate the new size instead of scaling the
drawables' memsizes including all constant parts. Fixes bug #329468.
* app/gimp-log.[ch]: added IMAGE_SCALE log domain.
* app/core/gimpimage-scale.c: use it here for debugging output.
svn path=/trunk/; revision=24260
2006-04-07 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable.[ch]: renamed gimp_drawable_cmap() to
gimp_drawable_get_colormap() and let it return a const array.
* app/core/gimpdrawable-convert.c
* app/core/gimpimage-convert.c
* app/core/gimpselection.c
* app/display/gimpdisplayshell-preview.c: changed accordingly.
2006-04-07 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable.[ch]: renamed gimp_drawable_data() to
gimp_drawable_get_tiles().
[lots of files]: changed accordingly.
2004-10-20 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added gimp_drawable_mask_intersect()
which returns the same bounding box as gimp_drawable_mask_bounds(),
but returns TRUE only if there is a non-empty intersection between
the drawable and the selection, or no selection at all. It also
returns the intersection as x,y,width,height instead of the
eeky x1,y1,x2,y2.
* app/core/gimp-edit.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-histogram.c
* app/core/gimpdrawable-invert.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpimagemap.c
* app/core/gimpselection.c
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/transform_tools.pdb: either switch from
gimp_drawable_mask_bounds() to _intersect() or check the return
values of _mask_bounds() manually to avoid operations on empty
areas. Return successfully because it's a nop, not a failure.
Fixes bug #155733 for the core.
* app/pdb/color_cmds.c
* app/pdb/transform_tools_cmds.c: regenerated.
2004-07-14 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimppickable.[ch]: new interface which has
get_image_type(), get_tiles() and get_color_at() methods.
* app/core/gimpdrawable.[ch]
* app/core/gimpimagemap.[ch]
* app/core/gimpprojection.[ch]: implement GimpPickableInterface
and removed public get_colot_at() functions.
* app/core/gimpimage-pick-color.[ch]: removed typedef
GimpImagePickColorFunc and gimp_image_pick_color_by_func(). Use
gimp_pickable_pick_color() instead.
* app/core/gimpimage-contiguous-region.c
* app/core/gimpimage-crop.c
* app/gui/info-window.c
* app/paint/gimpconvolve.c
* app/paint/gimpsmudge.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpimagemaptool.c
* app/widgets/gimpselectioneditor.c: use GimpPickable functions
instead of the various get_color_at() functions. Simplifies code
which has a "sample_merged" boolean. Various cleanups.
2004-04-13 Michael Natterer <mitch@gimp.org>
Moved the calls to floating_sel_relax()/rigor() from various
places to two single spots in the core where they are actually
needed. Fixes bug #138356 (which was caused by the projection
being triggered in the middle of changing the floating selection's
size or the size of the drawable it is attached to). This commit
effectively removes floating selection fiddling from the core's
public API.
* app/core/gimpdrawable.[ch] (gimp_drawable_has_floating_sel): new
function which returns TRUE if there is a floating selection
attached to the drawable.
* app/core/gimpdrawable.c (gimp_drawable_translate)
(gimp_drawable_set_tiles_full): if the drawable *has* a floating
selection, relax/rigor it before/after modifying the drawable.
* app/core/gimplayer.c (gimp_layer_translate)
(gimp_layer_set_tiles): if the layer *is* the floating selection,
relax/rigor it before/after modifying it.
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-flip.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-scale.c
* app/gui/layers-commands.c
* app/tools/gimpeditselectiontool.c
* tools/pdbgen/pdb/layer.pdb: removed calls to
floating_sel_rigor()/relax() all over the place. Also removed
lots of undo groups which are obsolete now.
* app/pdb/layer_cmds.c: regenerated.
2004-04-13 Michael Natterer <mitch@gimp.org>
GimpItem undo group cleanup in preparation of fixing bug #138356:
* app/core/core-enums.[c]: renamed LAYER_SCALE and LAYER_RESIZE
undo groups to ITEM_SCALE and ITEM_RESIZE.
* app/core/gimpitem.[ch]: always push undo groups around
GimpItem::translate(), scale(), resize(), flip(), rotate() and
transform(). Added the resp. undo_desc strings to GimpItemClass.
* app/core/gimpchannel.[ch]
* app/core/gimpdrawable.[ch]
* app/core/gimplayer.c: removed all undo groups from
implementations of the above methods. Removed the undo_desc
strings which were moved to GimpItemClass.
* app/core/gimpimage-crop.c
* app/core/gimpselection.c
* app/gui/layers-commands.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
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-03-15 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch] (enum GimpUndoType): replaced
GIMP_UNDO_LAYER_MOD and GIMP_UNDO_CHANNEL_MOD by
GIMP_UNDO_DRAWABLE_MOD.
* app/core/gimpimage-undo-push.[ch]: ditto: replaced
gimp_image_undo_push_layer_mod() and
gimp_image_undo_push_channel_mod() by
gimp_image_undo_push_drawable_mod().
* app/core/gimpdrawable.[ch]: added undo_desc strings for "resize"
and "scale" to the GimpDrawableClass struct.
(gimp_drawable_scale)
(gimp_drawable_resize): pass push_undo = TRUE to
gimp_drawable_set_tiles_full() and use the undo_desc from the
class.
(gimp_drawable_real_set_tiles): push a GIMP_UNDO_DRAWABLE_MOD here...
* app/core/gimpchannel.c
* app/core/gimplayer.c: ...and don't push undos in
GimpItem::scale(), GimpItem::resize(), GimpDrawable::set_tiles().
* app/core/gimpchannel.c: Removed even more bounds_known = FALSE
assignments from functions which already call
gimp_drawable_set_tiles().
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added "offset_x" and "offset_y"
parameters to GimpDrawable::set_tiles().
(gimp_drawable_set_tiles): removed the "GimpImageType" parameter.
(gimp_drawable_set_tiles_full): new function adding type, offset_x
and offset_y parameters.
(gimp_drawable_real_set_tiles): set the drawable's offsets from
the offset parameters and its size from the passed TileManager's
size. Emit "size_changed" accordingly.
* app/core/gimpchannel.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-undo-push.c
* app/core/gimplayer.c
* app/text/gimptextlayer.c
* app/tools/gimptransformtool.c: changed accordingly: removed
calls to gimp_viewable_size_changed() and all sorts of hackish
assignments of the drawable's width/height/offset_x/offset_y
properties.
2004-03-15 Michael Natterer <mitch@gimp.org>
Prepare the undo system for proper text layer undo:
* app/core/core-enums.[ch] (enum GimpUndoType): replaced
GIMP_UNDO_IMAGE and GIMP_UNDO_IMAGE_MOD by GIMP_UNDO_DRAWABLE.
* app/core/gimpimage-undo-push.[ch]: ditto: replaced
gimp_image_undo_push_image() and gimp_image_undo_push_image_mod()
by gimp_image_undo_push_drawable() which *always* expects to get a
TileManager passed. Also added g_return_if_fail()s to check if the
passed in tile manager follows the semantics of the "sparse"
boolean.
(undo_pop_drawable): removed all code and call the new
gimp_drawable_swap_pixels() instead (see below).
* app/core/gimpdrawable.[ch] (gimp_drawable_push_undo): if tiles
are NULL, create a copy of the area here and always pass tiles to
gimp_image_undo_push_drawable(). Added lots of g_return_if_fail()
here too.
Added new vitrual function GimpDrawable::swap_pixels() which
does what undo_pop_drawable() did.
* app/core/gimpchannel.c: implement swap_pixels() and invalidate
the channel's bounds and boundary.
2004-03-13 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable.[ch]: added new virtual function
GimpDrawable::set_tiles().
* app/core/gimpchannel.c
* app/core/gimplayer.c: push an undo before chaining up in
set_tiles().
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/tools/gimptransformtool.c: use gimp_drawable_set_tiles()
instead of fiddling with the drawable's tile manager directly.
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.
2003-10-06 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_mask_bounds): one
more fix for bug #107949: don't take the selection into
account if we are operating on the selection itself.
Ordered shadow tiles functions together, cleanup.
2003-10-06 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added new virtual functions
GimpDrawable::get_active_components(), apply_region() and
replace_region().
* app/core/Makefile.am
* app/core/gimpdrawable-combine.[ch]: new files containing
apply_region()'s and replace_region()'s default implementation.
They are identical to the ones removed from GimpImage except that
they don't mask the selection with itself (bug #107949).
* app/core/gimpchannel.c
* app/core/gimplayer.c: implement get_active_components().
* app/core/gimpchannel.c: implement apply_region() and
replace_region() and invalidate the channel's boundary
before upchaining (bug #107949).
* app/core/gimpimage.[ch]: removed gimp_image_apply_image(),
gimp_image_replace_image() and gimp_image_get_active_components().
* app/core/gimpimage-undo-push.c (undo_pop_image): invalidate
boundary and bounds if the drawable is a channel (bug #107949).
(undo_pop_mask)
(undo_pop_channel_mod): finish previous commit :)
* app/core/gimp-edit.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpimagemap.c
* app/core/gimplayer-floating-sel.c
* app/paint/gimppaintcore.c
* app/tools/gimpinktool.c: changed accordingly.
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-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added new pure virtual function
GimpDrawable::invalidate_boundary().
* app/core/gimplayer.[ch]: implement it and removed public
function gimp_layer_invalidate_boundary().
* app/core/gimpchannel.[ch]: implement it.
* app/core/gimpselection.[ch]: implement it and removed public
function gimp_selection_invalidate().
* app/core/gimpimage-mask.c (gimp_image_mask_invalidate)
* app/core/gimpimage-undo-push.c
* app/core/gimpimage.c
* app/core/gimplayer-floating-sel.c
* app/text/gimptextlayer.c: changed accordingly.
* app/core/gimpchannel.[ch]: made gimp_channel_push_undo() a
public function and made it call
gimp_drawable_invalidate_boundary(). Added undo_desc strings for
all undo pushing functions to GimpChannelClass.
* app/core/gimpselection.[ch]: removed gimp_selection_push_undo()
since after the change above it was identical to
gimp_channel_push_undo(). Don't push any undo here since
upchaining does the right thing now. Override GimpChannelClass'
undo_desc strings to say "Selection".
* app/core/gimpimage-mask.c (gimp_image_mask_push_undo): changed
accordingly.
2003-05-21 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added GimpDrawable::alpha_changed()
signal.
* app/core/gimpimage-undo-push.c
* app/core/gimplayer.c: emit it when alpha is removed from or
added to a layer.
* app/widgets/gimpcontainertreeview.[ch]: added a
"name_attributes" column to the list store which provides a
PangoAttrList for the name column.
* app/widgets/gimplayertreeview.[ch]: connect to all layers'
"alpha_changed" and set the BG layer's name to bold.
* app/widgets/gimpdrawabletreeview.c: removed redundant assertions.