Commit Graph

4854 Commits

Author SHA1 Message Date
Michael Natterer b4e5b4ae91 app: fix GimpRectangleOptions' packing after the GimpFrame change 2018-05-30 00:39:15 +02:00
Ell fdf330857b app: use gimp_wait() to wait for histogram in threshold and levels tools
In the threshold and levels tools, use gimp_wait() to wait for
histogram calculation to complete before applying auto-adjustment,
so that a message is displayed in the meantime.  Allow the
operation to be canceled, in which case we simply abort the auto-
adjustment, but let the histogram calculation continue.
2018-05-29 16:04:28 -04:00
Ell dd096d3ce5 app: show indication during font loading in text tool and font views
While fonts are loading, show a GimpBusyBox with an appropriate
message above the text tool options, and make the options
themselves insensitive, and in font views, such as in the fonts
dialog (through gimp_container_editor_bind_to_async_set(), added in
the previous commit).
2018-05-29 16:04:28 -04:00
Ell d5bc5cad45 app: disallow editing text layers while fonts are loading
We already avoid rendering text layers while fonts are loading,
showing an appropriate message, but this will soon be replaced with
waiting for the fonts to finish loading.

Instead, don't allow the text tool to start at all while the fonts
are loading (showing an appropriate tool message, and a BAD cursor
modifier), and halt the tool when reloading fonts if it's already
started.
2018-05-29 16:04:28 -04:00
Ell e2c56ef407 app: implement GimpWaitable and GimpCancelable in GimpAsync
Have GimpAsync implement the GimpWaitable and GimpCancelable
interfaces, added in the previous two commits, instead of providing
its own public version of the corresponding functions.

Add gimp_async_cancel_and_wait() as a convenience function for both
canceling an async operation, and waiting for it to complete.

Adapt the rest of the code to the change.
2018-05-27 13:17:24 -04:00
Ell cdd96059f7 app: port all interfaces to G_DEFINE_INTERFACE()
... instead of calling g_type_register_static() ourselves.
2018-05-27 05:56:34 -04:00
Ell 08ff2ac8c8 app: use gimp_gegl_buffer_copy() all over the place
Replace all uses of gegl_buffer_copy() in app/ with
gimp_gegl_buffer_copy(), added in the previous commit.
2018-05-25 08:12:27 -04:00
Michael Natterer f3f61379f7 app: remove the option to enable tearoff menus 2018-05-20 21:06:35 +02:00
Michael Natterer bdbec7941c Use the new macros from the last commit in all files
...and gone are the annoying warnings.
2018-05-20 21:06:34 +02:00
Michael Natterer cdb68d2351 app: undeprecate GimpLevelsTool
by using some semi-smart luminance magic to get a distinct color for
the alpha curve.
2018-05-20 21:06:34 +02:00
Michael Natterer 1d8696cd80 Get rid of gdk_flush() globally, use gdk_display_flush() 2018-05-20 21:06:34 +02:00
Simon Budig 4cac8373ff app/tools: fix the resize behaviour of the curves tool dialog. 2018-05-20 21:06:33 +02:00
Simon Budig 2fb681f582 app/tools: get rid of GtkTable 2018-05-20 21:06:33 +02:00
Simon Budig 0e819225d1 dialogs: some table->grid conversion in the item dialogs 2018-05-20 21:06:32 +02:00
Simon Budig 72e63887ba libgimpwidgets: convert GimpSizeEntry to a GtkGrid. 2018-05-20 21:06:32 +02:00
Michael Natterer 241af754b9 app: get rid of some GtkTables in tools/ 2018-05-20 21:06:30 +02:00
Michael Natterer f34b879a2d app: get rid of GtkHSeparator and GtkHScale 2018-05-20 21:06:30 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer 1b3135ca95 Get rid of using GtkMisc API globally 2018-05-20 21:06:30 +02:00
Michael Natterer 72bb4229fe app: port tools to GTK+ 3.0 (trivial changes only) 2018-05-20 21:06:26 +02:00
Michael Natterer 918f60836d Bug 796073 - Zero-size selections affect movement of pasted content...
...in weird ways

In gimp_rectangle_tool_button_press(), when the press triggers a
GimpEditSelectionTool operation (like moving a floating selection),
make sure we don't call COMMIT on a zero-size rectangle, because that
would get special treatment by commit(). Instead, CANCEL a zero-size
rectangle so stuff behaves as if it has never been there.
2018-05-15 23:59:05 +02:00
Ell 3c95928031 app: in GimpIScissorsTool, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Michael Natterer e9f2e82cff Bug 796071 - Clicking outside of a selection frame creates a new, ...
...zero-size selection

