Commit Graph

19527 Commits

Author SHA1 Message Date
Michael Natterer 4f4d6b27cf app: register the "settings folder" (e.g. GIMPDIR/curves) with the settings type
and remove all settings_folder API and values from GimpFilterTool and
its subclasses.
2017-06-05 22:00:17 +02:00
Michael Natterer 82d23fc6ff app: don't unref the passed file in gimp_operation_config_[de]serialize() 2017-06-05 20:32:07 +02:00
Michael Natterer 109f23af39 app: replace the hue-saturation tool by a generic filter action
Move the GUI to a custom gimppropgui function.
2017-06-05 18:35:05 +02:00
Michael Natterer 85aab2a0f5 app: restore color balance's tooltip 2017-06-05 13:16:59 +02:00
Michael Natterer 5abf0c2e5b app: rename gimppropgui-constructors.[ch] to gimppropgui-generic.[ch] 2017-06-05 12:05:39 +02:00
Michael Natterer 9e1aee48c5 app: move all custom gimppropgui constructors to their own files 2017-06-05 02:26:30 +02:00
Michael Natterer 757ca64e58 app: replace the color balance tool by a generic filter action
Move the color balance GUI to a custom gimppropgui function.
2017-06-05 01:20:37 +02:00
Michael Natterer ecfec4103b app: remove the colorize tool and replace it by a generic filter action 2017-06-04 21:21:43 +02:00
Michael Natterer adb826fb39 app: allow filter actions to have hardcoded default operation settings
by encoding them directly in the string attached to all filter
actions. The code now supports both "gegl:some-operation" and
"gegl:some-operation\n<serialized config>".

Add "default_settings" to GimpGeglProcedure to store the settings of
the invoking action, much like the "default_run_mode" member.

Change filters-commands.c to parse the new operation string, create
GimpGeglProcedures with the deserialized settings, and use those
settings when the procedures are ran.

Change the filter history to be smarter about what is already in the
history, there can now be several different procedures with the same
name.

Remove the dilate and erode actions from the drawable group, and add
them to filters, they are just special cases of value-propagate with
fixed settings.
2017-06-03 22:08:43 +02:00
Michael Natterer 2d38abd7c4 configure.ac: require babl >= 0.1.28 and GEGL >= 0.3.18 2017-06-03 18:14:33 +02:00
Michael Natterer c0c1225e93 pdb: remove a misplaced " from fileops.pdb 2017-06-03 18:12:50 +02:00
Michael Natterer e122303fe0 Bug 783382 - Lava filter broken
Allow NONE(0) for "wrapmode" (which translates to GEGL_ABYSS_NONE) in
the plug-in-edge PDB compat wrapper. The old plug-in accepted this
(undocumented) value and used a GimpPixelFetches in NONE mode.
2017-06-03 17:08:47 +02:00
Michael Natterer 142c167321 app: change the default value of "import-raw-plug-in" from NULL to ""
so it shows up in the generated gimprc and its manpage. This has no
effect on how the settings works.
2017-06-02 22:45:29 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Michael Natterer b1ea1eb71d app: apply some more filters immediately (without GUI) 2017-06-01 23:40:39 +02:00
Michael Natterer 383419926b app: add member "default_run_mode" to GimpGeglProcedure
which determines if a filter is applied directly (RUN_NONINTERACTIVE)
or asynchronously using GimpOperationTool (RUN_INTERACTIVE).

Split filter actions in two groups, one for direct apply and one for
interactive apply, which have separate callbacks that create
GimpGeglProcedures with the right default_run_mode set.

(After doing this distinction automatically based on the existance of
editable properties, I figured will might want direct apply also for
filters that do have properties, such as e.g. dilate and erode, which
are just value-propagate with some constant property values)
2017-05-31 23:48:22 +02:00
Michael Natterer 9d502791d0 app: rename procedure_commands_run_procedure()
to procedure_commands_run_procedure_async(). Add a new
procedure_commands_run_procedure() that calls the procedure
synchronously, needed later.
2017-05-31 23:48:22 +02:00
Michael Natterer ed2fb2944f app: add a "settings" argument to GimpGeglProcedure
which gets added automatically by procedure_commands_get_display_args().

Move the non-interactive and run-with-last-vals code to
gimp_gegl_procedure_execute() (not execute_async()) because it makes
more sence to call it synchronously anyway (not implemented yet).

This commit should change no behavior.
2017-05-31 23:48:22 +02:00
Ell 14bcde2c73 app: small code reorganization in the curves tool
Move gimp_curves_tool_color_picked() to match its prototype's
position, per commit f876f3b5f4.
2017-05-31 08:47:23 -04:00
Ell ff91bb1b5b app: fix unused variable warning in warp tool
... due to commit 7136f09f0a
2017-05-30 20:11:37 -04:00
Ell 7136f09f0a app, cursors: add a cursor for the warp tool
... and use it instead of the perspective tool cursor.

