Commit Graph

336 Commits

Author SHA1 Message Date
Michael Natterer 36ca4d03f1 app: some cleanup in GimpTransformTool and subclasses
- formatting
- rename some GimpTransformTool members
- add member "does_persoective" and don't include subclasses
- handle drawing cleanup
2015-03-23 23:18:28 +01:00
Johannes Matschke 2989bad35a Bug 721009 - new transform tool with freely placeable handles
Add new tool GimpHandleTransformTool which allows to freely place up
to 4 handles on the image, then move any one of them, which transforms
the image so that the remaining handles keep their position.

Did quite some cleanup on the code before pushing --Mitch
2015-03-05 12:36:59 +01:00
Thomas Manni d36b18d7dc fix typo on commit 5ae6c8b1b3 2014-11-27 15:44:58 +01:00
Thomas Manni 5ae6c8b1b3 Bug 740778 - fix transformtools
Do not enable transform tools in selection mode when no selection exists.
2014-11-27 08:30:56 +01:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer cd479ce04e app: add an "auto overlay" API to GimpToolGui
which makes tool dialogs auto-overlay if the canvas is large
enough. Set all tools dialogs except GimpImageMapTool's dialog to
auto.
2014-06-09 03:08:43 +02:00
Michael Natterer 23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
Michael Natterer 843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
Michael Natterer 0bdb74710a app: rename the value-1...value-4 actions to opacity, size, aspect, angle 2014-04-19 20:09:39 +02:00
Michael Natterer df8a148db0 app: make the transform tool's undo functions static 2014-04-18 23:03:22 +02:00
Michael Natterer 88e4d7e468 app: commit ongoing tool operations on tool change instead of cancelling
On tool change, we used to simply halt tools before switching to the
new one, which meant losing ongoing live-previewed tool changes, like
transforms, warps and color corrections. This change makes them being
applied to the image instead before switching to the new tool:

Add enum value GIMP_TOOL_ACTION_COMMIT that is passed to
GimpTool::control() before tool switching. Handle the new enum value
in all tools, and actually commit the previewed stuff. This changes
the behavior of GimpCageTool, GimpImageMapTool, GimpTransformTool and
GimpWarpTool.
2014-04-04 22:34:26 +02:00
Michael Natterer b13c68fda6 Bug 701159 - Wrong name in transform tool dialogs...
...when acting on a path or selection

Factor out the code that checks if an active item exists and if it's
transformable (not locked etc.) and use that function in more places.
This fixes both the wrong dialog labels and the tool running into
broken states when the selection or a path are being transformed.
2014-02-05 00:57:28 +01:00
Michael Natterer 1335bc42c8 app: halt the transform tool when switching layer|selection|path transform 2014-02-04 23:28:59 +01:00
Michael Natterer 5054241ca6 Bug 722034 - Incorrect snapping behaviour for scale tool
Always snap to the center of transform tool handles.
2014-01-29 23:40:35 +01:00
Clayton Walker df21310b0f app: properly initialize variables 2013-06-23 01:41:50 +02:00
Michael Natterer 90797f0927 app: add an embedding toggling test button to the transform dialogs 2013-06-08 01:33:35 +02:00
Michael Natterer ad8d12ed69 app: add "response" signal to GimpToolGui
and connect to it instead of to gimp_tool_gui_get_dialog()'s signal.
One more step towards on-the-fly embedding/detaching.
2013-06-07 23:45:11 +02:00
Michael Natterer 9a811d276e app: add gimp_tool_gui_set_alternative_button_order() and use it
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.
2013-06-07 15:18:24 +02:00
Michael Natterer 88387d6e8d app: remove the "shell" parameter from gimp_tool_dialog_new() and gui_new() 2013-06-07 12:19:42 +02:00
Michael Natterer 1c20940f82 app: use a GimpToolGui in GimpTransformTool 2013-06-07 11:52:48 +02:00
Michael Natterer 785436f32e app: don't crash the flip tool on each click
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().
2013-06-06 02:08:00 +02:00
Michael Natterer 3b68ae0f3c app, pdb, libgimp: Remove all traces of the supersampling recursion level
from all transform APIs. This is no longer used since we use GEGL to
transform, the value was only passed around and never used.
2013-05-31 01:15:32 +02:00
Massimo Valentini 0a31b29b9a app: transform_tool - don't flush the image when display is NULL
it means the dialog is being deleted
2013-05-29 20:10:33 +02:00
Michael Natterer e3ef19ec89 app: don't gimp_display_get_image(NULL) in gimp_transform_tool_response() 2013-05-29 19:41:54 +02:00
Michael Natterer fdfa2c782d app: integrate transform tool undo with normal image 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.
2013-05-23 16:02:42 +02:00
darkraid1 ac5428787e Bug 598523 - Protect hidden layers from editing
Don't allow tool operations on invisible items, just like we do for
group layers or locked items.

