Commit Graph

19795 Commits

Author SHA1 Message Date
Michael Natterer 0b9dd1d800 configure.ac: require gexiv2 >= 0.10.6 2017-07-23 15:58:28 +02:00
Michael Natterer 7d5f1e44f2 app: change GimpSettings to store its time as gint64
and use GDateTime for handling it.
2017-07-23 15:18:55 +02:00
Michael Natterer bcda53ee7b Bug 785001 - Enhanced smudge tool: Smudge with painting
Apply patches from shark0r that alow to mix in both constant and
gradient color while smudging; and clean up the patches.
2017-07-23 14:44:22 +02:00
Jehan 894d85f64a app: GIMP_MAX_NUM_THREADS should follow max value of GeglConfig's...
... "threads" property.
Actually there is no need of having a public GEGL_MAX_THREADS as written
in the previous commit. We can just retrieve the max for a GObject
property.
2017-07-18 16:41:32 +02:00
Jehan 32ffabcba4 Bug 784226 - Maximum of processing threads hard-coded to 16.
Raise GIMP_MAX_NUM_THREADS to 64, following the changes in GEGL (see
GEGL commits 6d128ac and f26acbb). This is still considered unstable and
to be used at one's own risk (cf. GIMP commit 1f5739d) but at least, it
could allow discovering and fixing bugs.
It would be nice if GEGL_MAX_THREADS could be public so that to not have
to edit this by hand at each change.
2017-07-18 16:07:15 +02:00
Jehan 3fa2127854 app: fixes for previously contributed commit.
- trailing whitespaces cleaned out;
- vectors are called "path" in all visible strings;
- do not check for floating selection and active channel: oppositely to
  layers, a vector can be selected in the same time as a channel, and
  while there is a floating selection.
2017-07-18 13:35:02 +02:00
Lionel N 2de6beaea8 Bug 585607 - Vectors select (next, previous, top & bottom)
Now possible to have keybindings for previous/next/top/bottom vector
2017-07-18 13:27:29 +02:00
Michael Natterer 04a53dbce3 app: consistently name the filter tool presets "Presets" in the GUI 2017-07-18 00:30:55 +02:00
Michael Natterer bef155ef30 app: prepend "Last used: " to the names of the automatic filter presets
and add a tooltip about renaming them in order to save them
permanently.
2017-07-18 00:29:45 +02:00
Michael Natterer 9af78831ea app: add a tooltip to the color temperature preset menu button 2017-07-18 00:28:56 +02:00
Michael Natterer cb0757e1c5 app: split some utils out of gimppropgui.[ch] to gimppropgui-utils.[ch] 2017-07-16 20:14:18 +02:00
Michael Natterer 694fde485e app: fix area-based scale_limits in gimp_prop_widget_new_from_pspec()
Don't set scale limits outside the hard limits of the GParamSpec,
and remove debug g_printerr().
2017-07-16 16:44:49 +02:00
Massimo Valentini f2306abc0a Bug 761170: Warnings building with clang
Fix some of the warnings.
2017-07-15 21:05:56 +02:00
Michael Natterer 4208aceafe app: make GimpToolTransformGrid handle modifiers itself
and update the grid as soon as a constraint is changed, not only on
the next motion. Change GimpTransformTool to forward the events to the
widget if it exists, but still handle them if it doesn't (yes this
code duplication is ugly, but the widget can hardly handle events if
it doesn't exist...).
2017-07-15 19:34:08 +02:00
Michael Natterer 0a5251c97a app: simplify gimp_transform_tool_modifier_key()
No need to have n g_object_set() to set n properties, use one call
instead.
2017-07-15 19:17:07 +02:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer f3561549bb app: fix leaks when freeing the list of accum_buffers in gimpsmudge.c 2017-07-15 18:42:43 +02:00
Michael Natterer a223ba8f40 Bug 707745 - Selected text is hard to read in the text tool's on-canvas editor
Change the text selection to draw an outline around each selected
glyph. It looks just as ugly as before but at least keeps the text
readable regardless of its color.
2017-07-13 12:34:54 +02:00
Ell e15a444656 Bug 784799 - select > shrink and border produce horizontal gaps in selection
The grow, shrink, and border ops are written to process the entire
input at once, so chunking breaks them.  Just make them non-threaded
for now.
2017-07-11 16:49:49 -04:00
Michael Natterer 4f2c0dd846 Bug 784802 - crop tool incorrectly detects current aspect ratio
When starting the crop tool, set its default aspect ratio to that of
the current layer/image. Dunno what change exactly broke it, but it
was broken.
2017-07-11 21:35:32 +02:00
Michael Natterer 8f6c0fd17c app: use some canvas item highlighting in GimpCageTool
and don't draw two handles on top of each other for selected points.
2017-07-11 12:43:24 +02:00
Michael Natterer f73b7f986b app: remove obsolete prototypes from gimpmovetool.h 2017-07-11 12:42:30 +02:00
Michael Natterer 44d7a26613 app: remove GimpFilterTool's "drawable" member
and use GimpTool's drawable. I guess at some point tool->drawable was
somewhat unpredictable, this is not the case any longer.
2017-07-10 23:28:49 +02:00
Michael Natterer 77f1424777 app: fix modifying the selection while GimpRectangleSelectTool is active
if did revert to the previous selection and thus break stuff like
enbaling quick mask or inverting the selection, because I merged the
undo magic it does into gimp_rectangle_select_tool_halt(), whereas
before it was done by the former gimp_rectangle_tool_cancel(), so only
on explicit cancel not HALT from whatever source.

