Also make some of GimpToolGui's memory management proper, there was
no leak but it needs to be proper in order to add runtime switching
between dialog and overlay.
Don't push an internal transform tool undo after invoking the flip
special case of directly transforming on each click, because the
transform clears the tool state and there is nothing to undo anyway
(flip is atomic). Additionally, add a precondition check to
gimp_transform_tool_push_internal_undo().
Also clean up formatting a bit, and add gimp_transform_tool_halt()
which really cleans the tool's state, so we don't end up with wrong
undo/redo actions in a new tool interaction.
Apply and heavily modify patch from remyDev which adds "lock position"
to GimpItem, similar to "lock content". Lock position disables all
sorts of translation and transform, from the GUI and the PDB.
Cleaned up some aspects of the lock content code as well because a
second instance of similar code always shows what went wrong the first
time.
Reset the tool on image changes again, but not if only the active
drawable changes, so keep bug #678890 closed:
Introduce new dirty flag GIMP_DIRTY_ACTIVE_DRAWABLE and set it on all
tools' dirty_mask except for rect select. Check the new flag when
reseting the active tool because of a drawable change.
add undo and redo buttons, can undo all interactions. The reset button
is equivalent to undoing all operations and lets you press redo to get
back to before you reset. Doing something after undo will of course
clear all redo events.
Make sure that temporarily setting/unsetting tool->control's "preserve
tool across image changes" does not mess up the default value:
Introduce gimp_tool_control_push/pop_preserve() which restores the old
state automatically, and use it in all tools, instead of saying
set_preserve(TRUE/FALSE) around image changes.
gimp_transform_tool_real_transform(): make sure we clip layer masks
and channels to their original extents also when transforming them
completely (not just a selection of them).
There are still many uses of literal SHIFT and MOD1 left, but all uses
of CONTROL are gone. Should work exactly as before on Win/X11, and
still has some glitches on OSX.
For example starting GIMP and pressing
Ctrl-N Enter Shift-T (or Shift-R or Shift-P)
showed warnings on the console, and with window manager's
focus mode set to 'click' it was also possible to crash GIMP.
which removes a lot of code from the transform tool, and reduces the
number of canvas items used for the transform grid from possibly
gazillions to one.