Commit Graph

5129 Commits

Author SHA1 Message Date
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 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 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 172f607ac5 app: use GdkDeviceManager to list devices 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 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 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 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 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
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
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 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
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 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 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
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
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 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 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
Michael Natterer 4cc8481b66 app: get rid of a few forgotten stock-ids and new_from_stock() 2018-04-29 04:50:17 +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
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 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 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
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 257eb95258 app: simpler and better-aligned packig in gimpviewablebox 2018-04-14 02:19: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 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 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 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
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
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 394c930fbe app: avoid potential division by 0 in dashboard CPU usage sampler 2018-04-04 17:49:46 -04:00
Ell bbd79f9d62 app: fix Wilber's eyes
Commit fd6d4931c8 accidentally
introduced a bug that caused Wilber's eyes to misbehave.  This
commit is an attempt to fix this issue.  Unfortunately, it seems
like the bug can still be triggered through a certain sequence of
actions...
2018-04-03 03:32:32 -04:00
Michael Natterer b46b9d8921 Bug 772126 - Make GimpColorFrame handle very long numbers
Add "ellipsize" property to GimpColorFrame and set it to
PANGO_ELLIPSIZE_END in the the pointer information dockable.

Better cut off long numbers than make them expand the dock.
2018-04-03 01:47:53 +02:00
Ell da3c96f541 app: add "misc" group to the dashboard
... which currently has a single "mipmapped" field, which shows the
total size of processed mipmapped data.
2018-04-02 16:47:45 -04:00
Ell 4c041b2e8a app: allow hiding groups in the dashboard
Add a "groups" submenu to the dashboard popup menu, which can be
used to control which groups are shown in the dashboard.
2018-04-02 16:47:41 -04:00
Ell fd6d4931c8 It's alive! 2018-04-01 01:19:41 +00:00
Ell c3efb1b0de app: don't show invisible actions in search dialog 2018-03-29 05:26:02 -04:00
Michael Natterer 2c417801fc app: fix error message in gimp_text_buffer_save() 2018-03-23 14:47:14 +01:00
Michael Natterer 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Ell 8d9580fd2b app: update layers-dialog floating-sel attrs/highlight when image changes
Move the button-highlight update to its own function, and call it
when the active image changes, as well as when its floating
selection changes.

Call the floating-selection-changed signal handler when the active
image changes, so that we correctly update its row's attributes.
2018-03-07 10:58:25 -05:00
Ell b1266b2c3f app: #include <string.h> in GimpHighlightableButton
Needed for memcmp().
2018-03-07 09:53:31 -05:00
Ell 378c5d3b87 app: don't highlight layers dialog "new" button when pasting to channel
We disallow creating a new layer from a floating selection when its
associated drawable is a channel, so there's no point in
highlighting the "new layer" button in this case.  Note that the
"layers-new" action remains sensitive, showing an error message if
activated.  Not sure if it's a good thing or not, but whatever.
2018-03-07 09:40:19 -05:00
Ell 7dd373293c app: reduce opacity of GimpHighlightableButton when insensitive 2018-03-07 09:40:19 -05:00
Ell e4c79cb2d6 app: use gimp_cairo_rounded_rectangle() in GimpOverlayFrame
... instead of drawing it the hard way.
2018-03-07 09:40:19 -05:00
Ell 2c6ee43e84 app: highlight "new", "anchor", and "delete" buttons in layers dialog ...
... when there's a floating selection