Make sure that clicking outside any selection halts the rectangle
select tool. This fixes ellipse select too.
2018-05-13 23:00:36 +02:00
Jehan 6a10ad3416 app: "validate" has the wrong meaning.
That was an obvious faux ami with French.
Status changed to "press Enter to refine", with the requirement of
staying not too long (this is a status message, not documentation), and
that also announces what will be the next step.
2018-05-13 21:53:25 +02:00
Michael Natterer 93064f4b2b app: formatting in gimpfreeselecttool.h 2018-05-13 21:46:37 +02:00
Jehan a89dc87aec Bug 795950 - Foreground selection tool requires use of the Enter key.
It is not obvious that you have to hit Enter to validate the first step
of Foreground Selection tool, i.e. the rough free selection. Adding this
information in status message.

Since Enter would only work once the free selection is closed or that
you have at least 3 points (then Enter closes the selection for you), I
also add gimp_free_select_tool_get_n_points() so that we can know how
many points were created from the Foreground Select tool, and only
update the status message when relevant.
2018-05-13 19:27:26 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Ell 49382e53d5 app: in GimpCurvesTool, calculate histogram asynchronously
In GimpCurvesTool, calculate the histogram of the target drawable
asynchronously, rather than synchronously, to avoid blocking the UI
while the histogram is calculated.
2018-05-11 14:01:42 -04:00
Ell b0ce645fe2 app: in GimpLevelsTool, calculate histogram asynchronously
In GimpLevelsTool, calculate the histogram of the target drawable
asynchronously, rather than synchronously, to avoid blocking the UI
while the histogram is calculated.
2018-05-11 14:01:42 -04:00
Ell 4af6fb5944 app: in GimpThresholdTool, calculate histogram asynchronously
In GimpThresholdTool, calculate the histogram of the target
drawable asynchronously, rather than synchronously, to avoid
blocking the UI while the histogram is calculated.

Additionally, fix the initial "low" threshold value for > 8bpc
images (127/255 => 0.5).
2018-05-11 14:01:42 -04:00
Ell cb045c3e63 Bug 795911 - GIMP crashed while I was undoing a gradient
In the gradient-tool editor, when responding to an endpoint size-
entry "changed" signal, make sure there is a selected handle, and
bail otherwise.  We can receive a "changed" signal without a
selected handle, if the endpoint is deselected while a change to
the size-entry's value is in progress, causing the the tool GUI to
be unmapped, and the changed value to be committed.
2018-05-08 11:42:42 -04:00
Ell 3d9bc96423 app: improve gimp_eraser_tool_is_alpha_only()
When in anti-erase mode, always return TRUE, since it's only
effective when the drawable has an alpha channel.

Also, remove an unnecessary #include in gimp_ink_tool.c.
2018-05-08 10:50:46 -04:00
Ell b775437561 app: #include "core/gimpdrawable.h" in gimperasertool.c
... for gimp_drawable_has_alpha().
2018-05-07 17:13:08 -04:00
Ell 1910ff8b1a app: warn when alpha-only painting has no effect
Add a GimpPaintTool::is_alpha_only() virtual function, which
subclasses can override to indicate whether painting only affects
the alpha channel (assuming FALSE by default).  Override the
function in Gimp{PaintBrush,Ink,Clone}Tool, returning TRUE when the
current paint mode only affects the alpha (as per
gimp_layer_mode_is_alpha_only(); see the previous commit,) and in
GimpEraserTool, returning TRUE when the target drawable has an
alpha channel.

When the function returns TRUE, and the target drawable doesn't
have an alpha channel, or the alpha channel is locked, show a BAD
cursor modifier, and raise an appropriate warning when attempting
to paint.
2018-05-07 16:53:29 -04:00
Ell f5ecc9f859 app, menus: add gegl:spherize to the menus 2018-05-06 07:13:08 -04:00
Ell cdd129110c app, menus: add gegl:recursive-transform to the menus 2018-05-06 07:13:00 -04:00
Ell 6be0bb1358 app: always set text-tool image when starting the editor
In GimpTextTool, when starting the editor in response to a button
press, always set the text tool's image first, so that the style
editor picks the correct resolution for the text-size entry.
Currently the image is only set when clicking inside the active
drawable's bounds.
2018-05-01 17:08:23 -04:00
Ell 151eeb9761 app: use gimp_item_{start,end}_transform() in GimpEditSelectionTool
... instead of gimp_item_{start,end}_move().

