Commit Graph

52826 Commits

Author SHA1 Message Date
Alx Sa 816fb1c676 tools, libgimpwidgets: Connect SelectionOptions to icon size
This patch resizes the selection mode
icons based on the user's icon size
settings. It creates a new function in
gimpenumwidgets.c to update sizes,
then connects to GimpGuiConfig's icon
size update notifications in GimpSelectionOptions.
2024-08-15 19:07:14 +00:00
Jehan ee2f86105c app: move "System Language" out of GIMP_L10N_LANGS_SIZE.
This is the only "language" from the list whose name is special and
should be localized at runtime, yet before we set any Preferences
language. It needs to be localized as the System Language itself which
will be run-dependant.

For instance, if your system is in French, it will be displayed as
"Langue système" but if you change your system to Korean, at next run,
it would show "시스템 언어". It is a per-run localization, independant
from the language selected in Preferences, and even less dependant from
build-time system language.
2024-08-15 20:57:02 +02:00
Jehan 7b274c1200 meson, build: verify for up-to-date gimp-data and warn otherwise. 2024-08-15 19:41:12 +02:00
Jehan 5b99177dad meson: shortcut meson not finding gimp-data/meson.build with a better error message.
As reported by pippin, when gimp-data submodule is not initialized,
meson configuration fails with:

> meson.build:1830:0: ERROR: Nonexistent build file 'gimp-data/meson.build'

This does not give a lot of info, and while the solution can also be
found in INSTALL.in (INSTALL in tarballs) and on developer website, it's
nicer if the build itself could give a clearer information.

Now it will say instead:

> ERROR: Problem encountered: gimp-data submodule not present. Run: git submodule update --init
2024-08-15 19:30:55 +02:00
Jehan aba7316e34 tools: bind the "iso_639_3" gettext domain to iso-codes location…
… found at build-time.

It was working on a machine with default paths and system-installed
packages (e.g. a typical Linux distributions) but needs to be manually
set up e.g. on Windows.
2024-08-15 15:50:30 +02:00
Jehan 364f541336 tools: fix self-localization of languages for Windows.
Basically reusing the solution from commit 7ccfad1716.
2024-08-15 15:50:30 +02:00
Jehan 90fb84de26 tools: list supported languages with po/LINGUAS.
We can't rely on installed *.mo files anymore when this procedure is
done at build time.
2024-08-15 15:50:30 +02:00
Jehan e7f62f69f3 tools: proper error handling for gen-languages.
In particular, we don't want the build to succeed when various obvious
issues occur, which may even end up in a successful-looking build (yet
with no proper language lists), like we had in !1597.
2024-08-15 15:50:30 +02:00
Jehan 8feb827e78 tools: gen-languages should always search from ISO_CODES_LOCATION.
This became a build step, not runtime one, therefore we don't care
anymore about relocation.
2024-08-15 15:50:30 +02:00
Jehan b9fcb22877 build, tools: always use iso_639_3 gettext domain.
Also no need to bundle the iso_639 gettext domain anymore for runtime.
2024-08-15 15:50:30 +02:00
Bruno 143dfb709b build: Provide 'iso_639_3.mo' for language list in text tool options
This list is generated at runtime, unlike the one from preferences.
2024-08-15 15:50:30 +02:00
Jehan 965dd51e80 build: don't bundle iso_639.xml anymore.
Note that we still need the iso_639.mo files at runtime. Only the XML
files don't need to be parsed anymore at runtime (they are parsed at
build-time now).
2024-08-15 15:50:30 +02:00
Jehan a106acd408 app, tools: localization for GimpLanguageStore languages must happen at runtime.
Unlike the GimpTranslationStore which can use a list of pre-localized
languages (each language in its own name), the GimpLanguageStore must be
displayed in the currently used locale.
2024-08-15 15:50:30 +02:00
Jehan 4d79e9db0b tools: only list languages with part 1 and part 2 codes or with a localization.
Our GimpTranslationStore contains self-localized names of all languages
we support.
As for GimpLanguageStore, it contains all known languages with their
name in the current locale. When moving to ISO 639-3 list, we had all
possible language, included ancient ones, extinct ones, and so on. With
the iso-codes installation on my machine, this meant a struct with 7910
languages! When showing the Text tool options for the first time, GIMP's
UI is frozen for a few seconds because of this, while it constructs the
GimpLanguageEntry making use of the GimpLanguageStore.

