Commit Graph

38758 Commits

Author SHA1 Message Date
Michael Natterer fd257971cc app: fix gimp_operation_tool_sync_op() to use the right output extents
Use the new gimp_filter_tool_get_drawable_area() instead of always
using gimp_item_mask_intersect() which is only right when the
operation is applied to the "selection" region. Also call
gimp_operation_tool_sync_op() when the region is changed in the UI.
2017-07-03 02:51:37 +02:00
Ell e701700a88 app: only use area dim., not off., for ui range of pixel-distance op props
Don't offset the ui range of op properties that use pixel-distance
units to the top-left corner of the region, since they're relative;
only do that for pixel-coordinate units.  Let their ui range be
[0, width/height].
2017-07-02 20:00:19 -04:00
Ell 54fd810173 app: make the "force" option insensitive for the pencil tool
It has no effect.
2017-07-02 19:26:30 -04:00
Ell 9de19a1f9a app: orient the spiral op line controller so that 0-degree rotation points right
This way, it runs to the middle of the spiral arm, and stays centered
even when balance != 0.
2017-07-02 19:14:38 -04:00
Michael Natterer 2da59e7ba3 app: add a "status-title" string property to GimpToolLine
which defaults to "Line: ". Set it to "Blend: " in the blend tool.
2017-07-03 01:02:23 +02:00
Michael Natterer f4f2de1b5c app: start an infrastructure for on-canvas controllers for operations
Pass a "GimpCreateControllerFunc" to all gimppropgui-*.[ch]
constructors which takes a callback (to update the config object when
the on-canvas GUI) and a controller type that determines the
callback's signature, and returns another callback (to update the
on-canvas GUI when the config object changes).

In GimpOperationTool, pass such a GimpCreateControllerFunc that
handles creating and adding on-canvas controller via the new
gimpfiltertool-widgets.[ch]. So far, a simple line like in the
blend tool is supported.

Add a custom GUI for gegl:spiral, and have its origin, radius and
angle controlled by such a line.
2017-07-03 00:45:59 +02:00
Michael Natterer a2c331011d app: add new function gimp_filter_tool_get_drawable_area()
which return's the used drawable's offsets and a GeglRectangle
where the filter is applied according to GimpFilterOptions::region
(either the selection or the whole drawable).
2017-07-03 00:45:59 +02:00
Michael Natterer 00a9659c28 app: add virtual function GimpFilterTool::config_notify()
and call it from GimpFilterTool's "notify" callback. Remove signal
connections from all subblasses and instead implement ::config_notify().

The config object belongs to GimpFilterTool, and only GimpFilterTool
should know when it's created and can be connected to.
2017-07-03 00:45:59 +02:00
Michael Natterer 9e55fb8ecf app: call gimp_filter_tool_get_operation() in initialize() not constructed()
so things from the tool's previous use get destroyed, including their
(maybe dangling) signal connections. Also shut down more stuff in
halt(), including destroying not just hiding the GUI.
2017-07-03 00:45:59 +02:00
Piotr Drąg c8420777d2 Update Polish translation 2017-07-02 17:50:33 +02:00
Piotr Drąg ddee27f6d4 Fix typos in translatable strings 2017-07-02 17:47:08 +02:00
Michael Natterer 6f2948fe54 app: don't let GimpColorTool change displays when GimpDrawTool has a widget
because widgets are bound to one GimpDisplayShell. Also, chain up
unconditionally in gimp_color_tool_draw(), we always want to draw the
widget even while picking colors.
2017-07-01 16:26:34 +02:00
Michael Natterer 3d08a52e1f app: add an optional GimpToolWidget to GimpFilterTool
The widget is fed events by GimpFilterTool, the actual interaction
with the filters operation and config will be done by subclasses.

