Commit Graph

21087 Commits

Author SHA1 Message Date
Michael Natterer 9244cbe898 app: port GimpOverlayChild to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer f5c3bb00c2 app: remove call to gtk_widget_style_attach() from GimpOverlayBox 2018-05-20 21:06:28 +02:00
Michael Natterer 1cd367845d app: port GimpColorFrame away from GtkStyle, using a new style property 2018-05-20 21:06:28 +02:00
Michael Natterer dfa38fc26a app: remove obsolete device checks from GimpToolbox
The new code doesn't actually work properly, but the old one was
clearly bogus with GTK+ 3.x.
2018-05-20 21:06:28 +02:00
Michael Natterer 912128fe2e app: when checking for a device change, check the event's source device
because the events we receive always come from either master or
floating devices, but never from a slave source device.
2018-05-20 21:06:28 +02:00
Michael Natterer 9c9ba4895d app: always ask the master device for its axes or state 2018-05-20 21:06:28 +02:00
Michael Natterer 5d1ab3e5f9 app: port GimpTagEntry to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 74564dfef3 app: port GimpHistogramView to GtkStyleContext
Locally added shade() and mix() utility functions which use
GtkSymbolicColor. Will move them to a better place once they are
needed elsewhere.
2018-05-20 21:06:28 +02:00
Michael Natterer f3d65fdb59 Implement GtkWidget::style_updated() instead of ::style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer dcb991c6c7 app: port GimpThumbBox to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer afaa31bb33 app: use gtk_widget_override_font() instead of modify_font() 2018-05-20 21:06:28 +02:00
Michael Natterer dada25b14e app: port GimpToolEditor to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3b37a7a1c8 app: port GimpDockWindow to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3374e32264 app: port GimpPaletteView to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 132485779e app: port GimpStrokeEditor to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 72ad56006b app: don't use style->black and style->white 2018-05-20 21:06:28 +02:00
Michael Natterer 86603f30b9 libgimpwidgets: move all GimpColorSelection members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 0e35af2723 libgimpwidgets: move all GimpColorNotebook members to a private struct. 2018-05-20 21:06:28 +02:00
Michael Natterer c32681f4c3 libgimpwidgets: move all GimpColorDisplayStack members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer aedd3e43de app: port GimpScaleButton to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer da0e45db60 app: port GimpOverlayFrame to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 4a677c52fb app: port GimpOverlayBox to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3b8bcb1e4d app: use gtk_menu_shell_get_selected_item() 2018-05-20 21:06:28 +02:00
Michael Natterer ce2cd374ee Replace gdk_cursor_unref() with g_object_unref() 2018-05-20 21:06:28 +02:00
Michael Natterer 8c975484ab app: check whether child widgets exist in GtkWidget::style_updated()
because it is emitted repeatedly during widget construction, when not
everything is in place yet.
2018-05-20 21:06:28 +02:00
Michael Natterer 19528a61fe app: copy gimp.css instead of gtkrc to the user's gimp directory
Also, don't migrate gtkrc files from older gimp versions.
2018-05-20 21:06:28 +02:00
Michael Natterer af1bb43f37 Port theme and gtkrc file loading to CSS files using GtkCssProvider 2018-05-20 21:06:28 +02:00
Michael Natterer e713ad4a43 app: implement GtkWidget::style_updated() instead of style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer ad7fe94d86 app: use gdk_drag_context_get_selected_action() instead of conect->action 2018-05-20 21:06:28 +02:00
Michael Natterer cfbec6b311 app: use gdk_drag_context_get_source_window()
instead of peeking into the struct
2018-05-20 21:06:28 +02:00
Michael Natterer de225a74a2 app: port the about dialog to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 1d304ea273 app: s/gtk_widget_modify_font/gtk_widget_override_font/ 2018-05-20 21:06:27 +02:00
Michael Natterer eb312ed55a app: remove calls to gtk_widget_get,set_extension_events() 2018-05-20 21:06:27 +02:00
Michael Natterer 084a01abfe app: port GimpDashEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 2c10a7c95a app: port GimpContainerBox to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 72d90394f5 app: port gimp_get_icon_size() to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer f69ca15573 app: port GimpFgBgView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer f21ad702a2 app: port GimpFgBgEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer a142c8916c app: port GimpComponentEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 200dbf96ce app: port GimpColormapEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 1138846d4e app: port GimpContainerTreeView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer ed1d57a882 app: port GimpContainerIconView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 5c6d52c5f3 app: port GimpPanedBox to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 5b3e3023cd app: port setting the canvas padding color to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 2200ca2371 app: port GimpBlobEditor to GtkStyleContext
Also, add prelighting for the handle.
2018-05-20 21:06:27 +02:00
Michael Natterer 9e7d1206ac app: change the list of available devices to something that makes sense
Include the client pointer, its slaves, and all floating devices.
2018-05-20 21:06:27 +02:00
Michael Natterer fc440cc4d0 app: port the device sort function to GdkDeviceManager
Also make sure we don't pass around uninitialized keyvals and
modifiers of device keys.
2018-05-20 21:06:27 +02:00
Michael Natterer 9c84e15484 app: put the toolbox' areas into a box until we decided about a wrapping widget 2018-05-20 21:06:27 +02:00
Michael Natterer de3bd90f9a app: introduce struct GimpDeviceKey because GdkDeviceKey is gone 2018-05-20 21:06:27 +02:00
Michael Natterer 0f90d95ab4 app: use GdkDevice accessors 2018-05-20 21:06:27 +02:00
Michael Natterer 898df1c5c3 app: implement proper height-for-width in GimpToolPalette 2018-05-20 21:06:27 +02:00
Michael Natterer b9cfa11205 app: skip keyboard devices so the device list becomes reasonable 2018-05-20 21:06:27 +02:00
Michael Natterer 8c3a0d17f4 app: port GimpSpinScale to GTK+ 3.0 2018-05-20 21:06:27 +02:00
Michael Natterer 64cde17687 app: don't connect to "size-requst" because that's deprecated
Instead, connect to "style-set" and calculate the widget's size
request there. Also fix the label's offsets after whatever GTK+ text
drawing changes.
2018-05-20 21:06:27 +02:00
Michael Natterer ef80e1755c app: port GimpOverlayBox to GtkWidget::get_preferred_width/height() 2018-05-20 21:06:27 +02:00
Michael Natterer 4085ad0cbc app: fix GimpOverlayDialog's minimum height
and avoid some code duplication by using the parent class' size
negotiation code.
2018-05-20 21:06:27 +02:00
Michael Natterer 20627342ac app: port to the new size request API 2018-05-20 21:06:27 +02:00
Michael Natterer 2ffda5a25d app: remove GtkWrapBox 2018-05-20 21:06:27 +02:00
Michael Natterer 76d15851b1 app: port the colormap editor to GTK+ 3.0 2018-05-20 21:06:27 +02:00
Michael Natterer 1a82e4adce app: add ugly workaround to make the icon view adapt to view size changes 2018-05-20 21:06:27 +02:00
Michael Natterer 08cb6022c7 app: cairo_save()/restore() around chaining up in draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 23e3ae8fbe app: use the new GtkScrollable API instead of deprecated tree view API 2018-05-20 21:06:27 +02:00
Michael Natterer 707131f695 app: GtkEntry turned into a no-window widget
Therefore, use the new get_area() functions to figure where to draw
from instead of the removed get_window() ones. Also adjust the tag
popup positioning code accordingly.
2018-05-20 21:06:27 +02:00
Michael Natterer 3b784075f3 app: port to GtkWidget::draw() 2018-05-20 21:06:27 +02:00
Michael Natterer c3b7cee99b app: forgot to remove a cairo_destroy() in draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 5f2034451b app: port to GtkWidget::draw() 2018-05-20 21:06:27 +02:00
Michael Natterer fd7551bc19 app: don't translate to allocation.x,y 2018-05-20 21:06:27 +02:00
Michael Natterer b85f40b815 app: remove GimpContainerGridView from the build entirely
but leave it in the tree as reference for the time being.
2018-05-20 21:06:27 +02:00
Michael Natterer 5d2b26a101 app: port popup arrow drawing to cairo and get rid of the arrow_pixbuf 2018-05-20 21:06:27 +02:00
Michael Natterer 1e8b020ac7 app: passing -1 as width/height to gtk_paint_box() no longer works 2018-05-20 21:06:26 +02:00
Michael Natterer 40b9ba002a app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 27df9b617a app: didn't completely commit the display shell expose() -> draw() change 2018-05-20 21:06:26 +02:00
Michael Natterer 86e033d495 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer f8ef0c71c2 app: can't set the scale combo entry's properties in init() any longer
Set them in constructed() instead.
2018-05-20 21:06:26 +02:00
Michael Natterer 1812012d59 app: port to GtkWidget::draw() but disable the code inside with #if 0 2018-05-20 21:06:26 +02:00
Michael Natterer 6494894334 app: port the tag entry to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer a0a303bb42 app: remove call to gtk_statusbar_set_has_resize_grip() 2018-05-20 21:06:26 +02:00
Michael Natterer 9dfc455c12 app: port to GtkWidget::draw() (incompletely) 2018-05-20 21:06:26 +02:00
Michael Natterer 672e297219 app: use the container icon view, the grid view is not GTK+ 3.0-able 2018-05-20 21:06:26 +02:00
Michael Natterer 4ca9a5b33f app: port the overlay stuff to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer bfa8831d62 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer bb6c901364 app: port the splash to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 00cde1a499 app: remove calls to colormap functions, they are gone 2018-05-20 21:06:26 +02:00
Michael Natterer 2a01159f0e app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 172f607ac5 app: use GdkDeviceManager to list devices 2018-05-20 21:06:26 +02:00
Michael Natterer 27659afa7c app: pass the cairo_region_t to gdk_window_invalidate_region() directly 2018-05-20 21:06:26 +02:00
Michael Natterer c7baa65843 app: s/GtkObject/GtkAdjustment/ in app/dialogs/ 2018-05-20 21:06:26 +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 df65b0bdcd app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer e888be6a9a app: port GimpScalComboBox to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 3c8d9a1de8 app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer 1a04428815 app: remove obsolete (GtkObject **) casts 2018-05-20 21:06:26 +02:00
Michael Natterer 5c720fa886 app: port device management to GdkDeviceManager 2018-05-20 21:06:26 +02:00
Michael Natterer 00b207a8d8 app: port call to gtk_paint_arrow() to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 04961e056d app: no need to alloc colors any longer, GdkColormap is gone 2018-05-20 21:06:26 +02:00
Michael Natterer bb3a98dab7 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 99133bc271 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer b16a564fd5 app: port GimpPaletteView to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer c872dfb140 app: port GimpNavigationView to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 0ba456bbd0 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 232a168785 app: s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer 8f8d62167d app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 691069947f app: port to GtkWidget::draw() and s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer 18feaf6ce1 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 94f1e6800d app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 04e9734685 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 5ddb81272f app: port virtual functions to GTK+ 3.0 API 2018-05-20 21:06:26 +02:00
Michael Natterer 942eb89f19 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 8c0265c525 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 94d19047ac app: remove GTK_OBJECT() cast 2018-05-20 21:06:26 +02:00
Michael Natterer ace9ed91cb app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer bb0eb4a7c3 Revert "app: Fix on canvas widgets ignoring clicks from tablets - bug 614441"
This reverts commit a059c0e7eb.
2018-05-20 21:06:26 +02:00
Michael Natterer dbd9797a13 Switch to version 2.99/3.0 in a lot of places and depend on GTK+ 3.22
and lots of other newer libraries.
2018-05-20 21:06:26 +02:00
Michael Natterer 4591452007 app: remove the gimp-2-6 session compatibility test
It was unreliable and a huge pain, and 2.6 is really old shit.
2018-05-20 20:02:13 +02:00
Michael Natterer 68c774daab app: also special-case "undo-size" when generating default docs
and hardcode it to "1g", so properties of the dist machine don't leak
into the tarball.
2018-05-20 18:43:03 +02:00
Michael Natterer 9ebf36f873 configure.ac: require babl >= 0.1.50 2018-05-20 15:24:33 +02:00
Michael Natterer 5a6b00ea86 Revert "depend on babl-0.1.50"
This reverts commit 0aec661cda
which accidentially deleted the start of configure.ac
2018-05-20 15:23:23 +02:00
Øyvind Kolås 0aec661cda depend on babl-0.1.50 2018-05-20 10:56:36 +02:00
Michael Natterer 1d3bd593c1 app: nobody knows why this is needed, move along 2018-05-20 02:36:31 +02:00
Michael Natterer 2439ae3acf app: add new action "view-scroll-center" with shortcut Shift+J
The zoom focus discussion on IRC suggests that everybody is annoyed
about centering behavior (or lack thereof), so here is a way to
explicitly center the image witout zooming.
2018-05-19 18:06:49 +02:00
Michael Natterer ef2cf21f10 Bug 796252 - Mouse wheel zooming should center on cursor...
... _even at low zoom levels_