Disable the cursor modifiers for now, since they're not really
meaningful.
2017-05-30 19:27:05 -04:00
Ell f876f3b5f4 app: fix curves tool color picking
Since commit bc4589968c, GimpFilterTool
assumes that color picking is only ever enabled through color picker
toggles, created using gimp_filter_tool_add_color_picker().  However,
the curves tool enables color picking using the color tool functions
directly.  CRITICALS ensued.

Use the new gimp_filter_tool_enable_color_picking() function, added
in the previous commit, and handle picking through the filter tool
interface, instead of the color tool interface.  This fixes the
issue.
2017-05-30 17:40:42 -04:00
Ell a5b03ddf2e app: add gimp_filter_tool_{enable,disable}_color_picking()
Subclasses of GimpFilterTool should use these functions to control
picking, instead of using gimp_color_tool_{enable,disable}()
directly.  This makes sure that the tool's picking state is
consistent, and allows the caller to control the pick identifier,
and use abyss picking (not currently needed by any subclass, but
maybe in the future, who knows.)
2017-05-30 17:40:42 -04:00
Michael Natterer 90698524d9 app: change gimp_operation_config_new() to _get_type()
Return only the config object's GType and do the g_object_new() in the
caller (one caller only needs the type, there is no need to create a
dummy object just to get to its type).
2017-05-29 08:04:52 +02:00
Michael Natterer 03085f491d app: ref the GimpProgress in gimp_procedure_execute[_async]()
around calling the actual execute vfuncs, Seen a crash when quitting
GIMP while a script-fu window was open, the progress was already
finalized. Now it simply prints the error message about the failing
script on the concole.
2017-05-28 17:41:52 +02:00
Michael Natterer 84e5aed103 app: turn invert-perceptual, -linear and -value into normal filter actions
so they show up in recent filters, and don't need their own callbacks.

This has the problem that they now show a GUI with no options, but
that simply puts on more pressure to fix this general uglyness of ops
without editable properties.
2017-05-26 18:49:22 +02:00
Michael Natterer ea7f1ba024 app: reduce indentation depth in gimp_plug_in_manager_search_directory()
by removing one if() level each from the nested loops. Instead,
continue the loop early if the file is hidden. And plug a memory leak.
2017-05-26 18:47:13 +02:00
Jehan f24edcded7 Revert "Bug 783108 - Make paint tools draw in all open views"
This reverts commit 2aa246f5e9.
As per Mitch request since painting is already too slow.
This may come back when we make painting fast again, I guess.
2017-05-26 17:48:34 +02:00
Richard McLean 2aa246f5e9 Bug 783108 - Make paint tools draw in all open views
Committed with minor fixes by the reviewer (Jehan).
2017-05-26 12:45:36 +02:00
Jehan efae55a73e app: allow plugin inside first-level directories of plug-ins folders.
We don't search recursively but only at the first level. If a plugin is
in its own subdirectory, the entry point has to be named the same (minus
extension) as the directory. For instance my-plugin/my-plugin for a
binary, or my-plugin/my-plugin.(py|exe|…).
This way, a plugin can load shared objects (libraries, other script
files, etc.) without polluting the main plug-ins directories, and in
particular without interfering with other plug-ins.
This is a first step to fix bug 757057 (DLL files which were used in
various plugins).
2017-05-24 17:33:15 +02:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Ell e7d781ff0e app: future-proof XCF layer blend/composite props
The layer blend space, composite space, and composite mode
properties have a special AUTO value, which may map to different
concrete values based on the layer mode.  Make sure we can change
this mapping in the future, without affecting existing XCFs (saved
after this commit), by encoding these properties as follows:

When saving an XCF, if the property has a concrete (non-AUTO)
value, which is always positive, encode it as is.  If the property
is AUTO, which is always 0, encode it as the negative of the value
it actually maps to at the time of saving (note that in some cases
AUTO may map to AUTO, in which case it's encoded as 0).

When loading an XCF, if the encoded property (stored in the file)
is nonnegative, use it as is.  Otherwise, compare the negative of
the encoded property to the value AUTO maps to at the time of
loading.  If the values are equal, set the property to AUTO;
otherwise, use the concrete value (i.e., the negative of the value
stored in the XCF).

Note that XCFs saved prior to this commit still load fine, it's
simply that if we change the AUTO mapping in the future, all their
AUTO properties will keep being loaded as AUTO, even if the
resulting concrete values will have changed.
2017-05-21 08:44:19 -04:00
Ell f400bdc049 app: add interpolation, abyss policy, and high quality preview options ...
... to the warp tool

The interpolation and abyss policy options control the sampler type
and abyss policy of the map-relative node.  The high quality preview
option determines whether to use the same sampler for map-relative
during preview as the one used during commit, or whether to use a
fast nearest-neighbor sampler.

A bit too much?  Maybe :)
2017-05-19 18:29:16 -04:00
Michael Natterer 81fe78bd9b app: derive GimpFgBgEditor from GtkEventBox instead of GtkDrawingArea
it doesn't need a visible GdkWindow.
2017-05-19 12:02:48 +02:00
Michael Natterer 54e2c196b7 app: use 2/3 of the area's shorter side for GimpFgBgEditor's oog color too 2017-05-19 11:55:54 +02:00
Michael Natterer 297ec3fdab app: add an out-of-gamut indicator to GimpFgBgEditor 2017-05-19 11:00:38 +02:00
Ell cd5930d813 warp: reorder warp tool options
... to be more similar to the paint options.
2017-05-19 04:56:30 -04:00
Ell 40afffbebc app: add option to stroke the warp tool during cursor motion ...
... and to disable/control the rate of the periodic stroke.