By only listing part 1 and part 2 languages (as well as the rare
languages which are not in these list yet which we still support, i.e.
right now only 'ckb' (Central Kurdish), see #11626), the list lowers to
189 languages, which is still good and are the main languages or
language families AFAIU. And now the Text tool options are constructed
instantly.
Note that this is in fact even less than when we were just using
iso_639.xml (I counted 487 languages stored there), but I believe it to
be enough for the usage we have in the Text tool.
2024-08-15 15:50:30 +02:00
Jehan 5f9083f251 app, tools: generate the language list at build-time.
Instead of always parsing the ISO-639 listing at each and every startup,
let's just generate the list of languages, their English name, and the
self-localized names as static struct.
This will just be much faster, and no worrying on the size of the XML
(or json) to parse.
2024-08-15 15:50:30 +02:00
Jacob Boerema 8838481d12 app: fix #11626 Language selection: name for ckb shows up as ???
We have translations for ckb (Central Kurdish), which is only
available in iso codes 639_3. For our language selection we only
parse 639(_2), which causes this language to show up as `??? (ckb)`.
This is of course not a good user experience since users need to know
that ckb is the abbreviation of their language.

We fix this by parsing `iso_639_3.xml` instead of `iso_639.xml`. This
works, but, since this file is a lot bigger, it takes a lot more time
(more than 1 second difference) to parse this.

Now, this is only done on startup, but this can certainly be a
noticeable delay.
2024-08-15 15:50:30 +02:00
Anders Jonsson d92519a8e8 app, plug-ins: fix translatability of static strings
Fixes #10565
2024-08-15 12:01:41 +00:00
Nils Philippsen 1c3522802a plug-ins: Fix building TIFF loader on big endian
A recent addition to load layers in Sketchbook TIFFs contained a typo in
code specific to big endian machines, making it fail to build there,
which wasn’t caught in CI.

In addition to this fix, use the appropriately named macro to convert
from little endian to big endian.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2024-08-15 11:12:12 +00:00
Bruno b4ad767296 build/linux: Sync with Beta manifest regarding openexr and imath (add libdeflate)
Ported from: 55fdadd10f
2024-08-15 11:09:48 +00:00
Jehan 51c8709e05 Issue #11906: action search followed by down arrow key stops responding…
… to keyboard input.

Removing a GtkBindingSet entry actually removes it from all GtkTreeView.
It's not limited to the ones contained in GimpContainerTreeView (which
makes sense, since it relies on the class) so it broke various
interactions across the software.

Let's just connect to signal key-press-event instead and block further
propagation. Not sure anyway why GTK has so many ways to handle key
interactions!

I'm also moving the implementation to GimpItemTreeView because this
enhanced keyboard handling is really about the items tree dockables
only, for the time being at least.
2024-08-15 12:32:48 +02:00
Yuri Chornoivan 9edb11ac5f Update Ukrainian translation 2024-08-14 18:11:53 +00:00
Anders Jonsson 0928fdb11d NEWS: fix typos 2024-08-14 14:30:13 +02:00
Luming Zh 256e0ca5a0 Update Chinese (China) translation 2024-08-14 08:06:02 +00:00
Luming Zh 60449b7c58 Update Chinese (China) translation 2024-08-14 07:56:19 +00:00
Martin b3f667ba4b Update Slovenian translation 2024-08-13 23:55:22 +00:00
Jehan 03702154ad app: use gimp-image instead of dialog-question for default GimpViewable…
… icon name.

As akk was reporting on IRC, the huge question mark from the
dialog-question icon really makes it feel like it's an help button
(especially when used as an actual button, e.g. in GEGL filter generated
dialogs with aux inputs, when no viewable has been set as input yet).
2024-08-14 00:36:23 +02:00
Jehan c28fa12148 app: auxiliary input pads should have nicer names as registered by the operation. 2024-08-13 22:32:44 +00:00
Alx Sa 7642e1f5da app/tools: Filters with aux nodes merged automatically
Currently we can't serialize GimpDrawable, which is necessary for us
to store filters with Aux Nodes. Therefore, they will automatically be
applied destructively as a workaround until we can.
2024-08-13 21:33:41 +00:00
Joachim Priesner b3daeb12b5 libgimpwidgets: Fix stack buffer overrun
3833ab2b1d changed the type of "rgb" from
gdouble[3] to gfloat[3], but it should instead have changed the type of
"lch".

Resolves #11898.
2024-08-13 17:58:18 +00:00
Jehan dd700544b4 NEWS: update. 2024-08-13 19:01:59 +02:00
Jehan 631a957f9a libgimp: have libgimpui depend on pdbgen.
There was a weird instance of build failure in CI when compiling one of
the libgimpui files. It could not find one of the PDB-generated
function:

> ../libgimp/gimpaspectpreview.c:329:19: error: call to undeclared function 'gimp_image_get_selection'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

My assumption is that as a multi-threaded build, this file was compiled
just at the same time as the PDB was generating it, and therefore it was
empty, hence a very bad timing creating a build failure.