Pass GIMP_ZOOM_FOCUS_POINTER to gimp_display_shell_scale() when
wheel-scrolling, and change the scaling code to really honor
GIMP_ZOOM_FOCUS_POINTER and not apply magic image centering.

This keep the same point centered under the mouse for wheel-scrolling
and the zoom tool (== when the zooming is really triggered at a
certain mouse position).
2018-05-19 15:24:52 +02:00
Ell 25490b0251 app: implement GimpPickable::get_pixel_average() in various classes
Implement GimpPickable::get_pixel_average(), added in the previous
commit, in GimpDrawable, GimpImage, and GimpProjection, using
gimp_gegl_average_color(), added in the commit before last.  This
is significantly faster than the default implementation.
2018-05-18 15:07:32 -04:00
Ell b98a04aadc app: add GimpPickable::get_pixel_average() vfunc
... which calculates the average color of the pickable over a given
area.  Use this function in gimp_pickable_pick_color() when
sample_average is TRUE, and provide a default implementation which
calculates the average color using GimpPickable::get_pixel_at(), as
gimp_pickable_pick_color() did before.

The default implementation is rather slow; classes that implement
the GimpPickable interface can provide a faster specialized version
(see the next commit).
2018-05-18 15:07:32 -04:00
Ell d272368251 app: add gimp_gegl_average_color()
... which takes a GeglBuffer and calculates the average color over
a given area.
2018-05-18 15:07:32 -04:00
Øyvind Kolås 580576e702 configure/app: depend on GEGL 0.4.2 2018-05-16 23:26:44 +02:00
Michael Natterer 64954afa4b app: don't use the user context in GimpDeviceEditor's container view
GimpDeviceInfo is a GimpToolPreset now, and using the user context
would cause the device info selected in the dialog to be set globally
as tool preset. Use a temporary context instead, the container view
just needs it because.
2018-05-16 22:41:12 +02:00
Ell 23dab4311a Bug 796153 - Airbrush doesn't paint on timeout, and crashes with dynamics
gimp_airbrush_stamp(), which is called during the airbrush timeout
to periodically stamp the airbrush, assumes the saved symmetry's
origin is the same as during the original call to
gimp_airbrush_paint().  However, since commit
bc09c71818, we clear the symmetry's
origin at the end of gimp_paint_core_paint(), resulting in an empty
symmetry with a NULL origin during gimp_airbrush_stamp().  As a
result, no dab is painted, and we segfault if there's active
dynamics.

Fix this by saving the symmetry's origin coords during
gimp_airbrush_paint(), and restoring them in gimp_airbrush_stamp().
2018-05-16 14:40:48 -04:00
Michael Natterer 320d23f964 app: make sure all devices loaded from devicerc have tool options
We rely on GimpDeviceInfo's tool-options being non-NULL, so make sure
this is the case and fix NULL options with the current tool's options
after loading devicerc.
2018-05-16 20:07:26 +02:00
Michael Natterer 2f629072f1 Bug 787919 - Tool options are lost when switching device
GimpDeviceInfo is the only way to store per-device settings like
color, brush etc. It used to be derived from GimpContext and therefore
limited to the context's properties, causing everything else (all
tool-individual options) to be lost on device change.

Derive it from GimpToolPreset instead, so it's capable of storing
arbitrary tool options.

Adapt things to the new class hierarchy and add a bunch of signal
handlers that make sure the active device's GimpDeviceInfo is updated
properly when the tool changes. Also change device switching
accordingly.

Change GimpDeviceStatus to only show the stuff that is relevant to
each device's tool.

And various small changes to make things work properly...
2018-05-16 02:09:19 +02:00
Michael Natterer d6e0ca5054 Bug 796090 - (wrong) true-color preview of GEGL filter ops, ...
...like gaussian blur in indexed mode

In GimpDrawable's source node, after the filter stack, insert a node
that converts the pixels back to the drawable's format if the drawable
is indexed.
2018-05-16 02:09:19 +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
Øyvind Kolås 55429df954 configure/app: depend on babl-0.1.48 2018-05-15 21:50:45 +02:00
Ell 5c7064fb9f app: make gimp-atomic parameters volatile 2018-05-15 12:58:38 -04:00
Ell 03141fc30a app: don't use mask sampler in gimp_pickable_contiguous_region_by_seed()
In gimp_pickable_contiguous_region_by_seed(), use gegl_buffer_get()
to sample the mask buffer, instead of using a sampler.  The sampler
is created at the beginning of the operation, and is subsequently
used after modifying the mask buffer, which should be avoided,
since the sampler may return outdated cached data.
2018-05-14 03:12:40 -04:00
Jehan 20f20dd7b1 configure, app: encourage packagers to set custom bug tracker.
We get a lot of packaging bugs for third-party builds in our tracker,
especially since our debug tool now opens directly our bug tracker.
It would be preferred if third-party packagers were to make a first
filtering of bugs and only reported once they knew for sure that the bug
is in core code, and not in packaging.

Our configure script will now propose a --with-bug-report-url option
allowing to set a different web address. This address will be the one
opening in the debug dialog.
2018-05-14 05:44:06 +02:00
Ell a6bee79e0d app: in gimp_pickable_contiguous_region_by_seed(), use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell 3c95928031 app: in GimpIScissorsTool, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell b7d95ad503 app: in GimpOperationCageTransform, use sampler object ...
... instead of gegl_buffer_sample()

GEGL commit 26f13cbfe9aaaa8c176162e54fdbb8af6876538e got rid of the
per-buffer cached samplers, making gegl_buffer_sample() much more
expensive, suitable primarily for one-off samples.