The warp tool is now fast enough to enable stroking directly in
the motion handler, which gives better-quality response to motion
than stroking periodically.  It's not quite fast enough to enable
exact motion, though :/

Allow individually enabling/disabling stroking during motion and
periodically, and allow controlling the rate of the periodical
stroke.
2017-05-19 04:55:29 -04:00
Ell 13b619c474 app: use different samplers for preview and commit in warp tool
Use a fast nearest-neighbor sampler for the map-relative node
during preview, and a slower cubic sampler when comitting/animating.
2017-05-19 04:55:09 -04:00
Michael Natterer 4f903a69b3 app: set the palette import dialog's "# Colors" scale to logarithmic
because the scale is useless otherwise with its range of 2..10000,
and because I needed a test case for the next commit (the
gimp_scale_entry_set_logarithmic() API was unused).
2017-05-18 18:21:51 +02:00
Ell 3814ac9056 app: in warp tool, avoid nop strokes with the MOVE behavior
When using the MOVE behavior, don't append the current cursor
position to the stroke path in the timeout proc if the cursor
hasn't moved since last time.  It has no effect, except for
requiring an unnecessary update.
2017-05-17 15:22:47 -04:00
Ell 5be79bc8c4 app: in warp tool, compress motion events
We stroke the last-reported coords in a timeout proc, so there's
no real need for exact motion notification.
2017-05-17 15:22:38 -04:00
Ell a0b30d542d app: in warp tool, improve update region calc.
... as a result of a stroke change.
2017-05-17 15:21:33 -04:00
Elle Stone 127e7daeb2 Bug 773461 - Color picker lacks L*a*b* mode
Add LAB readout to Pointer and Sample Points dialogs
2017-05-17 10:27:53 -04:00
Ell 9c7cae6220 app: maintain warp tool graph structure during undo/redo
When undoing a warp stroke, don't disconnect the current warp node
from its predecessor; rather, keep the graph as-is, and only
reconnect the render_node to the previous node.  This avoids
invalidating the undone node, so that redoing it (which, likewise,
only involves reconnecting the render_node) doesn't require
reprocessing, making it much faster.
2017-05-16 20:35:46 -04:00
Ell 13e274d82e app: add "spacing" parameter to warp tool; change "hardness" range
The spacing parameter controls the stroke spacing of the warp op.
It's similar, but not identical, to the brush spacing parameter of
the paint tools.  It provides a tradeoff between speed and quality.

Change the UI range of the hardness parameter from [0, 1] to [0, 100],
to match the other parameters.
2017-05-16 20:35:42 -04:00
Jehan 0dbdf232d5 app, menus: rename confusing layers-text-tool and vectors-path-tool.
"layers-text-tool" action shows as "Text Tool" while "vectors-path-tool"
shows as "Path Tool". That's very confusing with tools-text and
tools-vectors respectively.
These actions are mostly about entering in edit mode with the active
layer or path. For text layers, it will enter text edition on canvas,
whereas just open the attributes edition dialog on other layers. For
consistency, layers-text-edit is renamed as well too layers-edit-text.
This also fix the side effect of commits 10099bd and 526918b where I
didn't realize that layers-text-tool was also working on non text layers
on purpose (being very badly named). Now there is a separate layers-edit
and layers-edit-text.
Thanks to Pat David for English corrections. :-)
2017-05-16 00:04:24 +02:00
Michael Natterer 8f2471b112 Bug 772667 - instant freeze on rotate
Limit the number of lines drawn in the transform tool canvas grid to
one line every 5 image pixels. This should probably be done in display
pixels, didn't change that yet.
2017-05-14 22:28:51 +02:00
Thomas Manni f25c0cb9c9 Bug 121446 - Transform tool bounding box for path
When transform tools are applied on a path, set their bounding box as follow:
- if a selection exists, use the selection bounds
- else if the path has a valid bounding box, use it
- else use the image canvas bounds

Also disable transform tools on an empty path (path without strokes) since
there is no data to transform.
2017-05-13 23:04:22 +02:00