Layer-dialog interaction is restricted while the image has a
floating selection, which often causes confusion.  Highlight the
three layers-dialog buttons that "finalize" a floating selection --
the "new layer" button, the "anchor layer" button, and the "delete
layer" button -- to indicate that these buttons are used to finish
the paste operation.  The "new" and "anchor" buttons use a green
highlight color, while the "delete" button uses a red highlight
color.
2018-03-07 06:18:21 -05:00
Ell 15883c7be0 app: add gimp_item_tree_view_get_delete_button()
... which returns the editor button associated with the "delete"
action.
2018-03-07 06:18:21 -05:00
Ell 1253964c80 app: use GimpHighlightableButton for GimpEditor buttons
... instead of plain GimpButton.
2018-03-07 06:18:21 -05:00
Ell a12a2344bc app: add GimpHighlightableButton
GimpHighlightableButton is a subclass of GimpButton, which can be
"highlighted" by changing its color to draw attention to it.
2018-03-07 06:18:21 -05:00
Ell efa8040780 app: rename gimp_cairo_foo() functions to follow cairo naming scheme
Really pedantic stuff :)  Rename the functions in gimp-cairo.h to
follow the naming scheme employed by cairo, so that they don't feel
out of place.
2018-03-07 06:18:20 -05:00
Michael Natterer 0c6441619e app: default to GIMP_COLOR_SELECTOR_RED in GimpColorEditor
instead of HSV hue, HSV is not supposed to be the default model any
longer. Bigger color selector cleanup to follow...
2018-03-04 15:44:02 +01:00
Ell b8aeed4774 app: make the GimpSearchPopup entry icon non-activatable
... it doesn't actually do anything.
2018-02-27 03:55:34 -05:00
Jehan b671a43a31 Bug 793815 - segmentation fault on a handler using finalized user data.
The bug is very hard to reproduce, probably because it requires specific
timing conditions but this looks like this commit would prevent it.
Apparently the signal handler gimp_container_view_name_changed() may
have been run while the container view (set as user data) was most
likely already finalized, hence leaving an invalid dangling pointer.
Let's just make sure we disconnect this handler (and another) when we
finalize the container view and its private data.
2018-02-26 19:12:50 +01:00
Jehan 1a8edbed51 app: replace GimpHistogramEditor's "valid" by "recompute" flag.
Having to sync the "valid" flag with the presence of a histogram is
error-prone (cf. previous commit).
Instead gimp_histogram_editor_validate() return value will just depend
on the presence of the histogram. And "valid" becomes "recompute", i.e.
a flag to request for "recomputation" of the histogram.
2018-02-21 19:31:25 +01:00
Jehan 3535251979 Bug 793669 - histogram-related bug report.
When the histogram is freed, we need to set valid to FALSE, in order to
force recreation as soon as needed. Otherwise we may hit some race
condition of trying to work with a NULL histogram. For instance this
happened when starting painting fast enough after switching the active
image.
2018-02-21 16:45:13 +01:00
Ell bdab2829ef app: more action history sorting logic improvements/fixes
Simplify the action history sorting logic introduced in the
previous commit, and fix a few issues in its implementation.
2018-02-17 10:07:02 -05:00
Ell 2e54483361 app: improve action history sorting
The current sorting logic of actions in the history is essentially
linear, so that when an action is activated it moves up one place
in the history.  This has the undesirable effect that actions take
very long to climb up the history list, as well as that actions at
the top of the list can change their relative order too frequently.

Improve the sorting logic, such that items climb up the list
faster, while top items retain their relative position longer.  See
the comment at the top of the diff for the actual logic.
2018-02-17 08:08:00 -05:00
Ell 9653cdfc40 app: exclude undo/redo actions from history
The undo/redo actions' label changes based on context, and may
interfere with the labels of more relevant, but less frequent,
actions.

For example, after applying filter Foo, the label of edit-undo
becomes "Undo Foo", so searching for "Foo" results in both
edit-undo, and the action referring to the filter, with edit-undo
most likely appearing at the top of the list due to its frequency.

Excluding the undo/redo actions from the history is a simple, if
suboptimal, way to fix this.
2018-02-17 04:57:28 -05:00
Ell 2816695eda app: add gimp_action_history_is_blacklisted_action()
... and rename gimp_action_history_excluded_action() to
gimp_action_history_is_excluded_action().

is_blacklisted_action() determines whether an action should be
excluded from *both* the history and the search results, while
is_excluded_action() determines if an action should be excluded
only from the history.  This eliminates some redundancy across
gimpaction-history and action-search-dialog.
2018-02-17 04:57:28 -05:00
Ell dba39b13ad app: add missing comma in gimp_action_is_gui_blacklisted() 2018-02-17 04:57:28 -05:00
Jehan 77ed476113 app: add GIMP_MESSAGE_BUG_WARNING + GIMP_MESSAGE_BUG_CRITICAL severity.
Since a few commits, I don't generate the traces anymore in errors.c but
delay this to gui-message.c and rely on the message severity to decide
whether or not generating traces.
Unfortunately none of the current severities are properly describing
this new type of messages. Even GIMP_MESSAGE_ERROR is used everywhere in
our code NOT for actual programming bug, but often for data errors
(which are not bugs but proper messages and should obviously not prompt
a debug trace).
2018-02-12 18:22:15 +01:00
Jehan b0cd4412e0 app: make backtrace processed in the thread where error happens.
Slight back step from commit 34fe992f44. I don't keep track anymore of
the number of errors inside GimpCriticalDialog. The problem is that GTK+
calls must happen in the main thread, and errors in another thread will
be delayed into the main thread through gdk_threads_add_idle_full().
This makes any backtrace generated as a consequence of a threaded error
useless (in particular any error happening in GEGL since we always
process these as multi-threaded, whether they are or not).
Instead I now keep track of the number of errors in gui-message.c, which
still allows to reset the counters when the unique debug dialog is
closed. Therefore I can now generate backtraces conditionally to the
error counters inside the problematic thread (and right when the error
happened), without any GTK+ call.
This finally makes GEGL backtraces useful in the debug dialog! :-)
2018-02-12 05:28:12 +01:00
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Michael Natterer 4be9f84ed5 app: pass the GdkWindow to gimp_spin_scale_update,clear_target()
Another small thing to make maintaining gtk3-port easier.
2018-02-11 15:45:51 +01:00