Use a sampler object instead.
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
Ell b296496a65 app: in gimp_atomic_slist_pop_head(), don't warn on empty list
Allow trying to pop the head of an empty GSList, and just return
NULL.
2018-05-13 15:33:15 -04:00
Ell 5b7806e13c app: in GimpHistogramEditor, clear update timeout after validating
In gimp_histogram_editor_validate(), clear the update timeout, so
that if we validate the histogram before the timeout (in
particular, if editor->histogram itself is clear) we don't end up
unnecessarily re-validating it at the timeout.
2018-05-13 15:21:28 -04:00
Ell 5ed79b65bb app: in GimpHistogram, parallelize histogram calculation
Use gimp_parallel_distribute_area() to parallelize the histogram
calculation, which seems to scale very well.
2018-05-13 15:21:28 -04:00
Ell 398474ff58 app: add gimp-atomic
... which provides a set of higher-level lock-free atomic
operations.

Currently, the only two operations are
gimp_atomic_slist_push_head() and gimp_atomic_slist_pop_head(),
which atomically push/pop the first element of a GSList.
2018-05-13 15:21:28 -04:00
Ell 16a24ff081 app: various GimpAsync improvements
Code cleanup.

Improve function descriptions.

Improve function precondition checks.

Make sure the main thread is properly synced with the async thread
before calling the completion callbacks in the idle function.

Guarantee that all callbacks are called in FIFO order, even
callbacks added during the execution of other callbacks.
2018-05-13 15:21:28 -04: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
Ell 4c767b4f03 app: fix gimp-parallel shutdown
Some leftover from an earlier version.  Caused gimp_parallel_exit()
to hang, although we could only notice that in GIMP_UNSTABLE
builds.
2018-05-13 11:55:16 -04:00
Michael Natterer 5b2dd00fab app: put the call to gimp_gui_ungrab() back in gimp_eek()
It got lost while improving our error handling.
2018-05-13 13:49:33 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Ell 1139c00721 app: in GimpHistogramEditor, avoid calculating histogram of detached layers
... which results in CRITICALs.  This can evidentially happen during
gimp_image_remove_layer() under certain circumstances (see comment
in the patch.)
2018-05-12 09:29:11 -04:00
Ell d5b0b08431 app: cancel async histogram calculation in gimp_histogram_clear_values()
Cancel any on-going asynchronous histogram calculation, started
through gimp_histogram_calculate_async(), upon calling
gimp_histogram_clear_values().
2018-05-12 09:29:11 -04:00
Ell 729240db34 app: improve GimpAsync description 2018-05-12 09:29:11 -04:00
Ell 44ffbe74df app: always update GimpHistogramView bins when changing histograms
... and not only when histogram != NULL, since the bin count may
change in either case.
2018-05-11 21:42:56 -04:00
Ell 4ad72cfc77 app: connect GimpHistogramView to bg-histogram "notify" signal
In GimpHistogramView, connect the view to the bg-histogram's
"notify" signal, and update the view in response.  Previously, we
only updated the view in response to the main histogram's "notify"
signal.

The curves tool only uses the bg-histogram, and after the switch to
asynchronous histogram calculation, in commit
49382e53d5, it failed to update the
histogram view after the calculation was complete.
2018-05-11 21:31:16 -04: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 d0b7fe6f52 app: in GimpHistogramEditor, calculate histogram asynchronously
In GimpHistogramEditor, calculate the histogram of the active
drawable asynchronously, rather than synchronously, to avoid
blocking the UI (and the execution of PDB calls) while the
histogram is calculated.  For large images, this can notably
improve responsiveness, as well as plug-in execution speed, while
the histogram dialog is mapped.
2018-05-11 14:01:42 -04:00
Ell 1923fa8b44 app: add gimp_drawable_calculate_histogram_async()
... which is similar to gimp_drawable_calculate_histogram(),
calculating the histogram asynchronously on a separate thread.

Note that when calculating the histogram of the drawable's source
node, the node is rendered synchronously on the main thread (if
necessary), and the histogram of the result is calculated
asynchronously on a separate thread.
2018-05-11 14:01:42 -04:00
Ell 9ea560d4a9 app: add gimp_histogram_calculate_async()
... which is similar to gimp_histogram_calculate(), calculating the
histogram asynchronously on a separate thread.
2018-05-11 14:01:42 -04:00
Ell 1b646804ea app: add gimp_parallel_run_async()
... which runs a user-provided function asynchronously, returning a
corresponding GimpAsync object.  This can be used to execute code
off the main thread, using the GimpAsync object to synchronize as
necessary.

Note that while the code allows for running multiple asynchronous
functions in parallel in a thread pool, we currently limit the pool
to a single thread, queueing overlapping async function, since we
have no use for parallel asynchronous functions at the moment.
2018-05-11 14:01:42 -04:00
Ell e1d15feff7 app: add GimpAsync
GimpAsync represents an asynchronous task, running without blocking
the main thread.  It provides functions that allow waiting for
completion, queueing completion callbacks, and requesting
calcelation.  See the code for more details.

The interface and the implementation are intentionally limited for
the time being, to keep things simple, and are geared toward
asynchronous tasks executed on a separate thread (see the next
commit).  The public interface is relatively general, however, and
we may extend the implementation to support other kinds of tasks at
some point, who knows...
2018-05-11 14:01:42 -04:00
Jehan 66db143502 Bug 796014 - Cannot open some older .xcf files made with 2.8.22 in 2.10.
To avoid an infinite loop, gimp_item_linked_is_locked() was temporarily
unlinking items before calling gimp_item_is_position_locked(). This
worked only based on gimp_item_real_is_position_locked() code which
called gimp_item_linked_is_locked() only when it was linked. It did not
take into account the fact that it was an abstract method which could
have other implementations. In particular the group layer implementation
would call in turn gimp_item_is_position_locked() on each child layer.

Basically temporarily unsetting the link was anyway a very ugly hack.
The point is simply that we are only interested by the value of the
`lock_position` flag for this item, without further "intelligence". For
this, use gimp_item_get_lock_position() instead.
2018-05-11 18:04:31 +02:00
Michael Natterer f741cacc28 app: fix last commit: identify displays by name not by pointer
Not so sure any more this belongs here at all, but it doesn't hurt
either...
2018-05-10 17:32:58 +02:00
Michael Natterer 3ced1e18f4 app: fix GimpDeviceManager to not add the same display twice
Displays can be opened multiple times, which caused the device manager
to try to add their devices multiple times (which gets prevented with
warnings), and then remove the devices prematurely when the
multiple-opened display gets closed the first time (which is even
worse).

Add a simple hash that keeps track of how often displays are open, and
only add/remove their devices on first open and last close.

This actually happened with gtk-inspector on the gtk3-port branch, but
there is no reason this can't also happen in stable.
2018-05-10 14:18:59 +02:00
Jehan 962b8496fc Bug 795899 - "Some fonts failed to load" error when missing fonts/...
... directory in the configuration folder.
This subfolder should have been created already. Just in case it is not
(for any reason), just recreate it rather than popping up an error.
2018-05-09 14:27:22 +02:00
Michael Natterer 0d74264c4d app: rename argument in gimpprefsbox.h too 2018-05-09 13:54:16 +02:00
Michael Natterer 384b116c15 app: clean up GimpPrefsBox and the prefs dialog a bit
Better API for getting properties of the current page, add missing
help IDs, fix the icon of the resolution calibrate dialog, ...
2018-05-09 01:47:23 +02:00
Michael Natterer fa0a02125c app: make the splash texts dynamic, so they are larger on larger splashes
and position the lower text roughly in the middle between the upper
text and the progress bar. This gives better spacing that the previous
logic.
2018-05-08 22:54:53 +02: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 bc09c71818 Bug 795909 - Multiple images opened with floating selection ...
... closing one of them crashes GIMP

GimpSymmetry keeps a strong reference to the drawable passed to
gimp_symmetry_set_origin() until the next call to set_origin(), or
until it's destroyed.  This can unnecessarily extend the lifetime
of the drawable.  In particular, it can extend the lifetime of a
floating selection past the destruction of the image mask, during
image destruction, which results in a NULL mask pointer in
gimp_layer_invalidate_boundary(), called when detaching the
floating selection as part of its destructor.

Add gimp_symmetry_clear_origin(), which clears the origin set using
gimp_symmetry_set_origin(), dropping the reference to the drawable,
and call it in gimp_paint_core_paint() after painting.  This avoids
extending the lifetime of the drawable, and fixes the bug.
2018-05-08 10:22:46 -04:00
Ell 084cbc3102 app: fix pass-through group histograms (proactively)
In gimp_drawable_calculate_histogram(), when including the
drawable's filters in the histogram (i.e., when calculating the
histogram of the drawable's source node, rather than its buffer),
if the drawable is a projectable, call
gimp_projectable_{begin,end}_render() before/after calculating the
histogram, respectively.  This is necessary for pass-through
groups, whose {begin,end}_render() functions disconnect/reconnect
the group's backdrop from/to the group's layer stack.  If we fail
to do this, the backdrop is erroneously included in the histogram.

Note that currently layer groups can't have any filters applied to
them, so we never run into this situation, but once we have non-
destructive editing we probably will.
2018-05-08 03:43:49 -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 2c58598172 app: add gimp_layer_mode_is_alpha_only()
... which determines if a layer mode's blend function only affects
the alpha, maintaining the backdrop's color.  This is currently
true only for ERASE, SPLIT, and ANTI_ERASE modes.
2018-05-07 16:53:29 -04:00
Ell 2e68088c35 app: use gimp:normal instead of gegl:over in gimp_gegl_apply_cached_operation()
When the operation doesn't have an input pad, composite it over the
input using gimp:normal, instead of gegl:over, for consistency with
the rest of our compositing code (although the result should be the
same).
2018-05-07 14:38:53 -04:00
Ell f3febfe343 Bug 795866 - Transparent gradient on transparent layer ...
... drifts/sharpens when applying additional gradients