Do the same in the new code and move the undo magic from halt() to
rectangle_response(CANCEL), which is exactly the same distinction as
with the old GimpRectangleTool code.
2017-07-09 20:51:49 +02:00
Ell 27d5dcf20a app: don't remove dirname in save dialog when adding file extension
When the user provides a filename without an extension in the save
dialog, we add one for them, update the filename in the dialog, and
retry.  However, the updated filename is made up of only the
basename, leaving out the dirname part, if specified.  This means
that if the user enters "/somedir/somefile", the new filename
becomes "somefile.xcf", which refers to the current directory,
instead of "somedir".

Fix this by maintaining the dirname when adding a file extension.
2017-07-09 14:45:01 -04:00
Michael Natterer 5bf0e3c3d2 app: fix initializing a rectangle select by clicking into a selection
Don't unconditionally call COMMIT in rectangle_response(), because
that now implicitly HALTs the tool. Instead, check if we got here
because of a click, and call our commit() directly.
2017-07-09 20:09:23 +02:00
Michael Natterer afb9941c80 app: allow to close a GimpToolPolygon without committing it
so we can edit a complete shape, and reopen it to continue editing,
instead of immediately selecting when the first point is clicked.
2017-07-09 19:26:19 +02:00
Michael Natterer 4f7fff8cb8 app: change some gimp-operation-config.[ch] parameters to GObject
They were GimpObject for no reason, also inconsistent with other
places where we deal with config objects.
2017-07-09 19:20:55 +02:00
Michael Natterer 29795a29eb app: remove all "has_settings" stuff from the GimpFilterTool API
Instead, use gimp_operation_config_list_properties() to figure if an
operation has editable properties directly in
gimp_filter_tool_get_operation().
2017-07-09 18:59:54 +02:00
Michael Natterer 51cc6893ab app: add gimp_operation_config_list_properties()
which is the same as g_object_class_list_properties() but filters
out the properties for which we don't want to create a GUI.

Use it in gimp_prop_gui_new().
2017-07-09 17:59:29 +02:00
Michael Natterer 2a75df030e app: rename all GimpOperationTool variables to "op_tool"
Mostly to fix my own confusion, the variable name "tool" is used for
GimpTool everywhere else.
2017-07-09 17:31:25 +02:00
Michael Natterer 6a312a71f3 app: simplify GimpTool::undo() and ::redo()
Check for gimp_tool_can_undo() and can_redo() in gimptool.c, before
calling undo() and redo(), instead of doing the same in each tool
individually.
2017-07-09 17:22:06 +02:00
Michael Natterer 1c01f10329 app: rename gimp_transform_tool_transform() to gimp_transform_tool_commit()
and modernize some more stuff like initialize().
2017-07-09 16:48:52 +02:00
Michael Natterer 0459e301b7 Bug 784716 - Bump Map not working
GimpOperationTool's aux inputs were not properly ported to the new way
filter tools work (complete destruction and re-creation of the tool
dialog).

Split creating the operation GUI and adding it to the dialog into
separate functions, and call them at the right places.
2017-07-09 16:27:46 +02:00
Michael Natterer ef294f4a54 app: clean up how tools are COMMITed and HALTed
Call HALT generically in gimp_tool_control() after calling COMMIT, and
remove all hacks in tools that call both COMMIT and HALT or call
halt() from commit().

Some tools interact with their subclasses (e.g. filter tool and
operation tool), and it's essential that COMMIT runs through the
entire class hierarchy before HALT.

Probably breaks something, please test.
2017-07-09 16:25:42 +02:00
Michael Natterer 23ae146d95 Bug 777485 - Move unified transform tool shear handles to places...
...corresponding to the spec
2017-07-08 18:21:33 +02:00
Michael Natterer a5fe6b8372 Clean up metadata menu stuff: capitalization, separator, indentation 2017-07-08 09:39:31 +02:00
Alexandre Prokoudine c68239e937 Make new Metadata submenu and new dialogs' captions translatable.
Adjust the tooltip for the Edit Metadata menu item.
2017-07-08 03:16:41 +03:00
Michael Natterer 16cfcf1bde app: remove some #if 0'ed code from GimpToolPolygon 2017-07-06 12:32:36 +02:00
Michael Natterer 787f645c57 app: fiddle less with GimpFilterTool internals in GimpOperationTool
Use gimp_filter_tool_disable_color_picking() in
gimp_operation_tool_set_operation() instead of poking around manually.
2017-07-05 20:54:21 +02:00
Michael Natterer 84269cc608 app: move the add_controller() callback to GimpFilterTool
Why I added it to GimpOperationTool first, I have no idea...
2017-07-05 20:33:11 +02:00
Michael Natterer 3f6e9e429d app: don't crash in gimp_tool_info_get_description()
Found and tracked down by Elle Stone.
2017-07-05 18:34:37 +02:00
Michael Natterer f6c2e807e0 app: don't completely clear a GimpOperationTool when it's halted
Need to keep around the operation's name and its description, so
everything can be re-created when an image is clicked.