The order of precedence when there are multiple possible canvas
interactions is: moving the split preview guide, color picking,
widget.
2017-07-01 16:24:01 +02:00
Ell be193acfe0 app: fix parent_class type of GimpOperationScalarMultiplyClass 2017-06-30 16:24:49 -04:00
Michael Natterer bcb6b77bde app: change GimpColorTool to not touch tool->display and tool->drawable
Instead, pass a GimpDisplay around in all virtual functions and use
that instead. Some preparation for more fancy subclasses using
GimpToolWidgets.
2017-06-30 21:23:29 +02:00
Michael Natterer b85842893d app: brightness-contrast: move gimp_tool_control_activate,halt() around a bit 2017-06-30 21:20:32 +02:00
Michael Natterer 33c84f38bc app: GimpPaintTool: don't chain up to start/halt the tool
because the parent class is about to be refactored a bit, and the
actual code executed by chaining up is just 4 lines.
2017-06-30 16:39:28 +02:00
Michael Natterer 5377213a82 app: HALT the crop tool when clicking on another display
instead of calling COMMIT. Not all tools are the same, this might be
right for other tools, but for crop it just feels broken.
2017-06-29 22:17:29 +02:00
Michael Natterer 79207bd3bf app: restore the crop tool's "Click or press Enter to crop" status message
it probably got lost when improving GimpToolRectangle's messages.
Also add a default idle status message "Click-Drag to draw a crop
rectangle".
2017-06-29 22:15:17 +02:00
Michael Natterer e8c6382302 app: re-enable GimpRectangleTool's "suppress_updates" keyboard moving hack
so a handle can be moved with the cursor keys even if it moves away
from under the mouse pointer.
2017-06-29 22:02:48 +02:00
Michael Natterer 56d87724a3 app: don't base GimpToolRectangle's new "is_first" on rectangle extents
they also get set externally so are broken to use. Instead, simply set
"is_first" to TRUE in init() and to FALSE in button_release().
2017-06-29 20:48:41 +02:00
Michael Natterer 26b9e7a357 app: set better status title strings in crop, text, rectangle select 2017-06-29 20:38:04 +02:00
Michael Natterer 2aff5b0a5a app: add new string property "status-title" to GimpToolRectangle
and use it for the statusbar message instead of just always "Rectangle: ".
2017-06-29 20:37:17 +02:00
Michael Natterer c9abe09440 app: improve GimpToolRectangle's statusbar messages 2017-06-29 20:21:02 +02:00
Michael Natterer 9dc6d4f515 app: improve button release behavior or GimpToolRectangle a lot
- introduce new state "boolean is_first" which tracks if the currently
  drawn rectangle is the first with this instance
- cancel the widget if there was no movement when creating the first
  rectangle
- undo to the previous rectangle if the user created a zero-extent
  rectangle
- also undo to the previous rectangle if a newly drawn rectangle is
  canceled with button-3 release
2017-06-29 20:01:08 +02:00
Michael Natterer 34485cff86 plug-ins: don't say for(int x...) in file-pcx.c 2017-06-29 18:39:41 +02:00
Michael Natterer 5c8c30112a app: treat a NO_MOTION release like NORMAL one in GimpToolRectangle
which stops unexpected behavior that was there even before the new
code (like a rectangle without a selection).
2017-06-29 16:48:02 +02:00
Michael Natterer ff915b68c9 app: fix warnings and crashes in rectangle select and crop
We can't rely on g_object_unref() in halt() for breaking all property
GBindings between the tool options and GimpToolRectangle, because we
might be in the middle of a signal emission which also refs and keeps
the rectangle alive until the last callback returns. So we had
dangling rectangles interacting with tool options.

Remember all bindings in a list, and break them explicitly when we
shut down the rectangle in halt().