In GimpDrawableFilter, don't use gegl:over for operations without
an input pad, since this only works if the filter's mode is
REPLACE.  If the filter's mode is different, in particular, if it's
NORMAL, we end up compositing the operation's output against the
input twice: once in gegl:over, and again in the filter's
applicator.  Notably, this happens for the gradient tool.

Instead, revert commit 5b80d3d3be
(with some additions to avoid constructing unnecessary nodes when
the operation has no input) and simply change the applicator's mode
to NORMAL if the oepration doesn't have an input, and the filter's
mode is REPLACE.
2018-05-07 14:35:40 -04:00
Michael Natterer 7e1df2c8c6 app: add layers/channels/vectors freeze/thaw to gimpplugin-cleanup
so plug-ins cannot thaw what they haven't frozen, and the code
can clean up frozen stuff left behind by crashed or broken plug-ins.

Also redo the cleanup code so it only keeps track of the undo group
counts and freeze counts of what *this* GimpPlugInProcFrame did
itself. That should make it even stricter against broken code that
could mess up internals.
2018-05-07 20:09:07 +02:00
Michael Natterer d87259ccf9 app: fix gimp_gegl_apply_operation() for source OPs
Blend them on top of the source buffer using gegl:over like
GimpDrawableFilter does interactively. Fixes "Repeat Last" and
probably some other stuff for source OPs.
2018-05-07 14:26:26 +02:00
Michael Natterer 29cf157f69 app: add +gimp_container_freeze_count() which returns the freeze_count 2018-05-07 10:25:45 +02:00
Michael Natterer 1950eda8ab app: fix rendering of the bg_histogram in GimpHistogramView
gimp_histogram_view_draw_spike(): we were shifting the bg_histogram to
the right by accidentially offsetting the 'i' variable, use a local
variable for the loop instead.
2018-05-07 10:17:19 +02:00
Ell 40e3406b91 pdb: add gimp-image-{freeze,thaw}-{layers,channels,vectors}
These procedures freeze/thaw the corresponding containers of the
image, allowing plug-ins that perform many changes affecting any of
these containers to suppress updates to the corresponding dialogs,
significantly improving performance.
2018-05-07 02:56:10 -04:00
Ell 88c63420e8 app: ignore gimp_container_view_{select,activate,context}_item() ...
... while the container is frozen

In GimpContainerView, do nothing in response to a
gimp_container_view_{select,activate,context}_item() call while the
view's container is frozen.  While the container is frozen the view
is empty, and these functions can segfault.
2018-05-07 02:56:10 -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
Jehan 33a92e2447 app: get rid of gimp_get_backtrace().
It is not used anywhere anymore and can be replaced by the more powerful
gimp_stack_trace_print() (which can also allocate a string containing
the backtrace, hence is a proper replacement call).
2018-05-05 20:18:25 +02:00
Jehan 47a036f750 Bug 795814 - Error saving VERY large file.
g_alloca() is not very advisable, especially when it might be used to
allocate a big chunk of memory at once. It is better to allocate dynamic
memory with malloc(), or in particular with g_try_malloc() which won't
abort the program on failure.
This might be slightly slower (one of the advantages of memory on the
stack, though not even an absolute truth) but probably not by much, if
at all, and it's better to be safe anyway.
2018-05-05 20:13:27 +02:00
Jehan 98a575370c app: add a check on not-NULL string before g_utf8_validate().
Still looking for possible crash case during gimp_font_list_load_names()
(cf. bug 795650). g_utf8_validate() segfaults if called with NULL.
Though looking at pango_font_description_to_string() implementation, it
doesn't look like it would ever return NULL. Yet it is worth
double-checking. We don't load font every second anyway.
2018-05-05 15:55:30 +02:00
Jehan d58f131b59 Bug 795650 - Gimp crashes on start in Windows.
Add more assertion checks (similar to commit d094ab7e56).

This is still not a fix per-se, but at least would make the code a bit
more robust. In particular FcObjectSetDestroy() could crash if somehow
FcObjectSetBuild() had returned a NULL pointer. And obviously
dereferencing a NULL fontset would crash as well.
Now if any of these happened, no fonts would be loaded. But at least
GIMP would not crash.
2018-05-05 15:26:26 +02:00
Ell 07c81abf01 app: fix propgui random seed generation
After the switch of random-seed properties from INT to UINT, their
upper bound results in a negative value when converted to a
gint32, causing a CRITICAL in the call to g_random_int_range().
Use g_random_double_range() instead, which has enough precision to
accurately represent all values in the range, and round the result.
2018-05-04 13:41:55 -04:00
Michael Natterer 48f6d1b8ee app: avoid scaling GimpCanvasArc to zero, it causes a non-invertable matrix 2018-05-04 11:48:44 +02:00
Ell 2e643e6270 app: cleanly remove log handlers on exit
Remove the log handlers registered in errors_init(), in
errors_exit(), and call errors_exit() before destroying the Gimp
instance, since the log handlers depend on it.  This avoids
segfaulting if a message is logged after destroying the Gimp
instance.
2018-05-03 15:50:29 -04:00
Michael Natterer 62279047b1 Bug 795763 - Update gimp.org links to https://
Update links to https:// in "About". the "Help" menu, and several
user-visible error messages.
2018-05-03 00:27:29 +02: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
Jehan d094ab7e56 app: add some g_return_if_fail() in gimp_font_list_load_names().
Some crash happens inside this function (cf. bug 795650) on Windows.
Because of very inaccurate trace on this OS, it is hard to determine the
exact issue. Let's at least add some basic check on function parameters.
This won't fix any core issue, but may make things a bit more robust and
bugs easier to detect.
2018-05-01 03:41:37 +02:00
Jehan e796e3a50a app: popup error at startup when some fonts fail to load.
As proposed on IRC. This will allow people to debug their fonts (for
instance when there are permission issues or whatnot) by knowing the
list of problematic fonts in an error dialog at startup (and not only on
terminal).
2018-05-01 03:25:58 +02:00
Jehan 55d1ea5cf0 app: check that the font path is not NULL.
This is for Windows where we apparently need to call
g_win32_locale_filename_from_utf8() before feeding the path to
FcConfigAppFontAddFile().
Unfortunately as we discovered earlier (cf. commit ba06a0fe86), this
can sometimes return NULL. So we absolutely need to check for the path
not being NULL first.
2018-04-30 22:05:11 +02:00
Jehan 69f864d5f5 app: use a GFileEnumerator to loop through font files. 2018-04-30 21:58:19 +02:00
Jehan 3de1f33702 app: font loading output a GError.
This GError will either specify the font which failed to load (if
unique) or a vague message about fonts which fail to load.
Unfortunately right now, this message also goes to terminal because the
GUI is not ready yet.
2018-04-29 19:47:44 +02:00
Jehan 00dcd50a6c Bug 748553 - GIMP crash if a font does not have read permission.
Do not use FcConfigAppFontAddDir() because it seems to be half-loading
some fonts, even when they are not actually readable. On the other hand,
FcConfigAppFontAddFile() properly fails and does not leave the font list
in unstable state.
2018-04-29 17:34:13 +02: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 4cc8481b66 app: get rid of a few forgotten stock-ids and new_from_stock() 2018-04-29 04:50:17 +02:00
Jehan 0fce8fdb3c app: expand/unexpand locale paths in pluginrc.
It doesn't look like it is actually much of a problem, but anyway it's
better to have non-absolute paths in config files when possible.

Thanks to jtojnar on IRC for reporting these (and MyPaint brush paths
from my previous commit).
2018-04-29 02:20:58 +02:00
Jehan f6b586237c app: identifier of MyPaint brush GimpData using ${mypaint_brushes_dir}.
Absolute paths not to be used in $XDG_CONFIG/GIMP/{version}/tags.xml.
These are actually only an identifier, and not used as a path at all
anyway. Moreover MyPaint brushes even generate checksum (which allows
to remap the GimpData appropriately even if the paths are changing).
But anyway it's better not to have absolute paths when we can prevent
so.
2018-04-29 00:40:26 +02:00
Michael Natterer a007ad4b98 app: remove debug output from gimp_image_create_color_transforms() 2018-04-28 16:42:01 +02:00
Michael Natterer 8265b2425b app: s/GtkObject/GObject/ in gui-message.c, and minor reordering 2018-04-28 02:18:44 +02:00
Michael Natterer 8be9b12e78 configure.ac: require GEGL >= 0.4.1 2018-04-27 17:22:54 +02:00
Ell f6a56fac51 app: move exclusion and linear-burn modes to a more logical position
... in the layer-mode menu (this only affects UI.)
2018-04-26 16:08:55 -04:00
Øyvind Kolås f1db670f19 configure,app: depend on GEGL-0.4.0 2018-04-26 14:59:12 +02: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
Ell 2d19848277 app: don't invalidate gradient cache upon gradient-type changes
In GimpOperationGradient, since we no longer avoid using the
gradient cache for conical gradients, the gradient type doesn't
affect the cache.
2018-04-26 05:34:58 -04: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 6e87ceb896 app: use half the cache size for symmetric conical gradients
Symmetric conical gradients only span half a revolution (unlike
assymetric ones, which span an entire revolution), and therefore
require only half the cache size.
2018-04-25 17:42:52 -04:00
Ell d6a7302678 app: crop GimpDrawableFilter output
Add a crop node to the GimpDrawableFilter graph, applied after the
filter's output, cropping the output to the filter area (the same
area used for the input crop node).  If we fail to do this, filters
whose op's bounding box is bigger than the input region can affect
areas outside the drawable, when the filter is rendered as part of
the image graph (in contrast to being comitted).  This is
particularly relevant to source ops, that may have an infinite
bounding box.

