It made the transform code hard to read and never belonged into the
tile manager anyway. It's a simple pixel buffer that should not know
about any position in an image. Instead, pass around the offsets of
tile managers explicitly, so everything is less obscure for the price
of having more parameters. This will also help replacing TileManagers
with GeglBuffers.
- 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.
Description of undo actions should be marked as action descriptions,
and not as commands. This is required for translation for some
language (like Hebrew) that require a different grammatical tense for
describing actions
instead of simply reffing drawable->tiles. Add boolean property "copy-tiles"
and a boolean parameter to gimp_image_undo_push_drawable_mod() to control
the new feature. However, pass FALSE in gimp_drawable_real_set_tiles() (which
currently is the undo's only user)
gimp_drawable_get_mode_node() was calling gimp_drawable_get_node()
instead of gimp_item_get_node() if the mode_node didn't already exist.
Fortunately that was never the case i nthe current code. Added
warnings in the GimpItem::get_node() impls that would go off in such a
situation.
Add GIMP_LOG_FLOATING_SELECTION domain to get rid of the somewhat
annoying debug prints. Floating selection is likely to require further
debuggin later on, so instead of just removing the output, use
GIMP_LOG for it.
* 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.
When attaching/detaching a floating selection to/from its drawable,
connect/disconnect the floating selection's "update" signal and update
the drawable in the callback, because changes to the floating
selection affect the drawable and not the projection directly. Fixes
floating selection compositing in layer trees and is the right thing
to do anyway.
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
This also (really this time) fixes nested group layers. There were
cases when the outer group layer didn't properly resize itself because
gimp_drawable_set_tiles() on the inner group layer failed to emit
notify::width and notify::height.
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
2009-02-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_sync_source_node): need
to rip the floating selection's source node out of its layer's
graph before using it in the floating selection sub-graph, and
need to plug it back there when it's not a floating selection any
longer.
Unrelated:
Also introduce a "fs_crop_node" that makes sure the floating
selection stops at the drawable's boundaries.
(gimp_drawable_visibility_changed): use item->node instead of
gimp_item_get_node() because the latter creates the node on
demand.
* app/core/gimpdrawable-private.h: add fs_crop_node member.
svn path=/trunk/; revision=28022
2009-02-07 Michael Natterer <mitch@gimp.org>
Simplify floating selection handling a bit more:
* app/core/gimpdrawable.c
(gimp_drawable_attach_floating_sel)
(gimp_drawable_detach_floating_sel): call
gimp_image_set_floating_selection() from these functions.
* app/core/gimpfloatingselundo.c (gimp_floating_sel_undo_pop)
* app/core/gimpimage.c (gimp_image_add,remove_layer)
* app/core/gimplayer-floating-sel.c (floating_sel_to_layer): don't
call it here because we already call above functions.
svn path=/trunk/; revision=28000
2009-02-07 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c
(gimp_drawable_attach_floating_sel)
(gimp_drawable_detach_floating_sel): call
gimp_drawable_invalidate_boundary(floating_sel). Fixes missing
selection update after turning a floating selection into a
layer. It's called redundantly now when adding or deleting a
floating selection, but that doesn't hurt much.
* app/core/gimpfloatingselundo.c (gimp_floating_sel_undo_pop):
don't call it here because we already call above functions.
svn path=/trunk/; revision=27999
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-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_visibility_changed):
don't show the floating selection layer in the image graph, it
will be shown by the drawable it is attached to. This is a temp
special case hack, but better fits here than into the newly
created and clean GimpDrawableStack. The floating selection will
see the end of its days as layer soon enough anyway.
svn path=/trunk/; revision=27960
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