Commit Graph

47895 Commits

Author SHA1 Message Date
Jehan 40bebec273 libgimpconfig: remove more g_assert().
As discussed with mitch on IRC, these asserts make no sense. They can
happen if we fail to parse user-side data. Also currently deserialize()
does not even pass the GError down so we would always assert on failed
parsing.

What must be done instead if change the signature of deserialize() and
all its implementations, with a GError arg. Then this GError will
properly bubble up to the caller for appropriate handling.
2022-02-10 21:27:33 +01:00
Jehan 7131c220a8 NEWS: update. 2022-02-10 21:23:23 +01:00
Jehan b301dbee78 Issue #526: Import/Export Windows cursor files (.CUR).
MR !565 was only a partial implementation as it was assuming all cursors
had the same hot spot coordinates in the file, which is false more often
than not (since usually it's several sizes for the same image, hence
coordinates move). I should have realized this before merging.
With this new commit, we actually loads the hot spot coordinates per
cursor, stores them as per-layer parasites, then exports with per-cursor
coordinates.

Also it makes the procedure API use int32 array (should be int16 but we
removed the support, now I think it may have been a mistake) which shows
the ugliness of our array support once again with additional size args
per array (even if it's the same size). Also I realize that our support
of arrays with config object is not good. This is also something we'll
have to look at.
2022-02-10 18:44:44 +01:00
Jehan 73c0ee8da7 libgimp, libgimpconfig: gimp_config_deserialize_file() should not…
… assert the existence of GError.

This is even worse as deserialize() method does not even take a GError
parameter anyway so this assert will always go off when a
deserialization failed (which happened in my case as I was working on a
plug-in API, hence gimp_procedure_config_load_last() actually failed to
load a previous version of the plug-in-settings when I changed a
procedure arg's type).

Just fail the deserialization normally and let the calling code handling
this case. Nevertheless it is kind of useful to bubble-up the error to
calling code, so I add a TODO in the interface header (hopefully to see
and improve this before we release GIMP 3.0).
2022-02-10 18:44:44 +01:00
Hugo Carvalho ef3549648f Update Portuguese translation 2022-02-10 13:50:02 +00:00
Hugo Carvalho ef677336c5 Update Portuguese translation 2022-02-10 13:40:52 +00:00
Jehan d131c6a363 plug-ins: fix magics for .cur and .ico. 2022-02-10 13:27:24 +01:00
Nikc a22fd4f43a Issue #526 - Add Import/Export for Windows .CUR files 2022-02-10 12:09:40 +00:00
Jehan d25b7301d6 plug-ins: fix the ORA thumbnail load procedure.
- Fix return value in error case: s/GObject.Error/GLib.Error/ and anyway
  in this form, the error should be a string. Using the easier form
  procedure.new_return_values() instead.
- "file-png-load" uses a GFile now (like all load procedures).
2022-02-09 22:56:42 +01:00
Jehan 7b220257da app: GimpThumbnailProcedure expects a GFile too.
This was the reason why no thumbnail procedure was working on the dev
branch.
2022-02-09 22:31:24 +01:00
Jehan 5aae429cd6 app: properly report thumbnail creation errors.
There were some comments claiming we don't care about thumbnail creation
errors, only thumbnail saving. It's not true. Thumbnail creation errors
are probably even more important (in this specific usage). For instance,
trying to debug a thumbnail load procedure, I had no clue on the error
even though our system was able to report the issue. It's not cool for
plug-in developers.

Now we will check the thumbnail creation error, write down the error
message on stderr and clear the error for the fallback round (using the
normal file load proc). Then if it errors out again, we will keep this
error as the finale one because it's probably more important if we can't
even open images than the unrelated thumbnail saving error. We will
still return the saving error if the load proc failed without error.
2022-02-09 22:30:03 +01:00
Jehan 5b01290f94 all, libgimp, pdb: some alignment and param description fix. 2022-02-09 21:23:33 +01:00
Jehan 5e7bcc291b icons: add COPYING files for icon themes.
Our Symbolic icon theme comes from the art-libre theme now archived by
the GNOME design team. It had various authors, including originally
Jakub Steiner and Barbara Muraus, then jEsuSdA, Klaus Staedtler,
Alexandre Prokoudine and Aryeom Han. Various other people tweaked the
icons and may have contributed. See the git log for details.

The Color icon theme is more of an original work by Klaus Staedtler, as
I understand it, with some additional icons by Alexandre Prokoudine,
Aryeom Han and other contributors. See the git log for details.

This makes licensing clearer for these specific subsets of the project.
2022-02-09 16:31:22 +01:00
Jehan bcdb1cdb6a Issue #7837: gimp_installation_directory() in macOS doesn't know about…
… extensions yet.
2022-02-09 12:47:37 +01:00
Jehan 023ca21c96 NEWS: update. 2022-02-09 00:44:10 +01:00
Jehan 35cef54899 app: fix handling multi-drawables selected in bucket fill tool.
We were getting a critical when selecting multiple drawables (either
changing layer selection while the tool is ON, or starting with multiple
selection). We should not have assert code here, just handle the case
gracefully with a normal error message when trying to fill on several
layers at once.
2022-02-09 00:27:04 +01:00
Jehan e7668c03bd app: add some new feature to close line arts manually.
The line art algorithm is useful but not always accurate enough and
sometimes it can even be counter-productive to fast painters.

A technique of advanced painters which Aryeom uses and teaches when she
wants to close an area without actually closing the line art (i.e. the
non-closed line is a stylistic choice) is to close with a brush the area
on the color layer. It has also a great advantage over the line art
"smart" closing algorithm: you control the brush style and the exact
shape of the closure (therefore something you'd usually have to redo
with a closure made by an algorithm as you would likely not find it
pretty enough).
This new feature takes this technique into account. Basically rather
than relying on the closure algorithm, you would close yourself and the
tool is able to recognize closure pixels by the color proximity with the
fill color.

Final point is that this additional step is made after line art
computation i.e. in particular the target drawable is not added to the
sources for line art logics. This allows to stay fast otherwise the line
art would have to recompute itself after each fill.

This also shows why the previous commit of moving the line art object
was necessary, because a painter would likely want to move regularly
from bucket fill to a brush tool to create area closures and we want to
avoid recomputation every time.
2022-02-08 23:45:22 +01:00
Jehan 8a3ff1a7b6 devel-docs: move HACKING from root EXTRA_DIR to devel-docs one.
Also adding the CODING_STYLE.md. There is actually the question whether
we still want to track this docs files to package them in the tarballs.
It made sense 20 years ago when devs were working from tarballs, but
nowadays, devs are expected to work from git HEAD.

Anyway this fixes the CI.
2022-02-08 23:45:22 +01:00
Jehan 0db35973c8 app: temporarily move GimpLineArt ownership to context when bucket…
… fill tool finalizes.

The idea is that you may want to quickly switch tool to do something and
back to the bucket fill for line art selection. If the input drawable(s)
did not change, the previously computed data is still valid, so let's
hang on the line art object a little longer.
Since we are resetting the input when we get back, we would still
recompute anyway *if needed*, and the line art object does follow
changes on the input pickable so we would not get any deprecated data
anyway. Still we move around ownership a tiny bit to optimize for
common case of tool switching.

In order not to keep forever this data (buffer and distmap in
particular) forever just because one tried the line art once, I add a
timer to free it after a few minutes.

Moreover it will be useful for other cases, such as being able to share
the same line art object with the fuzzy select tool (if we end up adding
the line art option there). In a coming commit, the usage will be even
more obvious for use case where you want to edit the filled area with
other paint tools, then back to bucket fill while not touching the line
art source layer.
2022-02-08 23:45:22 +01:00
Lukas Oberhuber 5ad5f67ad0 goat-exercises: fix vala build problem
Problem appeared on mac and also on debian unstable. This is autotools
only as `--disable-since-check` is present
in meson.build.

Fix suggested by @nielsdg.

```
make[3]: Entering directory '/Users/distiller/.cache/jhbuild/build/gimp/extensions/goat-exercises'
  CC       goat-exercise-c.o
/Users/distiller/gtk/inst/bin/intltool-merge /Users/distiller/gtk/source/gimp/po-plug-ins org.gimp.extension.goat-exercises.metainfo.xml.in org.gimp.extension.goat-exercises.metainfo.xml -x -u -c ../../po-plug-ins/.intltool-merge-cache
  VALAC    goat_exercise_vala_vala.stamp
Generating and caching the translation database
  CCLD     goat-exercise-c
/Users/distiller/gtk/source/gimp/extensions/goat-exercises/goat-exercise-vala.vala:28.10-28.18: error: `Gimp.main' is not available in gimp-3.0 2.99.9. Use gimp-3.0 >= 3.0
  return Gimp.main(typeof(Goat), args);
         ^^^^^^^^^
```
2022-02-08 15:24:15 +00:00
Matej Urbančič 3e697596fb Update Slovenian translation 2022-02-07 18:21:55 +00:00
Matej Urbančič 6f31db5a4d Update Slovenian translation 2022-02-07 18:21:29 +00:00
Jehan bad465c681 README, devel-docs: reorganize a bit the main README and devel docs.
- ps-menurc removed in GIMP 2.7.2 (i.e. stable 2.8.0) according to
  NEWS.pre-2-8.
- in our main README, redirect now to devel-docs/README.md as entry
  point for contributors.
- move HACKING to devel-docs/ and specialize it into a "how to build
  from git and contributed" docs:
  * Make it markdown.
  * Remove some now obsolete or redundant recommendations (to be fair,
    we can probably clean up the file a bit more, but we'll see).
  * Add/improve relevant information.
  * Make more obvious when you want to build from tarball or git.
  * Just keep a single short paragraph about the coding style to
    redirect people to the appropriate CODING_STYLE.md file.
  * Don't recommend sending patches to the mailing list anymore.
- move CODING_STYLE.md to devel-docs/.
2022-02-07 15:45:28 +01:00
Lukas Oberhuber 6de9ea7022 macos: reduce frequency of coordinates refresh
This change reduces to 3.33 times a second, the updates to the
status bar coordinates widget.
This dramatically improves frame rate on macOS retina displays
because it reduces the frequency of full screen updates which
are triggered by this widget updating and are very slow.

This makes the statusbar refresh changes mac only where the
benefit will be felt keenly, rather than saddling all
platforms with the change.
2022-02-07 13:44:46 +00:00
Lukas Oberhuber dd6c104d2e macos: version 10.7 long no longer supported 2022-02-07 13:34:04 +00:00
Jehan 82899764a3 app, INSTALL: remove our Windows-only trick to add user-installed fonts.
This was added in commit 88f97aedef and only expected to last until
fontconfig had a fix **and** it got into a released version.
This is now done.

I could verify in the git repo that fontconfig's commit 55eb1ef is
included since their tagged release 2.13.95 which is now on MSYS2
(2.13.96 there even), so we will use it for our next release.

Thanks to frogonia (long time no see! \O) for following up on this!

See also fontconfig report:
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/144
2022-02-07 14:24:52 +01:00
Hugo Carvalho 0c9e7adf86 Update Portuguese translation 2022-02-06 21:52:43 +00:00
Hugo Carvalho 5a8d3d3b87 Update Portuguese translation 2022-02-06 21:50:49 +00:00
Anders Jonsson f119621dae Update Swedish translation 2022-02-06 20:12:35 +00:00
Luming Zh 590611a1c4 Update Chinese (China) translation 2022-02-06 03:17:08 +00:00
Jehan 1bc3fd4557 app: gimp_source_core_set|get_property() are now useless. 2022-02-05 14:25:33 +01:00
Jehan 4c8f50cb23 Issue #287: Impossible to stroke a path with the clone tool.
Actually we had half of the fix already with my recent change to source
tools giving the ability to clone from multiple source drawables where I
moved the source drawables from GimpSourceCore to GimpSourceOptions (see
commit 6ad00cdbba). The problem is that gimp_vectors_stroke() is using
the context paint options, but it is creating a brand new paint core
just to stroke the path. Hence with my recent changes, the drawable
sources were finally available to the path stroke, yet not the source
position. So stroking with clone was always starting on position (0, 0)
on the source.

This is now fixed by moving also the position properties "src-x" and
"src-y" on the GimpSourceOptions. This makes this info finally
accessible to the core when running the source tools this way.

Thanks to Eneko Castresana Vara for their initial contribution.
Unfortunately the code had diverged too much for it to be usable because
of our much too late review so a different fix had to be done.
2022-02-04 23:25:38 +01:00
Yuri Chornoivan 181e7de2c9 Update Ukrainian translation 2022-02-04 20:47:54 +00:00
Jehan 3e58869dbf libgimp: missing new API in def file.
Ahahah. So many years and I still forget this annoying def file! :P
2022-02-04 18:17:20 +01:00
Jehan d5f832d7a6 NEWS: update with the dynamics changes. 2022-02-04 15:31:55 +01:00
Jehan 849bd0ac47 app: new "context-dynamics-toggle" action.
As the name implies, this is an action to toggle the paint dynamics ON
and OFF which can be a huge time saver when painting and needing to
switch between dynamics and non-dynamics painting.

I have not been adding this action in the "dynamics-action" group
because these are only used for the dynamics dockable menu. Also it
looks like the context actions are not visible in the action search (I
can't recall why, but I think there was a reason), yet you can still set
a shortcut.
Should we create a new "paint-action" group maybe?
2022-02-04 15:12:00 +01:00
Jehan 387d97437d plug-ins: use the new function Gimp.context_enable_dynamics(). 2022-02-04 14:04:46 +01:00
Jehan d9387811f4 app, libgimp, pdb: new PDB API to enable/disable dynamics.
New libgimp C functions:
- gimp_context_are_dynamics_enabled()
- gimp_context_enable_dynamics()
2022-02-04 13:54:59 +01:00
Jehan b46fafb3a0 app: also get rid of "dynamics-expanded" config property when migrating. 2022-02-03 23:29:11 +01:00
Asalle 614e1c6b4c app: make dynamics tool options a checkbox
Fixes #4333

If the checkbox is unchecked: dynamics falls back to "Dynamics Off",
the current dynamics name and its options are hidden in the UI.

If the checkbox is checked: dynamics is set to previously used one
or the default one, all dynamics options are seen in the UI.
2022-02-03 20:33:45 +01:00
Luming Zh d98c1d7a2c Update Chinese (China) translation 2022-02-03 03:46:47 +00:00
Luming Zh aa8f2608a8 Update Chinese (China) translation 2022-02-03 03:45:31 +00:00
Jehan 6955db425e app: add some doc comment to internal API.
Relative to the MR !553 where I could verify that the function
gimp_tool_push_status() does not just push new messages, it also removes
any other message from the same context (and place the new one on
front, unlike gimp_tool_replace_status()).

Therefore calling gimp_tool_pop_status() before a push or replace is
simply wrong with undesirable effect (e.g. too many useless redraws,
which can be pretty bad on some platforms like macOS, but are not ideal
anyway as a general rule).
2022-02-02 22:42:03 +01:00
Lukas Oberhuber b4099de8cd app: reduce redraws on statusbar
This change reduces redraws due to spurious status updates.
Before this change, the status would be unset, then set again to the
same value it was previously. Each turn around setting and unsetting
causes a redraw.

On macOS this redraw causes a full screen redraw. With this
optimization, when the status message is unchanged, no redraw occurs.

This is because `gimp_tool_push_status` checks to see if the message
has changed.
2022-02-02 20:46:20 +00:00
Jehan 6ceaf14470 app: argh, a warning went through! 2022-02-02 21:32:47 +01:00
Jehan bc83b283fd app: avoiding infinite loops of signals calling each other.
This is a better fix for the previously reverted commit, avoiding
"floating-selection-changed" and "select-items" to recursively calling
each other.

The other fix on context update is similar and was also triggering
crashes because of recursive signal calling after the previous revert.
2022-02-02 21:13:33 +01:00
Jehan 748dc77bb5 Revert "app: check selected items changed before running "select-items"."
This reverts commit ca3c480314.

The fix was wrong and was creating other issues such as #7655. We must
always emit this signal.
2022-02-02 21:13:33 +01:00
Yuri Chornoivan 256f08b6e9 Update Ukrainian translation 2022-02-02 19:40:35 +00:00
Nikc 6a16779365 Issue #6683: Set turbulence max-value to 7 per GEGL specs (Port) 2022-02-02 18:26:00 +00:00
Anders Jonsson 849df6b731 Update Swedish translation 2022-02-02 18:22:26 +00:00