We probably didn't notice this until now, since before the recent
GimpProjection update-area changes, only the drawable's area would
get invalidated in response to changes in the filter, so regions
outside the drawable wouldn't normally get rendered.  However, this
could still have been triggered by causing regions outside the
drawable to be invalidated by other means.
2018-04-25 15:58:24 -04: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 38ba45cf31 app: in GimpOperationGradient, move cache generation back to process()
Undo the part of commit fa9a4108c3
that moved cache generation from process() to prepare().  prepare()
is called after each property change, in order to calculate the
op's bounding box for invalidation.  Since we only need the cache
for actual processing, generating it in process() avoids that
overhead.
2018-04-25 14:05:19 -04:00
Michael Natterer ef5bd98e99 app: protect GimpContext's "parent" pointer against dangling
with a weak ref and call set_parent(NULL) in dispose().
2018-04-25 19:20:12 +02: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
Ell 95921427d5 app: remove multithreading warning from the preferences dialog
Since we're prepping for a release, it's a about time we've done
that.  I hereby pronounce multithreading support fit for general
use!
2018-04-25 10:55:11 -04:00
Ell fa9a4108c3 app: various improvements to GimpOperationGradient
Invalidate the gradient cache while setting relevant properties,
and validate it, reconstructing if necessary, during prepare(),
rather than process(), to avoid the need to use a mutex.

Make sure the cache has at least two elements, corresponding to
the initial and final colors of the gradient, since both colors
might be needed, and to avoid division by zero.

Avoid using a cache if its necessary size is too big, or if the
gradient type is conical, since the necessary cache size for
conical gradients is unrelated to the gradient line length.

Improve index rounding during cache lookup.

Lots of indentation fixes.
2018-04-25 09:48:02 -04:00
Ell 4fce5d2518 Bug 793714 - Error when merging layer group with Pass through mode
When merging a pass-through group, change its mode to NORMAL first,
to avoid a critical when duplicating the group as a regular layer.
Preserve the group's blend/composite space/mode while changing its
mode (note that only the composite space currently matters, since
the other parmaeters are immutable for pass-through groups.)
2018-04-25 08:43:57 -04:00
Michael Natterer 8696c05855 app: disable the "Use Applicator" toggle in paint options 2018-04-25 00:55:41 +02:00
Simon Budig 44a931e16c ripple: put the compat code in the proper place, fix up POTFILES.in 2018-04-24 14:26:39 +02:00
Michael Natterer dcefc10eca app: make setting of layer mode on new layers smarter in layers-commands.c
If the mode remembered in GimpDialogConfig is NORMAL or NORMAL_LEGACY,
use the image's default new layer mode instead.
2018-04-24 14:00:34 +02:00
Michael Natterer 1c91cdabc8 app: change the default new layer mode in GimpDialogConfig
to GIMP_LAYER_MODE_NORMAL.
2018-04-24 14:00:34 +02:00
Michael Natterer 9ac34bda70 app: change the default paint mode in GimpContext to GIMP_LAYER_MODE_NORMAL 2018-04-24 14:00:34 +02:00
Simon Budig e6de783b3c remove the ripple plugin, provide compat PDB-API 2018-04-24 13:05:58 +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
Michael Natterer db227148f0 pdb: finally deprecate gimp-color-balance
Since nobody can tell me how the new gimp-drawable-color-balance can
be improved, it's going to be identical, just with a namespace.
2018-04-23 18:20:05 +02:00
Michael Natterer a9fb4f9a39 pdb: make all item-transform procedures honor the "linked" flag
and improve their documentation.
2018-04-23 17:10:46 +02:00
Michael Natterer b80036e14f pdb: deprecated gimp-layer-translate
and port all plug-ins/scripts to gimp-item-transform-translate.
2018-04-23 15:49:23 +02:00
Michael Natterer acbdc4d5b4 pdb: add gimp-item-transform-translate procedure
We were only able to translate selections and layers (bot not channels
and paths) via the PDB, this new procedure fixes that. Deprecation of
old API and some more transform consistency to follow...
2018-04-23 03:06:23 +02:00
Michael Natterer 5b80d3d3be app: fix source operations on layers with alpha
They are not supposed to completely overwrite the layer's alpha
channel. Instead, composite them on top of the layer using gegl:over.
2018-04-23 02:59:35 +02:00
Simon Budig 6ffa19d595 fix internal name of the filter-grid help-id 2018-04-23 01:53:49 +02:00
Michael Natterer a31ee3ec22 app: fix outer border color of GimpSpinScale to look OK on all themes
it used to be "text" which is almost always too extreme; use "text_aa"
instead which is half way between "text" and "base" and always gives a
reasonable contrast.
2018-04-23 01:28:09 +02:00
Michael Natterer 7256f18447 app: change offsets parameters of GimpItem::translate() from int to double
so we can use it to precisely position paths; use SIGNED_ROUND() in
channel, layer etc. to snap to pixels.
2018-04-23 01:27:56 +02:00
Michael Natterer b1a36b044b app: cast another argument to g_object_ref() in gimp_tool_info_new() 2018-04-23 01:25:17 +02:00
Jehan 33d9336083 app: gimp_get_temp_file() / gimp_temp_name() should create tmp/ if...
... it doesn't exist.
The tmp/ dir in the config folder should already be created by GIMP, but
just in case it is not there, try and create it, since all code calling
these assumes that it exists.
2018-04-23 00:35:01 +02:00
Ell a6a8147b19 app: fix indentation of GimpUndoType enum descriptions 2018-04-22 04:05:36 -04:00
Ell 37742a9fee Bug 795410 - Deleting a layer group and then undoing the deletion ...
... raises a CRITICAL

gimp_item_{start,end}_move() currently serves two different
purposes:  It is used by GimpLayer to suspend/resume mask resizing
of the layer's ancestors; this is necessary whenever an operation
on a layer might affect the size of its ancestors.  It is also used
by GimpGroupLayer to suspend/resume its own mask resizing; this, on
the other hand, is only necessary before applying one of the
transformation functions to the group, so that mask modification is
handled by GimpLayer.  In other words, the effects of
gimp_item_{start,end}_move() on group layers are only necessary in
a subset of the cases in which these functions are used.

While in itself this isn't a problem, it does cause issues when
removing a group layer:  gimp_image_remove_layer() calls
gimp_item_start_move() before removing the layer, and
gimp_item_end_move() afterwards.  While the former function is
called while the layer is still attached to the image, the latter
function is called after the layer is no longer attached.  Since
GimpGroupLayer pushes an undo step in response to these calls, only
the call to start_move() results in an undo step, while the call to
end_move() doesn't, resulting in an unbalanced
GIMP_UNDO_GROUP_LAYER_START_MOVE undo step on the stack.  This
causes problems when undoing the operation.

Add gimp_item_{start,end}_transform() functions, and corresponding
GimpItem::{start,end}_transform() virtual functions, which are more
specialized versions of gimp_item_{start,end}_move(), which should
be used instead of the former before/after transforming an item; in
other cases, such as when removing ot reordering an item,
gimp_item_{start,end}_move() should still be used.  The default
implementation of GimpItem::{start,end}_transform() calls
gimp_item_{start,end}_move(), respectively, so subclasses that
override these functions don't have to do that themselves.

In GimpGroupLayer, override GimpItem::{start,end}_transform(),
instead of GimpItem::{start,end}_move(), for the same purpose of
suspending mask resize.  This avoids these functions from being
called when removing a layer group, fixing the bug.
2018-04-22 04:05:36 -04:00
Ell eeae5b48ca app: avoid pushing undo for nested gimp_group_layer_{suspend,resume}_mask()
... in order not to overshoot the undo-stack estimated memory-
usage.  See comment in the code.
2018-04-22 04:05:36 -04:00
Ell 577e17032a app: fix undo when moving a group-layer child outside the group
In gimp_image_reorder_item(), call gimp_item_start/end_move()
before/after reordering the item (and use an undo group, so that
the resulting undo actions are grouped together with the reordering
undo action,) so that if the item is a child of a group layer, and
reordering moves it out of the group in a way that causes the
group's mask to be resized, the mask will be properly restored when
undoing the operation.
2018-04-22 04:05:35 -04:00
Jehan 4d6cba0cfb app: make --show-playground visible in --help.
After Alexandre Prokoudine's insistent demand! :-)
I am still not sure how wise this is, since this should be really
considered a "developer-only" option. Basically these tools are really
too buggy and unstable and we should not shine too much light on these.
The counter-argument is that doing so will favor the bitrot.