As I recall, I created the bogus stamp file stamp-pdbgen.h specifically
for such race condition issues (because meson has no generic dependency
rule, so we can't just ask one job to wait for another). We were using
this bogus object as source to libgimp, but not libgimpui.

Hopefully this will fix the problem and it won't re-happen randomly.
2024-08-13 18:16:39 +02:00
Jehan 576554a0af app: Up/Down in GimpContainerTreeView should select items "visually".
layers-select-next/layers-select-previous don't work well as up/down
arrow behavior because they only work within each selected layer's
level. But historically (and that's what makes the most sense IMO, and
is the most expected behavior), up/down arrows would walk through the
layer list visually. I.e. that it would select next whatever is the next
layer displayed in the Layers dockable, even if it means selecting
children or going down one layer group level.

The 2 new actions "layers-select-flattened-previous" and
"layers-select-flattened-next" do this. Say you have this tree:

Layer 1
Layer 2
 | - Layer 3
 | - Layer 4
Layer 5

With the "flattened" actions, after Layer 2, there is Layer 3, and after
Layer 4, there is Layer 5… unless… Layer 2 (layer group) is collapsed.
In which case, after Layer 2 is Layer 5. This selection movement indeed
takes into account the state of the layer group expanders.

This makes the Up/Down arrows work similarly to how they used to work
with default GtkTreeView implementation, except that the logic now also
works well with multiple selected items.
2024-08-13 16:41:21 +02:00
Jehan aee55ab25c Issue #11729: reword descriptions of "Select Previous|Next Layers" actions. 2024-08-13 12:54:27 +02:00
Jehan 583fbc6607 Revert "Issue #11729: Select Previous/Next Layers commands only select one layer."
This reverts commit 31df873d4c.

My commit was not wrong per-se (it didn't add any bug), but it was in
fact not useful either, and only adding a useless list copy for no good
reason.
I thought that action_select_object() was actually selecting objects,
but looking at implementation, it in fact doesn't. It only returns a
pointer to the object to select.
2024-08-13 12:54:27 +02:00
Jehan 5a51bfe868 app: update up/down PageUp/Down and Home/End behavior with multi-selection in mind.
This should likely eventually be re-specified in gimp-ux tracker,
especially as anyway we are planning on rewriting the GimpItemTreeView
from scratch.
But for now, this is better than the behavior where the arrow keys are
losing multi-item selections by default, and also the PageUp|Down
assigned actions are eaten away (as noted by Jacob in #11729).

Now we still don't go through to the PageUp|Down actions (in fact we do,
if we consider the default ones, but it's hardcoded, because after
careful consideration, I do indeed think that when such a tree view has
focus, the arrow and PageUp|Down buttons would have special meaning
anyway), even though I had a first version of this patch which did this.
We simply have much nicer hardcoded behavior!
2024-08-13 12:54:27 +02:00
Yuri Chornoivan 714e371830 Update Ukrainian translation 2024-08-12 16:38:28 +00:00
Jehan 31df873d4c Issue #11729: Select Previous/Next Layers commands only select one layer.
Somehow it works fine on my machine, but this is very likely the
culprit. gimp_image_get_selected_layers() returning directly the pointer
to selected layers, we should always make a copy before doing anything
which would change this selection!
2024-08-12 14:48:56 +02:00
Anders Jonsson 2da08995c3 Update Swedish translation 2024-08-12 12:28:00 +00:00
Lukas Oberhuber deaa99cf08 meson: fix MacOS build
lua is not available on macOS currently and the lack of lack of the lua variable causes
the build to fail.
2024-08-12 10:48:50 +00:00
Martin 68462fb25e Update Slovenian translation 2024-08-12 10:30:07 +00:00
Anders Jonsson 5422c8829d script-fu: fix gettext extraction
Gettext treats #! in scheme files as a comment start
and needs a !# for the comment to end, otherwise it skips
the whole file.
2024-08-12 09:24:13 +00:00
Ekaterine Papava 3865c0993c Update Georgian translation 2024-08-12 04:31:02 +00:00
Ekaterine Papava 98211b09d5 Update Georgian translation 2024-08-12 04:28:31 +00:00
Ekaterine Papava ac7e5d59c2 Update Georgian translation 2024-08-12 04:27:00 +00:00
Alx Sa 376bda8e38 app/display: Initialize rectange constraints
Resolves #11897.
The crop tool currently doesn't constrain
to the top-left of the layer when the
"Allow growing" option is turned off and
"Selected layers only" is turned on.
Instead, it always constrains to 0, 0.

When we converted to multi-layer select,
we added a loop to check the boundaries
of all selected layers. In this loop, we use
separate variables to get the offset and
then get the min of it and the current
min_x and min_y. However, those values
are initialized to 0, so they will always be
smaller if the layer is inside the canvas.

To fix this, before the loop we check if
there are any selected layers. If so, we
get the offset of the first layer and set
min_x and min_y to that value rather than
0, 0.
2024-08-11 19:51:06 +00:00
Bruno aabfec824d
build/linux: Sync with Beta manifest regarding graphviz
Ported from: 395358b517
2024-08-11 13:59:17 -03:00
Bruno d351bbe283
build/linux: Sync with Beta manifest regarding gimp module
Ported from: 61050e962c
2024-08-11 12:18:21 -03:00
Alx Sa 979a3c3c32 plug-ins: Use pre-multiplied alpha for Lighting Effect's...
...bump map settings.
Currently, the Lighting Effect's bump map options uses
the RGB values of transparent pixels as part of its map.
As the Bump map filter does not do this, this patch tries
to make it consistent by using associated alpha for the
bump map Babl format to fix this.
2024-08-11 14:52:36 +00:00
Bruno 9c4425f0f0
build/linux: Sync with Beta manifest regarding libheif and x265
Ported from: 1690804247
2024-08-11 10:37:02 -03:00
Jordi Mas 89b14e1e1a Update Catalan translation 2024-08-11 15:35:04 +02:00