Commit Graph

19510 Commits

Author SHA1 Message Date
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
Ell bb2417c299 app: add ui_meta keys for controlling some UI attributes dynamically
Add support for The following GEGL op property keys, which shall
contain GUM expressions of the specified type, controlling the
corresponding UI attributes of the property's widget:

  - sensitive [boolean]: controls widget sensitivity.

  - visible [boolean]: controls widget visibility.

  - label [string]: controls widget label (or the label of the
    associated label widget).

  - description [string]: controls widget tooltip text.

When any of above keys are present, the values they evaluate to take
precedence over the static values the corresponding attributes would
otherwise have.
2017-05-13 16:55:24 -04:00
Ell d6eb927b9e app: add interpreter for the GUM language
GUM is a small DSL, used in some property keys of GEGL operations
to dynamically control UI attributes based on context.  This commit
only adds an interpreter for the language; see the next commit for
the actual handling of the relevant keys.

See the comment at the top of gimppropgui-eval.c for a description
of the language.

Note that the interpreter is licensed under the LGPL.
2017-05-13 16:51:32 -04:00
Jehan bb977263ca app: layers-text-tool should give the focus to the canvas.
If focus is on the layer list for instance, running this action from
right-click menu raises the on-canvas toolbar, ready for edition, with a
visible text cursor. But if the canvas has no focus (since you clicked
on the layer list, it has the focus), you still have to move your mouse
over and click the text on canvas. That doesn't make sense and there
would be barely any reason to use this over selecting the text tool then
clicking the canvas.
2017-05-13 01:03:44 +02:00
Jehan 526918b26c app: layers_text_tool_cmd_callback() is not supposed to be run on...
... non-text layers.
Since commit 10099bd, the action will be non-sensitive with non-text
layers, so if it happens, there is a bug somewhere. Therefore
g_return_if_fail() on this condition.
Moreover opening the edit attributes dialog was absolutely confusing on
what this action is supposed to do. We should not have these kind of
random behaviors.
2017-05-13 00:01:56 +02:00
Jehan 10099bdaf7 app: layers-text-tool action should only be sensitive when active...
... layer is a text layer.
It doesn't make sense to activate the text tool on any other kind of
layer.
2017-05-13 00:00:35 +02:00
Ell 99ab780d9f app: update layer backdrop only after removing from stack
When a layer is removed from a layer stack, and its backdrop needs
invalidating, emit the UPDATE signals for the backdrop only after
the layer has been removed from the container.
2017-05-12 15:54:08 -04:00
Ell dd8e2e9b5e app: don't invalidate layer when invalidating its backdrop
Harmless, but unnecessary.
2017-05-12 15:54:07 -04:00
Ell 07ac78ef8d app: add GimpLayerStack
A subclass of GimpDrawableStack, for layer stacks.  Invalidates the
layers' backdrop as/when necessary, according to the value of their
excludes_backdrop property.

Make gimp_drawable_stack_update() protected, instead of private, so
that we can use it in GimpLayerStack.
2017-05-11 17:44:56 -04:00
Ell a051002295 app: add GimpLayer::excludes_backdrop property
A boolean flag, specifying whether the backdrop is clipped to the
layer.  That's the case when the layer's composite mode is dst-atop
or src-in.

This is a read-only property, derived from the other attributes of
the layer.  We compute its value through a virtual function, so that
GimpGroupLayer will eventually be able to specialize it for pass-
through groups.

The next commit uses this property to actually do something useful.
2017-05-11 17:44:55 -04:00
Ell a67135658e app: add gimp_layer_mode_get_included_region()
Takes a layer mode and a composite mode, and returns the region
included in the composition.

Use this function in GimpOperationLayerMode, instead of testing
for specific composite modes directly.  Will also be used by
the next commit.

Indentation cleanup in gimp_layer_modes.h
2017-05-11 17:44:55 -04:00
Ell c78cecd76d app: rename GimpLayerModeAffectMask to GimpLayerCompositeRegion
... so that we can use it for other functions that involve
compositing regions (which we do in the next commit).

Rename gimp_operation_layer_mode_get_affect_mask() and
friends to _get_affected_region().
2017-05-11 17:44:55 -04:00
Ell b5974d3457 app: make LCH lightness select-criterion faster
babl already has a faster path for getting L only, than going
through LCH.
2017-05-11 17:44:55 -04:00
Michael Natterer 465eba3260 app: factor out button-2-motion handling code in GimpDisplayShell
less code in the huge gimp_display_shell_canvas_tool_events().
Also fix the rotating cursor in gimp_display_shell_start_scrolling().
2017-05-11 21:31:41 +02:00
Michael Natterer 0c98028f3b app: don't hide the transformed layer for the flip tool
flip has no interaction.
2017-05-10 15:12:21 +02:00
Michael Natterer 5355fe15b4 app: GimpToolPalette: disconnect signals in dispose() not finalize() 2017-05-09 23:14:24 +02:00
Michael Natterer 70eff55215 configure.ac: require babl >= 0.1.27 and GEGL >= 0.3.15 2017-05-09 22:49:56 +02:00
Jehan a634e61bc0 app: change text tool font size default.
With bigger and denser default images, the older 18px font default is
very small (~ 4pt font at 300PPI).
I decided to settle for a 15pt font, i.e. 62 px at 300 PPI, which seems
like quite an acceptable relative size for our FullHD defaults.
It is bigger than a default font size for —say— a text processor, but
GIMP is not really designed to process large walls of small text anyway.
Rather shorter texts at bigger sizes (i.e. designs, etc.). So this seems
like quite an ok default.
Note that as any defaults, this only goes as far and won't be what most
people need most of the time anyway. But at least we should get rid of
this ridiculous 18px default.
2017-05-09 22:08:30 +02:00