Well ok. At least let's add a big warning message at the top of the
Playground page, to make it very clear (if that were not already the
case) that basically this is not to be considered a secret feature, but
really more a "we are looking for contributors" option.
2018-04-21 15:48:22 +02:00
Michael Natterer 8be37da012 Bug 795418 - Gimp 'critical error' when running luminosity masks script
In the gimp-channel-combine-masks PDB wrapper, only push an undo step
if the modified channel is attached to an image. It's a completely
reasonable use case to combine unattached channels.
2018-04-21 10:41:29 +02:00
Jehan 38a2887802 app, pdb: s/gimp_pdb_item_is_modifyable/gimp_pdb_item_is_modifiable/
Fix proper English.
2018-04-20 23:34:01 +02:00
Michael Natterer a1081bd595 app: fix gimp_pdb_item_is_modifyable() for channels
When a channel is position-locked, it is also implicitly
content-locked because we translate channels by modifying their
pixels.
2018-04-20 19:17:01 +02:00
Michael Natterer e4f327eca8 Bug 795385 - Segmentation fault when using gradient tool
We don't currently use GimpOperationGradient multi-threaded, but
protect cache initialization in process() with a mutex anyway in cae
we ever do.
2018-04-20 12:31:04 +02:00
Michael Natterer c0bac871ca Bug 795385 - Segmentation fault when using gradient tool
Make sure that the gradient cache in GimpOperationBlend contains
at least one pixel (is never NULL).
2018-04-20 10:23:28 +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 cb5f5d05e3 app: make the sample point dockable work with more than 4 sample points
Keep the color frames in a scrolled list of two columns, show a label
if the image has no sample points, show an icon if there is no image.
2018-04-19 18:31:34 +02:00
Michael Natterer 01e5a6b133 app: improve drawing of sample points so they are always visible
Draw them a bit brighter and larger, and with a dark shadow like tool
lines so they are visible on all backgrounds.
2018-04-19 16:20:41 +02:00
Ell f2a1fd5bf0 app: refactor gimppaintcore-loops to coalesce iteration
The gimppaintcore-loops functions perform very little actual
computational work (in case of do_layer_blend(), at least for
simple blend modes), which makes the cost of buffer iteration, and
memory bandwidth, nonnegligible factors.  Since these functions are
usually called in succession, acessing the same region of the same
buffers, using the same foramts, coalescing them into a single
function, which performs all the necessary processing in a single
step, can improve performance when these functions are the
bottleneck.

Add a gimp_paint_core_loops_process() function, which does just
that: it takes a set of algorithms to run, and a set of parameters,
and performs all of them in one go.  The individual functions are
kept for convenience, but are merely wrappers around
gimp_paint_core_loops_process().

Be warned: the implementation uses unholy C++ from outer space, in
order to make this (sort of) managable.  See the comments for more
details.
2018-04-19 05:36:31 -04:00
Ell 66bc050df8 app: indentation fix to last commit 2018-04-19 05:17:47 -04:00
Ell 87e6653c9a app: improve drawable flipping speed
In gimp_drawable_transform_buffer_flip(), perform flipping tile-by-
tile, instead of row-by-row/column-by-column.
2018-04-19 05:13:42 -04:00
Michael Natterer 12d38816a5 pdb: fix formatting of generated code in item_transform.pdb 2018-04-19 01:03:29 +02: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
Michael Natterer cafb18643f app: another optimization in GimpOperationGradient
Don't reallocate the cache in prepare() but only on demand in
process().
2018-04-18 12:47:40 +02:00
Michael Natterer 9dbf919d46 app: speed up gradient rendering a lot
by using a cache of colors that is calculated once, instead of
calling gimp_gradient_get_color_at() for each rendered pixel.
2018-04-18 01:18:09 +02:00
Michael Natterer 4d94863abc app: don't use style->dark for histogram and curve intersections/grid
because it's always darker than "bg" and not visible in dark themes.
Instead, use "text_aa" which is always between "text" and "base".
2018-04-17 20:44:03 +02:00
Michael Natterer 436e53d390 pdb: improve docs about which procedures are affected by context settings
Also add some double blank lines so they show up as single blank
lines in the generated docs, which improves readablility.
2018-04-17 13:19:16 +02:00
Michael Natterer 93f41b344c pdb: improve docs of gimp_context_set_diagonal_neighbors() 2018-04-17 01:16:54 +02:00
Michael Natterer c0dd812ea6 pdb: fix use of "seed" properties in plug_in_compat.pdb
now that GeglParamSpecSeed is uint.
2018-04-17 00:42:15 +02:00
Michael Natterer 2da25576c3 app: fix duplication of GeglParamSpecSeed, we missed its limits before
(which are probably never used, but still)
2018-04-17 00:12:01 +02:00
Michael Natterer cb84e0ab56 configure.ac: reqire GEGL >= 0.3.34 2018-04-17 00:08:48 +02:00
Ell ddfc7715cb app: make the airbrush tool thread-safe w.r.t. paint thread
GimpAirbrush currently performs painting and flushes the image on
its own during the airbrush timeout.  This is unsafe w.r.t. the
paint thread, since the timeout is run on the main thread, while
paint commands should run on the paint thread.

Add a "timeout" signal to GimpAirbrush, and simply emit this signal
during the airbrush timeout, rather than actually painting.

Connect to this signal in GimpAirbrushTool, and use
gimppaintool-paint to perform the actual painting, in a thread-safe
manner (see the previous commit.)
2018-04-16 09:56:39 -04:00
Ell e02a339e01 app: reorganize gimppainttool-paint, to allow use by subclasses
We'd like subclasses of GimpPaintTool to be able to issue paint
commands to the tool's paint-core (in particular, see the next
commit.)  Since paint commands should be executed on the paint
thread, the subclasses must not call the paint-core functions
directly, but should rather let gimppainttool-paint issue the
commands on their behalf.

Reorgainze gimppainttool-paint to make it usable for this purpose
by subclasses.  In particular, add
gimp_paint_tool_paint_core_paint() and
gimp_paint_tool_paint_core_interpolate(), which call the
corresponding paint-core functions on the paint thread.

Additionally, rename the {start,end,flush}_paint() virtual
functions of GimpPaintTool to paint_{start,end,flush}(), and rename
gimp_paint_tool_is_painting() to gimp_paint_tool_paint_is_active(),
so that all the gimppainttool-paint-related stuff are grouped under
the same namespace.
2018-04-16 09:56:39 -04:00
Michael Natterer 3f4995d3d7 pdb: add procedures to set the built-in gradients
gimp-context-set-gradient-fg-bg-rgb
gimp-context-set-gradient-fg-bg-hsv-cw
gimp-context-set-gradient-fg-bg-hsv-ccw
gimp-context-set-gradient-fg-transparent
2018-04-16 11:42:46 +02:00
Michael Natterer 410e55c40c pdb: never pass bogus supersample values to gimp_drawable_gradient()
even when supersampling is not enabled, or we will get warnings about
out-of-range property values.
2018-04-16 01:18:05 +02:00
Michael Natterer 5ee67deea5 pdb: deprecate all non-clipboard functions in the "edit" group
Still have to port script-fu scripts...
2018-04-15 16:39:59 +02:00
Michael Natterer ef3edece9b pdb: improve docs of deprecated functions
Don't unconditionally overwrite all the proc's description, author
etc.  Instead, try to preserve them and append the "Deprecated" notes
to the help texts and generated comments.

Only affects one procedure because we killed the meta info of all
other deprecated procs so far, but now we don't have to do that any
longer.
2018-04-15 16:06:00 +02:00
Michael Natterer 50536e1c38 Bug 795230 - Rename Blend tool and provide PDB compatibility
Add new PDB group "drawable_edit" which has all procedures from the
"edit" group which are not cut/copy/paste.

The new group's procedures don't have opacity, paint_mode
etc. arguments but take them from the context instead. Unlike the old
gimp-edit-fill, gimp-drawable-edit-fill now uses the context's opacity
and paint_mode.

The new gimp-drawable-edit-gradient-fill procedure uses even more
context properties which are also newly added with this commit
(gradient_color_space, gradient_repeat_mode, gradient_reverse).

And some cleanup in context.pdb.

This is still WIP, nothing in the edit group is depcreated yet.
2018-04-15 15:28:50 +02:00
Ell 02808e8072 Merge branch 'fix-gradient-history'
This fixes the history of app/core/gimpdrawable-gradient.h, and
app/tools/gimpgradienttool{.c,-editor.{c,h}}.
2018-04-15 03:30:52 -04:00
Michael Natterer 92330425c8 Bug 795230 - Rename Blend tool and provide PDB compatibility
Redo the part of commits b0beb0197a,
c3f98cccbd,
6b0f5136e0,
and 3736bfd189, reverted by commit
e30a32d56e.
2018-04-15 03:30:25 -04:00
Michael Natterer 2e69608a46 Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpblendtool{.c,-editor.{c,h}} to
gimpgradientool{.c,-editor.{c,h}}.  Note that this commit only
renames the files; the actual changes are done in the next commit,
so that git doesn't consider them new files.
2018-04-15 03:30:24 -04:00
Michael Natterer 721ce91d75 Bug 795230 - Rename Blend tool and provide PDB compatibility
Redo the part of commits 4f2e078ccb
and 5f6dfc7617, reverted by commit
e30a32d56e.
2018-04-15 03:30:07 -04:00
Michael Natterer 9fd44d5e44 Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpdrawable-blend.h to gimpdrawable-gradient.h.  Note that
this commit only renames the file; the actual changes are done in
the next commit, so that git doesn't consider this a new file.
2018-04-15 03:30:05 -04:00
Ell e30a32d56e Bug 795230 - Rename Blend tool and provide PDB compatibility
Partially revert commits 4f2e078ccb
and b0beb0197a, since the changes
they introduced to some of the renamed files were big enough for
git to consider them entirely new files, hence we lost their
history.  The next few commits fix this.

This commit also partially or entirely undoes followup commits
5f6dfc7617,
c3f98cccbd,
6b0f5136e0,
and 3736bfd189, which will be
restored by the next few commits as well.
2018-04-15 03:28:41 -04:00
Jehan 309d118f65 app, devel-docs: improve position of loading text on splash image.
The upper text will be centered on the top quarter of the bottom quarter
of the splash image, whereas the bottom text will be centered on the
bottom quarter of the bottom quarter of the splash (unless the splash is
too small, in which case the double of the layout pixel extents will be
used). Basically don't use absolute pixel values anymore for
positionning. This should all be done relatively since there are
nowadays all kind of display size (and positionning the text 6 pixels to
the bottom, as it was done, may be ok on low density displays, yet will
look ugly on high density screens).