Cleaned up and enhanced the patch a bit --Mitch
2013-05-13 23:29:43 +02:00
Mikael Magnusson 8cc53bbbdf app: forgot to invert the matrix in corrective mode when transforming the selection. 2013-04-23 17:15:23 +02:00
Michael Natterer e5112fa540 Bug 690900 - Typo in GIMP UI
Fix typo in gimptransformtool.c
2012-12-30 20:38:37 +01:00
Michael Natterer d4933b3052 Bug 674160 - Redesign of "Lock panel"
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.
2012-11-09 11:17:25 +01:00
Mikael Magnusson da795c1267 gimptransformtool: Restore code that apparently was for the flip tool 2012-09-20 15:18:00 +02:00
Michael Natterer e546f2b43b Bug 683462 - cropping with rectangular select tool leaves misaligned...
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.
2012-09-06 23:55:35 +02:00
Mikael Magnusson 6396e83057 transformtool: use new corner and side cursors appropriately considering current transform 2012-08-27 15:07:15 +02:00
Mikael Magnusson e83b40982f transformtool: adjust handles a bit
Since the move handle is gone, the pivot can be normal sized and circle again,
also put shear handles at 3/4 rather than 3/5.
2012-08-22 22:49:45 +02:00
Michael Natterer 95584e5548 app: re-format a comment in gimptransformtool.c 2012-08-22 20:41:44 +02:00
Mikael Magnusson 8dfc72dca9 transformtool: Make real_pick_function and real_draw_gui implementations of vfuncs 2012-08-21 20:59:15 +02:00
Michael Natterer b1acd93f5e Some formatting cleanup in the unified transform tool commits 2012-08-21 19:50:01 +02:00
Mikael Magnusson 08cd798ec6 transformtool: Set the cursor and tool cursor properly on each handle by way of the new cursor_update method 2012-08-20 20:28:21 +02:00
Mikael Magnusson 574df2b6db transformtool: We show corrective preview for selections and paths, so why not drawables 2012-08-20 15:46:47 +02:00
Mikael Magnusson f84987de73 transformtool: Add the bunch of 8 separate options for 3 things 2012-08-20 15:46:46 +02:00
Mikael Magnusson 03117bdf40 transformtool: Update modifier keys for options, solves problem with perspective frompivot + constrain 2012-08-20 15:46:46 +02:00
Mikael Magnusson 501c15f910 transformtool: Add a pick_function method to the TransformTool class and remove some more hack duplication 2012-08-20 15:46:46 +02:00
Mikael Magnusson 293600c579 transformtool: Add a draw_gui method to the TransformTool class and remove some hack duplication 2012-08-20 15:46:46 +02:00
Mikael Magnusson 615b5fabfd transformtool: Add the five options instead of just two 2012-08-20 15:41:55 +02:00
Mikael Magnusson 003ccf2aec transformtool: Enable hit detection for new handles 2012-08-20 15:22:22 +02:00
Mikael Magnusson c4143ff209 transformtool: Remove shift-clicking to accept transform since shift is used as a modifier 2012-08-20 15:22:22 +02:00
Mikael Magnusson 362afb122a transformtool: Try to straighten out modifiers 2012-08-20 15:22:21 +02:00
Mikael Magnusson 99f9d4d219 transformtool: add old "new" unified transformation tool
This is the proof of concept code I wrote before gsoc, with very naive
behaviour and simple interface.
2012-08-20 15:22:21 +02:00
Mikael Magnusson f5b08f33aa transformtool: Infinite undo
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.
2012-08-20 15:22:21 +02:00
Mikael Magnusson c883c761df transformtool: calculate center handle position correctly, add pivot handle
and use pivot handle in rotatetool so it works as before.
2012-08-20 15:22:21 +02:00
Michael Natterer 078128bb09 Bug 678890 - Selection box handles do not respond after changing layer
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.
2012-07-26 18:17:01 +02:00