This should have been part of commit
37742a9fee.
2018-04-29 08:30:37 -04:00
Ell 741c78ec9e app: serialize "draw mask" option of region-select tools 2018-04-29 07:21:07 -04:00
Michael Natterer a44e1500fa app: fix rectangle select tool cursor after committing/halting
gimp_rectangle_select_tool_cursor_update(): always set a cursor and
cursor modifier even if no GimpToolRectangle widget exists, so we are
not stuck with the last set cursor after committing or halting the
tool.
2018-04-26 13:00:18 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Ell 5970046e25 app: use gradient cache for conical gradients
Add gimp_drawable_gradient_adjust_coords(), which adjusts the
gradient segment coords according to the gradient type, so that, in
cases where the gradient span is unrelated to the segment length,
the gradient cache (in GimpOperationGradient) is big enough not to
produce banding.  Use the new function in gimp_drawable_gradient()
and in the gradient tool, instead of duplicating the logic.

Move the shapreburst coordinate-adjustment logic to the new
function, and add appropriate logic for conical gradients.

Remove the code that avoids using the gradient cache for conical
gradients from GimpOperationGradient.
2018-04-25 14:05:19 -04:00
Ell 45be8b2591 app: use paint composite-mode, instead of AUTO, in more places
In the various types of fill operations, and in fade operations,
use the paint composite-mode of the current paint mode, which is
the composite mode we use during painting, instead of AUTO, which
results in the default mode we use for layer compositing.  This
effectively means that filling using any non-legacy, non-
subtractive mode can paint over transparent areas, rather than
being limited to nontransparent areas.
2018-04-25 11:20:48 -04:00
Michael Natterer 8696c05855 app: disable the "Use Applicator" toggle in paint options 2018-04-25 00:55:41 +02:00
Michael Natterer 8d54476457 Bug 795493 - Warning when removing a text layer
In gimp_text_tool_connect(), when auto-removing empty text layers upon
text layer or tool change, make sure we don't try to remove a layer
that has already been removed, which can happen if this function is
reached *because* somehow the layer was removed externally (e.g. by
the user in the layers dialog).
2018-04-24 02:49:03 +02:00
Ell ee7554678e Bug 795369 - crop tool not changing from landscape to portrait ...
... when using default aspect ratio

The call to
gimp_{crop,rectangle_select}_tool_update_option_defaults() when
starting the crop/rectangle-select tools seems to no longer be
necessary, while it overrides user modification to the default
ratio's landscape/portrait orinetation (which only really matters
for the crop tool, since the rectangle-select tools' default ratio
is 1:1).  Fix this by simply removing the call.
2018-04-19 15:54:42 -04:00
Ell 187f2b4453 app: #include <string.h> in tool_manager.c
For strcmp() and strlen().
2018-04-19 14:52:54 -04:00
Michael Natterer 428110f63f app: remove non-cut/copy/paste functions from gimp-edit.[ch]
Move them to the new files gimpdrawable-edit.[ch] and
gimpimage-fade.[ch].
2018-04-18 23:48:33 +02:00
Ell 542a04735b app: fix airbrush periodic stamp behavior
Commit ddfc7715cb changed the
airbrush periodic stamp behavior, so that instead of using the main
brush, it issued a full MOTION event, potentially using a different
brush when using a GIH brush.

Fix this, by renaming the "timeout" signal of GimpAirbrush to
"stamp", and by adding a new gimp_airbrush_stamp() function, which
should be used for painting the periodic airbrush dab in response,
instead of calling gimp_paint_core_paint() directly, and which
calls gimp_airbrush_paint() instead, as the old code did.

In order to call this function from the paint thread, we replace
the various gimp_paint_tool_paint_core_foo() functions, introduced
in the above commit, with a generic gimp_paint_tool_paint_push()
function, which takes a callback (and a data pointer) to run on the
paint thread, and queues it for execution (when not using the paint
thread, the function is called directly from the calling thread.)
2018-04-18 14:50:57 -04:00
Michael Natterer ce8c4cb2a0 Bug 795288 - Layer is moved by arrow keys even after all locks...
...(Pixel, Position and Size, Alpha Channel) are enabled.

gimp_edit_selection_tool_translate(): add checks for locks and bail
out with a message if the item is NULL or locked.

gimp_move_tool_button_press(): refactor NULL and lock checks to look
more like the new code added above, and also check "lock-content" of
channels and masks: moving them changes their pixels.
2018-04-18 20:41:54 +02:00