Also write this down in the splash requirements in the release howto so
that splash designers are aware that the bottom quarter of their image
will have to be adapted for printing text.
2018-04-15 02:32:30 +02:00
Ell 09b16f6cc0 app: avoid copying the brush boundary on each brush tool flush()
In GimpBrushTool, remember the settings used for the last cached
brush boundary, and avoid creating a new copy if the settings
didn't change.  This should lower the overhead of
gimp_brush_tool_flush_paint() when not using dynamics.
2018-04-14 18:43:11 -04:00
Michael Natterer d528f80c16 app: cast g_object_ref() argument in gimp_plug_in_proc_frame_init() 2018-04-14 21:14:52 +02:00
Michael Natterer 3661097c04 app: add gimp_pdb_context_get_paint_options_list()
Which returns the entire GimpContainer of paint options.
2018-04-14 21:11:05 +02:00
Michael Natterer 0c066f311e app: drop alpha from all fishes in gimpgradient.c
Alpha is calculated separately, ne need to run it through babl.
Also some formatting cleanup.
2018-04-14 21:09:01 +02:00
Michael Natterer 3736bfd189 app: even in a "gradient tool" its called "Blending" not "Gradienting" 2018-04-14 21:06:13 +02:00
Øyvind Kolås 6d6da684f1 app: add handling of CIE Lab blend space to gradient
Using CIE Lab yields gradients that more closely resemble the perceptual
gradients but without the gamma based blending problems of linear-RGB / CIE
XYZ.
2018-04-14 18:12:30 +02:00
Ell 45c172a885 Bug 795257 - Segmentation fault crash using the clone tool
Commit f5cb1fed85, which performed
brush outline generation in GimpPaintTool in synchrony with the
paint thread, wasn't enough, since GimpSourceTool could still call
gimp_brush_tool_create_outline() directly during its
GimpDrawTool::draw() method, leading to the same race condition
when executed concurrently with the paint thread.

Partially revert the above commit, so that outline generation is
handled as before, as far as GimpPaintTool is concenered.  Instead,
add GimpPaintTool::{start,end,flush}_paint() virtual functions; the
first two are called when starting/ending painting using the paint
thread, while the third is called during the display-update
timeout, while the main thread and the paint thread are
synchronized.  This allows subclasses to perform non-thread-safe
actions while the threads are synchronized.

Override these functions in GimpBrushTool, and cache the brush
boundary in the flush() function.  Use the cached boundary in
gimp_brush_tool_create_outline() while painting, to avoid the above
race condition, both when this function is called through
GimpPaintTool, and through GimpSourceTool.
2018-04-14 10:14:58 -04:00
Jehan 3ac794816a Bug 724692 - Canvas rotation stuck with specific order of actions.
Commit b279c2d217 was breaking a specific use case, which I oversaw:
when space bar activates the move tool, you may want to release the
space bar while mouse button is pressed, and expect to still be able to
move the layer/selection/guide, but releasing space was stopping the
move immediately. The move tool must only be deactivated when both space
and button 1 are released, and the move itself must continue as long as
button 1 is pressed (when started while space was pressed).

As a nice side effect of this commit, panning and canvas rotation are
also improved since now they can be continued while releasing space
(respectively shift-space) if mouse button 1 was pressed, and up until
the mouse button is released. Pressing space again, then releasing the
mouse, back and forth, also work as expected (i.e. move tool stay
activated though the move stops; and panning or rotation continue).

Of course now we don't get anymore panning/rotation stuck while neither
space nor mouse buttons are pressed (which was the original bug). At
least one of these need to stay pressed for panning/rotation/move to
stay activated. And initial activation is obviously always through
(shift-)space only.
2018-04-14 15:36:08 +02:00
Jehan 6b0f5136e0 app: use "g" for gradient shortcut.
It makes more sense than "l" as a default, and "g" was currently unused.
So not much left to ponder.
2018-04-14 14:27:36 +02:00
Øyvind Kolås 5e98dade14 configure/app: depend on GEGL 0.3.32 2018-04-14 12:38:43 +02:00
Jehan c3f98cccbd app: fix menu path for gradient tool s/Blen_d/Gra_dient/.
This one string was still using the old name, which appeared in menus or
in the shortcut list.
2018-04-14 04:09:29 +02:00
Jehan 063a83c1ec app: migrate configuration files for s/Blend/Gradient/ tool renaming.
This includes migrating properly any custom shortcut (menurc), as well
as a few strings in tool-presets/, and finally "gimp-blend-tool" in
contextrc and devicerc.
File toolrc also has some occurrences, but we are already skipping it
anyway, same as whatever is under tool-options/.
Hopefully I missed nothing.
2018-04-14 04:01:32 +02:00
Michael Natterer 257eb95258 app: simpler and better-aligned packig in gimpviewablebox 2018-04-14 02:19:50 +02:00
Michael Natterer 5f6dfc7617 app: add GimpGradientBlendColorSpace parameter to gimp_drawable_gradient() 2018-04-14 01:34:50 +02:00
Michael Natterer b0beb0197a Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename the tool and its options, and the gradient sub-struct of paint
options.
2018-04-14 00:52:20 +02:00
Michael Natterer 4f2e078ccb Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpdrawable-blend.[ch] to gimpdrawable-gradient.[ch]
2018-04-13 23:43:27 +02:00
Michael Natterer b55c116755 Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename GimpOperationBlend to GimpOperationGradient.
2018-04-13 23:36:16 +02:00
Michael Natterer ea474f5e78 Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename the tool cursor: blend -> gradient in filename and enum value.
2018-04-13 23:27:03 +02:00
Michael Natterer 99ea6f91e2 app: fix the build after the GimpGradientBlendColorSpace commit
Somehow, gimppalette-import.c was not rebuilt on my system,
leaving one gimp_gradient_get_color_at() unchanged.
2018-04-13 23:12:21 +02:00
Michael Natterer ebb9d83d63 Bug 795230 - Rename Blend tool and provide PDB compatibility
Step 1: rename the icon to GIMP_ICON_TOOL_GRADIENT (gimp-tool-gradient)
2018-04-13 23:07:08 +02:00
Michael Natterer bf49b47620 Bug 795207 - Add color space to blend(gradient) tool options
First WIP commit, adds:

- enum GimpGradientBlendColorSpace { RGB_PERCEPTUAL, RGB_LINEAR }
- linear blending mode for gradient segments
- tool options GUI for the blend and paint tools which use gradients
2018-04-13 22:33:16 +02:00
Ell ff34965faf Bug 795177 - seg fault with clone tool
Don't flush the source pickable in gimp_source_core_motion(), as
this introduces a race condition between the paint thread and the
display-update timeout, when the source pickable is the image
containing the target drawable.

Flushing the source pickable shouldn't be currently necessary, and
either way, should happen during initialization.
2018-04-13 10:03:20 -04:00
Jehan b91742a84f Bug 795185 - Corrective rotation guides are incorrect in GIMP 2.10.
Most expected behavior in normal transform is to see the preview,
whereas you usually don't want to see it in corrective mode. In 2.8
actually, it seems like it was not even possible to see the image
preview in corrective mode.

So let's set "show-preview" to these defaults when "direction" property
is updated.  It is still possible to change it manually for any specific
use cases (i.e. you can hide the preview in normal transform, and
oppositely you can show it in corrective transform), but at least now
defaults are sane.
2018-04-12 12:13:38 +02:00
Jehan 3841d3d537 Bug 795185 - "Show image preview" works differently if checked before...
... or during rotation.
If checked before rotation, it works as expected, i.e. one sees only the
original or the rotated image.
While rotation is in progress: if unchecked, one sees neither the
original nor the image preview; if checked, one sees both original and
rotated preview.
Let's make the behavior consistent and only show exactly one version at
all time.
2018-04-12 10:03:13 +02:00
Michael Natterer 421c9fc51a Bug 795050 - ‘strncpy’ output truncated before terminating nul
Use memcpy() because we really dont' want to copy the terminating nul,
but we don't want a warning either.
2018-04-11 11:31:02 +02:00
Ell 5b8b33dad7 app: invert zoom mapping in gegl:panorama-projection gyro controller 2018-04-11 04:53:26 -04:00
Ell 5430e7794c app: various fixes in GimpToolGyroscope
Invert zoom adjustment using the mouse or the keyboard when in
inverse mode.  Take zoom factor into account when panning using the
keyboard.  Fix motion cancelation.
2018-04-11 04:53:26 -04:00
Jehan 1993d8a4a7 Bug 768872 - Tiling Symmetry doesn't wrap vertical coordinates over...
... edges for MyPaint brush.

Adding the concept of "stateful" symmetry when a tool needs to make sure
of corresponding stroke numbers and orders while painting (i.e. stroke N
at time T+1 is the continuation of stroke N at time T). This is the case
for the MyPaint brushes and the ink tool.
2018-04-11 02:09:21 +02:00
Øyvind Kolås 087d2462bc configure/app: depend on babl 0.1.46 2018-04-10 23:29:41 +02:00
Ell 6453b371a9 app: fix status message of GimpToolGyroscope 2018-04-10 11:08:37 -04:00
Ell 6982533292 app: add custom GUI for gegl:panorama-projection
... which uses a gyroscope controller to control the op's rotation
angles and zoom.
2018-04-10 10:18:49 -04:00
Ell 8738d2f22b app: add a gyroscope controller to prop-gui
Add a gyroscope controller, providing a prop-gui interface to
GimpToolGyroscope.