Also, forgot to unset the display's highlight in the rectangle
selection tool.
2017-06-29 15:06:27 +02:00
Michael Natterer e7964e499c app: we were leaking a reference in gimp_tool_rectangle_button_release()
because of bailing out early after emitting "response". Instead, don't
ref the object around this function, and move the "response" emission
to the end of the function.
2017-06-29 15:04:13 +02:00
Michael Natterer 5e08d71437 app: gimp_tools_exit(): destroy the tool manager before the tool options
The tool manager still keeps an active tool which it unrefs on
destruction, triggering a final HALT on the tool, which may want to
lookup tool options to reset something. Happened with the new
widget-ported rectangle select tool.
2017-06-29 12:58:03 +02:00
Michael Natterer 8bf20a6c21 app: use integer not unsigned integer for GimpGeglConfig::num-processors 2017-06-28 21:15:45 +02:00
Michael Natterer f1a93f87b2 app: some cleanup in GimpTextTool
Only real change: don't set "highlight" on GimpTextOptions, it doesn't
exist any longer.
2017-06-28 19:39:52 +02:00
Michael Natterer f73cd0a615 app: remove GimpRectangleOptions stuff from GimpTextOptions
It's not needed any longer.
2017-06-28 19:34:47 +02:00
Michael Natterer 1f5739de57 app: set the number of threads on GeglConfig again, it needs testing
- enable the setting code in gimp-gegl.c again
- but set the default to one thread in GimpGeglConfig, with a CPP warning
- rename "processors" to "threads" in the GUI
- add a warning box about unexpected results when increasing #threads
2017-06-28 19:05:58 +02:00
Michael Natterer 23f31b2ca3 app: remove the handle transform tool toggle from preferences
It's out of the playground now.
2017-06-28 18:57:57 +02:00
Michael Natterer 2296d08bad app: remove gimp_draw_tool_add_rectangle_guides() and _add_corner() 2017-06-28 15:47:23 +02:00
Michael Natterer e11cb1edf3 app: remove GimpRectangleTool, all users were ported to tool widgets 2017-06-28 15:42:02 +02:00
Michael Natterer 4ebec35a77 app: port GimpTextTool to GimpToolRectangle 2017-06-28 15:40:38 +02:00
Michael Natterer a562860eed app: add boolean property "force-narrow-mode" to GimpToolRectangle
which allows to force outside handles without resorting to hacks.
2017-06-28 14:23:51 +02:00
Michael Natterer 719f96d89a app: fix gimp_tool_rectangle_frame_item()
it was setting double properties from integers, boom.
2017-06-28 14:13:10 +02:00
Marco Ciampa 3378520204 Updated Italian translation 2017-06-28 13:34:12 +02:00
Michael Natterer e51915a340 app: rename all tools' widget members to simply "widget"
instead of "line", "polygon", "compass" etc. Good for consistency and
for copy & paste :)
2017-06-27 22:50:50 +02:00
Jehan 5ee96b1741 plug-ins: move conditional gimp_install_procedure() of file-darktable...
... to init().
Otherwise presence of darktable is not checked at every startup.
2017-06-27 22:47:06 +02:00
Jehan 90c6181334 plug-ins: libgimp/gimpui.h include not necessary. 2017-06-27 22:47:06 +02:00
Michael Natterer 375acda3ed app: implement GimpTool::cursor_update() in GimpDrawTool
using the set widget. Remove or simplify cursor_update()
implementations in some subclasses.
2017-06-27 22:41:25 +02:00
Michael Natterer 4d9d4d84a7 plug-ins: messed up the last fix to file-rawtherapee's Makefile.am 2017-06-27 22:39:05 +02:00
Michael Natterer a7e706f7b5 app: must set GimpDrawTool's widget to NULL when a tools is halted
We were leaking all tool widgets set with gimp_draw_tool_set_widget(),
and those having signal connections to e.g. the display shell were
doing things when they were supposed to be gone. Fixes make check.
2017-06-27 22:32:35 +02:00
Jehan 4ea8868943 plug-ins: conditional gimp_install_procedure() should be in init().
query() is run only the first time for efficiency. Yet this plugin is
dependent on the presence of `rawtherapee` which may be installed or
uninstalled between GIMP startups. Therefore we should move the usual
gimp_install_procedure() to init() so that the check is done at every
startup instead.
2017-06-27 22:28:48 +02:00
Piotr Drąg e34c5c652d Update POTFILES.in and POTFILES.skip 2017-06-27 21:44:56 +02:00
Michael Natterer 1ba12351d7 plug-ins: fix file-rawtherapee build 2017-06-27 21:41:35 +02:00