Instead, completely shut down GimpOperationTool when GimpGeglTool is
halted, so the next click will bring up a dialog with only the
operation selection combo.
2017-07-05 12:28:40 +02:00
Michael Natterer bc708fb2fb app: fix curves and levels tool to not crash with how GimpFilterTool works now
The tool dialog can now be completely shut down and re-created, make
sure we don't run into dangling pointers in the time when there is no
dialog.
2017-07-05 12:24:47 +02:00
Michael Natterer bc1997eeeb app: fix shutdown of GimpHistogramView
Not only unref the histograms, also disconnect from their signals.
2017-07-05 12:21:23 +02:00
Michael Natterer 36656175d1 app: some more s/blurb/label/ and s/help/tooltip/ in app/tools/ 2017-07-04 22:36:24 +02:00
Michael Natterer c682c5466c app: add an optional "label" to GimpTool which overrides GimpToolInfo's
Remove GimpFilterTool's "title" and use the GimpTool's "label" instead.
2017-07-04 22:31:17 +02:00
Michael Natterer d521510967 app: fix rectangle and ellipse select tool cursors
Actually use the cursor returned by gimp_tool_widget_get_cursor(),
not ignoring stuff seems to make stuff work...
2017-07-04 22:27:31 +02:00
Michael Natterer 25f4ae317e app: don't try to commit the crop tool when it has no display
Fixes a bunch of warnings that were only by coincidence not crashers.
2017-07-04 22:21:52 +02:00
Michael Natterer e21be2f3d9 app: rename GimpToolInfo's "blurb" and "help" members
to "label" and "tooltip". More standard names, less confusion.
2017-07-04 21:58:11 +02:00
Michael Natterer 1f42d65e21 app: remove undo_desc, icon_name, help_id stuff from GimpFilterTool
and its subclasses. Simply use the new GimpTool APIs now.
2017-07-04 20:43:28 +02:00
Michael Natterer 8e68743efa app: add gimp_tool_set/get_undo_desc/icon_name/help_id()
which allow to override stuff from GimpToolInfo for dynamic tools like
GimpFilterTool and friends. When NULL, the getters are falling back to
GimpToolInfo strings.
2017-07-04 20:43:28 +02:00
Michael Natterer 89d611f291 app: GimpFilterTool: remove members "import_dialog_title"...
...and "export_dialog_title"

It's ridiculous to keep this code around for strings that are only
marginally different (and not better) than the strings we can generate
from other strings we have anyway.
2017-07-04 20:43:28 +02:00
Michael Natterer 54683840e3 app: rename GimpTool::get_undo_desc() and ::get_redo_desc()
to ::can_undo() and ::can_redo(). They still return description
strings and the new naming is slightly off :) but get_undo_desc() will
be needed for something else soon, and half of the time the functions
are indeed used to check whether there are undo/redo staps at all.
2017-07-04 20:43:28 +02:00
Ell bfb51b0782 app: don't compute slider values for 0-length lines while dragging
... to avoid getting NaNs.
2017-07-04 10:43:01 -04:00
Michael Natterer 76644b7367 app: add a "status_title" to GimpCreateControllerFunc
so the status bar now says "Spiral:" or "Supernova:" instead of just
"Line:".
2017-07-04 12:51:05 +02:00
Ell 04b407a019 app: s/slider_count/n_sliders/ in GimpToolLine and firends
Yep yep yep.
2017-07-03 18:10:30 -04:00
Ell c7bc765a10 app: use sliders to control "balance" and "base" for gegl:spiral
Switch the gegl:spiral prop gui from using a line controller to
a slider-line controller, and use sliders to control the "balance"
and "base" properties.
2017-07-03 15:10:49 -04:00
Ell 60586a8817 app: add sliders to GimpToolLine; add slider-line controller
Add supprt for placing sliders on a GimpToolLine -- handles that can
be dragged over the line.  The sliders are accesible through a new
"sliders" property, and via the gimp_tool_line_{get,set}_sliders()
functions.

Add a slider-line controller, which works like a line controller,
but whose callback also supplies/takes an array of sliders.

Note that the data type for individual sliders is called
GimpControllerSlider (in particular, it's not line specific), so
that we may use it with other controller/tool-widget types in the
future.
2017-07-03 15:10:47 -04:00
Michael Natterer 6de4fca580 app: add a custom GUI for gegl:supernova, with an on-canvas controller 2017-07-03 12:45:59 +02:00
Michael Natterer e8ee5475b7 app: move all propgui files from app/widgets/ to new folder app/propgui/
We are getting more and app/widgets/ is already too large.
2017-07-03 12:29:41 +02:00
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 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 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
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