Implement the gyroscope controller in GimpFilterTool.
2018-04-10 10:18:48 -04:00
Ell 634d5ae57d app: add GimpToolGyroscope
GimpToolGyroscope is a tool widget providing canvas interaction for
3D rotation.  The widget doesn't preset a UI, but rather
facilitates panning, rotation, and zoom, by dragging the canvas, or
using the keyboard.

Rotation is expressed using yaw/pitch/roll angles (performed in
this order).  A zoom factor can be specified, which affects the
magnitude of the rotation per distance traveled.  The widget can
operate in inverse mode, performing an inverse transformation.
2018-04-10 10:18:48 -04:00
Ell 2c1f1c507c app, cursors: add zoom cursor modifier
To be used by GimpToolGyroscope.
2018-04-10 10:18:48 -04:00
Ell f81542e5c9 app, cursors: add rotate cursor modifier
To be used by GimpToolGyroscope.
2018-04-10 10:18:48 -04:00
Michael Natterer 3f95dc52d3 Bug 791519 - Unexpected selection from channel
Make sure a channel -> selection -> channel roundtrip never does any
gamma conversion.

In gimp_channel_duplicate(), make sure a created channel has the
right format, and the right data. Fixes selection -> channel.

When switching off quick mask, call gimp_item_to_selection() instead
if gimp_selection_load(), the latter was implementing a shortcut which
is now wrong.

Remove gimp_selection_load() which is now unused.

Unrelated: also remove gimp_selection_save(), it was an obvious
3-liner used only twice.
2018-04-10 02:00:23 +02:00
Michael Natterer bba8f69594 Revert "Bug 791512 - make the selection boundary detection the same as 2.8"
This commit was fixing only a symptom of our channel/selection
problem, making it appear things were fine.

This reverts commit 27512d802b.
2018-04-10 00:26:01 +02:00
Ell f5cb1fed85 Bug 795081 - Crash when using a brush combined with a dynamics
In GimpPaintTool, brush outline generation took place during
gimp_paint_tool_draw() even while painting.  This function is run
concurrently with the paint thread.  When using dynamics, this
introduced a race conidition between updating the brush mask in the
paint thread, and updating the brush boundary in the main thread.

Move brush outline generation during painting to
gimppainttool-paint.c, and perform it in the display-update
timeout, while the main thread and the paint thread are
synchronized.
2018-04-09 14:27:48 -04:00
Ell e98506b000 app: remove option for paint tools to opt out of a separate thread
After last commit, all paint tools work correctly with a separate
paint thread, so we can remove the option for specific paint tools
to opt out.  Particularly, GimpMybrushTool now uses a separate
paint thread too.

Note that the separate paint thread can still be disabled through
the GIMP_NO_PAINT_THREAD environment variable.
2018-04-09 14:27:48 -04:00
Ell 2ae16ca604 app: reorganize gimppaintool-paint
Reorganize/clean up gimppainttool-paint.  In particular, move all
paint-core interaction during painting to gimppainttool-paint.c, so
that we can have more control over what's going on; specifically,
enter the drawable into paint mode *before* starting the paint
core, so that it picks up the correct buffer.  This fixes painting
with the paint thread using GimpApplicator, and enables us to use
the paint thread with GimpMybrushTool.
2018-04-09 14:27:48 -04:00
Jehan f77edcdf19 app: do not use gimp_filename_to_utf8() in the signal handler.
This function is unsafe during signal handling. And in any case, when
printing to stderr, I don't think we need to convert to UTF-8. Quite the
contrary, the system encoding may be more appropriate.
2018-04-09 06:14:41 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Michael Natterer 8994246be2 Bug 791519 - Unexpected selection from channel
One additional fix for the gimp-channel-combine-masks procedure,
it needs both the combined *and* combined-to buffer in
gimp_gegl_mask_combine_buffer() to be treated specially.
2018-04-08 20:26:32 +02:00
Michael Natterer bb4ac7c829 Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.

This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).

To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-08 19:26:48 +02:00
Ell 8e7a34297f app: move painting to a separate thread
Add gimppainttool-paint.[ch], which takes care of painting during
motion events in GimpPaintTool.  Perform the actual painting in a
separate thread, so that display updates, which can have a
significant synchronization overhead, don't stall painting.

Allow specific paint tools to opt-out of a separate paint thread,
and avoid it in GimpMybrushTool, since it doesn't seem to work.

The separate paint thread can be explicitly disabled by setting the
GIMP_NO_PAINT_THREAD environment variable.
2018-04-08 09:42:48 -04:00
Ell ce9ca03ed4 app: add gimp_drawable_{start,end,flush}_paint()
gimp_drawable_start/end_paint() are used to enter/exit paint mode
for a given drawable.  While the drawable is in paint mode,
gimp_drawable_get_buffer() returns a copy of the real drawable's
buffer, referred to as the paint buffer, so that modifications to
the returned buffer don't immediately affect the projection, and
calls to gimp_drawable_update() queue the updated region, instead
of emitting an "update" signal.

gimp_drawable_flush_paint() can be called while the drawable is in
paint mode, in order to copy the updated region of the paint buffer
back to the drawable's real buffer, and to emit "update" signals
for the queued region.

We use these functions in the next commit, to move painting to a
separate thread in the paint tools.
2018-04-08 09:42:47 -04:00
Ell db50c72c24 app: align display paint area to a coarse grid
Align rectangles added to the display paint area, in
gimp_display_paint_area(), to a coarse grid, to reduce the
complexity of ther overall area.  This is similar to commit
49285463e6, however the alignment
happens in display space, instead of image space.
2018-04-08 09:42:47 -04:00
Thomas Manni 440be88035 Bug 794926 - Foreground select tool: several critical errors when ...
... double click during trimap painting

Disable double click when the tool is in trimap paint state.
2018-04-08 13:03:11 +02:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Ell bea27171ad app: throttle statusbar progress updates
Statusbar progress updates that update the progress bar are
relatively expensive, slowing down operations that report progress
frequently.  Only update the progress bar if a certain amount of
time has passed since the last update, to counter that.
2018-04-07 12:05:59 -04:00
Ell 87a10aaf9e Bug 795048 - Image->mode->Grayscale results in a black or transparent image
In gimp_gegl_convert_color_profile(), when src/dest_rect is NULL,
use the extents of src/dest_buffer, instead of passing a NULL area
to gimp_parallel_distribute_area(), which results in a CRITICAL.

Additionally, only report progress on the main thread.
2018-04-07 12:05:59 -04:00
Massimo Valentini 81e1e3967d app: silence gcc warning
gimp-templates.c:143:15: warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
               strncpy (dpi, "ppi", 3);
               ^~~~~~~~~~~~~~~~~~~~~~~
2018-04-07 14:45:45 +02:00
Michael Natterer 2dd2f2f371 Bug 770424 - Themes: insensitive menu item are not readable
Need to check if we must override PixbufStyle's draw_layout() after
each theme change, not only at the beginning of themes_init(), so it
works also when the the pixbuf engine was not already loaded at
startup.
2018-04-07 12:33:18 +02:00
Michael Natterer 43549b7a38 app: remove some references to TileManager from xcf-load.c comments
and minor whitepace cleanup.
2018-04-06 12:56:31 +02:00
Ell f7c2ce9b13 app: fix smudge tool artifacts
Commit cb239e60f6 introduced
artifacts when using the smudge tool with multithreads.  Fix this
(caused by a wrong offset passed to an iterator) plus indentation
fixes.
2018-04-05 19:17:45 -04:00
Jehan 87b9611628 app: fix build error "‘memset’ was not declared in this scope". 2018-04-05 23:57:34 +02:00
Ell 4336e2e52a app: parallelize gimpbrushcore-loops.cc
Use gimp_parallel_distribute_foo() to parallelize the brush core
loops.
2018-04-05 17:41:29 -04:00
Ell 6e314b5090 app: move brush-core loops to a separate file
Move gimp_brush_core_{subsample,pressurize,solidify}_mask() to a
separate gimpbrushcore-loops.cc file, so that they can be C++-ified
independently from the rest of the code.  The next commit
parallelizes them.
2018-04-05 17:41:29 -04:00
Ell f7ea9abc73 app: add include guards to gimppatincore-loops.h 2018-04-05 17:41:29 -04:00
Ville Pätsi cf21dcbe37 Rework and rename the default Dark theme 2018-04-05 23:59:27 +03:00
Jehan 0009794d9d app: migrate tool-presets with s/GimpImageMapOptions/GimpFilterOptions/.
As requested!
2018-04-05 11:46:49 +02:00
Ell 082a6404c9 app: fix iterator area in canvas_buffer_to_paint_buf_alpha()
The entire ROI was processed in all threads, instead of only the
thread-specific area, causing artifacts.
2018-04-05 02:19:52 -04:00
Ell cb239e60f6 app: parallelize gimp-gegl-loops.cc
Ditto.
2018-04-04 17:49:47 -04:00
Ell 828b99b5b3 app: switch gimp-gegl-loops.c to C++
Ditto.
2018-04-04 17:49:47 -04:00
Ell 3df757ffd7 app: parallelize gimppaintcore-loops.cc
Ditto.
2018-04-04 17:49:47 -04:00